Page MenuHomePhorge

final class PhutilEditorConfig
Arcanist Technical Documentation ()

Parser for EditorConfig files.

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

public function __construct($root)

Constructor.

Parameters
string$rootThe root directory.
Return
this//Implicit.//

public function getProperty($path, $key)

Get the specified EditorConfig property for the specified path.

Parameters
string$path
string$key
Return
wild

public function getProperties($path)

Get the EditorConfig properties for the specified path.

Returns a map containing all of the EditorConfig properties which apply to the specified path. The following rules are applied when processing EditorConfig files:

  • If a glob does not contain /, it can match a path in any subdirectory.
  • If the first character of a glob is /, it will only match files in the same directory as the .editorconfig file.
  • Properties and values are case-insensitive.
  • Unknown properties will be silently ignored.
  • Values are not validated against the specification (this may change in the future).
  • Invalid glob patterns will be silently ignored.
Parameters
string$path
Return
map<string, wild>

private function getEditorConfigs($path)

Returns the EditorConfig files which affect the specified path.

Find and parse all .editorconfig files between the specified path and the root directory. The results are returned in the same order that they should be matched.

return list<pair<string, map>>

Parameters
$path
Return
wild