Fixes #12055: Changed boolean to bool and integer to int in phpdoc

This commit is contained in:
Robert Korulczyk
2016-11-07 00:51:39 +01:00
committed by Alexander Makarov
parent 940f7c7cd4
commit 4aa935e69e
292 changed files with 1670 additions and 1670 deletions

View File

@ -29,7 +29,7 @@ class BooleanValidator extends Validator
*/
public $falseValue = '0';
/**
* @var boolean whether the comparison to [[trueValue]] and [[falseValue]] is strict.
* @var bool whether the comparison to [[trueValue]] and [[falseValue]] is strict.
* When this is true, the attribute value and type must both match those of [[trueValue]] or [[falseValue]].
* Defaults to false, meaning only the value needs to be matched.
*/

View File

@ -187,7 +187,7 @@ class CompareValidator extends Validator
* @param string $type the type of the values being compared
* @param mixed $value the value being compared
* @param mixed $compareValue another value being compared
* @return boolean whether the comparison using the specified operator is true.
* @return bool whether the comparison using the specified operator is true.
*/
protected function compareValues($operator, $type, $value, $compareValue)
{

View File

@ -157,7 +157,7 @@ class DateValidator extends Validator
*/
public $timestampAttributeTimeZone = 'UTC';
/**
* @var integer|string upper limit of the date. Defaults to null, meaning no upper limit.
* @var int|string upper limit of the date. Defaults to null, meaning no upper limit.
* This can be a unix timestamp or a string representing a date time value.
* If this property is a string, [[format]] will be used to parse it.
* @see tooBig for the customized message used when the date is too big.
@ -165,7 +165,7 @@ class DateValidator extends Validator
*/
public $max;
/**
* @var integer|string lower limit of the date. Defaults to null, meaning no lower limit.
* @var int|string lower limit of the date. Defaults to null, meaning no lower limit.
* This can be a unix timestamp or a string representing a date time value.
* If this property is a string, [[format]] will be used to parse it.
* @see tooSmall for the customized message used when the date is too small.
@ -314,7 +314,7 @@ class DateValidator extends Validator
* Parses date string into UNIX timestamp
*
* @param string $value string representing date
* @return integer|false a UNIX timestamp or `false` on failure.
* @return int|false a UNIX timestamp or `false` on failure.
*/
protected function parseDateValue($value)
{
@ -327,7 +327,7 @@ class DateValidator extends Validator
*
* @param string $value string representing date
* @param string $format expected date format
* @return integer|false a UNIX timestamp or `false` on failure.
* @return int|false a UNIX timestamp or `false` on failure.
*/
private function parseDateValueFormat($value, $format)
{
@ -351,7 +351,7 @@ class DateValidator extends Validator
* Parses a date value using the IntlDateFormatter::parse()
* @param string $value string representing date
* @param string $format the expected date format
* @return integer|boolean a UNIX timestamp or `false` on failure.
* @return int|bool a UNIX timestamp or `false` on failure.
* @throws InvalidConfigException
*/
private function parseDateValueIntl($value, $format)
@ -389,7 +389,7 @@ class DateValidator extends Validator
* Parses a date value using the DateTime::createFromFormat()
* @param string $value string representing date
* @param string $format the expected date format
* @return integer|boolean a UNIX timestamp or `false` on failure.
* @return int|bool a UNIX timestamp or `false` on failure.
*/
private function parseDateValuePHP($value, $format)
{
@ -410,7 +410,7 @@ class DateValidator extends Validator
/**
* Formats a timestamp using the specified format
* @param integer $timestamp
* @param int $timestamp
* @param string $format
* @return string
*/

View File

@ -32,7 +32,7 @@ class DefaultValueValidator extends Validator
*/
public $value;
/**
* @var boolean this property is overwritten to be false so that this validator will
* @var bool this property is overwritten to be false so that this validator will
* be applied when the value being validated is empty.
*/
public $skipOnEmpty = false;

View File

@ -55,7 +55,7 @@ class EachValidator extends Validator
*/
public $rule;
/**
* @var boolean whether to use error message composed by validator declared via [[rule]] if its validation fails.
* @var bool whether to use error message composed by validator declared via [[rule]] if its validation fails.
* If enabled, error message specified for this validator itself will appear only if attribute value is not an array.
* If disabled, own error message value will be used always.
*/

View File

@ -32,18 +32,18 @@ class EmailValidator extends Validator
*/
public $fullPattern = '/^[^@]*<[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?>$/';
/**
* @var boolean whether to allow name in the email address (e.g. "John Smith <john.smith@example.com>"). Defaults to false.
* @var bool whether to allow name in the email address (e.g. "John Smith <john.smith@example.com>"). Defaults to false.
* @see fullPattern
*/
public $allowName = false;
/**
* @var boolean whether to check whether the email's domain exists and has either an A or MX record.
* @var bool whether to check whether the email's domain exists and has either an A or MX record.
* Be aware that this check can fail due to temporary DNS problems even if the email address is
* valid and an email would be deliverable. Defaults to false.
*/
public $checkDNS = false;
/**
* @var boolean whether validation process should take into account IDN (internationalized domain
* @var bool whether validation process should take into account IDN (internationalized domain
* names). Defaults to false meaning that validation of emails containing IDN will always fail.
* Note that in order to use IDN validation you have to install and enable `intl` PHP extension,
* otherwise an exception would be thrown.

View File

@ -62,7 +62,7 @@ class ExistValidator extends Validator
*/
public $filter;
/**
* @var boolean whether to allow array type attribute.
* @var bool whether to allow array type attribute.
*/
public $allowArray = false;

View File

@ -19,7 +19,7 @@ use yii\helpers\FileHelper;
*
* Note that you should enable `fileinfo` PHP extension.
*
* @property integer $sizeLimit The size limit for uploaded files. This property is read-only.
* @property int $sizeLimit The size limit for uploaded files. This property is read-only.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
@ -36,7 +36,7 @@ class FileValidator extends Validator
*/
public $extensions;
/**
* @var boolean whether to check file type (extension) with mime-type. If extension produced by
* @var bool whether to check file type (extension) with mime-type. If extension produced by
* file mime-type check differs from uploaded file extension, the file will be considered as invalid.
*/
public $checkExtensionByMimeType = true;
@ -51,13 +51,13 @@ class FileValidator extends Validator
*/
public $mimeTypes;
/**
* @var integer the minimum number of bytes required for the uploaded file.
* @var int the minimum number of bytes required for the uploaded file.
* Defaults to null, meaning no limit.
* @see tooSmall for the customized message for a file that is too small.
*/
public $minSize;
/**
* @var integer the maximum number of bytes required for the uploaded file.
* @var int the maximum number of bytes required for the uploaded file.
* Defaults to null, meaning no limit.
* Note, the size limit is also affected by `upload_max_filesize` and `post_max_size` INI setting
* and the 'MAX_FILE_SIZE' hidden field value. See [[getSizeLimit()]] for details.
@ -68,7 +68,7 @@ class FileValidator extends Validator
*/
public $maxSize;
/**
* @var integer the maximum file count the given attribute can hold.
* @var int the maximum file count the given attribute can hold.
* Defaults to 1, meaning single file upload. By defining a higher number,
* multiple uploads become possible. Setting it to `0` means there is no limit on
* the number of files that can be uploaded simultaneously.
@ -289,7 +289,7 @@ class FileValidator extends Validator
* - 'MAX_FILE_SIZE' hidden field
* - [[maxSize]]
*
* @return integer the size limit for uploaded files.
* @return int the size limit for uploaded files.
*/
public function getSizeLimit()
{
@ -323,7 +323,7 @@ class FileValidator extends Validator
* Converts php.ini style size to bytes
*
* @param string $sizeStr $sizeStr
* @return integer
* @return int
*/
private function sizeToBytes($sizeStr)
{
@ -345,7 +345,7 @@ class FileValidator extends Validator
/**
* Checks if given uploaded file have correct type (extension) according current validator settings.
* @param UploadedFile $file
* @return boolean
* @return bool
*/
protected function validateExtension($file)
{
@ -472,7 +472,7 @@ class FileValidator extends Validator
* Checks the mimeType of the $file against the list in the [[mimeTypes]] property
*
* @param UploadedFile $file
* @return boolean whether the $file mimeType is allowed
* @return bool whether the $file mimeType is allowed
* @throws \yii\base\InvalidConfigException
* @see mimeTypes
* @since 2.0.8

View File

@ -46,12 +46,12 @@ class FilterValidator extends Validator
*/
public $filter;
/**
* @var boolean whether the filter should be skipped if an array input is given.
* @var bool whether the filter should be skipped if an array input is given.
* If true and an array input is given, the filter will not be applied.
*/
public $skipOnArray = false;
/**
* @var boolean this property is overwritten to be false so that this validator will
* @var bool this property is overwritten to be false so that this validator will
* be applied when the value being validated is empty.
*/
public $skipOnEmpty = false;

View File

@ -27,25 +27,25 @@ class ImageValidator extends FileValidator
*/
public $notImage;
/**
* @var integer the minimum width in pixels.
* @var int the minimum width in pixels.
* Defaults to null, meaning no limit.
* @see underWidth for the customized message used when image width is too small.
*/
public $minWidth;
/**
* @var integer the maximum width in pixels.
* @var int the maximum width in pixels.
* Defaults to null, meaning no limit.
* @see overWidth for the customized message used when image width is too big.
*/
public $maxWidth;
/**
* @var integer the minimum height in pixels.
* @var int the minimum height in pixels.
* Defaults to null, meaning no limit.
* @see underHeight for the customized message used when image height is too small.
*/
public $minHeight;
/**
* @var integer the maximum width in pixels.
* @var int the maximum width in pixels.
* Defaults to null, meaning no limit.
* @see overWidth for the customized message used when image height is too big.
*/

View File

@ -84,15 +84,15 @@ class IpValidator extends Validator
'system' => ['multicast', 'linklocal', 'localhost', 'documentation'],
];
/**
* @var boolean whether the validating value can be an IPv6 address. Defaults to `true`.
* @var bool whether the validating value can be an IPv6 address. Defaults to `true`.
*/
public $ipv6 = true;
/**
* @var boolean whether the validating value can be an IPv4 address. Defaults to `true`.
* @var bool whether the validating value can be an IPv4 address. Defaults to `true`.
*/
public $ipv4 = true;
/**
* @var boolean whether the address can be an IP with CIDR subnet, like `192.168.10.0/24`.
* @var bool whether the address can be an IP with CIDR subnet, like `192.168.10.0/24`.
* The following values are possible:
*
* - `false` - the address must not have a subnet (default).
@ -101,7 +101,7 @@ class IpValidator extends Validator
*/
public $subnet = false;
/**
* @var boolean whether to add the CIDR prefix with the smallest length (32 for IPv4 and 128 for IPv6) to an
* @var bool whether to add the CIDR prefix with the smallest length (32 for IPv4 and 128 for IPv6) to an
* address without it. Works only when `subnet` is not `false`. For example:
* - `10.0.1.5` will normalized to `10.0.1.5/32`
* - `2008:db0::1` will be normalized to `2008:db0::1/128`
@ -110,12 +110,12 @@ class IpValidator extends Validator
*/
public $normalize = false;
/**
* @var boolean whether address may have a [[NEGATION_CHAR]] character at the beginning.
* @var bool whether address may have a [[NEGATION_CHAR]] character at the beginning.
* Defaults to `false`.
*/
public $negation = false;
/**
* @var boolean whether to expand an IPv6 address to the full notation format.
* @var bool whether to expand an IPv6 address to the full notation format.
* Defaults to `false`.
*/
public $expandIPv6 = false;
@ -427,8 +427,8 @@ class IpValidator extends Validator
* The method checks whether the IP address with specified CIDR is allowed according to the [[ranges]] list.
*
* @param string $ip
* @param integer $cidr
* @return boolean
* @param int $cidr
* @return bool
* @see ranges
*/
private function isAllowed($ip, $cidr)
@ -451,7 +451,7 @@ class IpValidator extends Validator
* Parses IP address/range for the negation with [[NEGATION_CHAR]].
*
* @param $string
* @return array `[0 => boolean, 1 => string]`
* @return array `[0 => bool, 1 => string]`
* - boolean: whether the string is negated
* - string: the string without negation (when the negation were present)
*/
@ -493,7 +493,7 @@ class IpValidator extends Validator
* Validates IPv4 address
*
* @param string $value
* @return boolean
* @return bool
*/
protected function validateIPv4($value)
{
@ -504,7 +504,7 @@ class IpValidator extends Validator
* Validates IPv6 address
*
* @param string $value
* @return boolean
* @return bool
*/
protected function validateIPv6($value)
{
@ -515,7 +515,7 @@ class IpValidator extends Validator
* Gets the IP version
*
* @param string $ip
* @return integer
* @return int
*/
private function getIpVersion($ip)
{
@ -535,9 +535,9 @@ class IpValidator extends Validator
* Checks whether the IP is in subnet range
*
* @param string $ip an IPv4 or IPv6 address
* @param integer $cidr
* @param int $cidr
* @param string $range subnet in CIDR format e.g. `10.0.0.0/8` or `2001:af::/64`
* @return boolean
* @return bool
*/
private function inRange($ip, $cidr, $range)
{
@ -605,8 +605,8 @@ class IpValidator extends Validator
'ipv4Pattern' => new JsExpression(Html::escapeJsRegularExpression($this->ipv4Pattern)),
'ipv6Pattern' => new JsExpression(Html::escapeJsRegularExpression($this->ipv6Pattern)),
'messages' => $messages,
'ipv4' => (boolean)$this->ipv4,
'ipv6' => (boolean)$this->ipv6,
'ipv4' => (bool) $this->ipv4,
'ipv6' => (bool) $this->ipv6,
'ipParsePattern' => new JsExpression(Html::escapeJsRegularExpression($this->getIpParsePattern())),
'negation' => $this->negation,
'subnet' => $this->subnet,

View File

@ -24,16 +24,16 @@ use yii\helpers\Json;
class NumberValidator extends Validator
{
/**
* @var boolean whether the attribute value can only be an integer. Defaults to false.
* @var bool whether the attribute value can only be an integer. Defaults to false.
*/
public $integerOnly = false;
/**
* @var integer|float upper limit of the number. Defaults to null, meaning no upper limit.
* @var int|float upper limit of the number. Defaults to null, meaning no upper limit.
* @see tooBig for the customized message used when the number is too big.
*/
public $max;
/**
* @var integer|float lower limit of the number. Defaults to null, meaning no lower limit.
* @var int|float lower limit of the number. Defaults to null, meaning no lower limit.
* @see tooSmall for the customized message used when the number is too small.
*/
public $min;

View File

@ -36,16 +36,16 @@ class RangeValidator extends Validator
*/
public $range;
/**
* @var boolean whether the comparison is strict (both type and value must be the same)
* @var bool whether the comparison is strict (both type and value must be the same)
*/
public $strict = false;
/**
* @var boolean whether to invert the validation logic. Defaults to false. If set to true,
* @var bool whether to invert the validation logic. Defaults to false. If set to true,
* the attribute value should NOT be among the list of values defined via [[range]].
*/
public $not = false;
/**
* @var boolean whether to allow array type attribute.
* @var bool whether to allow array type attribute.
*/
public $allowArray = false;

View File

@ -28,7 +28,7 @@ class RegularExpressionValidator extends Validator
*/
public $pattern;
/**
* @var boolean whether to invert the validation logic. Defaults to false. If set to true,
* @var bool whether to invert the validation logic. Defaults to false. If set to true,
* the regular expression defined via [[pattern]] should NOT match the attribute value.
*/
public $not = false;

View File

@ -18,7 +18,7 @@ use Yii;
class RequiredValidator extends Validator
{
/**
* @var boolean whether to skip this validator if the value being validated is empty.
* @var bool whether to skip this validator if the value being validated is empty.
*/
public $skipOnEmpty = false;
/**
@ -31,7 +31,7 @@ class RequiredValidator extends Validator
*/
public $requiredValue;
/**
* @var boolean whether the comparison between the attribute value and [[requiredValue]] is strict.
* @var bool whether the comparison between the attribute value and [[requiredValue]] is strict.
* When this is true, both the values and types must match.
* Defaults to false, meaning only the values need to match.
* Note that when [[requiredValue]] is null, if this property is true, the validator will check

View File

@ -20,7 +20,7 @@ use Yii;
class StringValidator extends Validator
{
/**
* @var integer|array specifies the length limit of the value to be validated.
* @var int|array specifies the length limit of the value to be validated.
* This can be specified in one of the following forms:
*
* - an integer: the exact length that the value should be of;
@ -34,12 +34,12 @@ class StringValidator extends Validator
*/
public $length;
/**
* @var integer maximum length. If not set, it means no maximum length limit.
* @var int maximum length. If not set, it means no maximum length limit.
* @see tooLong for the customized message for a too long string.
*/
public $max;
/**
* @var integer minimum length. If not set, it means no minimum length limit.
* @var int minimum length. If not set, it means no minimum length limit.
* @see tooShort for the customized message for a too short string.
*/
public $min;

View File

@ -41,7 +41,7 @@ class UrlValidator extends Validator
*/
public $defaultScheme;
/**
* @var boolean whether validation process should take into account IDN (internationalized
* @var bool whether validation process should take into account IDN (internationalized
* domain names). Defaults to false meaning that validation of URLs containing IDN will always
* fail. Note that in order to use IDN validation you have to install and enable `intl` PHP
* extension, otherwise an exception would be thrown.

View File

@ -125,17 +125,17 @@ class Validator extends Component
*/
public $except = [];
/**
* @var boolean whether this validation rule should be skipped if the attribute being validated
* @var bool whether this validation rule should be skipped if the attribute being validated
* already has some validation error according to some previous rules. Defaults to true.
*/
public $skipOnError = true;
/**
* @var boolean whether this validation rule should be skipped if the attribute value
* @var bool whether this validation rule should be skipped if the attribute value
* is null or an empty string.
*/
public $skipOnEmpty = true;
/**
* @var boolean whether to enable client-side validation for this validator.
* @var bool whether to enable client-side validation for this validator.
* The actual client-side validation is done via the JavaScript code returned
* by [[clientValidateAttribute()]]. If that method returns null, even if this property
* is true, no client-side validation will be done by this validator.
@ -289,7 +289,7 @@ class Validator extends Component
* You may use this method to validate a value out of the context of a data model.
* @param mixed $value the data value to be validated.
* @param string $error the error message to be returned, if the validation fails.
* @return boolean whether the data is valid.
* @return bool whether the data is valid.
*/
public function validate($value, &$error = null)
{
@ -369,7 +369,7 @@ class Validator extends Component
* - the validator's `on` property contains the specified scenario
*
* @param string $scenario scenario name
* @return boolean whether the validator applies to the specified scenario.
* @return bool whether the validator applies to the specified scenario.
*/
public function isActive($scenario)
{
@ -405,7 +405,7 @@ class Validator extends Component
* A value is considered empty if it is null, an empty array, or an empty string.
* Note that this method is different from PHP empty(). It will return false when the value is 0.
* @param mixed $value the value to be checked
* @return boolean whether the value is empty
* @return bool whether the value is empty
*/
public function isEmpty($value)
{