diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2019-12-12 02:43:57 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2019-12-12 02:43:57 +0300 |
commit | 80a3c50bf5c52368ed5838a3675c020e64f267c7 (patch) | |
tree | 2e222eddb2f10aa0d261b022587ad88d15fbe529 | |
parent | f6a17433a22e88d4525e908b655e165868039d02 (diff) |
Remove some useless if conditions
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
-rw-r--r-- | libraries/classes/Core.php | 5 | ||||
-rw-r--r-- | libraries/classes/Normalization.php | 5 | ||||
-rw-r--r-- | libraries/classes/Plugins/Export/ExportOdt.php | 14 | ||||
-rw-r--r-- | test/selenium/TestBase.php | 36 |
4 files changed, 14 insertions, 46 deletions
diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php index d29c361827..778601939e 100644 --- a/libraries/classes/Core.php +++ b/libraries/classes/Core.php @@ -435,11 +435,8 @@ class Core 0, mb_strpos($_page . '?', '?') ); - if (in_array($_page, $whitelist)) { - return true; - } - return false; + return in_array($_page, $whitelist); } /** diff --git a/libraries/classes/Normalization.php b/libraries/classes/Normalization.php index d0651526f3..71a4301ea2 100644 --- a/libraries/classes/Normalization.php +++ b/libraries/classes/Normalization.php @@ -1047,10 +1047,7 @@ class Normalization if ($pkCnt && $pkCnt == $colCnt && $colCnt == $pkColCnt) { return true; } - if ($totalRows && $totalRows == $pkCnt) { - return true; - } - return false; + return $totalRows && $totalRows == $pkCnt; } /** diff --git a/libraries/classes/Plugins/Export/ExportOdt.php b/libraries/classes/Plugins/Export/ExportOdt.php index 8810c90fa7..712e1c387f 100644 --- a/libraries/classes/Plugins/Export/ExportOdt.php +++ b/libraries/classes/Plugins/Export/ExportOdt.php @@ -171,17 +171,11 @@ class ExportOdt extends ExportPlugin $GLOBALS['odt_buffer'] .= '</office:text>' . '</office:body>' . '</office:document-content>'; - if (! $this->export->outputHandler( - OpenDocument::create( - 'application/vnd.oasis.opendocument.text', - $GLOBALS['odt_buffer'] - ) - ) - ) { - return false; - } - return true; + return $this->export->outputHandler(OpenDocument::create( + 'application/vnd.oasis.opendocument.text', + $GLOBALS['odt_buffer'] + )); } /** diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index e2942b2e56..6f5a8aa5e6 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -137,10 +137,7 @@ abstract class TestBase extends TestCase if (empty($GLOBALS['CI_MODE'])) { return false; } - if ($GLOBALS['CI_MODE'] != 'selenium') { - return false; - } - return true; + return $GLOBALS['CI_MODE'] == 'selenium'; } /** @@ -150,13 +147,8 @@ abstract class TestBase extends TestCase */ public function hasBrowserstackConfig(): bool { - if (empty($GLOBALS['TESTSUITE_BROWSERSTACK_USER'])) { - return false; - } - if (empty($GLOBALS['TESTSUITE_BROWSERSTACK_KEY'])) { - return false; - } - return true; + return ! empty($GLOBALS['TESTSUITE_BROWSERSTACK_USER']) + && ! empty($GLOBALS['TESTSUITE_BROWSERSTACK_KEY']); } /** @@ -166,13 +158,8 @@ abstract class TestBase extends TestCase */ public function hasSeleniumConfig(): bool { - if (empty($GLOBALS['TESTSUITE_SELENIUM_HOST'])) { - return false; - } - if (empty($GLOBALS['TESTSUITE_SELENIUM_PORT'])) { - return false; - } - return true; + return ! empty($GLOBALS['TESTSUITE_SELENIUM_HOST']) + && ! empty($GLOBALS['TESTSUITE_SELENIUM_PORT']); } /** @@ -203,16 +190,9 @@ abstract class TestBase extends TestCase */ public function hasTestSuiteDatabaseServer(): bool { - if (empty($GLOBALS['TESTSUITE_SERVER'])) { - return false; - } - if (empty($GLOBALS['TESTSUITE_USER'])) { - return false; - } - if (empty($GLOBALS['TESTSUITE_DATABASE'])) { - return false; - } - return true; + return ! empty($GLOBALS['TESTSUITE_SERVER']) + && ! empty($GLOBALS['TESTSUITE_USER']) + && ! empty($GLOBALS['TESTSUITE_DATABASE']); } /** |