singular example

if ($class === null && $this->hasClassName) {
            // @codeCoverageIgnoreStart             $nameLang = $this->classNameLang ?: 'CLI.generator.className.default';
            $class    = CLI::prompt(lang($nameLang), null, 'required');
            CLI::newLine();
            // @codeCoverageIgnoreEnd         }

        helper('inflector');

        $component = singular($this->component);

        /** * @see https://regex101.com/r/a5KNCR/2 */
        $pattern = sprintf('/([a-z][a-z0-9_\/\\\\]+)(%s)$/i', $component);

        if (preg_match($pattern$class$matches) === 1) {
            $class = $matches[1] . ucfirst($matches[2]);
        }

        if ($this->enabledSuffixing && $this->getOption('suffix') && preg_match($pattern$class) !== 1) {
            

    function counted(int $count, string $string): string
    {
        $result = "{$count} ";

        return $result . ($count === 1 ? singular($string) : plural($string));
    }
}

if (function_exists('camelize')) {
    /** * Camelize * * Takes multiple words separated by spaces or * underscores and converts them to camel case. * * @param string $string Input string */
Home | Imprint | This part of the site doesn't use cookies.