diff --git a/cake/console/libs/console_input_argument.php b/cake/console/libs/console_input_argument.php index 3e8d1eb7da3..fbd05548fb7 100644 --- a/cake/console/libs/console_input_argument.php +++ b/cake/console/libs/console_input_argument.php @@ -50,6 +50,19 @@ public function __construct($name, $help = '', $required = false, $choices = arr } } +/** + * Protected attribute accessor. + * + * @param string $name Name of attribute to read. + * @return mixed. + */ + public function __get($name) { + if (isset($this->{'_' . $name})) { + return $this->{'_' . $name}; + } + return null; + } + /** * Get the name of the argument * diff --git a/cake/console/libs/console_input_option.php b/cake/console/libs/console_input_option.php index 173e19cdc77..d47bcb956f5 100644 --- a/cake/console/libs/console_input_option.php +++ b/cake/console/libs/console_input_option.php @@ -55,6 +55,19 @@ public function __construct($name, $short = null, $help = '', $boolean = false, } } +/** + * Protected attribute accessor. + * + * @param string $name Name of attribute to read. + * @return mixed. + */ + public function __get($name) { + if (isset($this->{'_' . $name})) { + return $this->{'_' . $name}; + } + return null; + } + /** * Get the name of the argument * diff --git a/cake/console/libs/console_input_subcommand.php b/cake/console/libs/console_input_subcommand.php index 514c5a1b90c..f6b80bfdd70 100644 --- a/cake/console/libs/console_input_subcommand.php +++ b/cake/console/libs/console_input_subcommand.php @@ -27,9 +27,7 @@ */ class ConsoleInputSubcommand { - protected $_name; - protected $_help; - protected $_parser; + protected $_name, $_help, $_parser; /** * Make a new Subcommand @@ -55,6 +53,19 @@ public function __construct($name, $help = '', $parser = null) { } } +/** + * Protected attribute accessor. + * + * @param string $name Name of attribute to read. + * @return mixed. + */ + public function __get($name) { + if (isset($this->{'_' . $name})) { + return $this->{'_' . $name}; + } + return null; + } + /** * Get the name of the subcommand * diff --git a/cake/console/libs/help_formatter.php b/cake/console/libs/help_formatter.php index 7af4cadf104..754a1865c66 100644 --- a/cake/console/libs/help_formatter.php +++ b/cake/console/libs/help_formatter.php @@ -141,7 +141,7 @@ protected function _generateUsage() { protected function _getMaxLength($collection) { $max = 0; foreach ($collection as $item) { - $max = (strlen($item->name()) > $max) ? strlen($item->name()) : $max; + $max = (strlen($item->name) > $max) ? strlen($item->name) : $max; } return $max; }