docs
docs copied to clipboard
Class Phalcon\Config: path() method poorly specified
The Methods section of Phalcon\Config's documentation describes path():
public function path( string $path, mixed $defaultValue = null, mixed $delimiter = null ): mixed | null;Returns a value from current config using a dot separated path.
It would greatly help to properly specify that method, indicating what value is returned.
By the way, if that is how values are obtained, renaming to something like "get" would surely clarify.
It already has get() method inherited from Collection class, but they work differently. path() is a wrapper on top of get().
path is a nested get so to speak.
Imagine:
database
adapter: Mysql
$value = $config->get('database'); // Config object
$adapter = $value->get('adapter'); // string `Mysql`
vs
$adapter = $config->path('database.adapter'); // string `Mysql`