diff options
Diffstat (limited to 'vendor/doctrine/inflector')
45 files changed, 2456 insertions, 0 deletions
diff --git a/vendor/doctrine/inflector/LICENSE b/vendor/doctrine/inflector/LICENSE new file mode 100644 index 0000000..8c38cc1 --- /dev/null +++ b/vendor/doctrine/inflector/LICENSE | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | Copyright (c) 2006-2015 Doctrine Project | ||
| 2 | |||
| 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| 4 | this software and associated documentation files (the "Software"), to deal in | ||
| 5 | the Software without restriction, including without limitation the rights to | ||
| 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
| 7 | of the Software, and to permit persons to whom the Software is furnished to do | ||
| 8 | so, subject to the following conditions: | ||
| 9 | |||
| 10 | The above copyright notice and this permission notice shall be included in all | ||
| 11 | copies or substantial portions of the Software. | ||
| 12 | |||
| 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 19 | SOFTWARE. | ||
diff --git a/vendor/doctrine/inflector/README.md b/vendor/doctrine/inflector/README.md new file mode 100644 index 0000000..6e3a97f --- /dev/null +++ b/vendor/doctrine/inflector/README.md | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # Doctrine Inflector | ||
| 2 | |||
| 3 | Doctrine Inflector is a small library that can perform string manipulations | ||
| 4 | with regard to uppercase/lowercase and singular/plural forms of words. | ||
| 5 | |||
| 6 | [](https://github.com/doctrine/inflector/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x) | ||
| 7 | [](https://codecov.io/gh/doctrine/inflector/branch/2.0.x) | ||
diff --git a/vendor/doctrine/inflector/composer.json b/vendor/doctrine/inflector/composer.json new file mode 100644 index 0000000..91d7707 --- /dev/null +++ b/vendor/doctrine/inflector/composer.json | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | { | ||
| 2 | "name": "doctrine/inflector", | ||
| 3 | "type": "library", | ||
| 4 | "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", | ||
| 5 | "keywords": ["php", "strings", "words", "manipulation", "inflector", "inflection", "uppercase", "lowercase", "singular", "plural"], | ||
| 6 | "homepage": "https://www.doctrine-project.org/projects/inflector.html", | ||
| 7 | "license": "MIT", | ||
| 8 | "authors": [ | ||
| 9 | {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, | ||
| 10 | {"name": "Roman Borschel", "email": "roman@code-factory.org"}, | ||
| 11 | {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, | ||
| 12 | {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, | ||
| 13 | {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} | ||
| 14 | ], | ||
| 15 | "require": { | ||
| 16 | "php": "^7.2 || ^8.0" | ||
| 17 | }, | ||
| 18 | "require-dev": { | ||
| 19 | "doctrine/coding-standard": "^11.0", | ||
| 20 | "phpstan/phpstan": "^1.8", | ||
| 21 | "phpstan/phpstan-phpunit": "^1.1", | ||
| 22 | "phpstan/phpstan-strict-rules": "^1.3", | ||
| 23 | "phpunit/phpunit": "^8.5 || ^9.5", | ||
| 24 | "vimeo/psalm": "^4.25 || ^5.4" | ||
| 25 | }, | ||
| 26 | "autoload": { | ||
| 27 | "psr-4": { | ||
| 28 | "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" | ||
| 29 | } | ||
| 30 | }, | ||
| 31 | "autoload-dev": { | ||
| 32 | "psr-4": { | ||
| 33 | "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector" | ||
| 34 | } | ||
| 35 | }, | ||
| 36 | "config": { | ||
| 37 | "allow-plugins": { | ||
| 38 | "dealerdirect/phpcodesniffer-composer-installer": true | ||
| 39 | } | ||
| 40 | } | ||
| 41 | } | ||
diff --git a/vendor/doctrine/inflector/docs/en/index.rst b/vendor/doctrine/inflector/docs/en/index.rst new file mode 100644 index 0000000..29866f4 --- /dev/null +++ b/vendor/doctrine/inflector/docs/en/index.rst | |||
| @@ -0,0 +1,226 @@ | |||
| 1 | Introduction | ||
| 2 | ============ | ||
| 3 | |||
| 4 | The Doctrine Inflector has methods for inflecting text. The features include pluralization, | ||
| 5 | singularization, converting between camelCase and under_score and capitalizing | ||
| 6 | words. | ||
| 7 | |||
| 8 | Installation | ||
| 9 | ============ | ||
| 10 | |||
| 11 | You can install the Inflector with composer: | ||
| 12 | |||
| 13 | .. code-block:: console | ||
| 14 | |||
| 15 | $ composer require doctrine/inflector | ||
| 16 | |||
| 17 | Usage | ||
| 18 | ===== | ||
| 19 | |||
| 20 | Using the inflector is easy, you can create a new ``Doctrine\Inflector\Inflector`` instance by using | ||
| 21 | the ``Doctrine\Inflector\InflectorFactory`` class: | ||
| 22 | |||
| 23 | .. code-block:: php | ||
| 24 | |||
| 25 | use Doctrine\Inflector\InflectorFactory; | ||
| 26 | |||
| 27 | $inflector = InflectorFactory::create()->build(); | ||
| 28 | |||
| 29 | By default it will create an English inflector. If you want to use another language, just pass the language | ||
| 30 | you want to create an inflector for to the ``createForLanguage()`` method: | ||
| 31 | |||
| 32 | .. code-block:: php | ||
| 33 | |||
| 34 | use Doctrine\Inflector\InflectorFactory; | ||
| 35 | use Doctrine\Inflector\Language; | ||
| 36 | |||
| 37 | $inflector = InflectorFactory::createForLanguage(Language::SPANISH)->build(); | ||
| 38 | |||
| 39 | The supported languages are as follows: | ||
| 40 | |||
| 41 | - ``Language::ENGLISH`` | ||
| 42 | - ``Language::FRENCH`` | ||
| 43 | - ``Language::NORWEGIAN_BOKMAL`` | ||
| 44 | - ``Language::PORTUGUESE`` | ||
| 45 | - ``Language::SPANISH`` | ||
| 46 | - ``Language::TURKISH`` | ||
| 47 | |||
| 48 | If you want to manually construct the inflector instead of using a factory, you can do so like this: | ||
| 49 | |||
| 50 | .. code-block:: php | ||
| 51 | |||
| 52 | use Doctrine\Inflector\CachedWordInflector; | ||
| 53 | use Doctrine\Inflector\RulesetInflector; | ||
| 54 | use Doctrine\Inflector\Rules\English; | ||
| 55 | |||
| 56 | $inflector = new Inflector( | ||
| 57 | new CachedWordInflector(new RulesetInflector( | ||
| 58 | English\Rules::getSingularRuleset() | ||
| 59 | )), | ||
| 60 | new CachedWordInflector(new RulesetInflector( | ||
| 61 | English\Rules::getPluralRuleset() | ||
| 62 | )) | ||
| 63 | ); | ||
| 64 | |||
| 65 | Adding Languages | ||
| 66 | ---------------- | ||
| 67 | |||
| 68 | If you are interested in adding support for your language, take a look at the other languages defined in the | ||
| 69 | ``Doctrine\Inflector\Rules`` namespace and the tests located in ``Doctrine\Tests\Inflector\Rules``. You can copy | ||
| 70 | one of the languages and update the rules for your language. | ||
| 71 | |||
| 72 | Once you have done this, send a pull request to the ``doctrine/inflector`` repository with the additions. | ||
| 73 | |||
| 74 | Custom Setup | ||
| 75 | ============ | ||
| 76 | |||
| 77 | If you want to setup custom singular and plural rules, you can configure these in the factory: | ||
| 78 | |||
| 79 | .. code-block:: php | ||
| 80 | |||
| 81 | use Doctrine\Inflector\InflectorFactory; | ||
| 82 | use Doctrine\Inflector\Rules\Pattern; | ||
| 83 | use Doctrine\Inflector\Rules\Patterns; | ||
| 84 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 85 | use Doctrine\Inflector\Rules\Substitution; | ||
| 86 | use Doctrine\Inflector\Rules\Substitutions; | ||
| 87 | use Doctrine\Inflector\Rules\Transformation; | ||
| 88 | use Doctrine\Inflector\Rules\Transformations; | ||
| 89 | use Doctrine\Inflector\Rules\Word; | ||
| 90 | |||
| 91 | $inflector = InflectorFactory::create() | ||
| 92 | ->withSingularRules( | ||
| 93 | new Ruleset( | ||
| 94 | new Transformations( | ||
| 95 | new Transformation(new Pattern('/^(bil)er$/i'), '\1'), | ||
| 96 | new Transformation(new Pattern('/^(inflec|contribu)tors$/i'), '\1ta') | ||
| 97 | ), | ||
| 98 | new Patterns(new Pattern('singulars')), | ||
| 99 | new Substitutions(new Substitution(new Word('spins'), new Word('spinor'))) | ||
| 100 | ) | ||
| 101 | ) | ||
| 102 | ->withPluralRules( | ||
| 103 | new Ruleset( | ||
| 104 | new Transformations( | ||
| 105 | new Transformation(new Pattern('^(bil)er$'), '\1'), | ||
| 106 | new Transformation(new Pattern('^(inflec|contribu)tors$'), '\1ta') | ||
| 107 | ), | ||
| 108 | new Patterns(new Pattern('noflect'), new Pattern('abtuse')), | ||
| 109 | new Substitutions( | ||
| 110 | new Substitution(new Word('amaze'), new Word('amazable')), | ||
| 111 | new Substitution(new Word('phone'), new Word('phonezes')) | ||
| 112 | ) | ||
| 113 | ) | ||
| 114 | ) | ||
| 115 | ->build(); | ||
| 116 | |||
| 117 | No operation inflector | ||
| 118 | ---------------------- | ||
| 119 | |||
| 120 | The ``Doctrine\Inflector\NoopWordInflector`` may be used to configure an inflector that doesn't perform any operation for | ||
| 121 | pluralization and/or singularization. If will simply return the input as output. | ||
| 122 | |||
| 123 | This is an implementation of the `Null Object design pattern <https://sourcemaking.com/design_patterns/null_object>`_. | ||
| 124 | |||
| 125 | .. code-block:: php | ||
| 126 | |||
| 127 | use Doctrine\Inflector\Inflector; | ||
| 128 | use Doctrine\Inflector\NoopWordInflector; | ||
| 129 | |||
| 130 | $inflector = new Inflector(new NoopWordInflector(), new NoopWordInflector()); | ||
| 131 | |||
| 132 | Tableize | ||
| 133 | ======== | ||
| 134 | |||
| 135 | Converts ``ModelName`` to ``model_name``: | ||
| 136 | |||
| 137 | .. code-block:: php | ||
| 138 | |||
| 139 | echo $inflector->tableize('ModelName'); // model_name | ||
| 140 | |||
| 141 | Classify | ||
| 142 | ======== | ||
| 143 | |||
| 144 | Converts ``model_name`` to ``ModelName``: | ||
| 145 | |||
| 146 | .. code-block:: php | ||
| 147 | |||
| 148 | echo $inflector->classify('model_name'); // ModelName | ||
| 149 | |||
| 150 | Camelize | ||
| 151 | ======== | ||
| 152 | |||
| 153 | This method uses `Classify`_ and then converts the first character to lowercase: | ||
| 154 | |||
| 155 | .. code-block:: php | ||
| 156 | |||
| 157 | echo $inflector->camelize('model_name'); // modelName | ||
| 158 | |||
| 159 | Capitalize | ||
| 160 | ========== | ||
| 161 | |||
| 162 | Takes a string and capitalizes all of the words, like PHP's built-in | ||
| 163 | ``ucwords`` function. This extends that behavior, however, by allowing the | ||
| 164 | word delimiters to be configured, rather than only separating on | ||
| 165 | whitespace. | ||
| 166 | |||
| 167 | Here is an example: | ||
| 168 | |||
| 169 | .. code-block:: php | ||
| 170 | |||
| 171 | $string = 'top-o-the-morning to all_of_you!'; | ||
| 172 | |||
| 173 | echo $inflector->capitalize($string); // Top-O-The-Morning To All_of_you! | ||
| 174 | |||
| 175 | echo $inflector->capitalize($string, '-_ '); // Top-O-The-Morning To All_Of_You! | ||
| 176 | |||
| 177 | Pluralize | ||
| 178 | ========= | ||
| 179 | |||
| 180 | Returns a word in plural form. | ||
| 181 | |||
| 182 | .. code-block:: php | ||
| 183 | |||
| 184 | echo $inflector->pluralize('browser'); // browsers | ||
| 185 | |||
| 186 | Singularize | ||
| 187 | =========== | ||
| 188 | |||
| 189 | Returns a word in singular form. | ||
| 190 | |||
| 191 | .. code-block:: php | ||
| 192 | |||
| 193 | echo $inflector->singularize('browsers'); // browser | ||
| 194 | |||
| 195 | Urlize | ||
| 196 | ====== | ||
| 197 | |||
| 198 | Generate a URL friendly string from a string of text: | ||
| 199 | |||
| 200 | .. code-block:: php | ||
| 201 | |||
| 202 | echo $inflector->urlize('My first blog post'); // my-first-blog-post | ||
| 203 | |||
| 204 | Unaccent | ||
| 205 | ======== | ||
| 206 | |||
| 207 | You can unaccent a string of text using the ``unaccent()`` method: | ||
| 208 | |||
| 209 | .. code-block:: php | ||
| 210 | |||
| 211 | echo $inflector->unaccent('año'); // ano | ||
| 212 | |||
| 213 | Legacy API | ||
| 214 | ========== | ||
| 215 | |||
| 216 | The API present in Inflector 1.x is still available, but will be deprecated in a future release and dropped for 3.0. | ||
| 217 | Support for languages other than English is available in the 2.0 API only. | ||
| 218 | |||
| 219 | Acknowledgements | ||
| 220 | ================ | ||
| 221 | |||
| 222 | The language rules in this library have been adapted from several different sources, including but not limited to: | ||
| 223 | |||
| 224 | - `Ruby On Rails Inflector <http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html>`_ | ||
| 225 | - `ICanBoogie Inflector <https://github.com/ICanBoogie/Inflector>`_ | ||
| 226 | - `CakePHP Inflector <https://book.cakephp.org/3.0/en/core-libraries/inflector.html>`_ | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php new file mode 100644 index 0000000..2d52908 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | class CachedWordInflector implements WordInflector | ||
| 8 | { | ||
| 9 | /** @var WordInflector */ | ||
| 10 | private $wordInflector; | ||
| 11 | |||
| 12 | /** @var string[] */ | ||
| 13 | private $cache = []; | ||
| 14 | |||
| 15 | public function __construct(WordInflector $wordInflector) | ||
| 16 | { | ||
| 17 | $this->wordInflector = $wordInflector; | ||
| 18 | } | ||
| 19 | |||
| 20 | public function inflect(string $word): string | ||
| 21 | { | ||
| 22 | return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word); | ||
| 23 | } | ||
| 24 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php new file mode 100644 index 0000000..166061d --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 8 | |||
| 9 | use function array_unshift; | ||
| 10 | |||
| 11 | abstract class GenericLanguageInflectorFactory implements LanguageInflectorFactory | ||
| 12 | { | ||
| 13 | /** @var Ruleset[] */ | ||
| 14 | private $singularRulesets = []; | ||
| 15 | |||
| 16 | /** @var Ruleset[] */ | ||
| 17 | private $pluralRulesets = []; | ||
| 18 | |||
| 19 | final public function __construct() | ||
| 20 | { | ||
| 21 | $this->singularRulesets[] = $this->getSingularRuleset(); | ||
| 22 | $this->pluralRulesets[] = $this->getPluralRuleset(); | ||
| 23 | } | ||
| 24 | |||
| 25 | final public function build(): Inflector | ||
| 26 | { | ||
| 27 | return new Inflector( | ||
| 28 | new CachedWordInflector(new RulesetInflector( | ||
| 29 | ...$this->singularRulesets | ||
| 30 | )), | ||
| 31 | new CachedWordInflector(new RulesetInflector( | ||
| 32 | ...$this->pluralRulesets | ||
| 33 | )) | ||
| 34 | ); | ||
| 35 | } | ||
| 36 | |||
| 37 | final public function withSingularRules(?Ruleset $singularRules, bool $reset = false): LanguageInflectorFactory | ||
| 38 | { | ||
| 39 | if ($reset) { | ||
| 40 | $this->singularRulesets = []; | ||
| 41 | } | ||
| 42 | |||
| 43 | if ($singularRules instanceof Ruleset) { | ||
| 44 | array_unshift($this->singularRulesets, $singularRules); | ||
| 45 | } | ||
| 46 | |||
| 47 | return $this; | ||
| 48 | } | ||
| 49 | |||
| 50 | final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): LanguageInflectorFactory | ||
| 51 | { | ||
| 52 | if ($reset) { | ||
| 53 | $this->pluralRulesets = []; | ||
| 54 | } | ||
| 55 | |||
| 56 | if ($pluralRules instanceof Ruleset) { | ||
| 57 | array_unshift($this->pluralRulesets, $pluralRules); | ||
| 58 | } | ||
| 59 | |||
| 60 | return $this; | ||
| 61 | } | ||
| 62 | |||
| 63 | abstract protected function getSingularRuleset(): Ruleset; | ||
| 64 | |||
| 65 | abstract protected function getPluralRuleset(): Ruleset; | ||
| 66 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php new file mode 100644 index 0000000..610a4cf --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php | |||
| @@ -0,0 +1,507 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | use RuntimeException; | ||
| 8 | |||
| 9 | use function chr; | ||
| 10 | use function function_exists; | ||
| 11 | use function lcfirst; | ||
| 12 | use function mb_strtolower; | ||
| 13 | use function ord; | ||
| 14 | use function preg_match; | ||
| 15 | use function preg_replace; | ||
| 16 | use function sprintf; | ||
| 17 | use function str_replace; | ||
| 18 | use function strlen; | ||
| 19 | use function strtolower; | ||
| 20 | use function strtr; | ||
| 21 | use function trim; | ||
| 22 | use function ucwords; | ||
| 23 | |||
| 24 | class Inflector | ||
| 25 | { | ||
| 26 | private const ACCENTED_CHARACTERS = [ | ||
| 27 | 'À' => 'A', | ||
| 28 | 'Á' => 'A', | ||
| 29 | 'Â' => 'A', | ||
| 30 | 'Ã' => 'A', | ||
| 31 | 'Ä' => 'Ae', | ||
| 32 | 'Æ' => 'Ae', | ||
| 33 | 'Å' => 'Aa', | ||
| 34 | 'æ' => 'a', | ||
| 35 | 'Ç' => 'C', | ||
| 36 | 'È' => 'E', | ||
| 37 | 'É' => 'E', | ||
| 38 | 'Ê' => 'E', | ||
| 39 | 'Ë' => 'E', | ||
| 40 | 'Ì' => 'I', | ||
| 41 | 'Í' => 'I', | ||
| 42 | 'Î' => 'I', | ||
| 43 | 'Ï' => 'I', | ||
| 44 | 'Ñ' => 'N', | ||
| 45 | 'Ò' => 'O', | ||
| 46 | 'Ó' => 'O', | ||
| 47 | 'Ô' => 'O', | ||
| 48 | 'Õ' => 'O', | ||
| 49 | 'Ö' => 'Oe', | ||
| 50 | 'Ù' => 'U', | ||
| 51 | 'Ú' => 'U', | ||
| 52 | 'Û' => 'U', | ||
| 53 | 'Ü' => 'Ue', | ||
| 54 | 'Ý' => 'Y', | ||
| 55 | 'ß' => 'ss', | ||
| 56 | 'à' => 'a', | ||
| 57 | 'á' => 'a', | ||
| 58 | 'â' => 'a', | ||
| 59 | 'ã' => 'a', | ||
| 60 | 'ä' => 'ae', | ||
| 61 | 'å' => 'aa', | ||
| 62 | 'ç' => 'c', | ||
| 63 | 'è' => 'e', | ||
| 64 | 'é' => 'e', | ||
| 65 | 'ê' => 'e', | ||
| 66 | 'ë' => 'e', | ||
| 67 | 'ì' => 'i', | ||
| 68 | 'í' => 'i', | ||
| 69 | 'î' => 'i', | ||
| 70 | 'ï' => 'i', | ||
| 71 | 'ñ' => 'n', | ||
| 72 | 'ò' => 'o', | ||
| 73 | 'ó' => 'o', | ||
| 74 | 'ô' => 'o', | ||
| 75 | 'õ' => 'o', | ||
| 76 | 'ö' => 'oe', | ||
| 77 | 'ù' => 'u', | ||
| 78 | 'ú' => 'u', | ||
| 79 | 'û' => 'u', | ||
| 80 | 'ü' => 'ue', | ||
| 81 | 'ý' => 'y', | ||
| 82 | 'ÿ' => 'y', | ||
| 83 | 'Ā' => 'A', | ||
| 84 | 'ā' => 'a', | ||
| 85 | 'Ă' => 'A', | ||
| 86 | 'ă' => 'a', | ||
| 87 | 'Ą' => 'A', | ||
| 88 | 'ą' => 'a', | ||
| 89 | 'Ć' => 'C', | ||
| 90 | 'ć' => 'c', | ||
| 91 | 'Ĉ' => 'C', | ||
| 92 | 'ĉ' => 'c', | ||
| 93 | 'Ċ' => 'C', | ||
| 94 | 'ċ' => 'c', | ||
| 95 | 'Č' => 'C', | ||
| 96 | 'č' => 'c', | ||
| 97 | 'Ď' => 'D', | ||
| 98 | 'ď' => 'd', | ||
| 99 | 'Đ' => 'D', | ||
| 100 | 'đ' => 'd', | ||
| 101 | 'Ē' => 'E', | ||
| 102 | 'ē' => 'e', | ||
| 103 | 'Ĕ' => 'E', | ||
| 104 | 'ĕ' => 'e', | ||
| 105 | 'Ė' => 'E', | ||
| 106 | 'ė' => 'e', | ||
| 107 | 'Ę' => 'E', | ||
| 108 | 'ę' => 'e', | ||
| 109 | 'Ě' => 'E', | ||
| 110 | 'ě' => 'e', | ||
| 111 | 'Ĝ' => 'G', | ||
| 112 | 'ĝ' => 'g', | ||
| 113 | 'Ğ' => 'G', | ||
| 114 | 'ğ' => 'g', | ||
| 115 | 'Ġ' => 'G', | ||
| 116 | 'ġ' => 'g', | ||
| 117 | 'Ģ' => 'G', | ||
| 118 | 'ģ' => 'g', | ||
| 119 | 'Ĥ' => 'H', | ||
| 120 | 'ĥ' => 'h', | ||
| 121 | 'Ħ' => 'H', | ||
| 122 | 'ħ' => 'h', | ||
| 123 | 'Ĩ' => 'I', | ||
| 124 | 'ĩ' => 'i', | ||
| 125 | 'Ī' => 'I', | ||
| 126 | 'ī' => 'i', | ||
| 127 | 'Ĭ' => 'I', | ||
| 128 | 'ĭ' => 'i', | ||
| 129 | 'Į' => 'I', | ||
| 130 | 'į' => 'i', | ||
| 131 | 'İ' => 'I', | ||
| 132 | 'ı' => 'i', | ||
| 133 | 'IJ' => 'IJ', | ||
| 134 | 'ij' => 'ij', | ||
| 135 | 'Ĵ' => 'J', | ||
| 136 | 'ĵ' => 'j', | ||
| 137 | 'Ķ' => 'K', | ||
| 138 | 'ķ' => 'k', | ||
| 139 | 'ĸ' => 'k', | ||
| 140 | 'Ĺ' => 'L', | ||
| 141 | 'ĺ' => 'l', | ||
| 142 | 'Ļ' => 'L', | ||
| 143 | 'ļ' => 'l', | ||
| 144 | 'Ľ' => 'L', | ||
| 145 | 'ľ' => 'l', | ||
| 146 | 'Ŀ' => 'L', | ||
| 147 | 'ŀ' => 'l', | ||
| 148 | 'Ł' => 'L', | ||
| 149 | 'ł' => 'l', | ||
| 150 | 'Ń' => 'N', | ||
| 151 | 'ń' => 'n', | ||
| 152 | 'Ņ' => 'N', | ||
| 153 | 'ņ' => 'n', | ||
| 154 | 'Ň' => 'N', | ||
| 155 | 'ň' => 'n', | ||
| 156 | 'ʼn' => 'N', | ||
| 157 | 'Ŋ' => 'n', | ||
| 158 | 'ŋ' => 'N', | ||
| 159 | 'Ō' => 'O', | ||
| 160 | 'ō' => 'o', | ||
| 161 | 'Ŏ' => 'O', | ||
| 162 | 'ŏ' => 'o', | ||
| 163 | 'Ő' => 'O', | ||
| 164 | 'ő' => 'o', | ||
| 165 | 'Œ' => 'OE', | ||
| 166 | 'œ' => 'oe', | ||
| 167 | 'Ø' => 'O', | ||
| 168 | 'ø' => 'o', | ||
| 169 | 'Ŕ' => 'R', | ||
| 170 | 'ŕ' => 'r', | ||
| 171 | 'Ŗ' => 'R', | ||
| 172 | 'ŗ' => 'r', | ||
| 173 | 'Ř' => 'R', | ||
| 174 | 'ř' => 'r', | ||
| 175 | 'Ś' => 'S', | ||
| 176 | 'ś' => 's', | ||
| 177 | 'Ŝ' => 'S', | ||
| 178 | 'ŝ' => 's', | ||
| 179 | 'Ş' => 'S', | ||
| 180 | 'ş' => 's', | ||
| 181 | 'Š' => 'S', | ||
| 182 | 'š' => 's', | ||
| 183 | 'Ţ' => 'T', | ||
| 184 | 'ţ' => 't', | ||
| 185 | 'Ť' => 'T', | ||
| 186 | 'ť' => 't', | ||
| 187 | 'Ŧ' => 'T', | ||
| 188 | 'ŧ' => 't', | ||
| 189 | 'Ũ' => 'U', | ||
| 190 | 'ũ' => 'u', | ||
| 191 | 'Ū' => 'U', | ||
| 192 | 'ū' => 'u', | ||
| 193 | 'Ŭ' => 'U', | ||
| 194 | 'ŭ' => 'u', | ||
| 195 | 'Ů' => 'U', | ||
| 196 | 'ů' => 'u', | ||
| 197 | 'Ű' => 'U', | ||
| 198 | 'ű' => 'u', | ||
| 199 | 'Ų' => 'U', | ||
| 200 | 'ų' => 'u', | ||
| 201 | 'Ŵ' => 'W', | ||
| 202 | 'ŵ' => 'w', | ||
| 203 | 'Ŷ' => 'Y', | ||
| 204 | 'ŷ' => 'y', | ||
| 205 | 'Ÿ' => 'Y', | ||
| 206 | 'Ź' => 'Z', | ||
| 207 | 'ź' => 'z', | ||
| 208 | 'Ż' => 'Z', | ||
| 209 | 'ż' => 'z', | ||
| 210 | 'Ž' => 'Z', | ||
| 211 | 'ž' => 'z', | ||
| 212 | 'ſ' => 's', | ||
| 213 | '€' => 'E', | ||
| 214 | '£' => '', | ||
| 215 | ]; | ||
| 216 | |||
| 217 | /** @var WordInflector */ | ||
| 218 | private $singularizer; | ||
| 219 | |||
| 220 | /** @var WordInflector */ | ||
| 221 | private $pluralizer; | ||
| 222 | |||
| 223 | public function __construct(WordInflector $singularizer, WordInflector $pluralizer) | ||
| 224 | { | ||
| 225 | $this->singularizer = $singularizer; | ||
| 226 | $this->pluralizer = $pluralizer; | ||
| 227 | } | ||
| 228 | |||
| 229 | /** | ||
| 230 | * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. | ||
| 231 | */ | ||
| 232 | public function tableize(string $word): string | ||
| 233 | { | ||
| 234 | $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); | ||
| 235 | |||
| 236 | if ($tableized === null) { | ||
| 237 | throw new RuntimeException(sprintf( | ||
| 238 | 'preg_replace returned null for value "%s"', | ||
| 239 | $word | ||
| 240 | )); | ||
| 241 | } | ||
| 242 | |||
| 243 | return mb_strtolower($tableized); | ||
| 244 | } | ||
| 245 | |||
| 246 | /** | ||
| 247 | * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. | ||
| 248 | */ | ||
| 249 | public function classify(string $word): string | ||
| 250 | { | ||
| 251 | return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); | ||
| 252 | } | ||
| 253 | |||
| 254 | /** | ||
| 255 | * Camelizes a word. This uses the classify() method and turns the first character to lowercase. | ||
| 256 | */ | ||
| 257 | public function camelize(string $word): string | ||
| 258 | { | ||
| 259 | return lcfirst($this->classify($word)); | ||
| 260 | } | ||
| 261 | |||
| 262 | /** | ||
| 263 | * Uppercases words with configurable delimiters between words. | ||
| 264 | * | ||
| 265 | * Takes a string and capitalizes all of the words, like PHP's built-in | ||
| 266 | * ucwords function. This extends that behavior, however, by allowing the | ||
| 267 | * word delimiters to be configured, rather than only separating on | ||
| 268 | * whitespace. | ||
| 269 | * | ||
| 270 | * Here is an example: | ||
| 271 | * <code> | ||
| 272 | * <?php | ||
| 273 | * $string = 'top-o-the-morning to all_of_you!'; | ||
| 274 | * echo $inflector->capitalize($string); | ||
| 275 | * // Top-O-The-Morning To All_of_you! | ||
| 276 | * | ||
| 277 | * echo $inflector->capitalize($string, '-_ '); | ||
| 278 | * // Top-O-The-Morning To All_Of_You! | ||
| 279 | * ?> | ||
| 280 | * </code> | ||
| 281 | * | ||
| 282 | * @param string $string The string to operate on. | ||
| 283 | * @param string $delimiters A list of word separators. | ||
| 284 | * | ||
| 285 | * @return string The string with all delimiter-separated words capitalized. | ||
| 286 | */ | ||
| 287 | public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-"): string | ||
| 288 | { | ||
| 289 | return ucwords($string, $delimiters); | ||
| 290 | } | ||
| 291 | |||
| 292 | /** | ||
| 293 | * Checks if the given string seems like it has utf8 characters in it. | ||
| 294 | * | ||
| 295 | * @param string $string The string to check for utf8 characters in. | ||
| 296 | */ | ||
| 297 | public function seemsUtf8(string $string): bool | ||
| 298 | { | ||
| 299 | for ($i = 0; $i < strlen($string); $i++) { | ||
| 300 | if (ord($string[$i]) < 0x80) { | ||
| 301 | continue; // 0bbbbbbb | ||
| 302 | } | ||
| 303 | |||
| 304 | if ((ord($string[$i]) & 0xE0) === 0xC0) { | ||
| 305 | $n = 1; // 110bbbbb | ||
| 306 | } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { | ||
| 307 | $n = 2; // 1110bbbb | ||
| 308 | } elseif ((ord($string[$i]) & 0xF8) === 0xF0) { | ||
| 309 | $n = 3; // 11110bbb | ||
| 310 | } elseif ((ord($string[$i]) & 0xFC) === 0xF8) { | ||
| 311 | $n = 4; // 111110bb | ||
| 312 | } elseif ((ord($string[$i]) & 0xFE) === 0xFC) { | ||
| 313 | $n = 5; // 1111110b | ||
| 314 | } else { | ||
| 315 | return false; // Does not match any model | ||
| 316 | } | ||
| 317 | |||
| 318 | for ($j = 0; $j < $n; $j++) { // n bytes matching 10bbbbbb follow ? | ||
| 319 | if (++$i === strlen($string) || ((ord($string[$i]) & 0xC0) !== 0x80)) { | ||
| 320 | return false; | ||
| 321 | } | ||
| 322 | } | ||
| 323 | } | ||
| 324 | |||
| 325 | return true; | ||
| 326 | } | ||
| 327 | |||
| 328 | /** | ||
| 329 | * Remove any illegal characters, accents, etc. | ||
| 330 | * | ||
| 331 | * @param string $string String to unaccent | ||
| 332 | * | ||
| 333 | * @return string Unaccented string | ||
| 334 | */ | ||
| 335 | public function unaccent(string $string): string | ||
| 336 | { | ||
| 337 | if (preg_match('/[\x80-\xff]/', $string) === false) { | ||
| 338 | return $string; | ||
| 339 | } | ||
| 340 | |||
| 341 | if ($this->seemsUtf8($string)) { | ||
| 342 | $string = strtr($string, self::ACCENTED_CHARACTERS); | ||
| 343 | } else { | ||
| 344 | $characters = []; | ||
| 345 | |||
| 346 | // Assume ISO-8859-1 if not UTF-8 | ||
| 347 | $characters['in'] = | ||
| 348 | chr(128) | ||
| 349 | . chr(131) | ||
| 350 | . chr(138) | ||
| 351 | . chr(142) | ||
| 352 | . chr(154) | ||
| 353 | . chr(158) | ||
| 354 | . chr(159) | ||
| 355 | . chr(162) | ||
| 356 | . chr(165) | ||
| 357 | . chr(181) | ||
| 358 | . chr(192) | ||
| 359 | . chr(193) | ||
| 360 | . chr(194) | ||
| 361 | . chr(195) | ||
| 362 | . chr(196) | ||
| 363 | . chr(197) | ||
| 364 | . chr(199) | ||
| 365 | . chr(200) | ||
| 366 | . chr(201) | ||
| 367 | . chr(202) | ||
| 368 | . chr(203) | ||
| 369 | . chr(204) | ||
| 370 | . chr(205) | ||
| 371 | . chr(206) | ||
| 372 | . chr(207) | ||
| 373 | . chr(209) | ||
| 374 | . chr(210) | ||
| 375 | . chr(211) | ||
| 376 | . chr(212) | ||
| 377 | . chr(213) | ||
| 378 | . chr(214) | ||
| 379 | . chr(216) | ||
| 380 | . chr(217) | ||
| 381 | . chr(218) | ||
| 382 | . chr(219) | ||
| 383 | . chr(220) | ||
| 384 | . chr(221) | ||
| 385 | . chr(224) | ||
| 386 | . chr(225) | ||
| 387 | . chr(226) | ||
| 388 | . chr(227) | ||
| 389 | . chr(228) | ||
| 390 | . chr(229) | ||
| 391 | . chr(231) | ||
| 392 | . chr(232) | ||
| 393 | . chr(233) | ||
| 394 | . chr(234) | ||
| 395 | . chr(235) | ||
| 396 | . chr(236) | ||
| 397 | . chr(237) | ||
| 398 | . chr(238) | ||
| 399 | . chr(239) | ||
| 400 | . chr(241) | ||
| 401 | . chr(242) | ||
| 402 | . chr(243) | ||
| 403 | . chr(244) | ||
| 404 | . chr(245) | ||
| 405 | . chr(246) | ||
| 406 | . chr(248) | ||
| 407 | . chr(249) | ||
| 408 | . chr(250) | ||
| 409 | . chr(251) | ||
| 410 | . chr(252) | ||
| 411 | . chr(253) | ||
| 412 | . chr(255); | ||
| 413 | |||
| 414 | $characters['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'; | ||
| 415 | |||
| 416 | $string = strtr($string, $characters['in'], $characters['out']); | ||
| 417 | |||
| 418 | $doubleChars = []; | ||
| 419 | |||
| 420 | $doubleChars['in'] = [ | ||
| 421 | chr(140), | ||
| 422 | chr(156), | ||
| 423 | chr(198), | ||
| 424 | chr(208), | ||
| 425 | chr(222), | ||
| 426 | chr(223), | ||
| 427 | chr(230), | ||
| 428 | chr(240), | ||
| 429 | chr(254), | ||
| 430 | ]; | ||
| 431 | |||
| 432 | $doubleChars['out'] = ['OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th']; | ||
| 433 | |||
| 434 | $string = str_replace($doubleChars['in'], $doubleChars['out'], $string); | ||
| 435 | } | ||
| 436 | |||
| 437 | return $string; | ||
| 438 | } | ||
| 439 | |||
| 440 | /** | ||
| 441 | * Convert any passed string to a url friendly string. | ||
| 442 | * Converts 'My first blog post' to 'my-first-blog-post' | ||
| 443 | * | ||
| 444 | * @param string $string String to urlize. | ||
| 445 | * | ||
| 446 | * @return string Urlized string. | ||
| 447 | */ | ||
| 448 | public function urlize(string $string): string | ||
| 449 | { | ||
| 450 | // Remove all non url friendly characters with the unaccent function | ||
| 451 | $unaccented = $this->unaccent($string); | ||
| 452 | |||
| 453 | if (function_exists('mb_strtolower')) { | ||
| 454 | $lowered = mb_strtolower($unaccented); | ||
| 455 | } else { | ||
| 456 | $lowered = strtolower($unaccented); | ||
| 457 | } | ||
| 458 | |||
| 459 | $replacements = [ | ||
| 460 | '/\W/' => ' ', | ||
| 461 | '/([A-Z]+)([A-Z][a-z])/' => '\1_\2', | ||
| 462 | '/([a-z\d])([A-Z])/' => '\1_\2', | ||
| 463 | '/[^A-Z^a-z^0-9^\/]+/' => '-', | ||
| 464 | ]; | ||
| 465 | |||
| 466 | $urlized = $lowered; | ||
| 467 | |||
| 468 | foreach ($replacements as $pattern => $replacement) { | ||
| 469 | $replaced = preg_replace($pattern, $replacement, $urlized); | ||
| 470 | |||
| 471 | if ($replaced === null) { | ||
| 472 | throw new RuntimeException(sprintf( | ||
| 473 | 'preg_replace returned null for value "%s"', | ||
| 474 | $urlized | ||
| 475 | )); | ||
| 476 | } | ||
| 477 | |||
| 478 | $urlized = $replaced; | ||
| 479 | } | ||
| 480 | |||
| 481 | return trim($urlized, '-'); | ||
| 482 | } | ||
| 483 | |||
| 484 | /** | ||
| 485 | * Returns a word in singular form. | ||
| 486 | * | ||
| 487 | * @param string $word The word in plural form. | ||
| 488 | * | ||
| 489 | * @return string The word in singular form. | ||
| 490 | */ | ||
| 491 | public function singularize(string $word): string | ||
| 492 | { | ||
| 493 | return $this->singularizer->inflect($word); | ||
| 494 | } | ||
| 495 | |||
| 496 | /** | ||
| 497 | * Returns a word in plural form. | ||
| 498 | * | ||
| 499 | * @param string $word The word in singular form. | ||
| 500 | * | ||
| 501 | * @return string The word in plural form. | ||
| 502 | */ | ||
| 503 | public function pluralize(string $word): string | ||
| 504 | { | ||
| 505 | return $this->pluralizer->inflect($word); | ||
| 506 | } | ||
| 507 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php new file mode 100644 index 0000000..a0740a7 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\English; | ||
| 8 | use Doctrine\Inflector\Rules\French; | ||
| 9 | use Doctrine\Inflector\Rules\NorwegianBokmal; | ||
| 10 | use Doctrine\Inflector\Rules\Portuguese; | ||
| 11 | use Doctrine\Inflector\Rules\Spanish; | ||
| 12 | use Doctrine\Inflector\Rules\Turkish; | ||
| 13 | use InvalidArgumentException; | ||
| 14 | |||
| 15 | use function sprintf; | ||
| 16 | |||
| 17 | final class InflectorFactory | ||
| 18 | { | ||
| 19 | public static function create(): LanguageInflectorFactory | ||
| 20 | { | ||
| 21 | return self::createForLanguage(Language::ENGLISH); | ||
| 22 | } | ||
| 23 | |||
| 24 | public static function createForLanguage(string $language): LanguageInflectorFactory | ||
| 25 | { | ||
| 26 | switch ($language) { | ||
| 27 | case Language::ENGLISH: | ||
| 28 | return new English\InflectorFactory(); | ||
| 29 | |||
| 30 | case Language::FRENCH: | ||
| 31 | return new French\InflectorFactory(); | ||
| 32 | |||
| 33 | case Language::NORWEGIAN_BOKMAL: | ||
| 34 | return new NorwegianBokmal\InflectorFactory(); | ||
| 35 | |||
| 36 | case Language::PORTUGUESE: | ||
| 37 | return new Portuguese\InflectorFactory(); | ||
| 38 | |||
| 39 | case Language::SPANISH: | ||
| 40 | return new Spanish\InflectorFactory(); | ||
| 41 | |||
| 42 | case Language::TURKISH: | ||
| 43 | return new Turkish\InflectorFactory(); | ||
| 44 | |||
| 45 | default: | ||
| 46 | throw new InvalidArgumentException(sprintf( | ||
| 47 | 'Language "%s" is not supported.', | ||
| 48 | $language | ||
| 49 | )); | ||
| 50 | } | ||
| 51 | } | ||
| 52 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Language.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Language.php new file mode 100644 index 0000000..78c3cc7 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Language.php | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | final class Language | ||
| 8 | { | ||
| 9 | public const ENGLISH = 'english'; | ||
| 10 | public const FRENCH = 'french'; | ||
| 11 | public const NORWEGIAN_BOKMAL = 'norwegian-bokmal'; | ||
| 12 | public const PORTUGUESE = 'portuguese'; | ||
| 13 | public const SPANISH = 'spanish'; | ||
| 14 | public const TURKISH = 'turkish'; | ||
| 15 | |||
| 16 | private function __construct() | ||
| 17 | { | ||
| 18 | } | ||
| 19 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php new file mode 100644 index 0000000..a58f43c --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 8 | |||
| 9 | interface LanguageInflectorFactory | ||
| 10 | { | ||
| 11 | /** | ||
| 12 | * Applies custom rules for singularisation | ||
| 13 | * | ||
| 14 | * @param bool $reset If true, will unset default inflections for all new rules | ||
| 15 | * | ||
| 16 | * @return $this | ||
| 17 | */ | ||
| 18 | public function withSingularRules(?Ruleset $singularRules, bool $reset = false): self; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Applies custom rules for pluralisation | ||
| 22 | * | ||
| 23 | * @param bool $reset If true, will unset default inflections for all new rules | ||
| 24 | * | ||
| 25 | * @return $this | ||
| 26 | */ | ||
| 27 | public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): self; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * Builds the inflector instance with all applicable rules | ||
| 31 | */ | ||
| 32 | public function build(): Inflector; | ||
| 33 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php new file mode 100644 index 0000000..2fdf535 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | class NoopWordInflector implements WordInflector | ||
| 8 | { | ||
| 9 | public function inflect(string $word): string | ||
| 10 | { | ||
| 11 | return $word; | ||
| 12 | } | ||
| 13 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php new file mode 100644 index 0000000..8bf02a2 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php | |||
| @@ -0,0 +1,184 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\English; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | use Doctrine\Inflector\Rules\Substitution; | ||
| 9 | use Doctrine\Inflector\Rules\Transformation; | ||
| 10 | use Doctrine\Inflector\Rules\Word; | ||
| 11 | |||
| 12 | class Inflectible | ||
| 13 | { | ||
| 14 | /** @return Transformation[] */ | ||
| 15 | public static function getSingular(): iterable | ||
| 16 | { | ||
| 17 | yield new Transformation(new Pattern('(s)tatuses$'), '\1\2tatus'); | ||
| 18 | yield new Transformation(new Pattern('(s)tatus$'), '\1\2tatus'); | ||
| 19 | yield new Transformation(new Pattern('(c)ampus$'), '\1\2ampus'); | ||
| 20 | yield new Transformation(new Pattern('^(.*)(menu)s$'), '\1\2'); | ||
| 21 | yield new Transformation(new Pattern('(quiz)zes$'), '\\1'); | ||
| 22 | yield new Transformation(new Pattern('(matr)ices$'), '\1ix'); | ||
| 23 | yield new Transformation(new Pattern('(vert|ind)ices$'), '\1ex'); | ||
| 24 | yield new Transformation(new Pattern('^(ox)en'), '\1'); | ||
| 25 | yield new Transformation(new Pattern('(alias)(es)*$'), '\1'); | ||
| 26 | yield new Transformation(new Pattern('(buffal|her|potat|tomat|volcan)oes$'), '\1o'); | ||
| 27 | yield new Transformation(new Pattern('(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$'), '\1us'); | ||
| 28 | yield new Transformation(new Pattern('([ftw]ax)es'), '\1'); | ||
| 29 | yield new Transformation(new Pattern('(analys|ax|cris|test|thes)es$'), '\1is'); | ||
| 30 | yield new Transformation(new Pattern('(shoe|slave)s$'), '\1'); | ||
| 31 | yield new Transformation(new Pattern('(o)es$'), '\1'); | ||
| 32 | yield new Transformation(new Pattern('ouses$'), 'ouse'); | ||
| 33 | yield new Transformation(new Pattern('([^a])uses$'), '\1us'); | ||
| 34 | yield new Transformation(new Pattern('([m|l])ice$'), '\1ouse'); | ||
| 35 | yield new Transformation(new Pattern('(x|ch|ss|sh)es$'), '\1'); | ||
| 36 | yield new Transformation(new Pattern('(m)ovies$'), '\1\2ovie'); | ||
| 37 | yield new Transformation(new Pattern('(s)eries$'), '\1\2eries'); | ||
| 38 | yield new Transformation(new Pattern('([^aeiouy]|qu)ies$'), '\1y'); | ||
| 39 | yield new Transformation(new Pattern('([lr])ves$'), '\1f'); | ||
| 40 | yield new Transformation(new Pattern('(tive)s$'), '\1'); | ||
| 41 | yield new Transformation(new Pattern('(hive)s$'), '\1'); | ||
| 42 | yield new Transformation(new Pattern('(drive)s$'), '\1'); | ||
| 43 | yield new Transformation(new Pattern('(dive)s$'), '\1'); | ||
| 44 | yield new Transformation(new Pattern('(olive)s$'), '\1'); | ||
| 45 | yield new Transformation(new Pattern('([^fo])ves$'), '\1fe'); | ||
| 46 | yield new Transformation(new Pattern('(^analy)ses$'), '\1sis'); | ||
| 47 | yield new Transformation(new Pattern('(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$'), '\1\2sis'); | ||
| 48 | yield new Transformation(new Pattern('(tax)a$'), '\1on'); | ||
| 49 | yield new Transformation(new Pattern('(c)riteria$'), '\1riterion'); | ||
| 50 | yield new Transformation(new Pattern('([ti])a(?<!regatta)$'), '\1um'); | ||
| 51 | yield new Transformation(new Pattern('(p)eople$'), '\1\2erson'); | ||
| 52 | yield new Transformation(new Pattern('(m)en$'), '\1an'); | ||
| 53 | yield new Transformation(new Pattern('(c)hildren$'), '\1\2hild'); | ||
| 54 | yield new Transformation(new Pattern('(f)eet$'), '\1oot'); | ||
| 55 | yield new Transformation(new Pattern('(n)ews$'), '\1\2ews'); | ||
| 56 | yield new Transformation(new Pattern('eaus$'), 'eau'); | ||
| 57 | yield new Transformation(new Pattern('^tights$'), 'tights'); | ||
| 58 | yield new Transformation(new Pattern('^shorts$'), 'shorts'); | ||
| 59 | yield new Transformation(new Pattern('s$'), ''); | ||
| 60 | } | ||
| 61 | |||
| 62 | /** @return Transformation[] */ | ||
| 63 | public static function getPlural(): iterable | ||
| 64 | { | ||
| 65 | yield new Transformation(new Pattern('(s)tatus$'), '\1\2tatuses'); | ||
| 66 | yield new Transformation(new Pattern('(quiz)$'), '\1zes'); | ||
| 67 | yield new Transformation(new Pattern('^(ox)$'), '\1\2en'); | ||
| 68 | yield new Transformation(new Pattern('([m|l])ouse$'), '\1ice'); | ||
| 69 | yield new Transformation(new Pattern('(matr|vert|ind)(ix|ex)$'), '\1ices'); | ||
| 70 | yield new Transformation(new Pattern('(x|ch|ss|sh)$'), '\1es'); | ||
| 71 | yield new Transformation(new Pattern('([^aeiouy]|qu)y$'), '\1ies'); | ||
| 72 | yield new Transformation(new Pattern('(hive|gulf)$'), '\1s'); | ||
| 73 | yield new Transformation(new Pattern('(?:([^f])fe|([lr])f)$'), '\1\2ves'); | ||
| 74 | yield new Transformation(new Pattern('sis$'), 'ses'); | ||
| 75 | yield new Transformation(new Pattern('([ti])um$'), '\1a'); | ||
| 76 | yield new Transformation(new Pattern('(tax)on$'), '\1a'); | ||
| 77 | yield new Transformation(new Pattern('(c)riterion$'), '\1riteria'); | ||
| 78 | yield new Transformation(new Pattern('(p)erson$'), '\1eople'); | ||
| 79 | yield new Transformation(new Pattern('(m)an$'), '\1en'); | ||
| 80 | yield new Transformation(new Pattern('(c)hild$'), '\1hildren'); | ||
| 81 | yield new Transformation(new Pattern('(f)oot$'), '\1eet'); | ||
| 82 | yield new Transformation(new Pattern('(buffal|her|potat|tomat|volcan)o$'), '\1\2oes'); | ||
| 83 | yield new Transformation(new Pattern('(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$'), '\1i'); | ||
| 84 | yield new Transformation(new Pattern('us$'), 'uses'); | ||
| 85 | yield new Transformation(new Pattern('(alias)$'), '\1es'); | ||
| 86 | yield new Transformation(new Pattern('(analys|ax|cris|test|thes)is$'), '\1es'); | ||
| 87 | yield new Transformation(new Pattern('s$'), 's'); | ||
| 88 | yield new Transformation(new Pattern('^$'), ''); | ||
| 89 | yield new Transformation(new Pattern('$'), 's'); | ||
| 90 | } | ||
| 91 | |||
| 92 | /** @return Substitution[] */ | ||
| 93 | public static function getIrregular(): iterable | ||
| 94 | { | ||
| 95 | yield new Substitution(new Word('atlas'), new Word('atlases')); | ||
| 96 | yield new Substitution(new Word('axis'), new Word('axes')); | ||
| 97 | yield new Substitution(new Word('axe'), new Word('axes')); | ||
| 98 | yield new Substitution(new Word('beef'), new Word('beefs')); | ||
| 99 | yield new Substitution(new Word('blouse'), new Word('blouses')); | ||
| 100 | yield new Substitution(new Word('brother'), new Word('brothers')); | ||
| 101 | yield new Substitution(new Word('cafe'), new Word('cafes')); | ||
| 102 | yield new Substitution(new Word('cave'), new Word('caves')); | ||
| 103 | yield new Substitution(new Word('chateau'), new Word('chateaux')); | ||
| 104 | yield new Substitution(new Word('niveau'), new Word('niveaux')); | ||
| 105 | yield new Substitution(new Word('child'), new Word('children')); | ||
| 106 | yield new Substitution(new Word('canvas'), new Word('canvases')); | ||
| 107 | yield new Substitution(new Word('cookie'), new Word('cookies')); | ||
| 108 | yield new Substitution(new Word('brownie'), new Word('brownies')); | ||
| 109 | yield new Substitution(new Word('corpus'), new Word('corpuses')); | ||
| 110 | yield new Substitution(new Word('cow'), new Word('cows')); | ||
| 111 | yield new Substitution(new Word('criterion'), new Word('criteria')); | ||
| 112 | yield new Substitution(new Word('curriculum'), new Word('curricula')); | ||
| 113 | yield new Substitution(new Word('demo'), new Word('demos')); | ||
| 114 | yield new Substitution(new Word('domino'), new Word('dominoes')); | ||
| 115 | yield new Substitution(new Word('echo'), new Word('echoes')); | ||
| 116 | yield new Substitution(new Word('epoch'), new Word('epochs')); | ||
| 117 | yield new Substitution(new Word('foot'), new Word('feet')); | ||
| 118 | yield new Substitution(new Word('fungus'), new Word('fungi')); | ||
| 119 | yield new Substitution(new Word('ganglion'), new Word('ganglions')); | ||
| 120 | yield new Substitution(new Word('gas'), new Word('gases')); | ||
| 121 | yield new Substitution(new Word('genie'), new Word('genies')); | ||
| 122 | yield new Substitution(new Word('genus'), new Word('genera')); | ||
| 123 | yield new Substitution(new Word('goose'), new Word('geese')); | ||
| 124 | yield new Substitution(new Word('graffito'), new Word('graffiti')); | ||
| 125 | yield new Substitution(new Word('hippopotamus'), new Word('hippopotami')); | ||
| 126 | yield new Substitution(new Word('hoof'), new Word('hoofs')); | ||
| 127 | yield new Substitution(new Word('human'), new Word('humans')); | ||
| 128 | yield new Substitution(new Word('iris'), new Word('irises')); | ||
| 129 | yield new Substitution(new Word('larva'), new Word('larvae')); | ||
| 130 | yield new Substitution(new Word('leaf'), new Word('leaves')); | ||
| 131 | yield new Substitution(new Word('lens'), new Word('lenses')); | ||
| 132 | yield new Substitution(new Word('loaf'), new Word('loaves')); | ||
| 133 | yield new Substitution(new Word('man'), new Word('men')); | ||
| 134 | yield new Substitution(new Word('medium'), new Word('media')); | ||
| 135 | yield new Substitution(new Word('memorandum'), new Word('memoranda')); | ||
| 136 | yield new Substitution(new Word('money'), new Word('monies')); | ||
| 137 | yield new Substitution(new Word('mongoose'), new Word('mongooses')); | ||
| 138 | yield new Substitution(new Word('motto'), new Word('mottoes')); | ||
| 139 | yield new Substitution(new Word('move'), new Word('moves')); | ||
| 140 | yield new Substitution(new Word('mythos'), new Word('mythoi')); | ||
| 141 | yield new Substitution(new Word('niche'), new Word('niches')); | ||
| 142 | yield new Substitution(new Word('nucleus'), new Word('nuclei')); | ||
| 143 | yield new Substitution(new Word('numen'), new Word('numina')); | ||
| 144 | yield new Substitution(new Word('occiput'), new Word('occiputs')); | ||
| 145 | yield new Substitution(new Word('octopus'), new Word('octopuses')); | ||
| 146 | yield new Substitution(new Word('opus'), new Word('opuses')); | ||
| 147 | yield new Substitution(new Word('ox'), new Word('oxen')); | ||
| 148 | yield new Substitution(new Word('passerby'), new Word('passersby')); | ||
| 149 | yield new Substitution(new Word('penis'), new Word('penises')); | ||
| 150 | yield new Substitution(new Word('person'), new Word('people')); | ||
| 151 | yield new Substitution(new Word('plateau'), new Word('plateaux')); | ||
| 152 | yield new Substitution(new Word('runner-up'), new Word('runners-up')); | ||
| 153 | yield new Substitution(new Word('safe'), new Word('safes')); | ||
| 154 | yield new Substitution(new Word('sex'), new Word('sexes')); | ||
| 155 | yield new Substitution(new Word('sieve'), new Word('sieves')); | ||
| 156 | yield new Substitution(new Word('soliloquy'), new Word('soliloquies')); | ||
| 157 | yield new Substitution(new Word('son-in-law'), new Word('sons-in-law')); | ||
| 158 | yield new Substitution(new Word('syllabus'), new Word('syllabi')); | ||
| 159 | yield new Substitution(new Word('testis'), new Word('testes')); | ||
| 160 | yield new Substitution(new Word('thief'), new Word('thieves')); | ||
| 161 | yield new Substitution(new Word('tooth'), new Word('teeth')); | ||
| 162 | yield new Substitution(new Word('tornado'), new Word('tornadoes')); | ||
| 163 | yield new Substitution(new Word('trilby'), new Word('trilbys')); | ||
| 164 | yield new Substitution(new Word('turf'), new Word('turfs')); | ||
| 165 | yield new Substitution(new Word('valve'), new Word('valves')); | ||
| 166 | yield new Substitution(new Word('volcano'), new Word('volcanoes')); | ||
| 167 | yield new Substitution(new Word('abuse'), new Word('abuses')); | ||
| 168 | yield new Substitution(new Word('avalanche'), new Word('avalanches')); | ||
| 169 | yield new Substitution(new Word('cache'), new Word('caches')); | ||
| 170 | yield new Substitution(new Word('criterion'), new Word('criteria')); | ||
| 171 | yield new Substitution(new Word('curve'), new Word('curves')); | ||
| 172 | yield new Substitution(new Word('emphasis'), new Word('emphases')); | ||
| 173 | yield new Substitution(new Word('foe'), new Word('foes')); | ||
| 174 | yield new Substitution(new Word('grave'), new Word('graves')); | ||
| 175 | yield new Substitution(new Word('hoax'), new Word('hoaxes')); | ||
| 176 | yield new Substitution(new Word('medium'), new Word('media')); | ||
| 177 | yield new Substitution(new Word('neurosis'), new Word('neuroses')); | ||
| 178 | yield new Substitution(new Word('save'), new Word('saves')); | ||
| 179 | yield new Substitution(new Word('wave'), new Word('waves')); | ||
| 180 | yield new Substitution(new Word('oasis'), new Word('oases')); | ||
| 181 | yield new Substitution(new Word('valve'), new Word('valves')); | ||
| 182 | yield new Substitution(new Word('zombie'), new Word('zombies')); | ||
| 183 | } | ||
| 184 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php new file mode 100644 index 0000000..85f92aa --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\English; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\GenericLanguageInflectorFactory; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | |||
| 10 | final class InflectorFactory extends GenericLanguageInflectorFactory | ||
| 11 | { | ||
| 12 | protected function getSingularRuleset(): Ruleset | ||
| 13 | { | ||
| 14 | return Rules::getSingularRuleset(); | ||
| 15 | } | ||
| 16 | |||
| 17 | protected function getPluralRuleset(): Ruleset | ||
| 18 | { | ||
| 19 | return Rules::getPluralRuleset(); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php new file mode 100644 index 0000000..7ccc103 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\English; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Patterns; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | use Doctrine\Inflector\Rules\Substitutions; | ||
| 10 | use Doctrine\Inflector\Rules\Transformations; | ||
| 11 | |||
| 12 | final class Rules | ||
| 13 | { | ||
| 14 | public static function getSingularRuleset(): Ruleset | ||
| 15 | { | ||
| 16 | return new Ruleset( | ||
| 17 | new Transformations(...Inflectible::getSingular()), | ||
| 18 | new Patterns(...Uninflected::getSingular()), | ||
| 19 | (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions() | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | public static function getPluralRuleset(): Ruleset | ||
| 24 | { | ||
| 25 | return new Ruleset( | ||
| 26 | new Transformations(...Inflectible::getPlural()), | ||
| 27 | new Patterns(...Uninflected::getPlural()), | ||
| 28 | new Substitutions(...Inflectible::getIrregular()) | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php new file mode 100644 index 0000000..02257de --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php | |||
| @@ -0,0 +1,189 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\English; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | |||
| 9 | final class Uninflected | ||
| 10 | { | ||
| 11 | /** @return Pattern[] */ | ||
| 12 | public static function getSingular(): iterable | ||
| 13 | { | ||
| 14 | yield from self::getDefault(); | ||
| 15 | |||
| 16 | yield new Pattern('.*ss'); | ||
| 17 | yield new Pattern('clothes'); | ||
| 18 | yield new Pattern('data'); | ||
| 19 | yield new Pattern('fascia'); | ||
| 20 | yield new Pattern('fuchsia'); | ||
| 21 | yield new Pattern('galleria'); | ||
| 22 | yield new Pattern('mafia'); | ||
| 23 | yield new Pattern('militia'); | ||
| 24 | yield new Pattern('pants'); | ||
| 25 | yield new Pattern('petunia'); | ||
| 26 | yield new Pattern('sepia'); | ||
| 27 | yield new Pattern('trivia'); | ||
| 28 | yield new Pattern('utopia'); | ||
| 29 | } | ||
| 30 | |||
| 31 | /** @return Pattern[] */ | ||
| 32 | public static function getPlural(): iterable | ||
| 33 | { | ||
| 34 | yield from self::getDefault(); | ||
| 35 | |||
| 36 | yield new Pattern('people'); | ||
| 37 | yield new Pattern('trivia'); | ||
| 38 | yield new Pattern('\w+ware$'); | ||
| 39 | yield new Pattern('media'); | ||
| 40 | } | ||
| 41 | |||
| 42 | /** @return Pattern[] */ | ||
| 43 | private static function getDefault(): iterable | ||
| 44 | { | ||
| 45 | yield new Pattern('\w+media'); | ||
| 46 | yield new Pattern('advice'); | ||
| 47 | yield new Pattern('aircraft'); | ||
| 48 | yield new Pattern('amoyese'); | ||
| 49 | yield new Pattern('art'); | ||
| 50 | yield new Pattern('audio'); | ||
| 51 | yield new Pattern('baggage'); | ||
| 52 | yield new Pattern('bison'); | ||
| 53 | yield new Pattern('borghese'); | ||
| 54 | yield new Pattern('bream'); | ||
| 55 | yield new Pattern('breeches'); | ||
| 56 | yield new Pattern('britches'); | ||
| 57 | yield new Pattern('buffalo'); | ||
| 58 | yield new Pattern('butter'); | ||
| 59 | yield new Pattern('cantus'); | ||
| 60 | yield new Pattern('carp'); | ||
| 61 | yield new Pattern('cattle'); | ||
| 62 | yield new Pattern('chassis'); | ||
| 63 | yield new Pattern('clippers'); | ||
| 64 | yield new Pattern('clothing'); | ||
| 65 | yield new Pattern('coal'); | ||
| 66 | yield new Pattern('cod'); | ||
| 67 | yield new Pattern('coitus'); | ||
| 68 | yield new Pattern('compensation'); | ||
| 69 | yield new Pattern('congoese'); | ||
| 70 | yield new Pattern('contretemps'); | ||
| 71 | yield new Pattern('coreopsis'); | ||
| 72 | yield new Pattern('corps'); | ||
| 73 | yield new Pattern('cotton'); | ||
| 74 | yield new Pattern('data'); | ||
| 75 | yield new Pattern('debris'); | ||
| 76 | yield new Pattern('deer'); | ||
| 77 | yield new Pattern('diabetes'); | ||
| 78 | yield new Pattern('djinn'); | ||
| 79 | yield new Pattern('education'); | ||
| 80 | yield new Pattern('eland'); | ||
| 81 | yield new Pattern('elk'); | ||
| 82 | yield new Pattern('emoji'); | ||
| 83 | yield new Pattern('equipment'); | ||
| 84 | yield new Pattern('evidence'); | ||
| 85 | yield new Pattern('faroese'); | ||
| 86 | yield new Pattern('feedback'); | ||
| 87 | yield new Pattern('fish'); | ||
| 88 | yield new Pattern('flounder'); | ||
| 89 | yield new Pattern('flour'); | ||
| 90 | yield new Pattern('foochowese'); | ||
| 91 | yield new Pattern('food'); | ||
| 92 | yield new Pattern('furniture'); | ||
| 93 | yield new Pattern('gallows'); | ||
| 94 | yield new Pattern('genevese'); | ||
| 95 | yield new Pattern('genoese'); | ||
| 96 | yield new Pattern('gilbertese'); | ||
| 97 | yield new Pattern('gold'); | ||
| 98 | yield new Pattern('headquarters'); | ||
| 99 | yield new Pattern('herpes'); | ||
| 100 | yield new Pattern('hijinks'); | ||
| 101 | yield new Pattern('homework'); | ||
| 102 | yield new Pattern('hottentotese'); | ||
| 103 | yield new Pattern('impatience'); | ||
| 104 | yield new Pattern('information'); | ||
| 105 | yield new Pattern('innings'); | ||
| 106 | yield new Pattern('jackanapes'); | ||
| 107 | yield new Pattern('jeans'); | ||
| 108 | yield new Pattern('jedi'); | ||
| 109 | yield new Pattern('kin'); | ||
| 110 | yield new Pattern('kiplingese'); | ||
| 111 | yield new Pattern('knowledge'); | ||
| 112 | yield new Pattern('kongoese'); | ||
| 113 | yield new Pattern('leather'); | ||
| 114 | yield new Pattern('love'); | ||
| 115 | yield new Pattern('lucchese'); | ||
| 116 | yield new Pattern('luggage'); | ||
| 117 | yield new Pattern('mackerel'); | ||
| 118 | yield new Pattern('Maltese'); | ||
| 119 | yield new Pattern('management'); | ||
| 120 | yield new Pattern('metadata'); | ||
| 121 | yield new Pattern('mews'); | ||
| 122 | yield new Pattern('money'); | ||
| 123 | yield new Pattern('moose'); | ||
| 124 | yield new Pattern('mumps'); | ||
| 125 | yield new Pattern('music'); | ||
| 126 | yield new Pattern('nankingese'); | ||
| 127 | yield new Pattern('news'); | ||
| 128 | yield new Pattern('nexus'); | ||
| 129 | yield new Pattern('niasese'); | ||
| 130 | yield new Pattern('nutrition'); | ||
| 131 | yield new Pattern('offspring'); | ||
| 132 | yield new Pattern('oil'); | ||
| 133 | yield new Pattern('patience'); | ||
| 134 | yield new Pattern('pekingese'); | ||
| 135 | yield new Pattern('piedmontese'); | ||
| 136 | yield new Pattern('pincers'); | ||
| 137 | yield new Pattern('pistoiese'); | ||
| 138 | yield new Pattern('plankton'); | ||
| 139 | yield new Pattern('pliers'); | ||
| 140 | yield new Pattern('pokemon'); | ||
| 141 | yield new Pattern('police'); | ||
| 142 | yield new Pattern('polish'); | ||
| 143 | yield new Pattern('portuguese'); | ||
| 144 | yield new Pattern('proceedings'); | ||
| 145 | yield new Pattern('progress'); | ||
| 146 | yield new Pattern('rabies'); | ||
| 147 | yield new Pattern('rain'); | ||
| 148 | yield new Pattern('research'); | ||
| 149 | yield new Pattern('rhinoceros'); | ||
| 150 | yield new Pattern('rice'); | ||
| 151 | yield new Pattern('salmon'); | ||
| 152 | yield new Pattern('sand'); | ||
| 153 | yield new Pattern('sarawakese'); | ||
| 154 | yield new Pattern('scissors'); | ||
| 155 | yield new Pattern('sea[- ]bass'); | ||
| 156 | yield new Pattern('series'); | ||
| 157 | yield new Pattern('shavese'); | ||
| 158 | yield new Pattern('shears'); | ||
| 159 | yield new Pattern('sheep'); | ||
| 160 | yield new Pattern('siemens'); | ||
| 161 | yield new Pattern('silk'); | ||
| 162 | yield new Pattern('sms'); | ||
| 163 | yield new Pattern('soap'); | ||
| 164 | yield new Pattern('social media'); | ||
| 165 | yield new Pattern('spam'); | ||
| 166 | yield new Pattern('species'); | ||
| 167 | yield new Pattern('staff'); | ||
| 168 | yield new Pattern('sugar'); | ||
| 169 | yield new Pattern('swine'); | ||
| 170 | yield new Pattern('talent'); | ||
| 171 | yield new Pattern('toothpaste'); | ||
| 172 | yield new Pattern('traffic'); | ||
| 173 | yield new Pattern('travel'); | ||
| 174 | yield new Pattern('trousers'); | ||
| 175 | yield new Pattern('trout'); | ||
| 176 | yield new Pattern('tuna'); | ||
| 177 | yield new Pattern('us'); | ||
| 178 | yield new Pattern('vermontese'); | ||
| 179 | yield new Pattern('vinegar'); | ||
| 180 | yield new Pattern('weather'); | ||
| 181 | yield new Pattern('wenchowese'); | ||
| 182 | yield new Pattern('wheat'); | ||
| 183 | yield new Pattern('whiting'); | ||
| 184 | yield new Pattern('wildebeest'); | ||
| 185 | yield new Pattern('wood'); | ||
| 186 | yield new Pattern('wool'); | ||
| 187 | yield new Pattern('yengeese'); | ||
| 188 | } | ||
| 189 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php new file mode 100644 index 0000000..05b535a --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\French; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | use Doctrine\Inflector\Rules\Substitution; | ||
| 9 | use Doctrine\Inflector\Rules\Transformation; | ||
| 10 | use Doctrine\Inflector\Rules\Word; | ||
| 11 | |||
| 12 | class Inflectible | ||
| 13 | { | ||
| 14 | /** @return Transformation[] */ | ||
| 15 | public static function getSingular(): iterable | ||
| 16 | { | ||
| 17 | yield new Transformation(new Pattern('/(b|cor|ém|gemm|soupir|trav|vant|vitr)aux$/'), '\1ail'); | ||
| 18 | yield new Transformation(new Pattern('/ails$/'), 'ail'); | ||
| 19 | yield new Transformation(new Pattern('/(journ|chev)aux$/'), '\1al'); | ||
| 20 | yield new Transformation(new Pattern('/(bijou|caillou|chou|genou|hibou|joujou|pou|au|eu|eau)x$/'), '\1'); | ||
| 21 | yield new Transformation(new Pattern('/s$/'), ''); | ||
| 22 | } | ||
| 23 | |||
| 24 | /** @return Transformation[] */ | ||
| 25 | public static function getPlural(): iterable | ||
| 26 | { | ||
| 27 | yield new Transformation(new Pattern('/(s|x|z)$/'), '\1'); | ||
| 28 | yield new Transformation(new Pattern('/(b|cor|ém|gemm|soupir|trav|vant|vitr)ail$/'), '\1aux'); | ||
| 29 | yield new Transformation(new Pattern('/ail$/'), 'ails'); | ||
| 30 | yield new Transformation(new Pattern('/(chacal|carnaval|festival|récital)$/'), '\1s'); | ||
| 31 | yield new Transformation(new Pattern('/al$/'), 'aux'); | ||
| 32 | yield new Transformation(new Pattern('/(bleu|émeu|landau|pneu|sarrau)$/'), '\1s'); | ||
| 33 | yield new Transformation(new Pattern('/(bijou|caillou|chou|genou|hibou|joujou|lieu|pou|au|eu|eau)$/'), '\1x'); | ||
| 34 | yield new Transformation(new Pattern('/$/'), 's'); | ||
| 35 | } | ||
| 36 | |||
| 37 | /** @return Substitution[] */ | ||
| 38 | public static function getIrregular(): iterable | ||
| 39 | { | ||
| 40 | yield new Substitution(new Word('monsieur'), new Word('messieurs')); | ||
| 41 | yield new Substitution(new Word('madame'), new Word('mesdames')); | ||
| 42 | yield new Substitution(new Word('mademoiselle'), new Word('mesdemoiselles')); | ||
| 43 | } | ||
| 44 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php new file mode 100644 index 0000000..62e31f0 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\French; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\GenericLanguageInflectorFactory; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | |||
| 10 | final class InflectorFactory extends GenericLanguageInflectorFactory | ||
| 11 | { | ||
| 12 | protected function getSingularRuleset(): Ruleset | ||
| 13 | { | ||
| 14 | return Rules::getSingularRuleset(); | ||
| 15 | } | ||
| 16 | |||
| 17 | protected function getPluralRuleset(): Ruleset | ||
| 18 | { | ||
| 19 | return Rules::getPluralRuleset(); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php new file mode 100644 index 0000000..6cd45bc --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\French; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Patterns; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | use Doctrine\Inflector\Rules\Substitutions; | ||
| 10 | use Doctrine\Inflector\Rules\Transformations; | ||
| 11 | |||
| 12 | final class Rules | ||
| 13 | { | ||
| 14 | public static function getSingularRuleset(): Ruleset | ||
| 15 | { | ||
| 16 | return new Ruleset( | ||
| 17 | new Transformations(...Inflectible::getSingular()), | ||
| 18 | new Patterns(...Uninflected::getSingular()), | ||
| 19 | (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions() | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | public static function getPluralRuleset(): Ruleset | ||
| 24 | { | ||
| 25 | return new Ruleset( | ||
| 26 | new Transformations(...Inflectible::getPlural()), | ||
| 27 | new Patterns(...Uninflected::getPlural()), | ||
| 28 | new Substitutions(...Inflectible::getIrregular()) | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php new file mode 100644 index 0000000..9747f91 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\French; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | |||
| 9 | final class Uninflected | ||
| 10 | { | ||
| 11 | /** @return Pattern[] */ | ||
| 12 | public static function getSingular(): iterable | ||
| 13 | { | ||
| 14 | yield from self::getDefault(); | ||
| 15 | } | ||
| 16 | |||
| 17 | /** @return Pattern[] */ | ||
| 18 | public static function getPlural(): iterable | ||
| 19 | { | ||
| 20 | yield from self::getDefault(); | ||
| 21 | } | ||
| 22 | |||
| 23 | /** @return Pattern[] */ | ||
| 24 | private static function getDefault(): iterable | ||
| 25 | { | ||
| 26 | yield new Pattern(''); | ||
| 27 | } | ||
| 28 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php new file mode 100644 index 0000000..1e952d8 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\NorwegianBokmal; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | use Doctrine\Inflector\Rules\Substitution; | ||
| 9 | use Doctrine\Inflector\Rules\Transformation; | ||
| 10 | use Doctrine\Inflector\Rules\Word; | ||
| 11 | |||
| 12 | class Inflectible | ||
| 13 | { | ||
| 14 | /** @return Transformation[] */ | ||
| 15 | public static function getSingular(): iterable | ||
| 16 | { | ||
| 17 | yield new Transformation(new Pattern('/re$/i'), 'r'); | ||
| 18 | yield new Transformation(new Pattern('/er$/i'), ''); | ||
| 19 | } | ||
| 20 | |||
| 21 | /** @return Transformation[] */ | ||
| 22 | public static function getPlural(): iterable | ||
| 23 | { | ||
| 24 | yield new Transformation(new Pattern('/e$/i'), 'er'); | ||
| 25 | yield new Transformation(new Pattern('/r$/i'), 're'); | ||
| 26 | yield new Transformation(new Pattern('/$/'), 'er'); | ||
| 27 | } | ||
| 28 | |||
| 29 | /** @return Substitution[] */ | ||
| 30 | public static function getIrregular(): iterable | ||
| 31 | { | ||
| 32 | yield new Substitution(new Word('konto'), new Word('konti')); | ||
| 33 | } | ||
| 34 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php new file mode 100644 index 0000000..912ae41 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\NorwegianBokmal; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\GenericLanguageInflectorFactory; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | |||
| 10 | final class InflectorFactory extends GenericLanguageInflectorFactory | ||
| 11 | { | ||
| 12 | protected function getSingularRuleset(): Ruleset | ||
| 13 | { | ||
| 14 | return Rules::getSingularRuleset(); | ||
| 15 | } | ||
| 16 | |||
| 17 | protected function getPluralRuleset(): Ruleset | ||
| 18 | { | ||
| 19 | return Rules::getPluralRuleset(); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php new file mode 100644 index 0000000..9902d35 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\NorwegianBokmal; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Patterns; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | use Doctrine\Inflector\Rules\Substitutions; | ||
| 10 | use Doctrine\Inflector\Rules\Transformations; | ||
| 11 | |||
| 12 | final class Rules | ||
| 13 | { | ||
| 14 | public static function getSingularRuleset(): Ruleset | ||
| 15 | { | ||
| 16 | return new Ruleset( | ||
| 17 | new Transformations(...Inflectible::getSingular()), | ||
| 18 | new Patterns(...Uninflected::getSingular()), | ||
| 19 | (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions() | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | public static function getPluralRuleset(): Ruleset | ||
| 24 | { | ||
| 25 | return new Ruleset( | ||
| 26 | new Transformations(...Inflectible::getPlural()), | ||
| 27 | new Patterns(...Uninflected::getPlural()), | ||
| 28 | new Substitutions(...Inflectible::getIrregular()) | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php new file mode 100644 index 0000000..5d8d3b3 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\NorwegianBokmal; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | |||
| 9 | final class Uninflected | ||
| 10 | { | ||
| 11 | /** @return Pattern[] */ | ||
| 12 | public static function getSingular(): iterable | ||
| 13 | { | ||
| 14 | yield from self::getDefault(); | ||
| 15 | } | ||
| 16 | |||
| 17 | /** @return Pattern[] */ | ||
| 18 | public static function getPlural(): iterable | ||
| 19 | { | ||
| 20 | yield from self::getDefault(); | ||
| 21 | } | ||
| 22 | |||
| 23 | /** @return Pattern[] */ | ||
| 24 | private static function getDefault(): iterable | ||
| 25 | { | ||
| 26 | yield new Pattern('barn'); | ||
| 27 | yield new Pattern('fjell'); | ||
| 28 | yield new Pattern('hus'); | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php new file mode 100644 index 0000000..a5f0ef7 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | use function preg_match; | ||
| 8 | |||
| 9 | final class Pattern | ||
| 10 | { | ||
| 11 | /** @var string */ | ||
| 12 | private $pattern; | ||
| 13 | |||
| 14 | /** @var string */ | ||
| 15 | private $regex; | ||
| 16 | |||
| 17 | public function __construct(string $pattern) | ||
| 18 | { | ||
| 19 | $this->pattern = $pattern; | ||
| 20 | |||
| 21 | if (isset($this->pattern[0]) && $this->pattern[0] === '/') { | ||
| 22 | $this->regex = $this->pattern; | ||
| 23 | } else { | ||
| 24 | $this->regex = '/' . $this->pattern . '/i'; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | public function getPattern(): string | ||
| 29 | { | ||
| 30 | return $this->pattern; | ||
| 31 | } | ||
| 32 | |||
| 33 | public function getRegex(): string | ||
| 34 | { | ||
| 35 | return $this->regex; | ||
| 36 | } | ||
| 37 | |||
| 38 | public function matches(string $word): bool | ||
| 39 | { | ||
| 40 | return preg_match($this->getRegex(), $word) === 1; | ||
| 41 | } | ||
| 42 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php new file mode 100644 index 0000000..e8d45cb --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | use function array_map; | ||
| 8 | use function implode; | ||
| 9 | use function preg_match; | ||
| 10 | |||
| 11 | class Patterns | ||
| 12 | { | ||
| 13 | /** @var Pattern[] */ | ||
| 14 | private $patterns; | ||
| 15 | |||
| 16 | /** @var string */ | ||
| 17 | private $regex; | ||
| 18 | |||
| 19 | public function __construct(Pattern ...$patterns) | ||
| 20 | { | ||
| 21 | $this->patterns = $patterns; | ||
| 22 | |||
| 23 | $patterns = array_map(static function (Pattern $pattern): string { | ||
| 24 | return $pattern->getPattern(); | ||
| 25 | }, $this->patterns); | ||
| 26 | |||
| 27 | $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; | ||
| 28 | } | ||
| 29 | |||
| 30 | public function matches(string $word): bool | ||
| 31 | { | ||
| 32 | return preg_match($this->regex, $word, $regs) === 1; | ||
| 33 | } | ||
| 34 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php new file mode 100644 index 0000000..0d41fe7 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Portuguese; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | use Doctrine\Inflector\Rules\Substitution; | ||
| 9 | use Doctrine\Inflector\Rules\Transformation; | ||
| 10 | use Doctrine\Inflector\Rules\Word; | ||
| 11 | |||
| 12 | class Inflectible | ||
| 13 | { | ||
| 14 | /** @return Transformation[] */ | ||
| 15 | public static function getSingular(): iterable | ||
| 16 | { | ||
| 17 | yield new Transformation(new Pattern('/^(g|)ases$/i'), '\1ás'); | ||
| 18 | yield new Transformation(new Pattern('/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i'), '\1ês'); | ||
| 19 | yield new Transformation(new Pattern('/(ae|ao|oe)s$/'), 'ao'); | ||
| 20 | yield new Transformation(new Pattern('/(ãe|ão|õe)s$/'), 'ão'); | ||
| 21 | yield new Transformation(new Pattern('/^(.*[^s]s)es$/i'), '\1'); | ||
| 22 | yield new Transformation(new Pattern('/sses$/i'), 'sse'); | ||
| 23 | yield new Transformation(new Pattern('/ns$/i'), 'm'); | ||
| 24 | yield new Transformation(new Pattern('/(r|t|f|v)is$/i'), '\1il'); | ||
| 25 | yield new Transformation(new Pattern('/uis$/i'), 'ul'); | ||
| 26 | yield new Transformation(new Pattern('/ois$/i'), 'ol'); | ||
| 27 | yield new Transformation(new Pattern('/eis$/i'), 'ei'); | ||
| 28 | yield new Transformation(new Pattern('/éis$/i'), 'el'); | ||
| 29 | yield new Transformation(new Pattern('/([^p])ais$/i'), '\1al'); | ||
| 30 | yield new Transformation(new Pattern('/(r|z)es$/i'), '\1'); | ||
| 31 | yield new Transformation(new Pattern('/^(á|gá)s$/i'), '\1s'); | ||
| 32 | yield new Transformation(new Pattern('/([^ê])s$/i'), '\1'); | ||
| 33 | } | ||
| 34 | |||
| 35 | /** @return Transformation[] */ | ||
| 36 | public static function getPlural(): iterable | ||
| 37 | { | ||
| 38 | yield new Transformation(new Pattern('/^(alem|c|p)ao$/i'), '\1aes'); | ||
| 39 | yield new Transformation(new Pattern('/^(irm|m)ao$/i'), '\1aos'); | ||
| 40 | yield new Transformation(new Pattern('/ao$/i'), 'oes'); | ||
| 41 | yield new Transformation(new Pattern('/^(alem|c|p)ão$/i'), '\1ães'); | ||
| 42 | yield new Transformation(new Pattern('/^(irm|m)ão$/i'), '\1ãos'); | ||
| 43 | yield new Transformation(new Pattern('/ão$/i'), 'ões'); | ||
| 44 | yield new Transformation(new Pattern('/^(|g)ás$/i'), '\1ases'); | ||
| 45 | yield new Transformation(new Pattern('/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i'), '\1eses'); | ||
| 46 | yield new Transformation(new Pattern('/m$/i'), 'ns'); | ||
| 47 | yield new Transformation(new Pattern('/([^aeou])il$/i'), '\1is'); | ||
| 48 | yield new Transformation(new Pattern('/ul$/i'), 'uis'); | ||
| 49 | yield new Transformation(new Pattern('/ol$/i'), 'ois'); | ||
| 50 | yield new Transformation(new Pattern('/el$/i'), 'eis'); | ||
| 51 | yield new Transformation(new Pattern('/al$/i'), 'ais'); | ||
| 52 | yield new Transformation(new Pattern('/(z|r)$/i'), '\1es'); | ||
| 53 | yield new Transformation(new Pattern('/(s)$/i'), '\1'); | ||
| 54 | yield new Transformation(new Pattern('/$/'), 's'); | ||
| 55 | } | ||
| 56 | |||
| 57 | /** @return Substitution[] */ | ||
| 58 | public static function getIrregular(): iterable | ||
| 59 | { | ||
| 60 | yield new Substitution(new Word('abdomen'), new Word('abdomens')); | ||
| 61 | yield new Substitution(new Word('alemão'), new Word('alemães')); | ||
| 62 | yield new Substitution(new Word('artesã'), new Word('artesãos')); | ||
| 63 | yield new Substitution(new Word('álcool'), new Word('álcoois')); | ||
| 64 | yield new Substitution(new Word('árvore'), new Word('árvores')); | ||
| 65 | yield new Substitution(new Word('bencão'), new Word('bencãos')); | ||
| 66 | yield new Substitution(new Word('cão'), new Word('cães')); | ||
| 67 | yield new Substitution(new Word('campus'), new Word('campi')); | ||
| 68 | yield new Substitution(new Word('cadáver'), new Word('cadáveres')); | ||
| 69 | yield new Substitution(new Word('capelão'), new Word('capelães')); | ||
| 70 | yield new Substitution(new Word('capitão'), new Word('capitães')); | ||
| 71 | yield new Substitution(new Word('chão'), new Word('chãos')); | ||
| 72 | yield new Substitution(new Word('charlatão'), new Word('charlatães')); | ||
| 73 | yield new Substitution(new Word('cidadão'), new Word('cidadãos')); | ||
| 74 | yield new Substitution(new Word('consul'), new Word('consules')); | ||
| 75 | yield new Substitution(new Word('cristão'), new Word('cristãos')); | ||
| 76 | yield new Substitution(new Word('difícil'), new Word('difíceis')); | ||
| 77 | yield new Substitution(new Word('email'), new Word('emails')); | ||
| 78 | yield new Substitution(new Word('escrivão'), new Word('escrivães')); | ||
| 79 | yield new Substitution(new Word('fóssil'), new Word('fósseis')); | ||
| 80 | yield new Substitution(new Word('gás'), new Word('gases')); | ||
| 81 | yield new Substitution(new Word('germens'), new Word('germen')); | ||
| 82 | yield new Substitution(new Word('grão'), new Word('grãos')); | ||
| 83 | yield new Substitution(new Word('hífen'), new Word('hífens')); | ||
| 84 | yield new Substitution(new Word('irmão'), new Word('irmãos')); | ||
| 85 | yield new Substitution(new Word('liquens'), new Word('liquen')); | ||
| 86 | yield new Substitution(new Word('mal'), new Word('males')); | ||
| 87 | yield new Substitution(new Word('mão'), new Word('mãos')); | ||
| 88 | yield new Substitution(new Word('orfão'), new Word('orfãos')); | ||
| 89 | yield new Substitution(new Word('país'), new Word('países')); | ||
| 90 | yield new Substitution(new Word('pai'), new Word('pais')); | ||
| 91 | yield new Substitution(new Word('pão'), new Word('pães')); | ||
| 92 | yield new Substitution(new Word('projétil'), new Word('projéteis')); | ||
| 93 | yield new Substitution(new Word('réptil'), new Word('répteis')); | ||
| 94 | yield new Substitution(new Word('sacristão'), new Word('sacristães')); | ||
| 95 | yield new Substitution(new Word('sotão'), new Word('sotãos')); | ||
| 96 | yield new Substitution(new Word('tabelião'), new Word('tabeliães')); | ||
| 97 | } | ||
| 98 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php new file mode 100644 index 0000000..bf12d54 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Portuguese; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\GenericLanguageInflectorFactory; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | |||
| 10 | final class InflectorFactory extends GenericLanguageInflectorFactory | ||
| 11 | { | ||
| 12 | protected function getSingularRuleset(): Ruleset | ||
| 13 | { | ||
| 14 | return Rules::getSingularRuleset(); | ||
| 15 | } | ||
| 16 | |||
| 17 | protected function getPluralRuleset(): Ruleset | ||
| 18 | { | ||
| 19 | return Rules::getPluralRuleset(); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php new file mode 100644 index 0000000..897f177 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Portuguese; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Patterns; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | use Doctrine\Inflector\Rules\Substitutions; | ||
| 10 | use Doctrine\Inflector\Rules\Transformations; | ||
| 11 | |||
| 12 | final class Rules | ||
| 13 | { | ||
| 14 | public static function getSingularRuleset(): Ruleset | ||
| 15 | { | ||
| 16 | return new Ruleset( | ||
| 17 | new Transformations(...Inflectible::getSingular()), | ||
| 18 | new Patterns(...Uninflected::getSingular()), | ||
| 19 | (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions() | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | public static function getPluralRuleset(): Ruleset | ||
| 24 | { | ||
| 25 | return new Ruleset( | ||
| 26 | new Transformations(...Inflectible::getPlural()), | ||
| 27 | new Patterns(...Uninflected::getPlural()), | ||
| 28 | new Substitutions(...Inflectible::getIrregular()) | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php new file mode 100644 index 0000000..b8e988f --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Portuguese; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | |||
| 9 | final class Uninflected | ||
| 10 | { | ||
| 11 | /** @return Pattern[] */ | ||
| 12 | public static function getSingular(): iterable | ||
| 13 | { | ||
| 14 | yield from self::getDefault(); | ||
| 15 | } | ||
| 16 | |||
| 17 | /** @return Pattern[] */ | ||
| 18 | public static function getPlural(): iterable | ||
| 19 | { | ||
| 20 | yield from self::getDefault(); | ||
| 21 | } | ||
| 22 | |||
| 23 | /** @return Pattern[] */ | ||
| 24 | private static function getDefault(): iterable | ||
| 25 | { | ||
| 26 | yield new Pattern('tórax'); | ||
| 27 | yield new Pattern('tênis'); | ||
| 28 | yield new Pattern('ônibus'); | ||
| 29 | yield new Pattern('lápis'); | ||
| 30 | yield new Pattern('fênix'); | ||
| 31 | } | ||
| 32 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php new file mode 100644 index 0000000..39889b7 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | class Ruleset | ||
| 8 | { | ||
| 9 | /** @var Transformations */ | ||
| 10 | private $regular; | ||
| 11 | |||
| 12 | /** @var Patterns */ | ||
| 13 | private $uninflected; | ||
| 14 | |||
| 15 | /** @var Substitutions */ | ||
| 16 | private $irregular; | ||
| 17 | |||
| 18 | public function __construct(Transformations $regular, Patterns $uninflected, Substitutions $irregular) | ||
| 19 | { | ||
| 20 | $this->regular = $regular; | ||
| 21 | $this->uninflected = $uninflected; | ||
| 22 | $this->irregular = $irregular; | ||
| 23 | } | ||
| 24 | |||
| 25 | public function getRegular(): Transformations | ||
| 26 | { | ||
| 27 | return $this->regular; | ||
| 28 | } | ||
| 29 | |||
| 30 | public function getUninflected(): Patterns | ||
| 31 | { | ||
| 32 | return $this->uninflected; | ||
| 33 | } | ||
| 34 | |||
| 35 | public function getIrregular(): Substitutions | ||
| 36 | { | ||
| 37 | return $this->irregular; | ||
| 38 | } | ||
| 39 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php new file mode 100644 index 0000000..9129460 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Spanish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | use Doctrine\Inflector\Rules\Substitution; | ||
| 9 | use Doctrine\Inflector\Rules\Transformation; | ||
| 10 | use Doctrine\Inflector\Rules\Word; | ||
| 11 | |||
| 12 | class Inflectible | ||
| 13 | { | ||
| 14 | /** @return Transformation[] */ | ||
| 15 | public static function getSingular(): iterable | ||
| 16 | { | ||
| 17 | yield new Transformation(new Pattern('/ereses$/'), 'erés'); | ||
| 18 | yield new Transformation(new Pattern('/iones$/'), 'ión'); | ||
| 19 | yield new Transformation(new Pattern('/ces$/'), 'z'); | ||
| 20 | yield new Transformation(new Pattern('/es$/'), ''); | ||
| 21 | yield new Transformation(new Pattern('/s$/'), ''); | ||
| 22 | } | ||
| 23 | |||
| 24 | /** @return Transformation[] */ | ||
| 25 | public static function getPlural(): iterable | ||
| 26 | { | ||
| 27 | yield new Transformation(new Pattern('/ú([sn])$/i'), 'u\1es'); | ||
| 28 | yield new Transformation(new Pattern('/ó([sn])$/i'), 'o\1es'); | ||
| 29 | yield new Transformation(new Pattern('/í([sn])$/i'), 'i\1es'); | ||
| 30 | yield new Transformation(new Pattern('/é([sn])$/i'), 'e\1es'); | ||
| 31 | yield new Transformation(new Pattern('/á([sn])$/i'), 'a\1es'); | ||
| 32 | yield new Transformation(new Pattern('/z$/i'), 'ces'); | ||
| 33 | yield new Transformation(new Pattern('/([aeiou]s)$/i'), '\1'); | ||
| 34 | yield new Transformation(new Pattern('/([^aeéiou])$/i'), '\1es'); | ||
| 35 | yield new Transformation(new Pattern('/$/'), 's'); | ||
| 36 | } | ||
| 37 | |||
| 38 | /** @return Substitution[] */ | ||
| 39 | public static function getIrregular(): iterable | ||
| 40 | { | ||
| 41 | yield new Substitution(new Word('el'), new Word('los')); | ||
| 42 | yield new Substitution(new Word('papá'), new Word('papás')); | ||
| 43 | yield new Substitution(new Word('mamá'), new Word('mamás')); | ||
| 44 | yield new Substitution(new Word('sofá'), new Word('sofás')); | ||
| 45 | yield new Substitution(new Word('mes'), new Word('meses')); | ||
| 46 | } | ||
| 47 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php new file mode 100644 index 0000000..85084ca --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Spanish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\GenericLanguageInflectorFactory; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | |||
| 10 | final class InflectorFactory extends GenericLanguageInflectorFactory | ||
| 11 | { | ||
| 12 | protected function getSingularRuleset(): Ruleset | ||
| 13 | { | ||
| 14 | return Rules::getSingularRuleset(); | ||
| 15 | } | ||
| 16 | |||
| 17 | protected function getPluralRuleset(): Ruleset | ||
| 18 | { | ||
| 19 | return Rules::getPluralRuleset(); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php new file mode 100644 index 0000000..d739972 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Spanish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Patterns; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | use Doctrine\Inflector\Rules\Substitutions; | ||
| 10 | use Doctrine\Inflector\Rules\Transformations; | ||
| 11 | |||
| 12 | final class Rules | ||
| 13 | { | ||
| 14 | public static function getSingularRuleset(): Ruleset | ||
| 15 | { | ||
| 16 | return new Ruleset( | ||
| 17 | new Transformations(...Inflectible::getSingular()), | ||
| 18 | new Patterns(...Uninflected::getSingular()), | ||
| 19 | (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions() | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | public static function getPluralRuleset(): Ruleset | ||
| 24 | { | ||
| 25 | return new Ruleset( | ||
| 26 | new Transformations(...Inflectible::getPlural()), | ||
| 27 | new Patterns(...Uninflected::getPlural()), | ||
| 28 | new Substitutions(...Inflectible::getIrregular()) | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php new file mode 100644 index 0000000..c26ebe9 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Spanish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | |||
| 9 | final class Uninflected | ||
| 10 | { | ||
| 11 | /** @return Pattern[] */ | ||
| 12 | public static function getSingular(): iterable | ||
| 13 | { | ||
| 14 | yield from self::getDefault(); | ||
| 15 | } | ||
| 16 | |||
| 17 | /** @return Pattern[] */ | ||
| 18 | public static function getPlural(): iterable | ||
| 19 | { | ||
| 20 | yield from self::getDefault(); | ||
| 21 | } | ||
| 22 | |||
| 23 | /** @return Pattern[] */ | ||
| 24 | private static function getDefault(): iterable | ||
| 25 | { | ||
| 26 | yield new Pattern('lunes'); | ||
| 27 | yield new Pattern('rompecabezas'); | ||
| 28 | yield new Pattern('crisis'); | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php new file mode 100644 index 0000000..471aff9 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | final class Substitution | ||
| 8 | { | ||
| 9 | /** @var Word */ | ||
| 10 | private $from; | ||
| 11 | |||
| 12 | /** @var Word */ | ||
| 13 | private $to; | ||
| 14 | |||
| 15 | public function __construct(Word $from, Word $to) | ||
| 16 | { | ||
| 17 | $this->from = $from; | ||
| 18 | $this->to = $to; | ||
| 19 | } | ||
| 20 | |||
| 21 | public function getFrom(): Word | ||
| 22 | { | ||
| 23 | return $this->from; | ||
| 24 | } | ||
| 25 | |||
| 26 | public function getTo(): Word | ||
| 27 | { | ||
| 28 | return $this->to; | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php new file mode 100644 index 0000000..17ee296 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\WordInflector; | ||
| 8 | |||
| 9 | use function strtolower; | ||
| 10 | use function strtoupper; | ||
| 11 | use function substr; | ||
| 12 | |||
| 13 | class Substitutions implements WordInflector | ||
| 14 | { | ||
| 15 | /** @var Substitution[] */ | ||
| 16 | private $substitutions; | ||
| 17 | |||
| 18 | public function __construct(Substitution ...$substitutions) | ||
| 19 | { | ||
| 20 | foreach ($substitutions as $substitution) { | ||
| 21 | $this->substitutions[$substitution->getFrom()->getWord()] = $substitution; | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | public function getFlippedSubstitutions(): Substitutions | ||
| 26 | { | ||
| 27 | $substitutions = []; | ||
| 28 | |||
| 29 | foreach ($this->substitutions as $substitution) { | ||
| 30 | $substitutions[] = new Substitution( | ||
| 31 | $substitution->getTo(), | ||
| 32 | $substitution->getFrom() | ||
| 33 | ); | ||
| 34 | } | ||
| 35 | |||
| 36 | return new Substitutions(...$substitutions); | ||
| 37 | } | ||
| 38 | |||
| 39 | public function inflect(string $word): string | ||
| 40 | { | ||
| 41 | $lowerWord = strtolower($word); | ||
| 42 | |||
| 43 | if (isset($this->substitutions[$lowerWord])) { | ||
| 44 | $firstLetterUppercase = $lowerWord[0] !== $word[0]; | ||
| 45 | |||
| 46 | $toWord = $this->substitutions[$lowerWord]->getTo()->getWord(); | ||
| 47 | |||
| 48 | if ($firstLetterUppercase) { | ||
| 49 | return strtoupper($toWord[0]) . substr($toWord, 1); | ||
| 50 | } | ||
| 51 | |||
| 52 | return $toWord; | ||
| 53 | } | ||
| 54 | |||
| 55 | return $word; | ||
| 56 | } | ||
| 57 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php new file mode 100644 index 0000000..30dcd59 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\WordInflector; | ||
| 8 | |||
| 9 | use function preg_replace; | ||
| 10 | |||
| 11 | final class Transformation implements WordInflector | ||
| 12 | { | ||
| 13 | /** @var Pattern */ | ||
| 14 | private $pattern; | ||
| 15 | |||
| 16 | /** @var string */ | ||
| 17 | private $replacement; | ||
| 18 | |||
| 19 | public function __construct(Pattern $pattern, string $replacement) | ||
| 20 | { | ||
| 21 | $this->pattern = $pattern; | ||
| 22 | $this->replacement = $replacement; | ||
| 23 | } | ||
| 24 | |||
| 25 | public function getPattern(): Pattern | ||
| 26 | { | ||
| 27 | return $this->pattern; | ||
| 28 | } | ||
| 29 | |||
| 30 | public function getReplacement(): string | ||
| 31 | { | ||
| 32 | return $this->replacement; | ||
| 33 | } | ||
| 34 | |||
| 35 | public function inflect(string $word): string | ||
| 36 | { | ||
| 37 | return (string) preg_replace($this->pattern->getRegex(), $this->replacement, $word); | ||
| 38 | } | ||
| 39 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php new file mode 100644 index 0000000..b6a48fa --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\WordInflector; | ||
| 8 | |||
| 9 | class Transformations implements WordInflector | ||
| 10 | { | ||
| 11 | /** @var Transformation[] */ | ||
| 12 | private $transformations; | ||
| 13 | |||
| 14 | public function __construct(Transformation ...$transformations) | ||
| 15 | { | ||
| 16 | $this->transformations = $transformations; | ||
| 17 | } | ||
| 18 | |||
| 19 | public function inflect(string $word): string | ||
| 20 | { | ||
| 21 | foreach ($this->transformations as $transformation) { | ||
| 22 | if ($transformation->getPattern()->matches($word)) { | ||
| 23 | return $transformation->inflect($word); | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | return $word; | ||
| 28 | } | ||
| 29 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php new file mode 100644 index 0000000..a2bda0d --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Turkish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | use Doctrine\Inflector\Rules\Substitution; | ||
| 9 | use Doctrine\Inflector\Rules\Transformation; | ||
| 10 | use Doctrine\Inflector\Rules\Word; | ||
| 11 | |||
| 12 | class Inflectible | ||
| 13 | { | ||
| 14 | /** @return Transformation[] */ | ||
| 15 | public static function getSingular(): iterable | ||
| 16 | { | ||
| 17 | yield new Transformation(new Pattern('/l[ae]r$/i'), ''); | ||
| 18 | } | ||
| 19 | |||
| 20 | /** @return Transformation[] */ | ||
| 21 | public static function getPlural(): iterable | ||
| 22 | { | ||
| 23 | yield new Transformation(new Pattern('/([eöiü][^aoıueöiü]{0,6})$/u'), '\1ler'); | ||
| 24 | yield new Transformation(new Pattern('/([aoıu][^aoıueöiü]{0,6})$/u'), '\1lar'); | ||
| 25 | } | ||
| 26 | |||
| 27 | /** @return Substitution[] */ | ||
| 28 | public static function getIrregular(): iterable | ||
| 29 | { | ||
| 30 | yield new Substitution(new Word('ben'), new Word('biz')); | ||
| 31 | yield new Substitution(new Word('sen'), new Word('siz')); | ||
| 32 | yield new Substitution(new Word('o'), new Word('onlar')); | ||
| 33 | } | ||
| 34 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php new file mode 100644 index 0000000..c6cdebe --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Turkish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\GenericLanguageInflectorFactory; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | |||
| 10 | final class InflectorFactory extends GenericLanguageInflectorFactory | ||
| 11 | { | ||
| 12 | protected function getSingularRuleset(): Ruleset | ||
| 13 | { | ||
| 14 | return Rules::getSingularRuleset(); | ||
| 15 | } | ||
| 16 | |||
| 17 | protected function getPluralRuleset(): Ruleset | ||
| 18 | { | ||
| 19 | return Rules::getPluralRuleset(); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php new file mode 100644 index 0000000..ea564ac --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Turkish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Patterns; | ||
| 8 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 9 | use Doctrine\Inflector\Rules\Substitutions; | ||
| 10 | use Doctrine\Inflector\Rules\Transformations; | ||
| 11 | |||
| 12 | final class Rules | ||
| 13 | { | ||
| 14 | public static function getSingularRuleset(): Ruleset | ||
| 15 | { | ||
| 16 | return new Ruleset( | ||
| 17 | new Transformations(...Inflectible::getSingular()), | ||
| 18 | new Patterns(...Uninflected::getSingular()), | ||
| 19 | (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions() | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | public static function getPluralRuleset(): Ruleset | ||
| 24 | { | ||
| 25 | return new Ruleset( | ||
| 26 | new Transformations(...Inflectible::getPlural()), | ||
| 27 | new Patterns(...Uninflected::getPlural()), | ||
| 28 | new Substitutions(...Inflectible::getIrregular()) | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php new file mode 100644 index 0000000..ec1c37d --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules\Turkish; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Pattern; | ||
| 8 | |||
| 9 | final class Uninflected | ||
| 10 | { | ||
| 11 | /** @return Pattern[] */ | ||
| 12 | public static function getSingular(): iterable | ||
| 13 | { | ||
| 14 | yield from self::getDefault(); | ||
| 15 | } | ||
| 16 | |||
| 17 | /** @return Pattern[] */ | ||
| 18 | public static function getPlural(): iterable | ||
| 19 | { | ||
| 20 | yield from self::getDefault(); | ||
| 21 | } | ||
| 22 | |||
| 23 | /** @return Pattern[] */ | ||
| 24 | private static function getDefault(): iterable | ||
| 25 | { | ||
| 26 | yield new Pattern('lunes'); | ||
| 27 | yield new Pattern('rompecabezas'); | ||
| 28 | yield new Pattern('crisis'); | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php new file mode 100644 index 0000000..98e93ba --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector\Rules; | ||
| 6 | |||
| 7 | class Word | ||
| 8 | { | ||
| 9 | /** @var string */ | ||
| 10 | private $word; | ||
| 11 | |||
| 12 | public function __construct(string $word) | ||
| 13 | { | ||
| 14 | $this->word = $word; | ||
| 15 | } | ||
| 16 | |||
| 17 | public function getWord(): string | ||
| 18 | { | ||
| 19 | return $this->word; | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php new file mode 100644 index 0000000..12b2ed5 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | use Doctrine\Inflector\Rules\Ruleset; | ||
| 8 | |||
| 9 | use function array_merge; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * Inflects based on multiple rulesets. | ||
| 13 | * | ||
| 14 | * Rules: | ||
| 15 | * - If the word matches any uninflected word pattern, it is not inflected | ||
| 16 | * - The first ruleset that returns a different value for an irregular word wins | ||
| 17 | * - The first ruleset that returns a different value for a regular word wins | ||
| 18 | * - If none of the above match, the word is left as-is | ||
| 19 | */ | ||
| 20 | class RulesetInflector implements WordInflector | ||
| 21 | { | ||
| 22 | /** @var Ruleset[] */ | ||
| 23 | private $rulesets; | ||
| 24 | |||
| 25 | public function __construct(Ruleset $ruleset, Ruleset ...$rulesets) | ||
| 26 | { | ||
| 27 | $this->rulesets = array_merge([$ruleset], $rulesets); | ||
| 28 | } | ||
| 29 | |||
| 30 | public function inflect(string $word): string | ||
| 31 | { | ||
| 32 | if ($word === '') { | ||
| 33 | return ''; | ||
| 34 | } | ||
| 35 | |||
| 36 | foreach ($this->rulesets as $ruleset) { | ||
| 37 | if ($ruleset->getUninflected()->matches($word)) { | ||
| 38 | return $word; | ||
| 39 | } | ||
| 40 | |||
| 41 | $inflected = $ruleset->getIrregular()->inflect($word); | ||
| 42 | |||
| 43 | if ($inflected !== $word) { | ||
| 44 | return $inflected; | ||
| 45 | } | ||
| 46 | |||
| 47 | $inflected = $ruleset->getRegular()->inflect($word); | ||
| 48 | |||
| 49 | if ($inflected !== $word) { | ||
| 50 | return $inflected; | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | return $word; | ||
| 55 | } | ||
| 56 | } | ||
diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php new file mode 100644 index 0000000..b88b1d6 --- /dev/null +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\Inflector; | ||
| 6 | |||
| 7 | interface WordInflector | ||
| 8 | { | ||
| 9 | public function inflect(string $word): string; | ||
| 10 | } | ||
