Back to CliApplication class

Method __get

public mixed
__get
(mixed $name)
Magic method to access properties of the application.
Parameters
  • string $name The name of the property.
Returns
  • mixed A value if the property name is valid, null otherwise.
Since
  • 4.0.0
Deprecated
  • 5.0

Method __get - Source code

/**
 * Magic method to access properties of the application.
 *
 * @param   string  $name  The name of the property.
 *
 * @return  mixed   A value if the property name is valid, null otherwise.
 *
 * @since       4.0.0
 * @deprecated  5.0  This is a B/C proxy for deprecated read accesses
 */
public function __get($name)
{
    switch ($name) {
        case 'input':
            @trigger_error('Accessing the input property of the application is deprecated, use the getInput() method instead.', E_USER_DEPRECATED);
            return $this->getInput();
        default:
            $trace = debug_backtrace();
            trigger_error(sprintf('Undefined property via __get(): %1$s in %2$s on line %3$s', $name, $trace[0]['file'], $trace[0]['line']), E_USER_NOTICE);
    }
}