From c7e8d8b900ff7eae6def790f6b094e96f59e58af Mon Sep 17 00:00:00 2001 From: Alexander Mohorev Date: Mon, 3 Mar 2014 20:50:44 +0300 Subject: [PATCH] @param, @var, @property and @return must declare types as boolean, integer, string, array or null --- apps/advanced/common/models/User.php | 2 +- apps/basic/models/User.php | 2 +- build/controllers/PhpDocController.php | 2 +- extensions/apidoc/helpers/ApiMarkdown.php | 2 +- extensions/bootstrap/NavBar.php | 2 +- extensions/bootstrap/Progress.php | 2 +- extensions/elasticsearch/Command.php | 2 +- extensions/elasticsearch/Connection.php | 2 +- extensions/redis/Connection.php | 4 ++-- extensions/sphinx/Query.php | 2 +- framework/base/ErrorException.php | 4 ++-- framework/db/BaseActiveRecord.php | 2 +- framework/db/Query.php | 4 ++-- framework/helpers/BaseConsole.php | 14 +++++++------- framework/helpers/BaseInflector.php | 8 ++++---- framework/i18n/MessageFormatter.php | 2 +- framework/requirements/YiiRequirementChecker.php | 2 +- framework/web/AssetConverter.php | 2 +- framework/widgets/LinkPager.php | 2 +- .../elasticsearch/ElasticSearchTestCase.php | 2 +- tests/unit/extensions/redis/RedisTestCase.php | 2 +- tests/unit/extensions/sphinx/SphinxTestCase.php | 8 ++++---- tests/unit/framework/caching/CacheTestCase.php | 2 +- tests/unit/framework/caching/DbCacheTest.php | 2 +- tests/unit/framework/db/DatabaseTestCase.php | 4 ++-- 25 files changed, 41 insertions(+), 41 deletions(-) diff --git a/apps/advanced/common/models/User.php b/apps/advanced/common/models/User.php index fc745320e8..b9d1e5090c 100644 --- a/apps/advanced/common/models/User.php +++ b/apps/advanced/common/models/User.php @@ -132,7 +132,7 @@ class User extends ActiveRecord implements IdentityInterface * Validates password * * @param string $password password to validate - * @return bool if password provided is valid for current user + * @return boolean if password provided is valid for current user */ public function validatePassword($password) { diff --git a/apps/basic/models/User.php b/apps/basic/models/User.php index b890e6934e..1ecbc68146 100644 --- a/apps/basic/models/User.php +++ b/apps/basic/models/User.php @@ -76,7 +76,7 @@ class User extends \yii\base\Object implements \yii\web\IdentityInterface * Validates password * * @param string $password password to validate - * @return bool if password provided is valid for current user + * @return boolean if password provided is valid for current user */ public function validatePassword($password) { diff --git a/build/controllers/PhpDocController.php b/build/controllers/PhpDocController.php index 562b4794bf..e1ebe51753 100644 --- a/build/controllers/PhpDocController.php +++ b/build/controllers/PhpDocController.php @@ -24,7 +24,7 @@ class PhpDocController extends Controller public $defaultAction = 'property'; /** - * @var bool whether to update class docs directly. Setting this to false will just output docs + * @var boolean whether to update class docs directly. Setting this to false will just output docs * for copy and paste. */ public $updateFiles = true; diff --git a/extensions/apidoc/helpers/ApiMarkdown.php b/extensions/apidoc/helpers/ApiMarkdown.php index 1ccf76d20b..dba4dffd08 100644 --- a/extensions/apidoc/helpers/ApiMarkdown.php +++ b/extensions/apidoc/helpers/ApiMarkdown.php @@ -218,7 +218,7 @@ class ApiMarkdown extends GithubMarkdown * * @param string $content * @param TypeDoc $context - * @param bool $paragraph + * @param boolean $paragraph * @return string */ public static function process($content, $context = null, $paragraph = false) diff --git a/extensions/bootstrap/NavBar.php b/extensions/bootstrap/NavBar.php index 8cc3579e90..2cdd93c0b0 100644 --- a/extensions/bootstrap/NavBar.php +++ b/extensions/bootstrap/NavBar.php @@ -70,7 +70,7 @@ class NavBar extends Widget */ public $screenReaderToggleText = 'Toggle navigation'; /** - * @var bool whether the navbar content should be included in an inner div container which by default + * @var boolean whether the navbar content should be included in an inner div container which by default * adds left and right padding. Set this to false for a 100% width navbar. */ public $renderInnerContainer = true; diff --git a/extensions/bootstrap/Progress.php b/extensions/bootstrap/Progress.php index 8f23a58892..fbfe135b89 100644 --- a/extensions/bootstrap/Progress.php +++ b/extensions/bootstrap/Progress.php @@ -133,7 +133,7 @@ class Progress extends Widget /** * Generates a bar - * @param int $percent the percentage of the bar + * @param integer $percent the percentage of the bar * @param string $label, optional, the label to display at the bar * @param array $options the HTML attributes of the bar * @return string the rendering result. diff --git a/extensions/elasticsearch/Command.php b/extensions/elasticsearch/Command.php index 9ea4a6019f..7231991e10 100644 --- a/extensions/elasticsearch/Command.php +++ b/extensions/elasticsearch/Command.php @@ -364,7 +364,7 @@ class Command extends Component * @param $pattern * @param $settings * @param $mappings - * @param int $order + * @param integer $order * @return mixed * @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html */ diff --git a/extensions/elasticsearch/Connection.php b/extensions/elasticsearch/Connection.php index 75de7a3bf1..4e305cd83a 100644 --- a/extensions/elasticsearch/Connection.php +++ b/extensions/elasticsearch/Connection.php @@ -29,7 +29,7 @@ class Connection extends Component const EVENT_AFTER_OPEN = 'afterOpen'; /** - * @var bool whether to autodetect available cluster nodes on [[open()]] + * @var boolean whether to autodetect available cluster nodes on [[open()]] */ public $autodetectCluster = true; /** diff --git a/extensions/redis/Connection.php b/extensions/redis/Connection.php index b8bbde2149..3a63610c00 100644 --- a/extensions/redis/Connection.php +++ b/extensions/redis/Connection.php @@ -45,7 +45,7 @@ class Connection extends Component */ public $hostname = 'localhost'; /** - * @var int the port to use for connecting to the redis server. Default port is 6379. + * @var integer the port to use for connecting to the redis server. Default port is 6379. */ public $port = 6379; /** @@ -54,7 +54,7 @@ class Connection extends Component */ public $password; /** - * @var int the redis database to use. This is an integer value starting from 0. Defaults to 0. + * @var integer the redis database to use. This is an integer value starting from 0. Defaults to 0. */ public $database = 0; /** diff --git a/extensions/sphinx/Query.php b/extensions/sphinx/Query.php index 8ad7c3ae5c..ff1d499c14 100644 --- a/extensions/sphinx/Query.php +++ b/extensions/sphinx/Query.php @@ -338,7 +338,7 @@ class Query extends Component implements QueryInterface /** * Sets the value indicating whether to SELECT DISTINCT or not. - * @param bool $value whether to SELECT DISTINCT or not. + * @param boolean $value whether to SELECT DISTINCT or not. * @return static the query object itself */ public function distinct($value = true) diff --git a/framework/base/ErrorException.php b/framework/base/ErrorException.php index b89ca49f26..03bab3e3ed 100644 --- a/framework/base/ErrorException.php +++ b/framework/base/ErrorException.php @@ -66,7 +66,7 @@ class ErrorException extends Exception * Returns if error is one of fatal type. * * @param array $error error got from error_get_last() - * @return bool if error is one of fatal type + * @return boolean if error is one of fatal type */ public static function isFatalError($error) { @@ -76,7 +76,7 @@ class ErrorException extends Exception /** * Gets the exception severity. * @link http://php.net/manual/en/errorexception.getseverity.php - * @return int the severity level of the exception. + * @return integer the severity level of the exception. */ final public function getSeverity() { diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php index 2f4da5c633..8e70320887 100644 --- a/framework/db/BaseActiveRecord.php +++ b/framework/db/BaseActiveRecord.php @@ -408,7 +408,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface /** * Check whether the named relation has been populated with records. * @param string $name the relation name (case-sensitive) - * @return bool whether relation has been populated with records. + * @return boolean whether relation has been populated with records. */ public function isRelationPopulated($name) { diff --git a/framework/db/Query.php b/framework/db/Query.php index 582e7f54b5..18f8c02b3c 100644 --- a/framework/db/Query.php +++ b/framework/db/Query.php @@ -396,7 +396,7 @@ class Query extends Component implements QueryInterface /** * Sets the value indicating whether to SELECT DISTINCT or not. - * @param bool $value whether to SELECT DISTINCT or not. + * @param boolean $value whether to SELECT DISTINCT or not. * @return static the query object itself */ public function distinct($value = true) @@ -754,7 +754,7 @@ class Query extends Component implements QueryInterface /** * Appends a SQL statement using UNION operator. * @param string|Query $sql the SQL statement to be appended using UNION - * @param bool $all TRUE if using UNION ALL and FALSE if using UNION + * @param boolean $all TRUE if using UNION ALL and FALSE if using UNION * @return static the query object itself */ public function union($sql, $all = false) diff --git a/framework/helpers/BaseConsole.php b/framework/helpers/BaseConsole.php index 8d37058f61..458f212958 100644 --- a/framework/helpers/BaseConsole.php +++ b/framework/helpers/BaseConsole.php @@ -123,7 +123,7 @@ class BaseConsole /** * Scrolls whole page up by sending ANSI control code SU to the terminal. * New lines are added at the bottom. This is not supported by ANSI.SYS used in windows. - * @param int $lines number of lines to scroll up + * @param integer $lines number of lines to scroll up */ public static function scrollUp($lines = 1) { @@ -133,7 +133,7 @@ class BaseConsole /** * Scrolls whole page down by sending ANSI control code SD to the terminal. * New lines are added at the top. This is not supported by ANSI.SYS used in windows. - * @param int $lines number of lines to scroll down + * @param integer $lines number of lines to scroll down */ public static function scrollDown($lines = 1) { @@ -474,7 +474,7 @@ class BaseConsole * colorcodes will just be removed (And %% will be transformed into %) * * @param string $string String to convert - * @param bool $colored Should the string be colored? + * @param boolean $colored Should the string be colored? * @return string */ // TODO rework/refactor according to https://github.com/yiisoft/yii2/issues/746 @@ -554,7 +554,7 @@ class BaseConsole * - not tty consoles * * @param mixed $stream - * @return bool true if the stream supports ANSI colors, otherwise false. + * @return boolean true if the stream supports ANSI colors, otherwise false. */ public static function streamSupportsAnsiColors($stream) { @@ -575,7 +575,7 @@ class BaseConsole /** * Usage: list($width, $height) = ConsoleHelper::getScreenSize(); * - * @param bool $refresh whether to force checking and not re-use cached size value. + * @param boolean $refresh whether to force checking and not re-use cached size value. * This is useful to detect changing window size while the application is running but may * not get up to date values on every terminal. * @return array|boolean An array of ($width, $height) or false when it was not able to determine size. @@ -617,7 +617,7 @@ class BaseConsole /** * Gets input from STDIN and returns a string right-trimmed for EOLs. * - * @param bool $raw If set to true, returns the raw string without trimming + * @param boolean $raw If set to true, returns the raw string without trimming * @return string the string read from stdin */ public static function stdin($raw = false) @@ -898,7 +898,7 @@ class BaseConsole * @param string|boolean $remove This can be `false` to leave the progress bar on screen and just print a newline. * If set to `true`, the line of the progress bar will be cleared. This may also be a string to be displayed instead * of the progress bar. - * @param bool $keepPrefix whether to keep the prefix that has been specified for the progressbar when progressbar + * @param boolean $keepPrefix whether to keep the prefix that has been specified for the progressbar when progressbar * gets removed. Defaults to true. * @see startProgress * @see updateProgress diff --git a/framework/helpers/BaseInflector.php b/framework/helpers/BaseInflector.php index 3865588b91..1988945c20 100644 --- a/framework/helpers/BaseInflector.php +++ b/framework/helpers/BaseInflector.php @@ -332,7 +332,7 @@ class BaseInflector * Converts an underscored or CamelCase word into a English * sentence. * @param string $words - * @param bool $ucAll whether to set all words to uppercase + * @param boolean $ucAll whether to set all words to uppercase * @return string */ public static function titleize($words, $ucAll = false) @@ -415,7 +415,7 @@ class BaseInflector /** * Returns a human-readable string from $word * @param string $word the string to humanize - * @param bool $ucAll whether to set all words to uppercase or not + * @param boolean $ucAll whether to set all words to uppercase or not * @return string */ public static function humanize($word, $ucAll = false) @@ -455,7 +455,7 @@ class BaseInflector * [[$transliteration]] array. * @param string $string An arbitrary string to convert * @param string $replacement The replacement to use for spaces - * @param bool $lowercase whether to return the string in lowercase or not. Defaults to `true`. + * @param boolean $lowercase whether to return the string in lowercase or not. Defaults to `true`. * @return string The converted string. */ public static function slug($string, $replacement = '-', $lowercase = true) @@ -484,7 +484,7 @@ class BaseInflector /** * Converts number to its ordinal English form. For example, converts 13 to 13th, 2 to 2nd ... - * @param int $number the number to get its ordinal value + * @param integer $number the number to get its ordinal value * @return string */ public static function ordinalize($number) diff --git a/framework/i18n/MessageFormatter.php b/framework/i18n/MessageFormatter.php index 4ea70832e9..f103cf5ca7 100644 --- a/framework/i18n/MessageFormatter.php +++ b/framework/i18n/MessageFormatter.php @@ -259,7 +259,7 @@ class MessageFormatter extends Component /** * Tokenizes a pattern by separating normal text from replaceable patterns * @param string $pattern patter to tokenize - * @return array|bool array of tokens or false on failure + * @return array|boolean array of tokens or false on failure */ private static function tokenizePattern($pattern) { diff --git a/framework/requirements/YiiRequirementChecker.php b/framework/requirements/YiiRequirementChecker.php index f0c740391b..4b009402f7 100644 --- a/framework/requirements/YiiRequirementChecker.php +++ b/framework/requirements/YiiRequirementChecker.php @@ -320,7 +320,7 @@ class YiiRequirementChecker /** * Normalizes requirement ensuring it has correct format. * @param array $requirement raw requirement. - * @param int $requirementKey requirement key in the list. + * @param integer $requirementKey requirement key in the list. * @return array normalized requirement. */ function normalizeRequirement($requirement, $requirementKey = 0) diff --git a/framework/web/AssetConverter.php b/framework/web/AssetConverter.php index 1b7d1c84d6..ec2d53c54f 100644 --- a/framework/web/AssetConverter.php +++ b/framework/web/AssetConverter.php @@ -64,7 +64,7 @@ class AssetConverter extends Component implements AssetConverterInterface * @param string $basePath asset base path and command working directory * @param string $asset the name of the asset file * @param string $result the name of the file to be generated by the converter command - * @return bool true on success, false on failure. Failures will be logged. + * @return boolean true on success, false on failure. Failures will be logged. * @throws \yii\base\Exception when the command fails and YII_DEBUG is true. * In production mode the error will be logged. */ diff --git a/framework/widgets/LinkPager.php b/framework/widgets/LinkPager.php index a2c905c731..c5b1750898 100644 --- a/framework/widgets/LinkPager.php +++ b/framework/widgets/LinkPager.php @@ -90,7 +90,7 @@ class LinkPager extends Widget */ public $lastPageLabel; /** - * @var bool whether to register link tags in the HTML header for prev, next, first and last page. + * @var boolean whether to register link tags in the HTML header for prev, next, first and last page. * Defaults to `false` to avoid conflicts when multiple pagers are used on one page. * @see http://www.w3.org/TR/html401/struct/links.html#h-12.1.2 * @see registerLinkTags() diff --git a/tests/unit/extensions/elasticsearch/ElasticSearchTestCase.php b/tests/unit/extensions/elasticsearch/ElasticSearchTestCase.php index c74ad4b85b..fb16e33388 100644 --- a/tests/unit/extensions/elasticsearch/ElasticSearchTestCase.php +++ b/tests/unit/extensions/elasticsearch/ElasticSearchTestCase.php @@ -35,7 +35,7 @@ class ElasticSearchTestCase extends TestCase } /** - * @param bool $reset whether to clean up the test database + * @param boolean $reset whether to clean up the test database * @return Connection */ public function getConnection($reset = true) diff --git a/tests/unit/extensions/redis/RedisTestCase.php b/tests/unit/extensions/redis/RedisTestCase.php index 265c52b070..2a29ddf275 100644 --- a/tests/unit/extensions/redis/RedisTestCase.php +++ b/tests/unit/extensions/redis/RedisTestCase.php @@ -31,7 +31,7 @@ abstract class RedisTestCase extends TestCase } /** - * @param bool $reset whether to clean up the test database + * @param boolean $reset whether to clean up the test database * @return Connection */ public function getConnection($reset = true) diff --git a/tests/unit/extensions/sphinx/SphinxTestCase.php b/tests/unit/extensions/sphinx/SphinxTestCase.php index 89e96920c4..1c756cc3dd 100644 --- a/tests/unit/extensions/sphinx/SphinxTestCase.php +++ b/tests/unit/extensions/sphinx/SphinxTestCase.php @@ -82,8 +82,8 @@ class SphinxTestCase extends TestCase } /** - * @param bool $reset whether to clean up the test database - * @param bool $open whether to open test database + * @param boolean $reset whether to clean up the test database + * @param boolean $open whether to open test database * @return \yii\sphinx\Connection */ public function getConnection($reset = false, $open = true) @@ -119,8 +119,8 @@ class SphinxTestCase extends TestCase } /** - * @param bool $reset whether to clean up the test database - * @param bool $open whether to open and populate test database + * @param boolean $reset whether to clean up the test database + * @param boolean $open whether to open and populate test database * @return \yii\db\Connection */ public function getDbConnection($reset = true, $open = true) diff --git a/tests/unit/framework/caching/CacheTestCase.php b/tests/unit/framework/caching/CacheTestCase.php index afd514def3..0a8737df92 100644 --- a/tests/unit/framework/caching/CacheTestCase.php +++ b/tests/unit/framework/caching/CacheTestCase.php @@ -22,7 +22,7 @@ use yii\caching\Cache; abstract class CacheTestCase extends TestCase { /** - * @var int virtual time to be returned by mocked time() function. + * @var integer virtual time to be returned by mocked time() function. * Null means normal time() behavior. */ public static $time; diff --git a/tests/unit/framework/caching/DbCacheTest.php b/tests/unit/framework/caching/DbCacheTest.php index c2d03e29a6..bfb30faeaf 100644 --- a/tests/unit/framework/caching/DbCacheTest.php +++ b/tests/unit/framework/caching/DbCacheTest.php @@ -34,7 +34,7 @@ class DbCacheTest extends CacheTestCase } /** - * @param bool $reset whether to clean up the test database + * @param boolean $reset whether to clean up the test database * @return \yii\db\Connection */ public function getConnection($reset = true) diff --git a/tests/unit/framework/db/DatabaseTestCase.php b/tests/unit/framework/db/DatabaseTestCase.php index 8ef12347d8..f751e0f506 100644 --- a/tests/unit/framework/db/DatabaseTestCase.php +++ b/tests/unit/framework/db/DatabaseTestCase.php @@ -35,8 +35,8 @@ abstract class DatabaseTestCase extends TestCase } /** - * @param bool $reset whether to clean up the test database - * @param bool $open whether to open and populate test database + * @param boolean $reset whether to clean up the test database + * @param boolean $open whether to open and populate test database * @return \yii\db\Connection */ public function getConnection($reset = true, $open = true)