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
This commit is contained in:
LustyRain 2017-10-04 00:22:42 +09:00
parent 1b364176ff
commit 31b13edf8a
18 changed files with 31 additions and 30 deletions

View file

@ -60,7 +60,7 @@ class ConsoleErrorHandler {
)); ));
$code = $exception->getCode(); $code = $exception->getCode();
$code = ($code && is_int($code)) ? $code : 1; $code = ($code && is_int($code)) ? $code : 1;
return $this->_stop($code); $this->_stop($code);
} }
/** /**
@ -88,7 +88,7 @@ class ConsoleErrorHandler {
} }
if ($log === LOG_ERR) { if ($log === LOG_ERR) {
return $this->_stop(1); $this->_stop(1);
} }
} }

View file

@ -415,7 +415,7 @@ class Shell extends CakeObject {
* @param string $command The command name to run on this shell. If this argument is empty, * @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. * 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. * @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 * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand
*/ */
public function runCommand($command, $argv) { public function runCommand($command, $argv) {
@ -469,7 +469,7 @@ class Shell extends CakeObject {
* Display the help in the correct format * Display the help in the correct format
* *
* @param string $command The command to get help for. * @param string $command The command to get help for.
* @return void * @return int|bool
*/ */
protected function _displayHelp($command) { protected function _displayHelp($command) {
$format = 'text'; $format = 'text';
@ -571,7 +571,7 @@ class Shell extends CakeObject {
* @param string $prompt Prompt text. * @param string $prompt Prompt text.
* @param string|array $options Array or string of options. * @param string|array $options Array or string of options.
* @param string $default Default input value. * @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) { protected function _getInput($prompt, $options, $default) {
if (!is_array($options)) { if (!is_array($options)) {
@ -726,7 +726,7 @@ class Shell extends CakeObject {
* *
* @param string $title Title of the error * @param string $title Title of the error
* @param string $message An optional error message * @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 * @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error
*/ */
public function error($title, $message = null) { public function error($title, $message = null) {

View file

@ -52,7 +52,7 @@ class DbAcl extends CakeObject implements AclInterface {
/** /**
* Initializes the containing component and sets the Aro/Aco objects to it. * 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 * @return void
*/ */
public function initialize(Component $component) { public function initialize(Component $component) {

View file

@ -136,7 +136,7 @@ class DigestAuthenticate extends BasicAuthenticate {
/** /**
* Gets the digest headers from the request/environment. * 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() { protected function _getDigest() {
$digest = env('PHP_AUTH_DIGEST'); $digest = env('PHP_AUTH_DIGEST');

View file

@ -761,7 +761,7 @@ class AuthComponent extends Component {
* *
* @param CakeRequest $request The request that contains authentication data. * @param CakeRequest $request The request that contains authentication data.
* @param CakeResponse $response The response * @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) { public function identify(CakeRequest $request, CakeResponse $response) {
if (empty($this->_authenticateObjects)) { if (empty($this->_authenticateObjects)) {

View file

@ -494,7 +494,7 @@ class CookieComponent extends Component {
* Decrypts $value using public $type method in Security class * Decrypts $value using public $type method in Security class
* *
* @param array $values Values to decrypt * @param array $values Values to decrypt
* @return string decrypted string * @return array decrypted string
*/ */
protected function _decrypt($values) { protected function _decrypt($values) {
$decrypted = array(); $decrypted = array();
@ -516,7 +516,7 @@ class CookieComponent extends Component {
* Decodes and decrypts a single value. * Decodes and decrypts a single value.
* *
* @param string $value The value to decode & decrypt. * @param string $value The value to decode & decrypt.
* @return string Decoded value. * @return string|array Decoded value.
*/ */
protected function _decode($value) { protected function _decode($value) {
$prefix = 'Q2FrZQ==.'; $prefix = 'Q2FrZQ==.';
@ -552,7 +552,7 @@ class CookieComponent extends Component {
* Maintains reading backwards compatibility with 1.x CookieComponent::_implode(). * Maintains reading backwards compatibility with 1.x CookieComponent::_implode().
* *
* @param string $string A string containing JSON encoded data, or a bare string. * @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) { protected function _explode($string) {
$first = substr($string, 0, 1); $first = substr($string, 0, 1);

View file

@ -282,7 +282,7 @@ class EmailComponent extends Component {
* If you are rendering a template this variable will be sent to the templates as `$content` * 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 $template Template to use when sending email
* @param string $layout Layout to use to enclose email body * @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) { public function send($content = null, $template = null, $layout = null) {
$lib = new CakeEmail(); $lib = new CakeEmail();

View file

@ -111,7 +111,7 @@ class CakeEvent {
/** /**
* Stops the event from being used anymore * Stops the event from being used anymore
* *
* @return void * @return bool
*/ */
public function stopPropagation() { public function stopPropagation() {
return $this->_stopped = true; return $this->_stopped = true;

View file

@ -166,7 +166,8 @@ class CakeEventManager {
*/ */
public function detach($callable, $eventKey = null) { public function detach($callable, $eventKey = null) {
if ($callable instanceof CakeEventListener) { if ($callable instanceof CakeEventListener) {
return $this->_detachSubscriber($callable, $eventKey); $this->_detachSubscriber($callable, $eventKey);
return ;
} }
if (empty($eventKey)) { if (empty($eventKey)) {
foreach (array_keys($this->_listeners) as $eventKey) { foreach (array_keys($this->_listeners) as $eventKey) {

View file

@ -432,7 +432,7 @@ class TranslateBehavior extends ModelBehavior {
* is disabled. * is disabled.
* *
* @param Model $Model Model using this behavior. * @param Model $Model Model using this behavior.
* @return void * @return bool true.
*/ */
protected function _setRuntimeData(Model $Model) { protected function _setRuntimeData(Model $Model) {
$locale = $this->_getLocale($Model); $locale = $this->_getLocale($Model);
@ -465,7 +465,7 @@ class TranslateBehavior extends ModelBehavior {
* This solves issues with saveAssociated and validate = first. * This solves issues with saveAssociated and validate = first.
* *
* @param Model $Model Model using this behavior. * @param Model $Model Model using this behavior.
* @return void * @return bool true.
*/ */
public function afterValidate(Model $Model) { public function afterValidate(Model $Model) {
$Model->data[$Model->alias] = array_merge( $Model->data[$Model->alias] = array_merge(
@ -481,7 +481,7 @@ class TranslateBehavior extends ModelBehavior {
* @param Model $Model Model the callback is called on * @param Model $Model Model the callback is called on
* @param bool $created Whether or not the save created a record. * @param bool $created Whether or not the save created a record.
* @param array $options Options passed from Model::save(). * @param array $options Options passed from Model::save().
* @return void * @return bool true.
*/ */
public function afterSave(Model $Model, $created, $options = array()) { public function afterSave(Model $Model, $created, $options = array()) {
if (!isset($this->runtime[$Model->alias]['beforeValidate']) && !isset($this->runtime[$Model->alias]['beforeSave'])) { if (!isset($this->runtime[$Model->alias]['beforeValidate']) && !isset($this->runtime[$Model->alias]['beforeSave'])) {

View file

@ -73,7 +73,7 @@ class BehaviorCollection extends ObjectCollection implements CakeEventListener {
* *
* @param string $behavior Behavior name. * @param string $behavior Behavior name.
* @param array $config Configuration options. * @param array $config Configuration options.
* @return void * @return bool true.
* @deprecated 3.0.0 Will be removed in 3.0. Replaced with load(). * @deprecated 3.0.0 Will be removed in 3.0. Replaced with load().
*/ */
public function attach($behavior, $config = array()) { public function attach($behavior, $config = array()) {
@ -97,7 +97,7 @@ class BehaviorCollection extends ObjectCollection implements CakeEventListener {
* *
* @param string $behavior CamelCased name of the behavior to load * @param string $behavior CamelCased name of the behavior to load
* @param array $config Behavior configuration parameters * @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. * @throws MissingBehaviorException when a behavior could not be found.
*/ */
public function load($behavior, $config = array()) { public function load($behavior, $config = array()) {
@ -204,7 +204,7 @@ class BehaviorCollection extends ObjectCollection implements CakeEventListener {
* @deprecated 3.0.0 Will be removed in 3.0. Use unload instead. * @deprecated 3.0.0 Will be removed in 3.0. Use unload instead.
*/ */
public function detach($name) { public function detach($name) {
return $this->unload($name); $this->unload($name);
} }
/** /**

View file

@ -212,7 +212,7 @@ class Sqlite extends DboSource {
* @param array $fields The fields to update. * @param array $fields The fields to update.
* @param array $values The values to set columns to. * @param array $values The values to set columns to.
* @param mixed $conditions array of conditions to use. * @param mixed $conditions array of conditions to use.
* @return array * @return bool
*/ */
public function update(Model $model, $fields = array(), $values = null, $conditions = null) { public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
if (empty($values) && !empty($fields)) { if (empty($values) && !empty($fields)) {

View file

@ -234,7 +234,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
* actually run validation rules over data, not just return the messages. * 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 * @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 * @triggers Model.afterValidate $model
* @see ModelValidator::validates() * @see ModelValidator::validates()
*/ */

View file

@ -760,7 +760,7 @@ class HttpSocket extends CakeSocket {
* *
* @param string|array $uri URI to parse * @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. * @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()) { protected function _parseUri($uri = null, $base = array()) {
$uriBase = array( $uriBase = array(

View file

@ -259,7 +259,7 @@ class HttpSocketResponse implements ArrayAccess {
* Parses an array based header. * Parses an array based header.
* *
* @param array $header Header as an indexed array (field => value) * @param array $header Header as an indexed array (field => value)
* @return array Parsed header * @return array|bool Parsed header
*/ */
protected function _parseHeader($header) { protected function _parseHeader($header) {
if (is_array($header)) { if (is_array($header)) {

View file

@ -581,10 +581,10 @@ class File {
*/ */
public function clearStatCache($all = false) { public function clearStatCache($all = false) {
if ($all === false && version_compare(PHP_VERSION, '5.3.0') >= 0) { if ($all === false && version_compare(PHP_VERSION, '5.3.0') >= 0) {
return clearstatcache(true, $this->path); clearstatcache(true, $this->path);
} }
return clearstatcache(); clearstatcache();
} }
/** /**

View file

@ -323,7 +323,7 @@ class Folder {
* Returns true if given $path is a registered stream wrapper. * Returns true if given $path is a registered stream wrapper.
* *
* @param string $path Path to check * @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) { public static function isRegisteredStreamWrapper($path) {
if (preg_match('/^[A-Z]+(?=:\/\/)/i', $path, $matches) && if (preg_match('/^[A-Z]+(?=:\/\/)/i', $path, $matches) &&

View file

@ -34,9 +34,9 @@ class Sanitize {
/** /**
* Removes any non-alphanumeric characters. * 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. * @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()) { public static function paranoid($string, $allowed = array()) {
$allow = null; $allow = null;