Skip to content

Commit

Permalink
Changed all public methods to specify public access.
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Apr 5, 2010
1 parent 14b6a7a commit 1497ec3
Show file tree
Hide file tree
Showing 139 changed files with 1,278 additions and 2,551 deletions.
27 changes: 9 additions & 18 deletions cake/console/cake.php
Expand Up @@ -127,9 +127,8 @@ class ShellDispatcher {
*
* @param array $args the argv
* @return void
* @access public
*/
function ShellDispatcher($args = array()) {
public function ShellDispatcher($args = array()) {
set_time_limit(0);

$this->__initConstants();
Expand Down Expand Up @@ -281,9 +280,8 @@ function __bootstrap() {
* Clear the console
*
* @return void
* @access public
*/
function clear() {
public function clear() {
if (empty($this->params['noclear'])) {
if ( DS === '/') {
passthru('clear');
Expand All @@ -297,9 +295,8 @@ function clear() {
* Dispatches a CLI request
*
* @return boolean
* @access public
*/
function dispatch() {
public function dispatch() {
$arg = $this->shiftArgs();

if (!$arg) {
Expand Down Expand Up @@ -429,9 +426,8 @@ function _getShell($plugin = null) {
* @param mixed $options Array or string of options.
* @param string $default Default input value.
* @return Either the default value, or the user-provided input.
* @access public
*/
function getInput($prompt, $options = null, $default = null) {
public function getInput($prompt, $options = null, $default = null) {
if (!is_array($options)) {
$printOptions = '';
} else {
Expand Down Expand Up @@ -462,9 +458,8 @@ function getInput($prompt, $options = null, $default = null) {
* @param string $string String to output.
* @param boolean $newline If true, the outputs gets an added newline.
* @return integer Returns the number of bytes output to stdout.
* @access public
*/
function stdout($string, $newline = true) {
public function stdout($string, $newline = true) {
if ($newline) {
return fwrite($this->stdout, $string . "\n");
} else {
Expand All @@ -476,19 +471,17 @@ function stdout($string, $newline = true) {
* Outputs to the stderr filehandle.
*
* @param string $string Error text to output.
* @access public
*/
function stderr($string) {
public function stderr($string) {
fwrite($this->stderr, $string);
}

/**
* Parses command line options
*
* @param array $params Parameters to parse
* @access public
*/
function parseParams($params) {
public function parseParams($params) {
$this->__parseParams($params);
$defaults = array('app' => 'app', 'root' => dirname(dirname(dirname(__FILE__))), 'working' => null, 'webroot' => 'webroot');
$params = array_merge($defaults, array_intersect_key($this->params, $defaults));
Expand Down Expand Up @@ -562,18 +555,16 @@ function __parseParams($params) {
* Removes first argument and shifts other arguments up
*
* @return mixed Null if there are no arguments otherwise the shifted argument
* @access public
*/
function shiftArgs() {
public function shiftArgs() {
return array_shift($this->args);
}

/**
* Shows console help
*
* @access public
*/
function help() {
public function help() {
$this->clear();
$this->stdout("\nWelcome to CakePHP v" . Configure::version() . " Console");
$this->stdout("---------------------------------------------------------------");
Expand Down
51 changes: 17 additions & 34 deletions cake/console/error.php
Expand Up @@ -58,9 +58,8 @@ function __construct($method, $messages) {
* Displays an error page (e.g. 404 Not found).
*
* @param array $params Parameters (code, name, and message)
* @access public
*/
function error($params) {
public function error($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr($code . $name . $message."\n");
$this->_stop();
Expand All @@ -70,9 +69,8 @@ function error($params) {
* Convenience method to display a 404 page.
*
* @param array $params Parameters (url, message)
* @access public
*/
function error404($params) {
public function error404($params) {
extract($params, EXTR_OVERWRITE);
$this->error(array(
'code' => '404',
Expand All @@ -86,9 +84,8 @@ function error404($params) {
* Renders the Missing Controller web page.
*
* @param array $params Parameters (className)
* @access public
*/
function missingController($params) {
public function missingController($params) {
extract($params, EXTR_OVERWRITE);
$controllerName = str_replace('Controller', '', $className);
$this->stderr(sprintf(__("Missing Controller '%s'", true), $controllerName));
Expand All @@ -99,9 +96,8 @@ function missingController($params) {
* Renders the Missing Action web page.
*
* @param array $params Parameters (action, className)
* @access public
*/
function missingAction($params) {
public function missingAction($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing Method '%s' in '%s'", true), $action, $className));
$this->_stop();
Expand All @@ -111,9 +107,8 @@ function missingAction($params) {
* Renders the Private Action web page.
*
* @param array $params Parameters (action, className)
* @access public
*/
function privateAction($params) {
public function privateAction($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Trying to access private method '%s' in '%s'", true), $action, $className));
$this->_stop();
Expand All @@ -123,9 +118,8 @@ function privateAction($params) {
* Renders the Missing Table web page.
*
* @param array $params Parameters (table, className)
* @access public
*/
function missingTable($params) {
public function missingTable($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing database table '%s' for model '%s'", true), $table, $className));
$this->_stop();
Expand All @@ -135,9 +129,8 @@ function missingTable($params) {
* Renders the Missing Database web page.
*
* @param array $params Parameters
* @access public
*/
function missingDatabase($params = array()) {
public function missingDatabase($params = array()) {
$this->stderr(__("Missing Database", true));
$this->_stop();
}
Expand All @@ -146,9 +139,8 @@ function missingDatabase($params = array()) {
* Renders the Missing View web page.
*
* @param array $params Parameters (file, action, className)
* @access public
*/
function missingView($params) {
public function missingView($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing View '%s' for '%s' in '%s'", true), $file, $action, $className));
$this->_stop();
Expand All @@ -158,9 +150,8 @@ function missingView($params) {
* Renders the Missing Layout web page.
*
* @param array $params Parameters (file)
* @access public
*/
function missingLayout($params) {
public function missingLayout($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing Layout '%s'", true), $file));
$this->_stop();
Expand All @@ -170,9 +161,8 @@ function missingLayout($params) {
* Renders the Database Connection web page.
*
* @param array $params Parameters
* @access public
*/
function missingConnection($params) {
public function missingConnection($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(__("Missing Database Connection. Try 'cake bake'", true));
$this->_stop();
Expand All @@ -182,9 +172,8 @@ function missingConnection($params) {
* Renders the Missing Helper file web page.
*
* @param array $params Parameters (file, helper)
* @access public
*/
function missingHelperFile($params) {
public function missingHelperFile($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing Helper file '%s' for '%s'", true), $file, Inflector::camelize($helper)));
$this->_stop();
Expand All @@ -194,9 +183,8 @@ function missingHelperFile($params) {
* Renders the Missing Helper class web page.
*
* @param array $params Parameters (file, helper)
* @access public
*/
function missingHelperClass($params) {
public function missingHelperClass($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing Helper class '%s' in '%s'", true), Inflector::camelize($helper), $file));
$this->_stop();
Expand All @@ -206,9 +194,8 @@ function missingHelperClass($params) {
* Renders the Missing Component file web page.
*
* @param array $params Parameters (file, component)
* @access public
*/
function missingComponentFile($params) {
public function missingComponentFile($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing Component file '%s' for '%s'", true), $file, Inflector::camelize($component)));
$this->_stop();
Expand All @@ -218,9 +205,8 @@ function missingComponentFile($params) {
* Renders the Missing Component class web page.
*
* @param array $params Parameters (file, component)
* @access public
*/
function missingComponentClass($params) {
public function missingComponentClass($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing Component class '%s' in '%s'", true), Inflector::camelize($component), $file));
$this->_stop();
Expand All @@ -230,9 +216,8 @@ function missingComponentClass($params) {
* Renders the Missing Model class web page.
*
* @param array $params Parameters (className)
* @access public
*/
function missingModel($params) {
public function missingModel($params) {
extract($params, EXTR_OVERWRITE);
$this->stderr(sprintf(__("Missing model '%s'", true), $className));
$this->_stop();
Expand All @@ -243,9 +228,8 @@ function missingModel($params) {
*
* @param string $string String to output.
* @param boolean $newline If true, the outputs gets an added newline.
* @access public
*/
function stdout($string, $newline = true) {
public function stdout($string, $newline = true) {
if ($newline) {
fwrite($this->stdout, $string . "\n");
} else {
Expand All @@ -257,9 +241,8 @@ function stdout($string, $newline = true) {
* Outputs to the stderr filehandle.
*
* @param string $string Error text to output.
* @access public
*/
function stderr($string) {
public function stderr($string) {
fwrite($this->stderr, "Error: ". $string . "\n");
}
}
Expand Down

0 comments on commit 1497ec3

Please sign in to comment.