Changeset View
Changeset View
Standalone View
Standalone View
src/internationalization/pht.php
| Show All 10 Lines | |||||
| * @param ... Next values referenced from $text. | * @param ... Next values referenced from $text. | ||||
| * @return string Translated string with substituted values. | * @return string Translated string with substituted values. | ||||
| */ | */ | ||||
| function pht($text, $variant = null /* , ... */) { | function pht($text, $variant = null /* , ... */) { | ||||
| $args = func_get_args(); | $args = func_get_args(); | ||||
| $translator = PhutilTranslator::getInstance(); | $translator = PhutilTranslator::getInstance(); | ||||
| return call_user_func_array(array($translator, 'translate'), $args); | return call_user_func_array(array($translator, 'translate'), $args); | ||||
| } | } | ||||
| /** | |||||
| * Count all elements in an array, or something in an object. | |||||
| * | |||||
| * @param array|Countable A countable object. | |||||
| * @return PhutilNumber Returns the number of elements in the input | |||||
| * parameter. | |||||
| */ | |||||
epriestley: Function spelled wrong (`phnutil` should be `phutil`). | |||||
| function phutil_count($countable) { | |||||
| if (!(is_array($countable) || $countable instanceof Countable)) { | |||||
| throw new InvalidArgumentException(pht('Argument should be countable.')); | |||||
| } | |||||
| return new PhutilNumber(count($countable)); | |||||
| } | |||||
Function spelled wrong (phnutil should be phutil).