Skip to content
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

Fixed singular of committee #18911

Closed
wants to merge 4 commits into from

Conversation

Projects
None yet
4 participants
@peterrehm
Copy link
Contributor

commented May 29, 2016

Q A
Branch? 2.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18872, #18748
License MIT
Doc PR -

In addition to PR #18909.

@peterrehm peterrehm force-pushed the peterrehm:inflector-2.3 branch from a5db520 to 2970b13 May 29, 2016

@@ -211,8 +210,13 @@ public static function singularify($plural)
}
}
$irregularNouns = array(

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas May 30, 2016

Member

would be better as a private static var

This comment has been minimized.

Copy link
@peterrehm

peterrehm May 30, 2016

Author Contributor

I had it like that prior to the PR but since those are irregular nouns in that context I have moved that into the function.

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas May 30, 2016

Member

Inline arrays are can't benefit from some opcache optims until php7. A private static would fix that

This comment has been minimized.

Copy link
@peterrehm

peterrehm May 30, 2016

Author Contributor

Shall I update it accordingly? I prefered the logic reason.

This comment has been minimized.

Copy link
@peterrehm

peterrehm Jun 4, 2016

Author Contributor

@nicolas-grekas Shall I refactor it? I would like to get this merged.

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Jun 4, 2016

Member

yep please

// Convert teeth to tooth, feet to foot
if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3 && 'feedback' !== $plural) {
if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3 && !in_array(strtolower($plural), $irregularNouns, true)) {

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas May 30, 2016

Member

isset instead of in_array would be more performant

@peterrehm peterrehm force-pushed the peterrehm:inflector-2.3 branch from 2970b13 to fd18148 May 30, 2016

@peterrehm

This comment has been minimized.

Copy link
Contributor Author

commented May 30, 2016

@nicolas-grekas Updated

@peterrehm

This comment has been minimized.

Copy link
Contributor Author

commented Jun 5, 2016

@nicolas-grekas Both PR's are updated

@peterrehm

This comment has been minimized.

Copy link
Contributor Author

commented Jun 5, 2016

Just added support for screenshots as well. However this shows best why I did not wanted the private static array, as this can lead to confusions now.

@fabpot

This comment has been minimized.

Copy link
Member

commented Jun 8, 2016

Thank you @peterrehm.

fabpot added a commit that referenced this pull request Jun 8, 2016

bug #18911 Fixed singular of committee (peterrehm)
This PR was submitted for the 2.3 branch but it was merged into the 2.7 branch instead (closes #18911).

Discussion
----------

Fixed singular of committee

| Q             | A
| ------------- | ---
| Branch?       | 2.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18872, #18748
| License       | MIT
| Doc PR        | -

In addition to PR #18909.

Commits
-------

5661d52 Fixed singular of committee

@fabpot fabpot closed this Jun 8, 2016

@peterrehm peterrehm deleted the peterrehm:inflector-2.3 branch Jun 8, 2016

@fabpot fabpot referenced this pull request Jun 15, 2016

Merged

Release v3.1.1 #19055

This was referenced Jun 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.