Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#2941 branch 'hotfix/ch…
Browse files Browse the repository at this point in the history
…ange-logical-operator'
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/File/ExcludeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function isValid($value, $file = null)

$extensions = $this->getExtension();

if ($this->getCase() and (!in_array($info['extension'], $extensions))) {
if ($this->getCase() && (!in_array($info['extension'], $extensions))) {
return true;
} elseif (!$this->getCase()) {
$found = false;
Expand Down
6 changes: 3 additions & 3 deletions src/File/ImageSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public function isValid($value, $file = null)
ErrorHandler::stop();
$this->setValue($file);

if (empty($size) or ($size[0] === 0) or ($size[1] === 0)) {
if (empty($size) || ($size[0] === 0) || ($size[1] === 0)) {
return $this->throwError($file, self::NOT_DETECTED);
}

Expand All @@ -352,15 +352,15 @@ public function isValid($value, $file = null)
$this->throwError($file, self::WIDTH_TOO_SMALL);
}

if (($this->getMaxWidth() !== null) and ($this->getMaxWidth() < $this->width)) {
if (($this->getMaxWidth() !== null) && ($this->getMaxWidth() < $this->width)) {
$this->throwError($file, self::WIDTH_TOO_BIG);
}

if ($this->height < $this->getMinHeight()) {
$this->throwError($file, self::HEIGHT_TOO_SMALL);
}

if (($this->getMaxHeight() !== null) and ($this->getMaxHeight() < $this->height)) {
if (($this->getMaxHeight() !== null) && ($this->getMaxHeight() < $this->height)) {
$this->throwError($file, self::HEIGHT_TOO_BIG);
}

Expand Down
2 changes: 1 addition & 1 deletion src/File/NotExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class NotExists extends Exists
public function isValid($value, $file = null)
{
$directories = $this->getDirectory(true);
if (($file !== null) and (!empty($file['destination']))) {
if (($file !== null) && (!empty($file['destination']))) {
$directories[] = $file['destination'];
} elseif (!isset($file['name'])) {
$file['name'] = $value;
Expand Down

0 comments on commit 4434323

Please # to comment.