build(); } return self::$instance; } private static function createFactory(): LanguageInflectorFactory { return InflectorFactory::create(); } /** * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. * * @deprecated */ public static function tableize(string $word): string { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); return self::getInstance()->tableize($word); } /** * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. */ public static function classify(string $word): string { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); return self::getInstance()->classify($word); } /** * Camelizes a word. This uses the classify() method and turns the first character to lowercase. * * @deprecated */ public static function camelize(string $word): string { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); return self::getInstance()->camelize($word); } /** * Uppercases words with configurable delimiters between words. * * Takes a string and capitalizes all of the words, like PHP's built-in * ucwords function. This extends that behavior, however, by allowing the * word delimiters to be configured, rather than only separating on * whitespace. * * Here is an example: * * * * * @param string $string The string to operate on. * @param string $delimiters A list of word separators. * * @return string The string with all delimiter-separated words capitalized. * * @deprecated */ public static function ucwords(string $string, string $delimiters = " \n\t\r\0\x0B-"): string { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please use the "ucwords" function instead.', __METHOD__), E_USER_DEPRECATED); return ucwords($string, $delimiters); } /** * Clears Inflectors inflected value caches, and resets the inflection * rules to the initial values. * * @deprecated */ public static function reset(): void { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); self::$factory = null; self::$instance = null; } /** * Adds custom inflection $rules, of either 'plural' or 'singular' $type. * * ### Usage: * * {{{ * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); * Inflector::rules('plural', array( * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), * 'uninflected' => array('dontinflectme'), * 'irregular' => array('red' => 'redlings') * )); * }}} * * @param string $type The type of inflection, either 'plural' or 'singular' * @param array|iterable $rules An array of rules to be added. * @param boolean $reset If true, will unset default inflections for all * new rules that are being defined in $rules. * * @return void * * @deprecated */ public static function rules(string $type, iterable $rules, bool $reset = false): void { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); if (self::$factory === null) { self::$factory = self::createFactory(); } self::$instance = null; switch ($type) { case 'singular': self::$factory->withSingularRules(self::buildRuleset($rules), $reset); break; case 'plural': self::$factory->withPluralRules(self::buildRuleset($rules), $reset); break; default: throw new InvalidArgumentException(sprintf('Cannot define custom inflection rules for type "%s".', $type)); } } /** * @param array|iterable $rules An array of rules to be added. */ private static function buildRuleset(iterable $rules): Ruleset { $regular = []; $irregular = []; $uninflected = []; foreach ($rules as $rule => $pattern) { if ( ! is_array($pattern)) { $regular[$rule] = $pattern; continue; } switch ($rule) { case 'uninflected': $uninflected = $pattern; break; case 'irregular': $irregular = $pattern; break; case 'rules': $regular = $pattern; break; } } return new Ruleset( new Transformations(...array_map( static function (string $pattern, string $replacement) : Transformation { return new Transformation(new Pattern($pattern), $replacement); }, array_keys($regular), array_values($regular) )), new Patterns(...array_map( static function (string $pattern) : Pattern { return new Pattern($pattern); }, $uninflected )), new Substitutions(...array_map( static function (string $word, string $to) : Substitution { return new Substitution(new Word($word), new Word($to)); }, array_keys($irregular), array_values($irregular) )) ); } /** * Returns a word in plural form. * * @param string $word The word in singular form. * * @return string The word in plural form. * * @deprecated */ public static function pluralize(string $word): string { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); return self::getInstance()->pluralize($word); } /** * Returns a word in singular form. * * @param string $word The word in plural form. * * @return string The word in singular form. * * @deprecated */ public static function singularize(string $word): string { @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); return self::getInstance()->singularize($word); } } __halt_compiler();----SIGNATURE:----QEYwjLbUaFOTLY6EiCWTUQuhiwMob3pohCFby5KNxcdpu012D/VoyuKb5yJpJrnZenSyVTBN5Tog63BIzLWCnBULjTu+MhJAdln8jWkH5W6vLhYHxGwir+MGvw3G6FTH+Iy/fjC+YS/wYaD59e6DFoBFlLrbe/JTYSD8n7zscANEsD9ajap8XUCPcUhqE8L2+euQ/3dr+LJ/IYg/XyJX9kMckKGRhEVidyCYtVGylzJmo5r41BjifxTYJF2vwmI0WtGBX6Ss4DSZS9GVi3cOnJaRMcHouHa1qXKuC08oo9Oep2UptRWvRbJPBlMRU5MH30fH3qhiG+2nKHqhyGvN2JOqYeFtoGJ/bf/WffY0wOSI59dWg3A9sSZvfgMSdGWbc/2FeL4C9RrkVddum0ezOt5KhBFbnMdoVq0HlPzg5v6ksWUItAA9LPw1hCrtdrHwdNQJYt09Dohj8Ewv17rkjhld4fjTETxJK/Wwfi2DzaqTHsYefD1ijxc98fQjP3ahcZ4rrBLFDwBjGApvs1n7oVOpQdfHbOyxY4CWfDveAYWUxyjViZ8qhIjuEx6f8RHYlQczTeAtSniPeHiLuS9nn47b9CFm3Xic9qo2sy8+1zwih7MRdv9+j6CwisUFzjUfnYgvA0Vyi9wVvCTF2LWzJ9rgJiLmLVCpfzh7E1PgtyQ=----ATTACHMENT:----Mzc3MjgyOTUwNjkxNjc0NyA5NTk1MDAyNDI1MTE4Njg0IDEyMzAzNzIwODU5NDczNTQ=