Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15321427
D8479.id20091.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
27 KB
Referenced Files
None
Subscribers
None
D8479.id20091.diff
View Options
diff --git a/src/auth/PhutilAuthAdapter.php b/src/auth/PhutilAuthAdapter.php
--- a/src/auth/PhutilAuthAdapter.php
+++ b/src/auth/PhutilAuthAdapter.php
@@ -1,31 +1,121 @@
<?php
+/**
+ * Abstract interface to an identity provider or authentication source, like
+ * Twitter, Facebook or Google.
+ *
+ * Generally, adapters are handed some set of credentials particular to the
+ * provider they adapt, and they turn those credentials into standard
+ * information about the user's identity. For example, the LDAP adapter is given
+ * a username and password (and some other configuration information), uses them
+ * to talk to the LDAP server, and produces a username, email, and so forth.
+ *
+ * Since the credentials a provider requires are specific to each provider, the
+ * base adapter does not specify how an adapter should be constructed or
+ * configured -- only what information it is expected to be able to provide once
+ * properly configured.
+ */
abstract class PhutilAuthAdapter {
+ /**
+ * Get a unique identifier associated with the identity. For most providers,
+ * this is an account ID.
+ *
+ * The account ID needs to be unique within this adapter's configuration, such
+ * that `<adapterKey, accountID>` is globally unique and always identifies the
+ * same identity.
+ *
+ * If the adapter was unable to authenticate an identity, it should return
+ * `null`.
+ *
+ * @return string|null Unique account identifier, or `null` if authentication
+ * failed.
+ */
abstract public function getAccountID();
+
+
+ /**
+ * Get a string identifying this adapter, like "ldap". This string should be
+ * unique to the adapter class.
+ *
+ * @return string Unique adapter identifier.
+ */
abstract public function getAdapterType();
+
+
+ /**
+ * Get a string identifying the domain this adapter is acting on. This allows
+ * an adapter (like LDAP) to act against different identity domains without
+ * conflating credentials. For providers like Facebook or Google, the adapters
+ * just return the relevant domain name.
+ *
+ * @return string Domain the adapter is associated with.
+ */
abstract public function getAdapterDomain();
+
+ /**
+ * Generate a string uniquely identifying this adapter configuration. Within
+ * the scope of a given key, all account IDs must uniquely identify exactly
+ * one identity.
+ *
+ * @return string Unique identifier for this adapter configuration.
+ */
public function getAdapterKey() {
return $this->getAdapterType().':'.$this->getAdapterDomain();
}
+
+ /**
+ * Optionally, return an email address associated with this account.
+ *
+ * @return string|null An email address associated with the account, or
+ * `null` if data is not available.
+ */
public function getAccountEmail() {
return null;
}
+
+ /**
+ * Optionally, return a human readable username associated with this account.
+ *
+ * @return string|null Account username, or `null` if data isn't available.
+ */
public function getAccountName() {
return null;
}
+
+ /**
+ * Optionally, return a URI corresponding to a human-viewable profile for
+ * this account.
+ *
+ * @return string|null A profile URI associated with this account, or
+ * `null` if the data isn't available.
+ */
public function getAccountURI() {
return null;
}
+
+ /**
+ * Optionally, return a profile image URI associated with this account.
+ *
+ * @return string|null URI for an account profile image, or `null` if one is
+ * not available.
+ */
public function getAccountImageURI() {
return null;
}
+
+ /**
+ * Optionally, return a real name associated with this account.
+ *
+ * @return string|null A human real name, or `null` if this data is not
+ * available.
+ */
public function getAccountRealName() {
return null;
}
diff --git a/src/auth/PhutilAuthAdapterEmpty.php b/src/auth/PhutilAuthAdapterEmpty.php
--- a/src/auth/PhutilAuthAdapterEmpty.php
+++ b/src/auth/PhutilAuthAdapterEmpty.php
@@ -1,5 +1,11 @@
<?php
+/**
+ * Empty authentication adapter with no logic.
+ *
+ * This adapter can be used when you need an adapter for some technical reason
+ * but it doesn't make sense to put logic inside it.
+ */
final class PhutilAuthAdapterEmpty extends PhutilAuthAdapter {
private $accountID;
@@ -15,7 +21,6 @@
return $this->adapterDomain;
}
-
public function setAdapterType($adapter_type) {
$this->adapterType = $adapter_type;
return $this;
diff --git a/src/auth/PhutilAuthAdapterLDAP.php b/src/auth/PhutilAuthAdapterLDAP.php
--- a/src/auth/PhutilAuthAdapterLDAP.php
+++ b/src/auth/PhutilAuthAdapterLDAP.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Retrieve identify information from LDAP accounts.
+ */
final class PhutilAuthAdapterLDAP extends PhutilAuthAdapter {
private $hostname;
diff --git a/src/auth/PhutilAuthAdapterOAuth.php b/src/auth/PhutilAuthAdapterOAuth.php
--- a/src/auth/PhutilAuthAdapterOAuth.php
+++ b/src/auth/PhutilAuthAdapterOAuth.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Abstract adapter for OAuth2 providers.
+ */
abstract class PhutilAuthAdapterOAuth extends PhutilAuthAdapter {
private $clientID;
diff --git a/src/auth/PhutilAuthAdapterOAuth1.php b/src/auth/PhutilAuthAdapterOAuth1.php
--- a/src/auth/PhutilAuthAdapterOAuth1.php
+++ b/src/auth/PhutilAuthAdapterOAuth1.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Abstract adapter for OAuth1 providers.
+ */
abstract class PhutilAuthAdapterOAuth1 extends PhutilAuthAdapter {
private $consumerKey;
diff --git a/src/auth/PhutilAuthAdapterOAuthAmazon.php b/src/auth/PhutilAuthAdapterOAuthAmazon.php
--- a/src/auth/PhutilAuthAdapterOAuthAmazon.php
+++ b/src/auth/PhutilAuthAdapterOAuthAmazon.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Amazon OAuth2.
+ */
final class PhutilAuthAdapterOAuthAmazon extends PhutilAuthAdapterOAuth {
public function getAdapterType() {
diff --git a/src/auth/PhutilAuthAdapterOAuthAsana.php b/src/auth/PhutilAuthAdapterOAuthAsana.php
--- a/src/auth/PhutilAuthAdapterOAuthAsana.php
+++ b/src/auth/PhutilAuthAdapterOAuthAsana.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Asana OAuth2.
+ */
final class PhutilAuthAdapterOAuthAsana extends PhutilAuthAdapterOAuth {
public function getAdapterType() {
diff --git a/src/auth/PhutilAuthAdapterOAuthDisqus.php b/src/auth/PhutilAuthAdapterOAuthDisqus.php
--- a/src/auth/PhutilAuthAdapterOAuthDisqus.php
+++ b/src/auth/PhutilAuthAdapterOAuthDisqus.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Disqus OAuth2.
+ */
final class PhutilAuthAdapterOAuthDisqus extends PhutilAuthAdapterOAuth {
public function getAdapterType() {
diff --git a/src/auth/PhutilAuthAdapterOAuthFacebook.php b/src/auth/PhutilAuthAdapterOAuthFacebook.php
--- a/src/auth/PhutilAuthAdapterOAuthFacebook.php
+++ b/src/auth/PhutilAuthAdapterOAuthFacebook.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Facebook OAuth2.
+ */
final class PhutilAuthAdapterOAuthFacebook extends PhutilAuthAdapterOAuth {
private $requireSecureBrowsing;
diff --git a/src/auth/PhutilAuthAdapterOAuthGitHub.php b/src/auth/PhutilAuthAdapterOAuthGitHub.php
--- a/src/auth/PhutilAuthAdapterOAuthGitHub.php
+++ b/src/auth/PhutilAuthAdapterOAuthGitHub.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Github OAuth2.
+ */
final class PhutilAuthAdapterOAuthGitHub extends PhutilAuthAdapterOAuth {
public function getAdapterType() {
diff --git a/src/auth/PhutilAuthAdapterOAuthGoogle.php b/src/auth/PhutilAuthAdapterOAuthGoogle.php
--- a/src/auth/PhutilAuthAdapterOAuthGoogle.php
+++ b/src/auth/PhutilAuthAdapterOAuthGoogle.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Google OAuth2.
+ */
final class PhutilAuthAdapterOAuthGoogle extends PhutilAuthAdapterOAuth {
public function getAdapterType() {
diff --git a/src/auth/PhutilAuthAdapterOAuthJIRA.php b/src/auth/PhutilAuthAdapterOAuthJIRA.php
--- a/src/auth/PhutilAuthAdapterOAuthJIRA.php
+++ b/src/auth/PhutilAuthAdapterOAuthJIRA.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for JIRA OAuth1.
+ */
final class PhutilAuthAdapterOAuthJIRA extends PhutilAuthAdapterOAuth1 {
// TODO: JIRA tokens expire (after 5 years) and we could surface and store
diff --git a/src/auth/PhutilAuthAdapterOAuthTwitch.php b/src/auth/PhutilAuthAdapterOAuthTwitch.php
--- a/src/auth/PhutilAuthAdapterOAuthTwitch.php
+++ b/src/auth/PhutilAuthAdapterOAuthTwitch.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Twitch.tv OAuth2.
+ */
final class PhutilAuthAdapterOAuthTwitch extends PhutilAuthAdapterOAuth {
public function getAdapterType() {
diff --git a/src/auth/PhutilAuthAdapterOAuthTwitter.php b/src/auth/PhutilAuthAdapterOAuthTwitter.php
--- a/src/auth/PhutilAuthAdapterOAuthTwitter.php
+++ b/src/auth/PhutilAuthAdapterOAuthTwitter.php
@@ -1,5 +1,8 @@
<?php
+/**
+ * Authentication adapter for Twitter OAuth1.
+ */
final class PhutilAuthAdapterOAuthTwitter extends PhutilAuthAdapterOAuth1 {
private $userInfo;
diff --git a/src/auth/PhutilAuthAdapterPersona.php b/src/auth/PhutilAuthAdapterPersona.php
--- a/src/auth/PhutilAuthAdapterPersona.php
+++ b/src/auth/PhutilAuthAdapterPersona.php
@@ -1,7 +1,7 @@
<?php
/**
- * Adapter for Mozilla's Persona.
+ * Authentication adapter for Mozilla's Persona.
*/
final class PhutilAuthAdapterPersona extends PhutilAuthAdapter {
diff --git a/src/auth/exception/PhutilAuthException.php b/src/auth/exception/PhutilAuthException.php
--- a/src/auth/exception/PhutilAuthException.php
+++ b/src/auth/exception/PhutilAuthException.php
@@ -1,5 +1,9 @@
<?php
+/**
+ * Abstract exception class for errors encountered during authentication
+ * workflows.
+ */
abstract class PhutilAuthException extends Exception {
}
diff --git a/src/docs/article/core_quick_reference.diviner b/src/docs/article/core_quick_reference.diviner
--- a/src/docs/article/core_quick_reference.diviner
+++ b/src/docs/article/core_quick_reference.diviner
@@ -14,6 +14,12 @@
You can efficiently merge a vector of arrays with @{function:array_mergev}.
+Functions @{function:head}, @{function:last}, @{function:head_key} and
+@{function:last_key} let you access the first or last elements of an array
+without raising warnings.
+
+You can combine an array with itself safely with @{function:array_fuse}.
+
= Default Value Selection =
Functions @{function:idx}, @{function:nonempty} and @{function:coalesce} help
@@ -32,12 +38,7 @@
@{function:array_select_keys} allows you to choose or reorder keys from a
dictionary.
-= UTF-8 =
-
-You can test a string for being valid UTF-8 with @{function:phutil_is_utf8},
-and sanitize strings to UTF-8 with @{function:phutil_utf8ize}.
-
-= xsprintf =
+= Lunar Phases =
-@{function:xsprintf} allows you to define ##sprintf()##-style functions with
-custom conversions.
+@{class:PhutilLunarPhase} calculates lunar phases, allowing you to harden an
+application against threats from werewolves, werebears, and other werecreatures.
diff --git a/src/docs/article/overview.diviner b/src/docs/article/overview.diviner
--- a/src/docs/article/overview.diviner
+++ b/src/docs/article/overview.diviner
@@ -6,17 +6,19 @@
= Overview =
**libphutil** (pronounced as "lib-futile", like the English word //futile//) is
-a collection of PHP utility classes and functions which provide powerful
-extensions to the standard library.
+a collection of PHP utility classes and functions. Most code in the library is
+general-purpose, and makes it easier to build applications in PHP.
-This code was originally developed at Facebook and parts of it appear in the
-core libraries for <http://www.facebook.com/>.
+libphutil is principally the shared library for
+[[ http://www.phabricator.org | Phabricator ]] and its CLI **Arcanist**, but is
+suitable for inclusion in other projects. In particular, some of the classes
+provided in this library vastly improve the state of common operations in PHP,
+like executing system commands.
-libphutil is principally the shared library for **Arcanist** and
-**Phabricator** (see <http://www.phabricator.org/>), but is suitable for
-inclusion in other projects. In particular, some of the classes provided in this
-library vastly improve the state of common operations in PHP, like executing
-system commands.
+libphutil is developed and maintained by
+[[ http://www.phacility.com/ | Phacility ]]. Some of the code in this library
+was originally developed at Facebook, and parts of it appear in the core
+libraries for <http://www.facebook.com/>.
= Loading libphutil =
@@ -30,7 +32,7 @@
= Major Components =
-The major components of libphutil are:
+Some of the major components of libphutil are:
- **Core Utilities**: a collection of useful functions like @{function:ipull}
which simplify common data manipulation;
@@ -51,5 +53,5 @@
Information on extending and contributing to libphutil is available in the
Phabricator documentation:
- - to get started as a contributor, see @{article@phabricator:Contributor
+ - to get started as a contributor, see @{article@phabcontrib:Contributor
Introduction}.
diff --git a/src/docs/book/libphutil.book b/src/docs/book/libphutil.book
--- a/src/docs/book/libphutil.book
+++ b/src/docs/book/libphutil.book
@@ -19,6 +19,21 @@
"groups" : {
"overview" : {
"name" : "libphutil Overview"
+ },
+ "util" : {
+ "name" : "Core Utilities",
+ "include": "(^src/utils/)"
+ },
+ "library" : {
+ "name": "libphutil Library System",
+ "include": "(^src/moduleutils/)"
+ },
+ "auth" : {
+ "name": "Authentication",
+ "include": "(^src/auth/)"
+ },
+ "utf8" : {
+ "name": "Handling Unicode and UTF-8"
}
}
}
diff --git a/src/moduleutils/moduleutils.php b/src/moduleutils/moduleutils.php
--- a/src/moduleutils/moduleutils.php
+++ b/src/moduleutils/moduleutils.php
@@ -1,17 +1,11 @@
<?php
-/**
- * @group library
- */
function phutil_get_library_root($library) {
$bootloader = PhutilBootloader::getInstance();
return $bootloader->getLibraryRoot($library);
}
-/**
- * @group library
- */
function phutil_get_library_root_for_path($path) {
foreach (Filesystem::walkToRoot($path) as $dir) {
if (@file_exists($dir.'/__phutil_library_init__.php')) {
@@ -21,9 +15,6 @@
return null;
}
-/**
- * @group library
- */
function phutil_get_library_name_for_root($path) {
$path = rtrim(Filesystem::resolvePath($path), '/');
@@ -41,8 +32,6 @@
/**
* Warns about use of deprecated behavior.
- *
- * @group library
*/
function phutil_deprecated($what, $why) {
PhutilErrorHandler::dispatchErrorMessage(
diff --git a/src/parser/PhutilEmailAddress.php b/src/parser/PhutilEmailAddress.php
--- a/src/parser/PhutilEmailAddress.php
+++ b/src/parser/PhutilEmailAddress.php
@@ -5,8 +5,6 @@
* to be fully RFC-compliant, because trying to do so is a crazy mess. However,
* it should parse all reasonable addresses which are actually in use on the
* internet today.
- *
- * @group util
*/
final class PhutilEmailAddress {
diff --git a/src/parser/PhutilGitURI.php b/src/parser/PhutilGitURI.php
--- a/src/parser/PhutilGitURI.php
+++ b/src/parser/PhutilGitURI.php
@@ -13,8 +13,6 @@
* Note that these URIs can not be transformed into normal URIs because the
* path is interpreted as relative on the remote, rather than absolute (as with
* normal URIs).
- *
- * @group util
*/
final class PhutilGitURI {
diff --git a/src/parser/PhutilJSON.php b/src/parser/PhutilJSON.php
--- a/src/parser/PhutilJSON.php
+++ b/src/parser/PhutilJSON.php
@@ -5,8 +5,6 @@
*
* @task pretty Formatting JSON Objects
* @task internal Internals
- *
- * @group util
*/
final class PhutilJSON {
diff --git a/src/parser/PhutilLanguageGuesser.php b/src/parser/PhutilLanguageGuesser.php
--- a/src/parser/PhutilLanguageGuesser.php
+++ b/src/parser/PhutilLanguageGuesser.php
@@ -3,8 +3,6 @@
/**
* Very simple class to guess the languages of source files which we failed to
* determine by examining file name/extension rules.
- *
- * @group util
*/
final class PhutilLanguageGuesser {
diff --git a/src/parser/PhutilQueryStringParser.php b/src/parser/PhutilQueryStringParser.php
--- a/src/parser/PhutilQueryStringParser.php
+++ b/src/parser/PhutilQueryStringParser.php
@@ -1,11 +1,10 @@
<?php
+
/**
* Parses a request string leaving all characters intact.
*
* http://php.net/manual/en/language.variables.external.php#language.variables.external.dot-in-names
* http://php.net/manual/en/language.variables.external.php#81080
- *
- * @group util
*/
final class PhutilQueryStringParser {
diff --git a/src/parser/PhutilSimpleOptions.php b/src/parser/PhutilSimpleOptions.php
--- a/src/parser/PhutilSimpleOptions.php
+++ b/src/parser/PhutilSimpleOptions.php
@@ -10,8 +10,6 @@
* @task unparse Unparsing Simple Options
* @task config Parser Configuration
* @task internal Internals
- *
- * @group util
*/
final class PhutilSimpleOptions {
diff --git a/src/parser/PhutilURI.php b/src/parser/PhutilURI.php
--- a/src/parser/PhutilURI.php
+++ b/src/parser/PhutilURI.php
@@ -2,8 +2,6 @@
/**
* Basic URI parser object.
- *
- * @group util
*/
final class PhutilURI {
diff --git a/src/parser/__tests__/PhutilGitURITestCase.php b/src/parser/__tests__/PhutilGitURITestCase.php
--- a/src/parser/__tests__/PhutilGitURITestCase.php
+++ b/src/parser/__tests__/PhutilGitURITestCase.php
@@ -1,9 +1,7 @@
<?php
/**
- * Test cases for @{class:PhutilGitURI} parser.
- *
- * @group util
+ * @covers PhutilGitURI
*/
final class PhutilGitURITestCase extends PhutilTestCase {
diff --git a/src/serviceprofiler/PhutilServiceProfiler.php b/src/serviceprofiler/PhutilServiceProfiler.php
--- a/src/serviceprofiler/PhutilServiceProfiler.php
+++ b/src/serviceprofiler/PhutilServiceProfiler.php
@@ -3,8 +3,6 @@
/**
* Simple event store for service calls, so they can be printed to stdout or
* displayed in a debug console.
- *
- * @group util
*/
final class PhutilServiceProfiler {
diff --git a/src/utils/AbstractDirectedGraph.php b/src/utils/AbstractDirectedGraph.php
--- a/src/utils/AbstractDirectedGraph.php
+++ b/src/utils/AbstractDirectedGraph.php
@@ -27,9 +27,6 @@
* @task build Graph Construction
* @task cycle Cycle Detection
* @task explore Graph Exploration
- *
- * @group util
- * @stable
*/
abstract class AbstractDirectedGraph {
diff --git a/src/utils/PhutilArray.php b/src/utils/PhutilArray.php
--- a/src/utils/PhutilArray.php
+++ b/src/utils/PhutilArray.php
@@ -5,8 +5,6 @@
* class wraps a basic array and provides trivial implementations for
* `Countable`, `ArrayAccess` and `Iterator`, so subclasses need only implement
* specializations.
- *
- * @group util
*/
abstract class PhutilArray
extends Phobject
diff --git a/src/utils/PhutilArrayWithDefaultValue.php b/src/utils/PhutilArrayWithDefaultValue.php
--- a/src/utils/PhutilArrayWithDefaultValue.php
+++ b/src/utils/PhutilArrayWithDefaultValue.php
@@ -25,8 +25,6 @@
* Normally, the default value is `0` to allow the object to be used to count
* things or build bitmasks. You can change the default with
* @{method:setDefaultValue}.
- *
- * @group util
*/
final class PhutilArrayWithDefaultValue extends PhutilArray {
diff --git a/src/utils/PhutilBufferedIterator.php b/src/utils/PhutilBufferedIterator.php
--- a/src/utils/PhutilBufferedIterator.php
+++ b/src/utils/PhutilBufferedIterator.php
@@ -11,8 +11,6 @@
* @task impl Methods to Implement
* @task config Configuration
* @task iterator Iterator Implementation
- *
- * @group util
*/
abstract class PhutilBufferedIterator implements Iterator {
diff --git a/src/utils/PhutilBufferedIteratorExample.php b/src/utils/PhutilBufferedIteratorExample.php
--- a/src/utils/PhutilBufferedIteratorExample.php
+++ b/src/utils/PhutilBufferedIteratorExample.php
@@ -2,8 +2,6 @@
/**
* Example implementation and test case for @{class:PhutilBufferedIterator}.
- *
- * @group util
*/
final class PhutilBufferedIteratorExample extends PhutilBufferedIterator {
diff --git a/src/utils/PhutilRope.php b/src/utils/PhutilRope.php
--- a/src/utils/PhutilRope.php
+++ b/src/utils/PhutilRope.php
@@ -4,8 +4,6 @@
* String-like object which reduces the cost of managing large strings. This
* is particularly useful for buffering large amounts of data that is being
* passed to `fwrite()`.
- *
- * @group util
*/
final class PhutilRope extends Phobject {
diff --git a/src/utils/utils.php b/src/utils/utils.php
--- a/src/utils/utils.php
+++ b/src/utils/utils.php
@@ -15,7 +15,6 @@
*
* @param wild Anything.
* @return wild Unmodified argument.
- * @group util
*/
function id($x) {
return $x;
@@ -33,7 +32,6 @@
* array.
* @return wild If $array[$key] exists, that value is returned. If not,
* $default is returned without raising a warning.
- * @group util
*/
function idx(array $array, $key, $default = null) {
// isset() is a micro-optimization - it is fast but fails for null values.
@@ -105,7 +103,6 @@
* ##null## to preserve the original keys.
* @return dict A dictionary with keys and values derived according
* to whatever you passed as $method and $key_method.
- * @group util
*/
function mpull(array $list, $method, $key_method = null) {
$result = array();
@@ -179,7 +176,6 @@
* ##null## to preserve the original keys.
* @return dict A dictionary with keys and values derived according
* to whatever you passed as $property and $key_property.
- * @group util
*/
function ppull(array $list, $property, $key_property = null) {
$result = array();
@@ -228,7 +224,6 @@
* array, or null to preserve the array keys.
* @return dict A dictionary with keys and values derived according
* to whatever you passed for $index and $key_index.
- * @group util
*/
function ipull(array $list, $index, $key_index = null) {
$result = array();
@@ -277,7 +272,6 @@
* groups.
* @return dict Dictionary mapping distinct method returns to lists of
* all objects which returned that value.
- * @group util
*/
function mgroup(array $list, $by /* , ... */) {
$map = mpull($list, $by);
@@ -318,7 +312,6 @@
* groups.
* @return dict Dictionary mapping distinct index values to lists of
* all objects which had that value at the index.
- * @group util
*/
function igroup(array $list, $by /* , ... */) {
$map = ipull($list, $by);
@@ -363,7 +356,6 @@
* @param string Name of a method to call on each object; the return values
* will be used to sort the list.
* @return list Objects ordered by the return values of the method calls.
- * @group util
*/
function msort(array $list, $method) {
$surrogate = mpull($list, $method);
@@ -388,7 +380,6 @@
* @param string Index to access on each object; the return values
* will be used to sort the list.
* @return list Arrays ordered by the index values.
- * @group util
*/
function isort(array $list, $index) {
$surrogate = ipull($list, $index);
@@ -426,7 +417,6 @@
* filter instead of keeping them.
*
* @return array List of objects which pass the filter.
- * @group util
*/
function mfilter(array $list, $method, $negate = false) {
if (!is_string($method)) {
@@ -473,7 +463,6 @@
* filter instead of keeping them.
*
* @return array List of arrays which pass the filter.
- * @group util
*/
function ifilter(array $list, $index, $negate = false) {
if (!is_scalar($index)) {
@@ -513,7 +502,6 @@
* @return dict Dictionary of only those key-value pairs where the key was
* present in the list of keys to select. Ordering is
* determined by the list order.
- * @group util
*/
function array_select_keys(array $dict, array $keys) {
$result = array();
@@ -533,7 +521,6 @@
* @param array
* @param string Name of the class or 'array' to check arrays.
* @return array Returns passed array.
- * @group util
*/
function assert_instances_of(array $arr, $class) {
$is_array = !strcasecmp($class, 'array');
@@ -599,7 +586,6 @@
*
* @param ... Zero or more arguments of any type.
* @return mixed First non-##null## arg, or null if no such arg exists.
- * @group util
*/
function coalesce(/* ... */) {
$args = func_get_args();
@@ -623,7 +609,6 @@
* @param ... Zero or more arguments of any type.
* @return mixed First non-##empty()## arg, or last arg if no such arg
* exists, or null if you passed in zero args.
- * @group util
*/
function nonempty(/* ... */) {
$args = func_get_args();
@@ -671,7 +656,6 @@
* @param list Array of arguments to pass to its constructor.
* @return obj A new object of the specified class, constructed by passing
* the argument vector to its constructor.
- * @group util
*/
function newv($class_name, array $argv) {
$reflector = new ReflectionClass($class_name);
@@ -690,7 +674,6 @@
*
* @param array Array to retrieve the first element from.
* @return wild The first value of the array.
- * @group util
*/
function head(array $arr) {
return reset($arr);
@@ -703,7 +686,6 @@
*
* @param array Array to retrieve the last element from.
* @return wild The last value of the array.
- * @group util
*/
function last(array $arr) {
return end($arr);
@@ -714,7 +696,6 @@
*
* @param array Array to retrieve the first key from.
* @return int|string The first key of the array.
- * @group util
*/
function head_key(array $arr) {
reset($arr);
@@ -726,7 +707,6 @@
*
* @param array Array to retrieve the last key from.
* @return int|string The last key of the array.
- * @group util
*/
function last_key(array $arr) {
end($arr);
@@ -746,7 +726,6 @@
*
* @param list Vector of arrays to merge.
* @return list Arrays, merged with array_merge() semantics.
- * @group util
*/
function array_mergev(array $arrayv) {
if (!$arrayv) {
@@ -767,7 +746,6 @@
* @param string Block of text to be split into lines.
* @param bool If true, retain line endings in result strings.
* @return list List of lines.
- * @group util
*/
function phutil_split_lines($corpus, $retain_endings = true) {
if (!strlen($corpus)) {
@@ -812,7 +790,6 @@
*
* @param list List of scalars.
* @return dict Dictionary with inputs mapped to themselves.
- * @group util
*/
function array_fuse(array $list) {
if ($list) {
@@ -839,7 +816,6 @@
* @param wild Element to interleave.
* @param list List of elements to be interleaved.
* @return list Original list with the new element interleaved.
- * @group util
*/
function array_interleave($interleave, array $array) {
$result = array();
diff --git a/src/xsprintf/xsprintf.php b/src/xsprintf/xsprintf.php
--- a/src/xsprintf/xsprintf.php
+++ b/src/xsprintf/xsprintf.php
@@ -32,7 +32,6 @@
* @param list List of arguments, with the sprintf() pattern in position 0.
* @return string Formatted string.
*
- * @group util
*/
function xsprintf($callback, $userdata, $argv) {
$argc = count($argv);
@@ -105,8 +104,6 @@
* @param int The current character position in the string.
* @param wild The value to convert.
* @param int The string length.
- *
- * @group util
*/
function xsprintf_callback_example(
$userdata,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 10:57 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7271675
Default Alt Text
D8479.id20091.diff (27 KB)
Attached To
Mode
D8479: Update some libphutil docs
Attached
Detach File
Event Timeline
Log In to Comment