@@ -19,6 +19,7 @@ final class Inflector
1919 * `huò qǔ dào dochira Ukraí̈nsʹka: g̀,ê, Srpska: đ, n̂, d̂! ¿Español?`.
2020 *
2121 * For detailed information see [unicode normalization forms](http://unicode.org/reports/tr15/#Normalization_Forms_Table)
22+ *
2223 * @see http://unicode.org/reports/tr15/#Normalization_Forms_Table
2324 * @see toTransliterated()
2425 */
@@ -141,6 +142,7 @@ final class Inflector
141142
142143 /**
143144 * @psalm-var array<string, string>
145+ *
144146 * @var string[] The special rules for converting a word between its plural form and singular form.
145147 * The keys are the special words in singular form, and the values are the corresponding plural form.
146148 */
@@ -280,6 +282,7 @@ final class Inflector
280282 * @var string|\Transliterator Either a {@see \Transliterator}, or a string from which a {@see \Transliterator}
281283 * can be built for transliteration. Used by {@see toTransliterated()} when intl is available.
282284 * Defaults to {@see TRANSLITERATE_LOOSE}.
285+ *
283286 * @see https://secure.php.net/manual/en/transliterator.transliterate.php
284287 */
285288 private $ transliterator = self ::TRANSLITERATE_LOOSE ;
@@ -290,6 +293,7 @@ final class Inflector
290293 * @param string[] $rules The rules for converting a word into its plural form.
291294 * @psalm-param array<string, string> $rules
292295 * The keys are the regular expressions and the values are the corresponding replacements.
296+ *
293297 * @return self
294298 */
295299 public function withPluralizeRules (array $ rules ): self
@@ -312,6 +316,7 @@ public function getPluralizeRules(): array
312316 * @param string[] $rules The rules for converting a word into its singular form.
313317 * The keys are the regular expressions and the values are the corresponding replacements.
314318 * @psalm-param array<string, string> $rules
319+ *
315320 * @return self
316321 */
317322 public function withSingularizeRules (array $ rules ): self
@@ -334,6 +339,7 @@ public function getSingularizeRules(): array
334339 * @param string[] $rules The special rules for converting a word between its plural form and singular form.
335340 * @psalm-param array<string, string> $rules
336341 * The keys are the special words in singular form, and the values are the corresponding plural form.
342+ *
337343 * @return self
338344 */
339345 public function withSpecialRules (array $ rules ): self
@@ -356,7 +362,9 @@ public function getSpecialRules(): array
356362 * @param string|\Transliterator $transliterator Either a {@see \Transliterator}, or a string from which
357363 * a {@see \Transliterator} can be built for transliteration. Used by {@see toTransliterated()} when intl is available.
358364 * Defaults to {@see TRANSLITERATE_LOOSE}.
365+ *
359366 * @return self
367+ *
360368 * @see https://secure.php.net/manual/en/transliterator.transliterate.php
361369 */
362370 public function withTransliterator ($ transliterator ): self
@@ -369,6 +377,7 @@ public function withTransliterator($transliterator): self
369377 /**
370378 * @param string[] $transliterationMap Fallback map for transliteration used by {@see toTransliterated()} when intl
371379 * isn't available or turned off with {@see withoutIntl()}.
380+ *
372381 * @return $this
373382 */
374383 public function withTransliterationMap (array $ transliterationMap ): self
@@ -380,6 +389,7 @@ public function withTransliterationMap(array $transliterationMap): self
380389
381390 /**
382391 * Disables usage of intl for {@see toTransliterated()}.
392+ *
383393 * @return self
384394 */
385395 public function withoutIntl (): self
@@ -393,7 +403,9 @@ public function withoutIntl(): self
393403 * Converts a word to its plural form.
394404 * Note that this is for English only!
395405 * For example, "apple" will become "apples", and "child" will become "children".
406+ *
396407 * @param string $input The word to be pluralized.
408+ *
397409 * @return string The pluralized word.
398410 */
399411 public function toPlural (string $ input ): string
@@ -412,7 +424,9 @@ public function toPlural(string $input): string
412424
413425 /**
414426 * Returns the singular of the $word.
427+ *
415428 * @param string $input The english word to singularize.
429+ *
416430 * @return string Singular noun.
417431 */
418432 public function toSingular (string $ input ): string
@@ -433,8 +447,10 @@ public function toSingular(string $input): string
433447 /**
434448 * Converts an underscored or PascalCase word into a English
435449 * sentence.
450+ *
436451 * @param string $input The string to titleize.
437452 * @param bool $uppercaseAll Whether to set all words to uppercase.
453+ *
438454 * @return string
439455 */
440456 public function toSentence (string $ input , bool $ uppercaseAll = false ): string
@@ -447,7 +463,9 @@ public function toSentence(string $input, bool $uppercaseAll = false): string
447463 /**
448464 * Converts a string into space-separated words.
449465 * For example, 'PostTag' will be converted to 'Post Tag'.
466+ *
450467 * @param string $input The string to be converted.
468+ *
451469 * @return string The resulting words.
452470 */
453471 public function toWords (string $ input ): string
@@ -463,9 +481,11 @@ public function toWords(string $input): string
463481 * Converts a PascalCase name into an ID in lowercase.
464482 * Words in the ID may be concatenated using the specified character (defaults to '-').
465483 * For example, 'PostTag' will be converted to 'post-tag'.
484+ *
466485 * @param string $input The string to be converted.
467486 * @param string $separator The character used to concatenate the words in the ID.
468487 * @param bool $strict Whether to insert a separator between two consecutive uppercase chars, defaults to false.
488+ *
469489 * @return string The resulting ID.
470490 */
471491 public function pascalCaseToId (string $ input , string $ separator = '- ' , bool $ strict = false ): string
@@ -488,8 +508,11 @@ public function pascalCaseToId(string $input, string $separator = '-', bool $str
488508 * Converts a word like "send_email" to "SendEmail". It
489509 * will remove non alphanumeric character from the word, so
490510 * "who's online" will be converted to "WhoSOnline".
511+ *
491512 * @param string $input The word to PascalCase.
513+ *
492514 * @return string PascalCased string.
515+ *
493516 * @see toCamelCase()
494517 */
495518 public function toPascalCase (string $ input ): string
@@ -499,8 +522,10 @@ public function toPascalCase(string $input): string
499522
500523 /**
501524 * Returns a human-readable string.
525+ *
502526 * @param string $input The string to humanize.
503527 * @param bool $uppercaseWords Whether to set all words to uppercase or not.
528+ *
504529 * @return string
505530 */
506531 public function toHumanReadable (string $ input , bool $ uppercaseWords = false ): string
@@ -516,7 +541,9 @@ public function toHumanReadable(string $input, bool $uppercaseWords = false): st
516541 * Converts a word like "send_email" to "sendEmail". It
517542 * will remove non alphanumeric character from the word, so
518543 * "who's online" will be converted to "whoSOnline".
544+ *
519545 * @param string $input The word to convert.
546+ *
520547 * @return string
521548 */
522549 public function toCamelCase (string $ input ): string
@@ -530,7 +557,9 @@ public function toCamelCase(string $input): string
530557 * Converts a class name to its table name (pluralized) naming conventions.
531558 *
532559 * For example, converts "Car" to "cars", "Person" to "people", and "ActionLog" to "action_log".
560+ *
533561 * @param string $className the class name for getting related table_name.
562+ *
534563 * @return string
535564 */
536565 public function classToTable (string $ className ): string
@@ -542,7 +571,9 @@ public function classToTable(string $className): string
542571 * Converts a table name to its class name.
543572 *
544573 * For example, converts "cars" to "Car", "people" to "Person", and "action_log" to "ActionLog".
574+ *
545575 * @param string $tableName
576+ *
546577 * @return string
547578 */
548579 public function tableToClass (string $ tableName ): string
@@ -561,6 +592,7 @@ public function tableToClass(string $tableName): string
561592 * @param string $input An arbitrary string to convert.
562593 * @param string $replacement The replacement to use for spaces.
563594 * @param bool $lowercase whether to return the string in lowercase or not. Defaults to `true`.
595+ *
564596 * @return string The converted string.
565597 */
566598 public function toSlug (string $ input , string $ replacement = '- ' , bool $ lowercase = true ): string
@@ -586,6 +618,7 @@ public function toSlug(string $input, string $replacement = '-', bool $lowercase
586618 * @param string|\Transliterator|null $transliterator either a {@see \Transliterator} or a string
587619 * from which a {@see \Transliterator} can be built. If null, value set with {@see withTransliterator()}
588620 * or {@see TRANSLITERATE_LOOSE} is used.
621+ *
589622 * @return string
590623 */
591624 public function toTransliterated (string $ input , $ transliterator = null ): string
0 commit comments