Simplify conditional returns

This commit is contained in:
Giuseppe Criscione 2020-11-26 16:12:40 +01:00
parent e9511a95f0
commit bc2fa532d6
2 changed files with 2 additions and 8 deletions

View File

@ -362,10 +362,7 @@ class Page extends AbstractPage
*/
public function isDeletable(): bool
{
if ($this->hasChildren() || $this->isSite() || $this->isIndexPage() || $this->isErrorPage()) {
return false;
}
return true;
return !($this->hasChildren() || $this->isSite() || $this->isIndexPage() || $this->isErrorPage());
}
/**

View File

@ -142,10 +142,7 @@ class HTTPRequest
*/
public static function isHTTPS(): bool
{
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
return true;
}
return false;
return isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' || $_SERVER['SERVER_PORT'] == 443;
}
/**