{"id":20651739,"url":"https://github.com/gevorgmansuryan/inflector","last_synced_at":"2025-04-17T14:14:09.233Z","repository":{"id":62510376,"uuid":"122042912","full_name":"gevorgmansuryan/Inflector","owner":"gevorgmansuryan","description":"Inflector pluralizes and singularizes English nouns. It also contains some other useful methods.","archived":false,"fork":false,"pushed_at":"2018-02-19T10:58:53.000Z","size":9,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T06:11:23.145Z","etag":null,"topics":["camelize","composer","php","slugify","yii2"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gevorgmansuryan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-19T09:46:36.000Z","updated_at":"2020-09-19T03:52:48.000Z","dependencies_parsed_at":"2022-11-02T12:46:39.156Z","dependency_job_id":null,"html_url":"https://github.com/gevorgmansuryan/Inflector","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2FInflector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2FInflector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2FInflector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2FInflector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gevorgmansuryan","download_url":"https://codeload.github.com/gevorgmansuryan/Inflector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249347324,"owners_count":21255148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camelize","composer","php","slugify","yii2"],"created_at":"2024-11-16T17:29:21.757Z","updated_at":"2025-04-17T14:14:09.212Z","avatar_url":"https://github.com/gevorgmansuryan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inflector pluralizes and singularizes English nouns. It also contains some other useful methods.\n\n###### string `Inflector::pluralize(string $word)`\nConverts a word to its plural form. Note that this is for English only!\n\nFor example, 'apple' will become 'apples', and 'child' will become 'children'.\n-param string $word the word to be pluralized\n\n###### string `Inflector::singularize(string $word)`\nReturns the singular of the $word.\n- param string $word the english word to singularize\n\n###### string `Inflector::titleize(string $word [, bool $ucAll = false])`\nConverts an underscored or CamelCase word into a English sentence.\n- param string $words\n- param $ucAll whether to set all words to uppercase\n\n###### string `Inflector::camelize(string $word)`\nConverts a word like \"send_email\" to \"SendEmail\". It will remove non alphanumeric character from the word, so \"who's online\" will be converted to \"WhoSOnline\".\n- param string $word the word to CamelCase\n\n###### string `Inflector::camel2words(string $word [, bool $ucwords = false])`\nConverts a CamelCase name into space-separated words.\n\nFor example, 'PostTag' will be converted to 'Post Tag'.\n- param string $name the string to be converted\n- param bool $ucwords whether to capitalize the first letter in each word\n- param $ucwords whether to capitalize the first letter in each word.\n \n###### string `Inflector::camel2id(string $name [, string $separator = '-' [, bool $strict = false]])`\nConverts a CamelCase name into an ID in lowercase. Words in the ID may be concatenated using the specified character (defaults to '-').\n\nFor example, 'PostTag' will be converted to 'post-tag'.\n- param string $name the string to be converted\n- param string $separator the character used to concatenate the words in the ID\n- param bool|string $strict whether to insert a separator between two consecutive uppercase chars, defaults to false\n\n###### string `Inflector::id2camel(string $id [, string $separator = '-'])`\nConverts an ID into a CamelCase name. Words in the ID separated by `$separator` (defaults to '-') will be concatenated into a CamelCase name.\n\nFor example, 'post-tag' is converted to 'PostTag'.\n\n- param string $id the ID to be converted\n- param string $separator the character used to separate the words in the ID\n\n###### string `Inflector::underscore(string $words)`\nConverts any \"CamelCased\" into an \"underscored_word\".\n- param string $words the word(s) to underscore\n\n###### string `Inflector::humanize(string $word [, bool $ucAll = false])`\nReturns a human-readable string from $word.\n- param string $word the string to humanize\n- param bool $ucAll whether to set all words to uppercase or not\n\n###### string `Inflector::variablize(string $word)`\nSame as camelize but first char is in lowercase.\nConverts a word like \"send_email\" to \"sendEmail\". It will remove non alphanumeric character from the word, so \"who's online\" will be converted to \"whoSOnline\".\n- param string $word to lowerCamelCase\n\n###### string `Inflector::tableize(string $className)`\nConverts a class name to its table name (pluralized) naming conventions.\n\nFor example, converts \"Person\" to \"people\".\n- param string $className the class name for getting related table_name\n\n###### string `Inflector::slug(string $name [, string $replacement = '-' [, bool $lowercase = true]])`\nReturns a string with all spaces converted to given replacement, non word characters removed and the rest of characters transliterated.\n\nIf intl extension isn't available uses fallback that converts latin characters only and removes the rest. You may customize characters map via $transliteration property of the helper.\n- param string $string An arbitrary string to convert\n- param string $replacement The replacement to use for spaces\n- param bool $lowercase whether to return the string in lowercase or not. Defaults to `true`.\n\n###### string `Inflector::transliterate(string $string [, string|\\Transliterator $transliterator = null])`\nReturns transliterated version of a string.\n\nIf intl extension isn't available uses fallback that converts latin characters only and removes the rest. You may customize characters map via $transliteration property of the helper.\n- param string $string input string\n- param string|\\Transliterator $transliterator either a [[\\Transliterator]] or a string from which a [[\\Transliterator]] can be built.\n\n###### string `Inflector::classify(string $tableName)`  \nConverts a table name to its class name.\n\nFor example, converts \"people\" to \"Person\".\n- param string $tableName\n\n###### string `Inflector::ordinalize(int $number)`\nConverts number to its ordinal English form. For example, converts 13 to 13th, 2 to 2nd ...\n- param int $number the number to get its ordinal value\n\n###### string `Inflector::sentence(array $words [, $twoWordsConnector = ' and ' [, $lastWordConnector = null [, $connector = ', ']]])`\nConverts a list of words into a sentence.\n\nSpecial treatment is done for the last few words. For example,\n\n```php\n$words = ['Spain', 'France'];\necho Inflector::sentence($words);\n// output: Spain and France\n\n$words = ['Spain', 'France', 'Italy'];\necho Inflector::sentence($words);\n// output: Spain, France and Italy\n\n$words = ['Spain', 'France', 'Italy'];\necho Inflector::sentence($words, ' \u0026 ');\n// output: Spain, France \u0026 Italy\n```\n\n- param array $words the words to be converted into an string\n- param string $twoWordsConnector the string connecting words when there are only two\n- param string $lastWordConnector the string connecting the last two words. If this is null, it will take the value of `$twoWordsConnector`.\n- param string $connector the string connecting words other than those connected by $lastWordConnector and $twoWordsConnector\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgevorgmansuryan%2Finflector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgevorgmansuryan%2Finflector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgevorgmansuryan%2Finflector/lists"}