strings icon indicating copy to clipboard operation
strings copied to clipboard

Optimize Inflector

Open xepozz opened this issue 10 months ago • 3 comments

We have introduced https://github.com/yiisoft/strings/blob/master/src/CombinedRegexp.php that helps with a loop of regexps. There are some places to apply CombinedRegexp:

  • https://github.com/yiisoft/strings/blob/63aef52b3d8568af153bddc1f526994474d96074/src/Inflector.php#L439
  • https://github.com/yiisoft/strings/blob/63aef52b3d8568af153bddc1f526994474d96074/src/Inflector.php#L418

xepozz avatar Aug 12 '23 07:08 xepozz

User can override rules via withSingularizeRules() and withPluralizeRules() methods, and use regular expressions with different flags. It is do not allow us use CombinedRegexp here.

vjik avatar Oct 23 '23 14:10 vjik

I didn't get you

xepozz avatar Oct 23 '23 16:10 xepozz

I didn't get you

CombinedRegexp uses same flags for all expressions, but inflector allow use expressions with different flags.

vjik avatar Oct 23 '23 16:10 vjik