Skip to content

Commit

Permalink
Use callable as type name instead of callback in phpdoc (#4378)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob006 committed Oct 6, 2021
1 parent d2ad6cd commit 3792709
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion framework/YiiBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public static function t($category,$message,$params=array(),$source=null,$langua
* Registers a new class autoloader.
* The new autoloader will be placed before {@link autoload} and after
* any other existing autoloaders.
* @param callback $callback a valid PHP callback (function name or array($className,$methodName)).
* @param callable $callback a valid PHP callback (function name or array($className,$methodName)).
* @param boolean $append whether to append the new autoloader after the default Yii autoloader.
* Be careful using this option as it will disable {@link enableIncludePath autoloading via include path}
* when set to true. After this the Yii autoloader can not rely on loading classes via simple include anymore
Expand Down
4 changes: 2 additions & 2 deletions framework/base/CComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public function getEventHandlers($name)
* makes the handler to be invoked first.
*
* @param string $name the event name
* @param callback $handler the event handler
* @param callable $handler the event handler
* @throws CException if the event is not defined
* @see detachEventHandler
*/
Expand All @@ -520,7 +520,7 @@ public function attachEventHandler($name,$handler)
* Detaches an existing event handler.
* This method is the opposite of {@link attachEventHandler}.
* @param string $name event name
* @param callback $handler the event handler to be removed
* @param callable $handler the event handler to be removed
* @return boolean if the detachment process is successful
* @see attachEventHandler
*/
Expand Down
2 changes: 1 addition & 1 deletion framework/validators/CFilterValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class CFilterValidator extends CValidator
{
/**
* @var callback the filter method
* @var callable the filter method
*/
public $filter;

Expand Down
4 changes: 2 additions & 2 deletions framework/web/CController.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ public function renderClip($name,$params=array(),$return=false)
* Note, the callback and its parameter values will be serialized and saved in cache.
* Make sure they are serializable.
*
* @param callback $callback a PHP callback which returns the needed dynamic content.
* @param callable $callback a PHP callback which returns the needed dynamic content.
* When the callback is specified as a string, it will be first assumed to be a method of the current
* controller class. If the method does not exist, it is assumed to be a global PHP function.
* Note, the callback should return the dynamic content instead of echoing it.
Expand All @@ -934,7 +934,7 @@ public function renderDynamic($callback)

/**
* This method is internally used.
* @param callback $callback a PHP callback which returns the needed dynamic content.
* @param callable $callback a PHP callback which returns the needed dynamic content.
* @param array $params parameters passed to the PHP callback
* @see renderDynamic
*/
Expand Down
4 changes: 2 additions & 2 deletions framework/web/helpers/CHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class CHtml
*/
public static $renderSpecialAttributesValue=true;
/**
* @var callback the generator used in the {@link CHtml::modelName()} method.
* @var callable the generator used in the {@link CHtml::modelName()} method.
* @since 1.1.14
*/
private static $_modelNameConverter;
Expand Down Expand Up @@ -2439,7 +2439,7 @@ public static function modelName($model)
* Set generator used in the {@link CHtml::modelName()} method. You can use the `null` value to restore default
* generator.
*
* @param callback|null $converter the new generator, the model or class name will be passed to the this callback
* @param callable|null $converter the new generator, the model or class name will be passed to this callback
* and result must be a valid value for HTML name attribute.
* @throws CException if $converter isn't a valid callback
* @since 1.1.14
Expand Down

0 comments on commit 3792709

Please sign in to comment.