inflector
inflector copied to clipboard
Deprecation of methods as being dropped in 2.x
It's strange that you deprecate the following methods (tableize, classify, ...), because it's still used in Doctrine ORM:
For example Inflector::classify
is used in:
https://github.com/doctrine/orm/blob/master/lib/Doctrine/ORM/EntityRepository.php
The deprecation refers to the legacy API and instructs users to switch to the new API (found in the Doctrine\Inflector namespace without “Common”). The logic is still available.
... instructs users to switch to the new API (found in the Doctrine\Inflector namespace without “Common”)
On Laravel what would I replace this with when adding new rules? Because Doctrine\Inflector\Inflector::rules is no good
Doctrine\Common\Inflector\Inflector::rules('plural', [
'/^is$/' => 'are',
'/^Is$/' => 'Are'
]);
@Healyhatman I'm also experiencing the same issue but there is no documentation for how to migrate from this.
@alcaeus Do you have any insight on how to migrate to the new method of adding irregular inflection rules?
@Healyhatman @ninjasitm There is already documentation written for this: https://github.com/doctrine/inflector/blob/master/docs/en/index.rst
@garrettw Yes. But how do we do this in Laravel? Here you have to create an inflector instance where as before it was created statically. Can you help me out on this in case I'm missing something really simple?
@ninjasitm I'd suggest asking Laravel community about this. We're not documenting how other frameworks use and expose usage of Inflector to their users
OK. Will create an issue on the laravel/framework
github repo. If I find a solution I'll link back here.