Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15426871
D13372.id32398.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D13372.id32398.diff
View Options
diff --git a/src/symbols/PhutilSymbolLoader.php b/src/symbols/PhutilSymbolLoader.php
--- a/src/symbols/PhutilSymbolLoader.php
+++ b/src/symbols/PhutilSymbolLoader.php
@@ -1,32 +1,39 @@
<?php
/**
- * Query and load Phutil classes, interfaces and functions. PhutilSymbolLoader
- * is a query object which selects symbols which satisfy certain criteria, and
- * optionally loads them. For instance, to load all classes in a library:
+ * Query and load Phutil classes, interfaces and functions.
*
- * $symbols = id(new PhutilSymbolLoader())
- * ->setType('class')
- * ->setLibrary('example')
- * ->selectAndLoadSymbols();
+ * `PhutilSymbolLoader` is a query object which selects symbols which satisfy
+ * certain criteria, and optionally loads them. For instance, to load all
+ * classes in a library:
+ *
+ * ```lang=php
+ * $symbols = id(new PhutilSymbolLoader())
+ * ->setType('class')
+ * ->setLibrary('example')
+ * ->selectAndLoadSymbols();
+ * ```
*
* When you execute the loading query, it returns a dictionary of matching
* symbols:
*
- * array(
- * 'class$Example' => array(
- * 'type' => 'class',
- * 'name' => 'Example',
- * 'library' => 'libexample',
- * 'where' => 'examples/example.php',
- * ),
- * // ... more ...
- * );
+ * ```lang=php
+ * array(
+ * 'class$Example' => array(
+ * 'type' => 'class',
+ * 'name' => 'Example',
+ * 'library' => 'libexample',
+ * 'where' => 'examples/example.php',
+ * ),
+ * // ... more ...
+ * );
+ * ```
*
* The **library** and **where** keys show where the symbol is defined. The
* **type** and **name** keys identify the symbol itself.
*
- * NOTE: This class must not use libphutil functions, including id() and idx().
+ * NOTE: This class must not use libphutil functions, including @{function:id}
+ * and @{function:idx}.
*
* @task config Configuring the Query
* @task load Loading Symbols
@@ -45,10 +52,12 @@
/**
- * Select the type of symbol to load, either ##class## or ##function##.
+ * Select the type of symbol to load, either `class`, `function` or
+ * `interface`.
*
* @param string Type of symbol to load.
* @return this
+ *
* @task config
*/
public function setType($type) {
@@ -63,6 +72,7 @@
*
* @param string Library name.
* @return this
+ *
* @task config
*/
public function setLibrary($library) {
@@ -81,6 +91,7 @@
*
* @param string Path relative to library root, like "apps/cheese/".
* @return this
+ *
* @task config
*/
public function setPathPrefix($path) {
@@ -95,6 +106,7 @@
*
* @param string Symbol name.
* @return this
+ *
* @task config
*/
public function setName($name) {
@@ -110,6 +122,7 @@
*
* @param string Base class name.
* @return this
+ *
* @task config
*/
public function setAncestorClass($base) {
@@ -127,6 +140,7 @@
*
* @param bool True if the query should load only concrete symbols.
* @return this
+ *
* @task config
*/
public function setConcreteOnly($concrete) {
@@ -145,6 +159,7 @@
* @return dict A dictionary of matching symbols. See top-level class
* documentation for details. These symbols will be loaded
* and available.
+ *
* @task load
*/
public function selectAndLoadSymbols() {
@@ -187,12 +202,11 @@
// As an optimization, we filter the list of candidate symbols in
// several passes, applying a name-based filter first if possible since
// it is highly selective and guaranteed to match at most one symbol.
- // This is the common case and we land here through __autoload() so it's
- // worthwhile to microoptimize a bit because this code path is very hot
- // and we save 5-10ms per page for a very moderate increase in
+ // This is the common case and we land here through `__autoload()` so
+ // it's worthwhile to micro-optimize a bit because this code path is
+ // very hot and we save 5-10ms per page for a very moderate increase in
// complexity.
-
if ($this->name) {
// If we have a name filter, just pick the matching name out if it
// exists.
@@ -277,6 +291,7 @@
*
* @return dict A dictionary of matching symbols. See top-level class
* documentation for details.
+ *
* @task load
*/
public function selectSymbolsWithoutLoading() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 24 2025, 11:19 AM (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7671149
Default Alt Text
D13372.id32398.diff (4 KB)
Attached To
Mode
D13372: Minor tidying of PhutilSymbolLoader
Attached
Detach File
Event Timeline
Log In to Comment