Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15402996
D14070.id34010.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14070.id34010.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -402,6 +402,7 @@
'newv' => 'utils/utils.php',
'nonempty' => 'utils/utils.php',
'phlog' => 'error/phlog.php',
+ 'phnutil_count' => 'internationalization/pht.php',
'pht' => 'internationalization/pht.php',
'phutil_censor_credentials' => 'utils/utils.php',
'phutil_console_confirm' => 'console/format.php',
diff --git a/src/internationalization/pht.php b/src/internationalization/pht.php
--- a/src/internationalization/pht.php
+++ b/src/internationalization/pht.php
@@ -16,3 +16,13 @@
$translator = PhutilTranslator::getInstance();
return call_user_func_array(array($translator, 'translate'), $args);
}
+
+/**
+ * Count all elements in an array, or something in an object.
+ *
+ * @param wild An array or `Countable` object.
+ * @return PhutilNumber Returns the number of elements in the input parameter.
+ */
+function phnutil_count($countable) {
+ return new PhutilNumber(count($countable));
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 1:34 AM (4 d, 58 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7710639
Default Alt Text
D14070.id34010.diff (1 KB)
Attached To
Mode
D14070: Add a `phutil_count` function
Attached
Detach File
Event Timeline
Log In to Comment