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

[DDC-2160] Smart Pluralize/Singularize support for Doctrine/Common/Util/Inflector #227

Merged
merged 3 commits into from
Jan 10, 2013

Conversation

jbergler
Copy link
Contributor

Doctrine/ORM/Tools/EntityGenerator should pluralize/signularize correctly.

This PR adds functionality to Doctrine/Common/Util/Inflector to singularize/pluralize. The code is largely borrowed from a similar class in the CakePHP project - I'm not sure if the updates to the class doc covers the requirements for this.

Test coverage also added.

…e used in Doctrine/ORM/Tools/EntityGenerator to fix [DDC-2160] properly.
@doctrinebot
Copy link

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DCOM-147

@jbergler
Copy link
Contributor Author

I am updating the pull request for Doctrine/ORM/Tools/EntityGenerator upstream to use this functionality

}

Inflector::reset();
Copy link
Member

Choose a reason for hiding this comment

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

Please remove it. A file containing a class definition should contain only the class

…til/InflectorTest to follow coding standards
@beberlei
Copy link
Member

beberlei commented Jan 6, 2013

Awesome, can you change the protected to private? This class can reastically not be overwritten, lets not make people hopes :-)

@jbergler
Copy link
Contributor Author

jbergler commented Jan 6, 2013

Done

@schmittjoh
Copy link
Member

How about making this a dedicated composer package which we can just reference?

There is no point in each project coming up with own inflectors, no?

@lsmith77
Copy link
Member

lsmith77 commented Jan 6, 2013

@Ocramius
Copy link
Member

Ocramius commented Jan 6, 2013

@schmittjoh the problem is, again, all the non-composer folks.

@schmittjoh
Copy link
Member

@Ocramius, if they exists, let them voice their concern, but we cannot stay in the past forever.

@Ocramius
Copy link
Member

Ocramius commented Jan 6, 2013

@schmittjoh I'm all for deprecating all that stuff, we are just forced to keep BC until 3.x.

@schmittjoh
Copy link
Member

Regarding BC that should be easy here as these are all new features.

@beberlei
Copy link
Member

beberlei commented Jan 6, 2013

@schmittjoh i haven't actually thought about this, i suppose a dedicated component for this would be pretty nice. I started an internal inquiry if we should drop PEAR support for 2.4

@beberlei
Copy link
Member

We will drop PEAR support for 2.4, and will start moving parts out of Common into their own subprojects.

@beberlei
Copy link
Member

I will merge this for now, then start extracting it.

beberlei added a commit that referenced this pull request Jan 10, 2013
[DDC-2160] Smart Pluralize/Singularize support for Doctrine/Common/Util/Inflector
@beberlei beberlei merged commit 28b0e7f into doctrine:master Jan 10, 2013
@beberlei
Copy link
Member

@schmittjoh
Copy link
Member

That's great news!

Thanks for the swift response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants