mirror of
https://github.com/nextcloud/server.git
synced 2026-03-24 19:33:49 -04:00
Avoid assignment in if clause
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
07997131d3
commit
e34ec33199
1 changed files with 12 additions and 8 deletions
|
|
@ -125,11 +125,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -138,11 +140,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