mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
1b364176ff
commit
31b13edf8a
18 changed files with 31 additions and 30 deletions
|
@ -60,7 +60,7 @@ class ConsoleErrorHandler {
|
|||
));
|
||||
$code = $exception->getCode();
|
||||
$code = ($code && is_int($code)) ? $code : 1;
|
||||
return $this->_stop($code);
|
||||
$this->_stop($code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -88,7 +88,7 @@ class ConsoleErrorHandler {
|
|||
}
|
||||
|
||||
if ($log === LOG_ERR) {
|
||||
return $this->_stop(1);
|
||||
$this->_stop(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -415,7 +415,7 @@ class Shell extends CakeObject {
|
|||
* @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 @@ class Shell extends CakeObject {
|
|||
* 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 @@ class Shell extends CakeObject {
|
|||
* @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 @@ class Shell extends CakeObject {
|
|||
*
|
||||
* @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 @@ class DbAcl extends CakeObject implements AclInterface {
|
|||
/**
|
||||
* 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 @@ class DigestAuthenticate extends BasicAuthenticate {
|
|||
/**
|
||||
* 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 @@ class AuthComponent extends Component {
|
|||
*
|
||||
* @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 @@ class CookieComponent extends Component {
|
|||
* 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 @@ class CookieComponent extends Component {
|
|||
* 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 @@ class CookieComponent extends Component {
|
|||
* 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 @@ class EmailComponent extends Component {
|
|||
* 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 @@ class CakeEvent {
|
|||
/**
|
||||
* Stops the event from being used anymore
|
||||
*
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function stopPropagation() {
|
||||
return $this->_stopped = true;
|
||||
|
|
|
@ -166,7 +166,8 @@ class CakeEventManager {
|
|||
*/
|
||||
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 @@ class TranslateBehavior extends ModelBehavior {
|
|||
* 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 @@ class TranslateBehavior extends ModelBehavior {
|
|||
* 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 @@ class TranslateBehavior extends ModelBehavior {
|
|||
* @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 @@ class BehaviorCollection extends ObjectCollection implements CakeEventListener {
|
|||
*
|
||||
* @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 @@ class BehaviorCollection extends ObjectCollection implements CakeEventListener {
|
|||
*
|
||||
* @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 @@ class BehaviorCollection extends ObjectCollection implements CakeEventListener {
|
|||
* @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 @@ class Sqlite extends DboSource {
|
|||
* @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 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
* 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 @@ class HttpSocket extends CakeSocket {
|
|||
*
|
||||
* @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 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
* 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 @@ class File {
|
|||
*/
|
||||
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 @@ class Folder {
|
|||
* 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;
|
||||
|
|
Loading…
Reference in a new issue