Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfrommaidmaid:lock-4
Sep 1, 2017
Merged

Conversation

@maidmaid
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#23724
LicenseMIT
Doc PR/

Because minimal required version PHP is currenty 7.1.3.

ping@jderusse

returnfalse;
}

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

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
ContributorAuthor

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?

publicstaticfunctionisSupported($blocking =null)
{
if (!extension_loaded('sysvsem')) {
returnfalse;
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
ContributorAuthor

@maidmaidmaidmaidAug 31, 2017
edited
Loading

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 theSymfony\Component\Console\Command\LockableTrait). ping@nicolas-grekas

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 releasewith 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
ContributorAuthor

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
ContributorAuthor

Choose a reason for hiding this comment

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

@maidmaid
Copy link
ContributorAuthor

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 in24fc394

@maidmaidmaidmaidforce-pushed thelock-4 branch 2 times, most recently from0321809 toec91588CompareAugust 31, 2017 14:34
@maidmaid
Copy link
ContributorAuthor

Changes done.

@jderusse
Copy link
Member

Sounds good to me.

@xabbuh
Copy link
Member

@maidmaid
Copy link
ContributorAuthor

@xabbuh
Copy link
Member

@maidmaid I meant the test case :)

@maidmaid
Copy link
ContributorAuthor

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

@xabbuh
Copy link
Member

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

@Simperfit
Copy link
Contributor

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

@maidmaid
Copy link
ContributorAuthor

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

@xabbuh
Copy link
Member

Can you also remove theuse statement forNotSupportedException inSemaphoreStore?

@maidmaid
Copy link
ContributorAuthor

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 =newFlockStore(sys_get_temp_dir());
}
$store = SemaphoreStore::isSupported() ?newSemaphoreStore() :newFlockStore(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 thefalse argument to minimise the diff

}else {
$store =newFlockStore(sys_get_temp_dir());
}
$store = SemaphoreStore::isSupported() ?newSemaphoreStore() :newFlockStore(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 thefalse argument to minimise the diff

@maidmaid
Copy link
ContributorAuthor

Changes done.

fabpot added a commit that referenced this pull requestSep 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

Thank you@maidmaid.

@fabpotfabpot merged commitd817f98 intosymfony:masterSep 1, 2017
fabpot added a commit that referenced this pull requestSep 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@jderusseCommits-------d817f98 Remove old version check
@maidmaidmaidmaid deleted the lock-4 branchSeptember 1, 2017 18:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@jderussejderussejderusse left review comments

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@xabbuhxabbuhxabbuh approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.0

Development

Successfully merging this pull request may close these issues.

9 participants

@maidmaid@jderusse@xabbuh@Simperfit@fabpot@javiereguiluz@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp