mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Avoid assignment in if clause
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
ab3a1d5706
commit
8504f0a59e
1 changed files with 12 additions and 8 deletions
|
|
@ -124,11 +124,13 @@ class OC_Image implements \OCP\IImage {
|
|||
* @return int
|
||||
*/
|
||||
public function width() {
|
||||
if ($this->valid() && (($width = imagesx($this->resource)) !== false)) {
|
||||
return $width;
|
||||
} else {
|
||||
return -1;
|
||||
if ($this->valid()) {
|
||||
$width = imagesx($this->resource);
|
||||
if ($width !== false) {
|
||||
return $width;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -137,11 +139,13 @@ class OC_Image implements \OCP\IImage {
|
|||
* @return int
|
||||
*/
|
||||
public function height() {
|
||||
if ($this->valid() && (($height = imagesy($this->resource)) !== false)) {
|
||||
return $height;
|
||||
} else {
|
||||
return -1;
|
||||
if ($this->valid()) {
|
||||
$height = imagesy($this->resource);
|
||||
if ($height !== false) {
|
||||
return $height;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue