mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fixes #12055: Changed boolean to bool and integer to int in phpdoc
This commit is contained in:
committed by
Alexander Makarov
parent
940f7c7cd4
commit
4aa935e69e
@ -76,13 +76,13 @@ class DbMessageSource extends MessageSource
|
||||
*/
|
||||
public $messageTable = '{{%message}}';
|
||||
/**
|
||||
* @var integer the time in seconds that the messages can remain valid in cache.
|
||||
* @var int the time in seconds that the messages can remain valid in cache.
|
||||
* Use 0 to indicate that the cached data will never expire.
|
||||
* @see enableCaching
|
||||
*/
|
||||
public $cachingDuration = 0;
|
||||
/**
|
||||
* @var boolean whether to enable caching translated messages
|
||||
* @var bool whether to enable caching translated messages
|
||||
*/
|
||||
public $enableCaching = false;
|
||||
|
||||
|
||||
@ -246,13 +246,13 @@ class Formatter extends Component
|
||||
*/
|
||||
public $currencyCode;
|
||||
/**
|
||||
* @var integer the base at which a kilobyte is calculated (1000 or 1024 bytes per kilobyte), used by [[asSize]] and [[asShortSize]].
|
||||
* @var int the base at which a kilobyte is calculated (1000 or 1024 bytes per kilobyte), used by [[asSize]] and [[asShortSize]].
|
||||
* Defaults to 1024.
|
||||
*/
|
||||
public $sizeFormatBase = 1024;
|
||||
|
||||
/**
|
||||
* @var boolean whether the [PHP intl extension](http://php.net/manual/en/book.intl.php) is loaded.
|
||||
* @var bool whether the [PHP intl extension](http://php.net/manual/en/book.intl.php) is loaded.
|
||||
*/
|
||||
private $_intlLoaded = false;
|
||||
|
||||
@ -463,7 +463,7 @@ class Formatter extends Component
|
||||
|
||||
/**
|
||||
* Formats the value as a date.
|
||||
* @param integer|string|DateTime $value the value to be formatted. The following
|
||||
* @param int|string|DateTime $value the value to be formatted. The following
|
||||
* types of value are supported:
|
||||
*
|
||||
* - an integer representing a UNIX timestamp
|
||||
@ -495,7 +495,7 @@ class Formatter extends Component
|
||||
|
||||
/**
|
||||
* Formats the value as a time.
|
||||
* @param integer|string|DateTime $value the value to be formatted. The following
|
||||
* @param int|string|DateTime $value the value to be formatted. The following
|
||||
* types of value are supported:
|
||||
*
|
||||
* - an integer representing a UNIX timestamp
|
||||
@ -527,7 +527,7 @@ class Formatter extends Component
|
||||
|
||||
/**
|
||||
* Formats the value as a datetime.
|
||||
* @param integer|string|DateTime $value the value to be formatted. The following
|
||||
* @param int|string|DateTime $value the value to be formatted. The following
|
||||
* types of value are supported:
|
||||
*
|
||||
* - an integer representing a UNIX timestamp
|
||||
@ -568,7 +568,7 @@ class Formatter extends Component
|
||||
];
|
||||
|
||||
/**
|
||||
* @param integer|string|DateTime $value the value to be formatted. The following
|
||||
* @param int|string|DateTime $value the value to be formatted. The following
|
||||
* types of value are supported:
|
||||
*
|
||||
* - an integer representing a UNIX timestamp
|
||||
@ -642,7 +642,7 @@ class Formatter extends Component
|
||||
/**
|
||||
* Normalizes the given datetime value as a DateTime object that can be taken by various date/time formatting methods.
|
||||
*
|
||||
* @param integer|string|DateTime $value the datetime value to be normalized. The following
|
||||
* @param int|string|DateTime $value the datetime value to be normalized. The following
|
||||
* types of value are supported:
|
||||
*
|
||||
* - an integer representing a UNIX timestamp
|
||||
@ -650,7 +650,7 @@ class Formatter extends Component
|
||||
* The timestamp is assumed to be in [[defaultTimeZone]] unless a time zone is explicitly given.
|
||||
* - a PHP [DateTime](http://php.net/manual/en/class.datetime.php) object
|
||||
*
|
||||
* @param boolean $checkTimeInfo whether to also check if the date/time value has some time information attached.
|
||||
* @param bool $checkTimeInfo whether to also check if the date/time value has some time information attached.
|
||||
* Defaults to `false`. If `true`, the method will then return an array with the first element being the normalized
|
||||
* timestamp and the second a boolean indicating whether the timestamp has time information or it is just a date value.
|
||||
* This parameter is available since version 2.0.1.
|
||||
@ -695,7 +695,7 @@ class Formatter extends Component
|
||||
|
||||
/**
|
||||
* Formats a date, time or datetime in a float number as UNIX timestamp (seconds since 01-01-1970).
|
||||
* @param integer|string|DateTime $value the value to be formatted. The following
|
||||
* @param int|string|DateTime $value the value to be formatted. The following
|
||||
* types of value are supported:
|
||||
*
|
||||
* - an integer representing a UNIX timestamp
|
||||
@ -723,7 +723,7 @@ class Formatter extends Component
|
||||
* 2. Using a timestamp that is relative to the `$referenceTime`.
|
||||
* 3. Using a `DateInterval` object.
|
||||
*
|
||||
* @param integer|string|DateTime|DateInterval $value the value to be formatted. The following
|
||||
* @param int|string|DateTime|DateInterval $value the value to be formatted. The following
|
||||
* types of value are supported:
|
||||
*
|
||||
* - an integer representing a UNIX timestamp
|
||||
@ -732,7 +732,7 @@ class Formatter extends Component
|
||||
* - a PHP [DateTime](http://php.net/manual/en/class.datetime.php) object
|
||||
* - a PHP DateInterval object (a positive time interval will refer to the past, a negative one to the future)
|
||||
*
|
||||
* @param integer|string|DateTime $referenceTime if specified the value is used as a reference time instead of `now`
|
||||
* @param int|string|DateTime $referenceTime if specified the value is used as a reference time instead of `now`
|
||||
* when `$value` is not a `DateInterval` object.
|
||||
* @return string the formatted result.
|
||||
* @throws InvalidParamException if the input value can not be evaluated as a date value.
|
||||
@ -819,7 +819,7 @@ class Formatter extends Component
|
||||
/**
|
||||
* Represents the value as duration in human readable format.
|
||||
*
|
||||
* @param DateInterval|string|integer $value the value to be formatted. Acceptable formats:
|
||||
* @param DateInterval|string|int $value the value to be formatted. Acceptable formats:
|
||||
* - [DateInterval object](http://php.net/manual/ru/class.dateinterval.php)
|
||||
* - integer - number of seconds. For example: value `131` represents `2 minutes, 11 seconds`
|
||||
* - ISO8601 duration format. For example, all of these values represent `1 day, 2 hours, 30 minutes` duration:
|
||||
@ -920,7 +920,7 @@ class Formatter extends Component
|
||||
* value is rounded automatically to the defined decimal digits.
|
||||
*
|
||||
* @param mixed $value the value to be formatted.
|
||||
* @param integer $decimals the number of digits after the decimal point. If not given the number of digits is determined from the
|
||||
* @param int $decimals the number of digits after the decimal point. If not given the number of digits is determined from the
|
||||
* [[locale]] and if the [PHP intl extension](http://php.net/manual/en/book.intl.php) is not available defaults to `2`.
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
@ -955,7 +955,7 @@ class Formatter extends Component
|
||||
* Formats the value as a percent number with "%" sign.
|
||||
*
|
||||
* @param mixed $value the value to be formatted. It must be a factor e.g. `0.75` will result in `75%`.
|
||||
* @param integer $decimals the number of digits after the decimal point.
|
||||
* @param int $decimals the number of digits after the decimal point.
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
* @return string the formatted result.
|
||||
@ -987,7 +987,7 @@ class Formatter extends Component
|
||||
* Formats the value as a scientific number.
|
||||
*
|
||||
* @param mixed $value the value to be formatted.
|
||||
* @param integer $decimals the number of digits after the decimal point.
|
||||
* @param int $decimals the number of digits after the decimal point.
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
* @return string the formatted result.
|
||||
@ -1125,8 +1125,8 @@ class Formatter extends Component
|
||||
* If [[sizeFormatBase]] is 1024, [binary prefixes](http://en.wikipedia.org/wiki/Binary_prefix) (e.g. kibibyte/KiB, mebibyte/MiB, ...)
|
||||
* are used in the formatting result.
|
||||
*
|
||||
* @param string|integer|float $value value in bytes to be formatted.
|
||||
* @param integer $decimals the number of digits after the decimal point.
|
||||
* @param string|int|float $value value in bytes to be formatted.
|
||||
* @param int $decimals the number of digits after the decimal point.
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
* @return string the formatted result.
|
||||
@ -1181,8 +1181,8 @@ class Formatter extends Component
|
||||
* If [[sizeFormatBase]] is 1024, [binary prefixes](http://en.wikipedia.org/wiki/Binary_prefix) (e.g. kibibyte/KiB, mebibyte/MiB, ...)
|
||||
* are used in the formatting result.
|
||||
*
|
||||
* @param string|integer|float $value value in bytes to be formatted.
|
||||
* @param integer $decimals the number of digits after the decimal point.
|
||||
* @param string|int|float $value value in bytes to be formatted.
|
||||
* @param int $decimals the number of digits after the decimal point.
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
* @return string the formatted result.
|
||||
@ -1235,8 +1235,8 @@ class Formatter extends Component
|
||||
/**
|
||||
* Given the value in bytes formats number part of the human readable form.
|
||||
*
|
||||
* @param string|integer|float $value value in bytes to be formatted.
|
||||
* @param integer $decimals the number of digits after the decimal point
|
||||
* @param string|int|float $value value in bytes to be formatted.
|
||||
* @param int $decimals the number of digits after the decimal point
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
* @return array [parameters for Yii::t containing formatted number, internal position of size unit]
|
||||
@ -1290,7 +1290,7 @@ class Formatter extends Component
|
||||
* otherwise an exception is thrown.
|
||||
*
|
||||
* @param mixed $value the input value
|
||||
* @return float|integer the normalized number value
|
||||
* @return float|int the normalized number value
|
||||
* @throws InvalidParamException if the input value is not numeric.
|
||||
*/
|
||||
protected function normalizeNumericValue($value)
|
||||
@ -1312,10 +1312,10 @@ class Formatter extends Component
|
||||
*
|
||||
* You may override this method to create a number formatter based on patterns.
|
||||
*
|
||||
* @param integer $style the type of the number formatter.
|
||||
* @param int $style the type of the number formatter.
|
||||
* Values: NumberFormatter::DECIMAL, ::CURRENCY, ::PERCENT, ::SCIENTIFIC, ::SPELLOUT, ::ORDINAL
|
||||
* ::DURATION, ::PATTERN_RULEBASED, ::DEFAULT_STYLE, ::IGNORE
|
||||
* @param integer $decimals the number of digits after the decimal point.
|
||||
* @param int $decimals the number of digits after the decimal point.
|
||||
* @param array $options optional configuration for the number formatter. This parameter will be merged with [[numberFormatterOptions]].
|
||||
* @param array $textOptions optional configuration for the number formatter. This parameter will be merged with [[numberFormatterTextOptions]].
|
||||
* @return NumberFormatter the created formatter instance
|
||||
|
||||
@ -40,11 +40,11 @@ class GettextMessageSource extends MessageSource
|
||||
*/
|
||||
public $catalog = 'messages';
|
||||
/**
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
public $useMoFile = true;
|
||||
/**
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
public $useBigEndian = false;
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ use yii\base\Exception;
|
||||
class GettextMoFile extends GettextFile
|
||||
{
|
||||
/**
|
||||
* @var boolean whether to use big-endian when reading and writing an integer.
|
||||
* @var bool whether to use big-endian when reading and writing an integer.
|
||||
*/
|
||||
public $useBigEndian = false;
|
||||
|
||||
@ -200,7 +200,7 @@ class GettextMoFile extends GettextFile
|
||||
/**
|
||||
* Reads one or several bytes.
|
||||
* @param resource $fileHandle to read from
|
||||
* @param integer $byteCount to be read
|
||||
* @param int $byteCount to be read
|
||||
* @return string bytes
|
||||
*/
|
||||
protected function readBytes($fileHandle, $byteCount = 1)
|
||||
@ -216,7 +216,7 @@ class GettextMoFile extends GettextFile
|
||||
* Write bytes.
|
||||
* @param resource $fileHandle to write to
|
||||
* @param string $bytes to be written
|
||||
* @return integer how many bytes are written
|
||||
* @return int how many bytes are written
|
||||
*/
|
||||
protected function writeBytes($fileHandle, $bytes)
|
||||
{
|
||||
@ -226,7 +226,7 @@ class GettextMoFile extends GettextFile
|
||||
/**
|
||||
* Reads a 4-byte integer.
|
||||
* @param resource $fileHandle to read from
|
||||
* @return integer the result
|
||||
* @return int the result
|
||||
*/
|
||||
protected function readInteger($fileHandle)
|
||||
{
|
||||
@ -238,8 +238,8 @@ class GettextMoFile extends GettextFile
|
||||
/**
|
||||
* Writes a 4-byte integer.
|
||||
* @param resource $fileHandle to write to
|
||||
* @param integer $integer to be written
|
||||
* @return integer how many bytes are written
|
||||
* @param int $integer to be written
|
||||
* @return int how many bytes are written
|
||||
*/
|
||||
protected function writeInteger($fileHandle, $integer)
|
||||
{
|
||||
@ -249,8 +249,8 @@ class GettextMoFile extends GettextFile
|
||||
/**
|
||||
* Reads a string.
|
||||
* @param resource $fileHandle file handle
|
||||
* @param integer $length of the string
|
||||
* @param integer $offset of the string in the file. If null, it reads from the current position.
|
||||
* @param int $length of the string
|
||||
* @param int $offset of the string in the file. If null, it reads from the current position.
|
||||
* @return string the result
|
||||
*/
|
||||
protected function readString($fileHandle, $length, $offset = null)
|
||||
@ -266,7 +266,7 @@ class GettextMoFile extends GettextFile
|
||||
* Writes a string.
|
||||
* @param resource $fileHandle to write to
|
||||
* @param string $string to be written
|
||||
* @return integer how many bytes are written
|
||||
* @return int how many bytes are written
|
||||
*/
|
||||
protected function writeString($fileHandle, $string)
|
||||
{
|
||||
|
||||
@ -79,7 +79,7 @@ class MessageFormatter extends Component
|
||||
* @param string $pattern The pattern string to insert parameters into.
|
||||
* @param array $params The array of name value pairs to insert into the format string.
|
||||
* @param string $language The locale to use for formatting locale-dependent parts
|
||||
* @return string|boolean The formatted pattern string or `FALSE` if an error occurred
|
||||
* @return string|bool The formatted pattern string or `FALSE` if an error occurred
|
||||
*/
|
||||
public function format($pattern, $params, $language)
|
||||
{
|
||||
@ -141,7 +141,7 @@ class MessageFormatter extends Component
|
||||
* @param string $pattern The pattern to use for parsing the message.
|
||||
* @param string $message The message to parse, conforming to the pattern.
|
||||
* @param string $language The locale to use for formatting locale-dependent parts
|
||||
* @return array|boolean An array containing items extracted, or `FALSE` on error.
|
||||
* @return array|bool An array containing items extracted, or `FALSE` on error.
|
||||
* @throws \yii\base\NotSupportedException when PHP intl extension is not installed.
|
||||
*/
|
||||
public function parse($pattern, $message, $language)
|
||||
@ -259,7 +259,7 @@ class MessageFormatter extends Component
|
||||
* @param string $pattern The pattern string to insert things into.
|
||||
* @param array $args The array of values to insert into the format string
|
||||
* @param string $locale The locale to use for formatting locale-dependent parts
|
||||
* @return string|boolean The formatted pattern string or `FALSE` if an error occurred
|
||||
* @return string|bool The formatted pattern string or `FALSE` if an error occurred
|
||||
*/
|
||||
protected function fallbackFormat($pattern, $args, $locale)
|
||||
{
|
||||
@ -286,7 +286,7 @@ class MessageFormatter extends Component
|
||||
/**
|
||||
* Tokenizes a pattern by separating normal text from replaceable patterns
|
||||
* @param string $pattern patter to tokenize
|
||||
* @return array|boolean array of tokens or false on failure
|
||||
* @return array|bool array of tokens or false on failure
|
||||
*/
|
||||
private static function tokenizePattern($pattern)
|
||||
{
|
||||
@ -331,7 +331,7 @@ class MessageFormatter extends Component
|
||||
* @param array $token the token to parse
|
||||
* @param array $args arguments to replace
|
||||
* @param string $locale the locale
|
||||
* @return boolean|string parsed token or false on failure
|
||||
* @return bool|string parsed token or false on failure
|
||||
* @throws \yii\base\NotSupportedException when unsupported formatting is used.
|
||||
*/
|
||||
private function parseToken($token, $args, $locale)
|
||||
|
||||
@ -28,7 +28,7 @@ class MessageSource extends Component
|
||||
const EVENT_MISSING_TRANSLATION = 'missingTranslation';
|
||||
|
||||
/**
|
||||
* @var boolean whether to force message translation when the source and target languages are the same.
|
||||
* @var bool whether to force message translation when the source and target languages are the same.
|
||||
* Defaults to false, meaning translation is only performed when source and target languages are different.
|
||||
*/
|
||||
public $forceTranslation = false;
|
||||
@ -79,7 +79,7 @@ class MessageSource extends Component
|
||||
* @param string $category the message category
|
||||
* @param string $message the message to be translated
|
||||
* @param string $language the target language
|
||||
* @return string|boolean the translated message or false if translation wasn't found or isn't required
|
||||
* @return string|bool the translated message or false if translation wasn't found or isn't required
|
||||
*/
|
||||
public function translate($category, $message, $language)
|
||||
{
|
||||
@ -98,7 +98,7 @@ class MessageSource extends Component
|
||||
* @param string $category the category that the message belongs to.
|
||||
* @param string $message the message to be translated.
|
||||
* @param string $language the target language.
|
||||
* @return string|boolean the translated message or false if translation wasn't found.
|
||||
* @return string|bool the translated message or false if translation wasn't found.
|
||||
*/
|
||||
protected function translateMessage($category, $message, $language)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user