diff --git a/models/Asset.php b/models/Asset.php index 8bf1e26e..6bc44c2a 100644 --- a/models/Asset.php +++ b/models/Asset.php @@ -263,7 +263,7 @@ class Asset } $data['id_asset'] = $db->insert_id(); - return $return_format == 'object' ? new self($data) : $data; + return $return_format === 'object' ? new self($data) : $data; } public function getId() @@ -394,7 +394,7 @@ class Asset finfo_close($finfo); // Detected an image? - if (substr($this->mimetype, 0, 5) == 'image') + if (substr($this->mimetype, 0, 5) === 'image') { $image = new Imagick($destination); $d = $image->getImageGeometry(); diff --git a/models/AssetIterator.php b/models/AssetIterator.php index b05b59d1..84433f7d 100644 --- a/models/AssetIterator.php +++ b/models/AssetIterator.php @@ -56,7 +56,7 @@ class AssetIterator extends Asset // Reset internal pointer for next asset. $this->db->data_seek($this->res_thumbs, 0); - if ($this->return_format == 'object') + if ($this->return_format === 'object') return new Asset($row); else return $row; diff --git a/models/Database.php b/models/Database.php index 8507fa71..7f59a6c1 100644 --- a/models/Database.php +++ b/models/Database.php @@ -519,7 +519,7 @@ class Database $insertRows[] = $this->quote($insertData, array_combine($indexed_columns, $dataRow)); // Determine the method of insertion. - $queryTitle = $method == 'replace' ? 'REPLACE' : ($method == 'ignore' ? 'INSERT IGNORE' : 'INSERT'); + $queryTitle = $method === 'replace' ? 'REPLACE' : ($method === 'ignore' ? 'INSERT IGNORE' : 'INSERT'); // Do the insert. return $this->query(' diff --git a/models/Image.php b/models/Image.php index 73fa459c..27b5734f 100644 --- a/models/Image.php +++ b/models/Image.php @@ -22,7 +22,7 @@ class Image extends Asset { $asset = parent::fromId($id_asset, 'array'); if ($asset) - return $return_format == 'object' ? new Image($asset) : $asset; + return $return_format === 'object' ? new Image($asset) : $asset; else return false; } @@ -34,7 +34,7 @@ class Image extends Asset $assets = parent::fromIds($id_assets, 'array'); - if ($return_format == 'array') + if ($return_format === 'array') return $assets; else { diff --git a/models/Tag.php b/models/Tag.php index ce663631..e6b6f130 100644 --- a/models/Tag.php +++ b/models/Tag.php @@ -39,7 +39,7 @@ class Tag if (empty($row)) throw new NotFoundException(); - return $return_format == 'object' ? new Tag($row) : $row; + return $return_format === 'object' ? new Tag($row) : $row; } public static function fromSlug($slug, $return_format = 'object') @@ -58,7 +58,7 @@ class Tag if (empty($row)) throw new NotFoundException(); - return $return_format == 'object' ? new Tag($row) : $row; + return $return_format === 'object' ? new Tag($row) : $row; } public static function getAll($limit = 0, $return_format = 'array') @@ -84,7 +84,7 @@ class Tag }); } - if ($return_format == 'object') + if ($return_format === 'object') { $return = []; foreach ($rows as $row) @@ -110,7 +110,7 @@ class Tag 'limit' => $limit, ]); - if ($return_format == 'object') + if ($return_format === 'object') { $return = []; foreach ($rows as $row) @@ -136,7 +136,7 @@ class Tag 'limit' => $limit, ]); - if ($return_format == 'object') + if ($return_format === 'object') { $return = []; foreach ($rows as $row) @@ -166,7 +166,7 @@ class Tag if (empty($rows)) return []; - if ($return_format == 'object') + if ($return_format === 'object') { $return = []; foreach ($rows as $row) @@ -196,7 +196,7 @@ class Tag if (empty($rows)) return []; - if ($return_format == 'object') + if ($return_format === 'object') { $return = []; foreach ($rows as $row) @@ -244,7 +244,7 @@ class Tag trigger_error('Could not create the requested tag.', E_USER_ERROR); $data['id_tag'] = $db->insert_id(); - return $return_format == 'object' ? new Tag($data) : $data; + return $return_format === 'object' ? new Tag($data) : $data; } public function getUrl() diff --git a/templates/FormView.php b/templates/FormView.php index 47c52ec1..0549a882 100644 --- a/templates/FormView.php +++ b/templates/FormView.php @@ -81,7 +81,7 @@ class FormView extends SubTemplate if ($field['type'] != 'checkbox' && isset($field['label'])) echo '