Permalink
Browse files

Fix: phpdoc miss

## did
- void unReturn
- miss return void
- add return type
- type miss typing
- add param type and return type
  - string → string|array
- change ClassName
  • Loading branch information...
lustyrain committed Oct 3, 2017
1 parent 1b36417 commit 31b13edf8a381cfe908890141c5387b3b45bc78f
@@ -60,7 +60,7 @@ public function handleException($exception) {
));
$code = $exception->getCode();
$code = ($code && is_int($code)) ? $code : 1;
return $this->_stop($code);
$this->_stop($code);
}
/**
@@ -88,7 +88,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
}
if ($log === LOG_ERR) {
return $this->_stop(1);
$this->_stop(1);
}
}
@@ -415,7 +415,7 @@ public function dispatchShell() {
* @param string $command The command name to run on this shell. If this argument is empty,
* and the shell has a `main()` method, that will be called instead.
* @param array $argv Array of arguments to run the shell with. This array should be missing the shell name.
* @return void
* @return int|bool
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand
*/
public function runCommand($command, $argv) {
@@ -469,7 +469,7 @@ public function runCommand($command, $argv) {
* Display the help in the correct format
*
* @param string $command The command to get help for.
* @return void
* @return int|bool
*/
protected function _displayHelp($command) {
$format = 'text';
@@ -571,7 +571,7 @@ public function in($prompt, $options = null, $default = null) {
* @param string $prompt Prompt text.
* @param string|array $options Array or string of options.
* @param string $default Default input value.
* @return Either the default value, or the user-provided input.
* @return string|int the default value, or the user-provided input.
*/
protected function _getInput($prompt, $options, $default) {
if (!is_array($options)) {
@@ -726,7 +726,7 @@ public function hr($newlines = 0, $width = 63) {
*
* @param string $title Title of the error
* @param string $message An optional error message
* @return void
* @return int
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error
*/
public function error($title, $message = null) {
@@ -52,7 +52,7 @@ public function __construct() {
/**
* Initializes the containing component and sets the Aro/Aco objects to it.
*
* @param AclComponent $component The AclComponent instance.
* @param Component $component The AclComponent instance.
* @return void
*/
public function initialize(Component $component) {
@@ -136,7 +136,7 @@ public function getUser(CakeRequest $request) {
/**
* Gets the digest headers from the request/environment.
*
* @return array Array of digest information.
* @return array|bool|null Array of digest information.
*/
protected function _getDigest() {
$digest = env('PHP_AUTH_DIGEST');
@@ -761,7 +761,7 @@ public function redirectUrl($url = null) {
*
* @param CakeRequest $request The request that contains authentication data.
* @param CakeResponse $response The response
* @return array User record data, or false, if the user could not be identified.
* @return array|bool User record data, or false, if the user could not be identified.
*/
public function identify(CakeRequest $request, CakeResponse $response) {
if (empty($this->_authenticateObjects)) {
@@ -494,7 +494,7 @@ protected function _encrypt($value) {
* Decrypts $value using public $type method in Security class
*
* @param array $values Values to decrypt
* @return string decrypted string
* @return array decrypted string
*/
protected function _decrypt($values) {
$decrypted = array();
@@ -516,7 +516,7 @@ protected function _decrypt($values) {
* Decodes and decrypts a single value.
*
* @param string $value The value to decode & decrypt.
* @return string Decoded value.
* @return string|array Decoded value.
*/
protected function _decode($value) {
$prefix = 'Q2FrZQ==.';
@@ -552,7 +552,7 @@ protected function _implode(array $array) {
* Maintains reading backwards compatibility with 1.x CookieComponent::_implode().
*
* @param string $string A string containing JSON encoded data, or a bare string.
* @return array Map of key and values
* @return string|array Map of key and values
*/
protected function _explode($string) {
$first = substr($string, 0, 1);
@@ -282,7 +282,7 @@ public function initialize(Controller $controller) {
* If you are rendering a template this variable will be sent to the templates as `$content`
* @param string $template Template to use when sending email
* @param string $layout Layout to use to enclose email body
* @return bool Success
* @return array Success
*/
public function send($content = null, $template = null, $layout = null) {
$lib = new CakeEmail();
@@ -111,7 +111,7 @@ public function subject() {
/**
* Stops the event from being used anymore
*
* @return void
* @return bool
*/
public function stopPropagation() {
return $this->_stopped = true;
@@ -166,7 +166,8 @@ protected function _extractCallable($function, $object) {
*/
public function detach($callable, $eventKey = null) {
if ($callable instanceof CakeEventListener) {
return $this->_detachSubscriber($callable, $eventKey);
$this->_detachSubscriber($callable, $eventKey);
return ;
}
if (empty($eventKey)) {
foreach (array_keys($this->_listeners) as $eventKey) {
@@ -432,7 +432,7 @@ public function beforeSave(Model $Model, $options = array()) {
* is disabled.
*
* @param Model $Model Model using this behavior.
* @return void
* @return bool true.
*/
protected function _setRuntimeData(Model $Model) {
$locale = $this->_getLocale($Model);
@@ -465,7 +465,7 @@ protected function _setRuntimeData(Model $Model) {
* This solves issues with saveAssociated and validate = first.
*
* @param Model $Model Model using this behavior.
* @return void
* @return bool true.
*/
public function afterValidate(Model $Model) {
$Model->data[$Model->alias] = array_merge(
@@ -481,7 +481,7 @@ public function afterValidate(Model $Model) {
* @param Model $Model Model the callback is called on
* @param bool $created Whether or not the save created a record.
* @param array $options Options passed from Model::save().
* @return void
* @return bool true.
*/
public function afterSave(Model $Model, $created, $options = array()) {
if (!isset($this->runtime[$Model->alias]['beforeValidate']) && !isset($this->runtime[$Model->alias]['beforeSave'])) {
@@ -73,7 +73,7 @@ public function init($modelName, $behaviors = array()) {
*
* @param string $behavior Behavior name.
* @param array $config Configuration options.
* @return void
* @return bool true.
* @deprecated 3.0.0 Will be removed in 3.0. Replaced with load().
*/
public function attach($behavior, $config = array()) {
@@ -97,7 +97,7 @@ public function attach($behavior, $config = array()) {
*
* @param string $behavior CamelCased name of the behavior to load
* @param array $config Behavior configuration parameters
* @return bool True on success, false on failure
* @return bool True on success.
* @throws MissingBehaviorException when a behavior could not be found.
*/
public function load($behavior, $config = array()) {
@@ -204,7 +204,7 @@ public function unload($name) {
* @deprecated 3.0.0 Will be removed in 3.0. Use unload instead.
*/
public function detach($name) {
return $this->unload($name);
$this->unload($name);
}
/**
@@ -212,7 +212,7 @@ public function describe($model) {
* @param array $fields The fields to update.
* @param array $values The values to set columns to.
* @param mixed $conditions array of conditions to use.
* @return array
* @return bool
*/
public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
if (empty($values) && !empty($fields)) {
@@ -234,7 +234,7 @@ public function validateMany(&$data, $options = array()) {
* actually run validation rules over data, not just return the messages.
*
* @param string $options An optional array of custom options to be made available in the beforeValidate callback
* @return array Array of invalid fields
* @return array|bool Array of invalid fields
* @triggers Model.afterValidate $model
* @see ModelValidator::validates()
*/
@@ -760,7 +760,7 @@ protected function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pa
*
* @param string|array $uri URI to parse
* @param bool|array $base If true use default URI config, otherwise indexed array to set 'scheme', 'host', 'port', etc.
* @return array Parsed URI
* @return array|bool Parsed URI
*/
protected function _parseUri($uri = null, $base = array()) {
$uriBase = array(
@@ -259,7 +259,7 @@ protected function _decodeChunkedBody($body) {
* Parses an array based header.
*
* @param array $header Header as an indexed array (field => value)
* @return array Parsed header
* @return array|bool Parsed header
*/
protected function _parseHeader($header) {
if (is_array($header)) {
@@ -581,10 +581,10 @@ public function mime() {
*/
public function clearStatCache($all = false) {
if ($all === false && version_compare(PHP_VERSION, '5.3.0') >= 0) {
return clearstatcache(true, $this->path);
clearstatcache(true, $this->path);
}
return clearstatcache();
clearstatcache();
}
/**
@@ -323,7 +323,7 @@ public static function isAbsolute($path) {
* Returns true if given $path is a registered stream wrapper.
*
* @param string $path Path to check
* @return boo true If path is registered stream wrapper.
* @return bool true If path is registered stream wrapper.
*/
public static function isRegisteredStreamWrapper($path) {
if (preg_match('/^[A-Z]+(?=:\/\/)/i', $path, $matches) &&
@@ -34,9 +34,9 @@ class Sanitize {
/**
* Removes any non-alphanumeric characters.
*
* @param string $string String to sanitize
* @param string|array $string String to sanitize
* @param array $allowed An array of additional characters that are not to be removed.
* @return string Sanitized string
* @return string|array Sanitized string
*/
public static function paranoid($string, $allowed = array()) {
$allow = null;

0 comments on commit 31b13ed

Please sign in to comment.