From f6783cff5ea4ee8fa762a047b6fdeeb4f6f4e8ee Mon Sep 17 00:00:00 2001 From: romeOz Date: Fri, 5 Jun 2015 06:19:43 +0300 Subject: [PATCH] Minor adjustment. --- src/rules/Between.php | 2 +- src/rules/CType.php | 2 +- src/rules/Call.php | 2 +- src/rules/Contains.php | 2 +- src/rules/Date.php | 2 +- src/rules/EndsWith.php | 2 +- src/rules/Equals.php | 2 +- src/rules/FileExtensions.php | 2 +- src/rules/FileMimeTypes.php | 2 +- src/rules/FileSizeBetween.php | 2 +- src/rules/FileSizeMax.php | 2 +- src/rules/FileSizeMin.php | 2 +- src/rules/In.php | 2 +- src/rules/Ip.php | 2 +- src/rules/Length.php | 2 +- src/rules/Max.php | 2 +- src/rules/Min.php | 2 +- src/rules/Regex.php | 2 +- src/rules/Required.php | 2 +- src/rules/Rule.php | 4 +--- src/rules/StartsWith.php | 2 +- 21 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/rules/Between.php b/src/rules/Between.php index 59274f4..98ca505 100644 --- a/src/rules/Between.php +++ b/src/rules/Between.php @@ -12,7 +12,7 @@ public function __construct($min = null, $max = null, $inclusive = false, $confi if (!is_null($min) && !is_null($max) && $min > $max) { throw new ValidateException(sprintf('%s cannot be less than %s for validation', $min, $max)); } - $this->parentConstruct($config); + parent::__construct($config); $this->params['minValue'] = $min; $this->params['maxValue'] = $max; $this->params['inclusive'] = $inclusive; diff --git a/src/rules/CType.php b/src/rules/CType.php index 1a743ae..2a00601 100644 --- a/src/rules/CType.php +++ b/src/rules/CType.php @@ -11,7 +11,7 @@ abstract class CType extends Rule public function __construct($additionalChars = '', $config = []) { - $this->parentConstruct($config); + parent::__construct($config); if (!is_string($additionalChars)) { throw new ValidateException('Invalid list of additional characters to be loaded'); } diff --git a/src/rules/Call.php b/src/rules/Call.php index f849b96..bedbf94 100644 --- a/src/rules/Call.php +++ b/src/rules/Call.php @@ -8,7 +8,7 @@ class Call extends Rule protected $args = []; public function __construct(callable $call, array $args = null, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->call = $call; if (!empty($args)) { $this->args = $args; diff --git a/src/rules/Contains.php b/src/rules/Contains.php index fbab2f5..de8bccb 100644 --- a/src/rules/Contains.php +++ b/src/rules/Contains.php @@ -7,7 +7,7 @@ class Contains extends Rule { public function __construct($containsValue, $identical = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['containsValue'] = $containsValue; $this->params['identical'] = $identical; } diff --git a/src/rules/Date.php b/src/rules/Date.php index e4a74f6..636f6d3 100644 --- a/src/rules/Date.php +++ b/src/rules/Date.php @@ -8,7 +8,7 @@ class Date extends Rule { public function __construct($format = null, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['format'] = $format; } diff --git a/src/rules/EndsWith.php b/src/rules/EndsWith.php index e746bab..d534913 100644 --- a/src/rules/EndsWith.php +++ b/src/rules/EndsWith.php @@ -6,7 +6,7 @@ class EndsWith extends Rule { public function __construct($endValue, $identical = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['endValue'] = $endValue; $this->params['identical'] = $identical; } diff --git a/src/rules/Equals.php b/src/rules/Equals.php index 0666a63..a221a7d 100644 --- a/src/rules/Equals.php +++ b/src/rules/Equals.php @@ -6,7 +6,7 @@ class Equals extends Rule { public function __construct($compareTo, $compareIdentical = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['compareTo'] = $compareTo; $this->params['compareIdentical'] = $compareIdentical; } diff --git a/src/rules/FileExtensions.php b/src/rules/FileExtensions.php index 3211c25..46b37b0 100644 --- a/src/rules/FileExtensions.php +++ b/src/rules/FileExtensions.php @@ -10,7 +10,7 @@ class FileExtensions extends Rule { public function __construct($extensions, $checkExtensionByMimeType = true, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['extensions'] = $this->toArray($extensions); $this->params['checkExtensionByMimeType'] = $checkExtensionByMimeType; } diff --git a/src/rules/FileMimeTypes.php b/src/rules/FileMimeTypes.php index 018a9cc..f1fb340 100644 --- a/src/rules/FileMimeTypes.php +++ b/src/rules/FileMimeTypes.php @@ -8,7 +8,7 @@ class FileMimeTypes extends Rule { public function __construct($mimeTypes, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['mimeTypes'] = $this->toArray($mimeTypes); } diff --git a/src/rules/FileSizeBetween.php b/src/rules/FileSizeBetween.php index 5228e9e..2e0dfd0 100644 --- a/src/rules/FileSizeBetween.php +++ b/src/rules/FileSizeBetween.php @@ -9,7 +9,7 @@ class FileSizeBetween extends Rule { public function __construct($min = null, $max = null, $inclusive = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); if (!is_null($min) && !is_null($max) && $min > $max) { throw new ValidateException(sprintf('%s cannot be less than %s for validation', $min, $max)); } diff --git a/src/rules/FileSizeMax.php b/src/rules/FileSizeMax.php index 0a9c201..95cab29 100644 --- a/src/rules/FileSizeMax.php +++ b/src/rules/FileSizeMax.php @@ -9,7 +9,7 @@ class FileSizeMax extends Rule { public function __construct($maxValue = null, $inclusive = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['maxValue'] = class_exists('rock\file\UploadedFile') ? UploadedFile::getSizeLimit($maxValue) : FileHelper::sizeToBytes(ini_get('upload_max_filesize')); diff --git a/src/rules/FileSizeMin.php b/src/rules/FileSizeMin.php index ef67714..29c665b 100644 --- a/src/rules/FileSizeMin.php +++ b/src/rules/FileSizeMin.php @@ -9,7 +9,7 @@ class FileSizeMin extends Rule { public function __construct($minValue, $inclusive = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['minValue'] = FileHelper::sizeToBytes($minValue); $this->params['inclusive'] = $inclusive; } diff --git a/src/rules/In.php b/src/rules/In.php index 6b7b899..bb4d1f3 100644 --- a/src/rules/In.php +++ b/src/rules/In.php @@ -6,7 +6,7 @@ class In extends Rule { public function __construct($haystack, $compareIdentical = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['haystack'] = $haystack; $this->params['compareIdentical'] = $compareIdentical; } diff --git a/src/rules/Ip.php b/src/rules/Ip.php index 8e95c5c..06b9e0c 100644 --- a/src/rules/Ip.php +++ b/src/rules/Ip.php @@ -9,7 +9,7 @@ class Ip extends Rule { public function __construct($ipOptions = null, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['ipOptions'] = null; if (is_int($ipOptions)) { $this->params['ipOptions'] = $ipOptions; diff --git a/src/rules/Length.php b/src/rules/Length.php index d1eab1e..d486a3b 100644 --- a/src/rules/Length.php +++ b/src/rules/Length.php @@ -10,7 +10,7 @@ class Length extends Rule { public function __construct($min = null, $max = null, $inclusive = true, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); if (!is_numeric($min) && !is_null($min)) { throw new ValidateException(sprintf('%s is not a valid numeric length', $min)); } diff --git a/src/rules/Max.php b/src/rules/Max.php index c7b6070..584e6e3 100644 --- a/src/rules/Max.php +++ b/src/rules/Max.php @@ -7,7 +7,7 @@ class Max extends Rule { public function __construct($max, $inclusive = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['maxValue'] = $max; $this->params['inclusive'] = $inclusive; } diff --git a/src/rules/Min.php b/src/rules/Min.php index f4d0796..2bc86ee 100644 --- a/src/rules/Min.php +++ b/src/rules/Min.php @@ -11,7 +11,7 @@ class Min extends Rule { public function __construct($min, $inclusive = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['minValue'] = $min; $this->params['inclusive'] = $inclusive; } diff --git a/src/rules/Regex.php b/src/rules/Regex.php index 1fe910d..29cd7fc 100644 --- a/src/rules/Regex.php +++ b/src/rules/Regex.php @@ -7,7 +7,7 @@ class Regex extends Rule { public function __construct($regex = null, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['regex'] = $regex; } diff --git a/src/rules/Required.php b/src/rules/Required.php index 236bef8..97a1ee1 100644 --- a/src/rules/Required.php +++ b/src/rules/Required.php @@ -9,7 +9,7 @@ class Required extends Rule public function __construct($strict = true, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['strict'] = $strict; } diff --git a/src/rules/Rule.php b/src/rules/Rule.php index 1545b69..c730d5d 100644 --- a/src/rules/Rule.php +++ b/src/rules/Rule.php @@ -8,9 +8,7 @@ abstract class Rule implements ObjectInterface { - use ObjectTrait{ - ObjectTrait::__construct as parentConstruct; - } + use ObjectTrait; public $params = []; /** diff --git a/src/rules/StartsWith.php b/src/rules/StartsWith.php index 2f986d8..606eb60 100644 --- a/src/rules/StartsWith.php +++ b/src/rules/StartsWith.php @@ -6,7 +6,7 @@ class StartsWith extends Rule { public function __construct($startValue, $identical = false, $config = []) { - $this->parentConstruct($config); + parent::__construct($config); $this->params['startValue'] = $startValue; $this->params['identical'] = $identical; }