Skip to content

Commit

Permalink
Minor adjustment.
Browse files Browse the repository at this point in the history
  • Loading branch information
romeOz committed Jun 5, 2015
1 parent 1356f74 commit f6783cf
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/rules/Between.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/CType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Call.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Contains.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Date extends Rule
{
public function __construct($format = null, $config = [])
{
$this->parentConstruct($config);
parent::__construct($config);
$this->params['format'] = $format;
}

Expand Down
2 changes: 1 addition & 1 deletion src/rules/EndsWith.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Equals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/FileExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/FileMimeTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/rules/FileSizeBetween.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/FileSizeMax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion src/rules/FileSizeMin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/In.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Length.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Max.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Min.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Regex extends Rule
{
public function __construct($regex = null, $config = [])
{
$this->parentConstruct($config);
parent::__construct($config);
$this->params['regex'] = $regex;
}

Expand Down
2 changes: 1 addition & 1 deletion src/rules/Required.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Required extends Rule

public function __construct($strict = true, $config = [])
{
$this->parentConstruct($config);
parent::__construct($config);
$this->params['strict'] = $strict;
}

Expand Down
4 changes: 1 addition & 3 deletions src/rules/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

abstract class Rule implements ObjectInterface
{
use ObjectTrait{
ObjectTrait::__construct as parentConstruct;
}
use ObjectTrait;

public $params = [];
/**
Expand Down
2 changes: 1 addition & 1 deletion src/rules/StartsWith.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f6783cf

Please sign in to comment.