Skip to content

Commit

Permalink
Remove aligned '=>' and '='
Browse files Browse the repository at this point in the history
  • Loading branch information
polc authored and fabpot committed Oct 26, 2014
1 parent 8213195 commit bb8d86b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions Constraints/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class File extends Constraint
public $maxSizeMessage = 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.';
public $mimeTypesMessage = 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.';

public $uploadIniSizeErrorMessage = 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.';
public $uploadFormSizeErrorMessage = 'The file is too large.';
public $uploadPartialErrorMessage = 'The file was only partially uploaded.';
public $uploadNoFileErrorMessage = 'No file was uploaded.';
public $uploadNoTmpDirErrorMessage = 'No temporary folder was configured in php.ini.';
public $uploadIniSizeErrorMessage = 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.';
public $uploadFormSizeErrorMessage = 'The file is too large.';
public $uploadPartialErrorMessage = 'The file was only partially uploaded.';
public $uploadNoFileErrorMessage = 'No file was uploaded.';
public $uploadNoTmpDirErrorMessage = 'No temporary folder was configured in php.ini.';
public $uploadCantWriteErrorMessage = 'Cannot write temporary file to disk.';
public $uploadExtensionErrorMessage = 'A PHP extension caused the upload to fail.';
public $uploadErrorMessage = 'The file could not be uploaded.';
public $uploadErrorMessage = 'The file could not be uploaded.';
}
10 changes: 5 additions & 5 deletions Constraints/ImageValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function validate($value, Constraint $constraint)
return;
}

$width = $size[0];
$width = $size[0];
$height = $size[1];

if ($constraint->minWidth) {
Expand All @@ -59,7 +59,7 @@ public function validate($value, Constraint $constraint)

if ($width < $constraint->minWidth) {
$this->context->addViolation($constraint->minWidthMessage, array(
'{{ width }}' => $width,
'{{ width }}' => $width,
'{{ min_width }}' => $constraint->minWidth,
));

Expand All @@ -74,7 +74,7 @@ public function validate($value, Constraint $constraint)

if ($width > $constraint->maxWidth) {
$this->context->addViolation($constraint->maxWidthMessage, array(
'{{ width }}' => $width,
'{{ width }}' => $width,
'{{ max_width }}' => $constraint->maxWidth,
));

Expand All @@ -89,7 +89,7 @@ public function validate($value, Constraint $constraint)

if ($height < $constraint->minHeight) {
$this->context->addViolation($constraint->minHeightMessage, array(
'{{ height }}' => $height,
'{{ height }}' => $height,
'{{ min_height }}' => $constraint->minHeight,
));

Expand All @@ -104,7 +104,7 @@ public function validate($value, Constraint $constraint)

if ($height > $constraint->maxHeight) {
$this->context->addViolation($constraint->maxHeightMessage, array(
'{{ height }}' => $height,
'{{ height }}' => $height,
'{{ max_height }}' => $constraint->maxHeight,
));
}
Expand Down
6 changes: 3 additions & 3 deletions Constraints/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ private function getNonDelimitedPattern()

if (preg_match('/^(.)(\^?)(.*?)(\$?)\1$/', $this->pattern, $matches)) {
$delimiter = $matches[1];
$start = empty($matches[2]) ? '.*' : '';
$pattern = $matches[3];
$end = empty($matches[4]) ? '.*' : '';
$start = empty($matches[2]) ? '.*' : '';
$pattern = $matches[3];
$end = empty($matches[4]) ? '.*' : '';

// Unescape the delimiter in pattern
$pattern = str_replace('\\'.$delimiter, $delimiter, $pattern);
Expand Down
2 changes: 1 addition & 1 deletion Constraints/TypeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function validate($value, Constraint $constraint)

$this->context->addViolation($constraint->message, array(
'{{ value }}' => $this->formatValue($value),
'{{ type }}' => $constraint->type,
'{{ type }}' => $constraint->type,
));
}
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ $validator = Validation::createValidator();
$constraint = new Assert\Collection(array(
'name' => new Assert\Collection(array(
'first_name' => new Assert\Length(array('min' => 101)),
'last_name' => new Assert\Length(array('min' => 1)),
'last_name' => new Assert\Length(array('min' => 1)),
)),
'email' => new Assert\Email(),
'simple' => new Assert\Length(array('min' => 102)),
'gender' => new Assert\Choice(array(3, 4)),
'file' => new Assert\File(),
'email' => new Assert\Email(),
'simple' => new Assert\Length(array('min' => 102)),
'gender' => new Assert\Choice(array(3, 4)),
'file' => new Assert\File(),
'password' => new Assert\Length(array('min' => 60)),
));

Expand Down
8 changes: 4 additions & 4 deletions Tests/Constraints/FileValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public function testMaxSizeExceeded($bytesWritten, $limit, $sizeAsString, $limit
fclose($this->file);

$constraint = new File(array(
'maxSize' => $limit,
'maxSizeMessage' => 'myMessage',
'maxSize' => $limit,
'maxSizeMessage' => 'myMessage',
));

$this->validator->validate($this->getFile($this->path), $constraint);
Expand Down Expand Up @@ -205,8 +205,8 @@ public function testMaxSizeNotExceeded($bytesWritten, $limit)
fclose($this->file);

$constraint = new File(array(
'maxSize' => $limit,
'maxSizeMessage' => 'myMessage',
'maxSize' => $limit,
'maxSizeMessage' => 'myMessage',
));

$this->validator->validate($this->getFile($this->path), $constraint);
Expand Down

0 comments on commit bb8d86b

Please sign in to comment.