8000 [Lock] Remove old version check by maidmaid · Pull Request #24053 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Lock] Remove old version check #24053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2017
Merged

[Lock] Remove old version check #24053

merged 1 commit into from
Sep 1, 2017

Conversation

maidmaid
Copy link
Contributor
Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #23724
License MIT
Doc PR /

Because minimal required version PHP is currenty 7.1.3.

ping @jderusse

@@ -37,7 +37,7 @@ public static function isSupported($blocking = null)
return false;
}

if ($blocking === false && \PHP_VERSION_ID < 50601) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the removed check is always "false", to the "&&" is false also, so the full "if" block can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Block removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in master, the removed check is always true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm

@jderusse
Copy link
Member

we have several similar thing in tests, can you remove them too?

@@ -37,10 +37,6 @@ public static function isSupported($blocking = null)
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return extension_loaded('sysvsem');

Copy link
Contributor Author
@maidmaid maidmaid Aug 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I remove $blocking arg? Or is it a BC?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.4 is not released yet. IMHO, you can remove it too (this method is used in the Symfony\Component\Console\Command\LockableTrait). ping @nicolas-grekas

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing an argument is BC I think
(but 3.4 will be release with the arg isn't it? so the fact it's not released yet shouldn't matter)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if one starts overriding/calling this method in 3.4 and we remove this argument in 4.0 without adverting in 3.4, one will keep passing/defining this argument when calling/overriding the method. Yet that would be just dead code, but if we need to add a new argument to this method in the future for whatever reason, the new argument will receive the value intended for the old arg, leading to WTF moments. Seems fragile to me

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(we don't make free BC breaks in major releases)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, this argument will stay in 3.4 (because 3.x is compatible with php 5.5 and need this check) and will be released.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. What about add a deprecated notice in 3.4 and remove this argument in 4.0?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maidmaid sounds good enough to me, as usual the deprecation should not be triggered for internal calls.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #24057

@maidmaid
Copy link
Contributor Author

we have several similar thing in tests, can you remove them too?

Tests seem ok. What exactly do you think?

@jderusse
Copy link
Member

@maidmaid indeed tests have already been cleaned in 24fc394

@maidmaid maidmaid force-pushed the lock-4 branch 2 times, most recently from 0321809 to ec91588 Compare August 31, 2017 14:34
@maidmaid
Copy link
Contributor Author

Changes done.

@jderusse
Copy link
Member

Sounds good to me.

@xabbuh
Copy link
Member
xabbuh commented Sep 1, 2017

@maidmaid
Copy link
Contributor Author
maidmaid commented Sep 1, 2017

@xabbuh
Copy link
Member
xabbuh commented Sep 1, 2017

@maidmaid I meant the test case :)

@maidmaid
Copy link
Contributor Author
maidmaid commented Sep 1, 2017

@xabbuh Sorry, I don't understand well, could you be more precise please?

@xabbuh
Copy link
Member
xabbuh commented Sep 1, 2017
A3DB

@maidmaid Take a look at the line in the test I linked to in #24053 (comment). There we still pass false to isSupported().

@Simperfit
Copy link
Contributor

The test case should be updated, it has false as an argument

@maidmaid
Copy link
Contributor Author
maidmaid commented Sep 1, 2017

Oh, of course, I confused the trait with the test, sorry! Changes done.

@xabbuh
Copy link
Member
xabbuh commented Sep 1, 2017

Can you also remove the use statement for NotSupportedException in SemaphoreStore?

@maidmaid
Copy link
Contributor Author
maidmaid commented Sep 1, 2017

Done.

4.0.0
-----

* removed the `$blocking` argument of the `SemaphoreStore::isSupported()` method
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to document this as the method is internal

} else {
$store = new FlockStore(sys_get_temp_dir());
}
$store = SemaphoreStore::isSupported() ? new SemaphoreStore() : new FlockStore(sys_get_temp_dir());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just drop the false argument to minimise the diff

} else {
$store = new FlockStore(sys_get_temp_dir());
}
$store = SemaphoreStore::isSupported() ? new SemaphoreStore() : new FlockStore(sys_get_temp_dir());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just drop the false argument to minimise the diff

@maidmaid
Copy link
Contributor Author
maidmaid commented Sep 1, 2017

Changes done.

fabpot added a commit that referenced this pull request Sep 1, 2017
…maid)

This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] Make SemaphoreStore::isSupported() internal

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24053 (comment)
| License       | MIT
| Doc PR        | /

Commits
-------

86f2f25 Mark SemaphoreStore::isSupported() as internal
@fabpot
Copy link
Member
fabpot commented Sep 1, 2017

Thank you @maidmaid.

@fabpot fabpot merged commit d817f98 into symfony:master Sep 1, 2017
fabpot added a commit that referenced this pull request Sep 1, 2017
This PR was merged into the 4.0-dev branch.

Discussion
----------

[Lock] Remove old version check

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23724
| License       | MIT
| Doc PR        | /

Because minimal required version PHP is currenty 7.1.3.

ping @jderusse

Commits
-------

d817f98 Remove old version check
@maidmaid maidmaid deleted the lock-4 branch September 1, 2017 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants
0