[TASK] Remove ternary operator where not needed 10/41110/5
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 13 Jul 2015 18:43:58 +0000 (20:43 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 13 Jul 2015 19:45:34 +0000 (21:45 +0200)
The usage of the ternary operator just for conversion to boolean like
... ? TRUE : FALSE
is be replaced by a normal (bool) typecast.

Change-Id: Ia32f63b423ffa7e066c9cf8bb002dde51b419bfa
Resolves: #68063
Releases: master
Reviewed-on: http://review.typo3.org/41110
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
40 files changed:
typo3/sysext/backend/Classes/Backend/ToolbarItems/HelpToolbarItem.php
typo3/sysext/backend/Classes/Form/Container/FlexFormLanguageContainer.php
typo3/sysext/backend/Classes/Form/Container/FullRecordContainer.php
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php
typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php
typo3/sysext/backend/Classes/Form/ElementConditionMatcher.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Utility/IconUtility.php
typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/ExtDirect/ExtDirectApi.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/extbase/Classes/Mvc/Cli/Request.php
typo3/sysext/extbase/Classes/Mvc/Request.php
typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php
typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Http/EidRequestHandler.php
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/frontend/Classes/Utility/EidUtility.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php
typo3/sysext/lang/Classes/Domain/Model/Language.php
typo3/sysext/lowlevel/Classes/View/DatabaseIntegrityView.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/recycler/Classes/Utility/RecyclerUtility.php
typo3/sysext/rtehtmlarea/Classes/Extension/Spellchecker.php
typo3/sysext/saltedpasswords/Classes/Salt/BlowfishSalt.php
typo3/sysext/saltedpasswords/Classes/Salt/Md5Salt.php
typo3/sysext/saltedpasswords/Classes/Salt/PhpassSalt.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php
typo3/sysext/workspaces/Classes/Controller/ReviewController.php
typo3/sysext/workspaces/Classes/ExtDirect/ActionHandler.php

index e86af44..867cade 100644 (file)
@@ -48,7 +48,7 @@ class HelpToolbarItem implements ToolbarItemInterface {
         * @return bool TRUE
         */
        public function checkAccess() {
-               $result = $this->helpModuleMenu ? TRUE : FALSE;
+               $result = (bool)$this->helpModuleMenu;
                return $result;
        }
 
index fa2f6b6..921f598 100644 (file)
@@ -47,7 +47,7 @@ class FlexFormLanguageContainer extends AbstractContainer {
                $langDisabled = (bool)$flexFormDataStructureArray['meta']['langDisable'];
                $flexFormRowData['meta']['currentLangId'] = array();
                // Look up page language overlays
-               $checkPageLanguageOverlay = $this->getBackendUserAuthentication()->getTSConfigVal('options.checkPageLanguageOverlay') ? TRUE : FALSE;
+               $checkPageLanguageOverlay = (bool)$this->getBackendUserAuthentication()->getTSConfigVal('options.checkPageLanguageOverlay');
                $pageOverlays = array();
                if ($checkPageLanguageOverlay) {
                        $whereClause = 'pid=' . (int)$row['pid'] . BackendUtility::deleteClause('pages_language_overlay')
index 114e24d..ed44682 100644 (file)
@@ -77,7 +77,7 @@ class FullRecordContainer extends AbstractContainer {
                        array_unshift($fieldsArray, '--div--;LLL:EXT:lang/locallang_core.xlf:labels.generalTab');
                }
                // If first tab has no label definition, add "general" label
-               $firstTabHasLabel = count(GeneralUtility::trimExplode(';',  $fieldsArray[0])) > 1 ? TRUE : FALSE;
+               $firstTabHasLabel = count(GeneralUtility::trimExplode(';',  $fieldsArray[0])) > 1;
                if (!$firstTabHasLabel) {
                        $fieldsArray[0] = '--div--;LLL:EXT:lang/locallang_core.xlf:labels.generalTab';
                }
index d74fe09..b0492c3 100644 (file)
@@ -119,7 +119,7 @@ class InlineRecordContainer extends AbstractContainer {
                        // Get configuration:
                        $collapseAll = isset($config['appearance']['collapseAll']) && $config['appearance']['collapseAll'];
                        $expandAll = isset($config['appearance']['collapseAll']) && !$config['appearance']['collapseAll'];
-                       $ajaxLoad = isset($config['appearance']['ajaxLoad']) && !$config['appearance']['ajaxLoad'] ? FALSE : TRUE;
+                       $ajaxLoad = !isset($config['appearance']['ajaxLoad']) || $config['appearance']['ajaxLoad'];
                        if ($isNewRecord) {
                                // Show this record expanded or collapsed
                                $isExpanded = $expandAll || (!$collapseAll ? 1 : 0);
@@ -429,9 +429,9 @@ class InlineRecordContainer extends AbstractContainer {
                $isParentExisting = MathUtility::canBeInterpretedAsInteger($parentUid);
                $tcaTableCtrl = &$GLOBALS['TCA'][$foreign_table]['ctrl'];
                $tcaTableCols = &$GLOBALS['TCA'][$foreign_table]['columns'];
-               $isPagesTable = $foreign_table == 'pages' ? TRUE : FALSE;
+               $isPagesTable = $foreign_table === 'pages';
                $isOnSymmetricSide = RelationHandler::isOnSymmetricSide($parentUid, $config, $rec);
-               $enableManualSorting = $tcaTableCtrl['sortby'] || $config['MM'] || !$isOnSymmetricSide && $config['foreign_sortby'] || $isOnSymmetricSide && $config['symmetric_sortby'] ? TRUE : FALSE;
+               $enableManualSorting = $tcaTableCtrl['sortby'] || $config['MM'] || !$isOnSymmetricSide && $config['foreign_sortby'] || $isOnSymmetricSide && $config['symmetric_sortby'];
                $nameObject = $this->inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($this->globalOptions['inlineFirstPid']);
                $nameObjectFt = $nameObject . '-' . $foreign_table;
                $nameObjectFtId = $nameObjectFt . '-' . $rec['uid'];
index 0ae814c..4da8e91 100644 (file)
@@ -439,7 +439,7 @@ class SingleFieldContainer extends AbstractContainer {
                } else {
                        $label = $GLOBALS['TCA'][$table]['ctrl']['label'];
                }
-               return $level['config']['foreign_table'] === $table && $label == $field ? TRUE : FALSE;
+               return $level['config']['foreign_table'] === $table && $label === $field;
        }
 
        /**
@@ -578,7 +578,7 @@ class SingleFieldContainer extends AbstractContainer {
                        }
                }
                // Return the result for '%AND' (if nothing was checked, TRUE is returned)
-               return $localEntries == $localMatches ? TRUE : FALSE;
+               return $localEntries === $localMatches;
        }
 
        /**
@@ -588,7 +588,7 @@ class SingleFieldContainer extends AbstractContainer {
         * @return bool Returns TRUE, if the object is an associative array
         */
        protected function isAssociativeArray($object) {
-               return is_array($object) && !empty($object) && array_keys($object) !== range(0, sizeof($object) - 1) ? TRUE : FALSE;
+               return is_array($object) && !empty($object) && array_keys($object) !== range(0, sizeof($object) - 1);
        }
 
        /**
index f842663..d697f5f 100644 (file)
@@ -144,8 +144,8 @@ class SelectTreeElement extends AbstractFormElement {
                $width = 280;
                $appearance = $PA['fieldConf']['config']['treeConfig']['appearance'];
                if (is_array($appearance)) {
-                       $header = $appearance['showHeader'] ? TRUE : FALSE;
-                       $expanded = $appearance['expandAll'] === TRUE;
+                       $header = (bool)$appearance['showHeader'];
+                       $expanded = (bool)$appearance['expandAll'];
                        if (isset($appearance['width'])) {
                                $width = (int)$appearance['width'];
                        }
index b7603ef..fcb1019 100644 (file)
@@ -233,7 +233,7 @@ class ElementConditionMatcher {
                                break;
                        case 'BIT':
                        case '!BIT':
-                               $result = ((int)$fieldValue & $operand) ? TRUE : FALSE;
+                               $result = (bool)((int)$fieldValue & $operand);
                                if ($operator[0] === '!') {
                                        $result = !$result;
                                }
index 84121e9..bb943bd 100644 (file)
@@ -1883,7 +1883,7 @@ function jumpToUrl(URL) {
         */
        public function collapseableSection($title, $html, $id, $saveStatePointer = '') {
                GeneralUtility::logDeprecatedFunction();
-               $hasSave = $saveStatePointer ? TRUE : FALSE;
+               $hasSave = (bool)$saveStatePointer;
                $collapsedStyle = ($collapsedClass = '');
                if ($hasSave) {
                        /** @var $userSettingsController \TYPO3\CMS\Backend\Controller\UserSettingsController */
index b9c2ef2..8cce59f 100644 (file)
@@ -182,7 +182,7 @@ class IconUtility {
                $deleted = FALSE;
                // Set, if a page-record (only pages!) has the extend-to-subpages flag set.
                $protectSection = FALSE;
-               $noIconFound = $row['_NO_ICON_FOUND'] ? TRUE : FALSE;
+               $noIconFound = (bool)$row['_NO_ICON_FOUND'];
                // + $shaded which is also boolean!
                // Icon state based on "enableFields":
                if (is_array($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
@@ -939,8 +939,8 @@ class IconUtility {
                        'fe_group' => FALSE,
                        'deleted' => FALSE,
                        'protectedSection' => FALSE,
-                       'nav_hide' => $row['nav_hide'] ? TRUE : FALSE,
-                       'noIconFound' => $row['_NO_ICON_FOUND'] ? TRUE : FALSE
+                       'nav_hide' => (bool)$row['nav_hide'],
+                       'noIconFound' => (bool)$row['_NO_ICON_FOUND']
                );
                // Icon state based on "enableFields":
                if (is_array($tcaCtrl['enablecolumns'])) {
index 7c64ac1..c51b1bf 100644 (file)
@@ -618,7 +618,7 @@ abstract class AbstractUserAuthentication {
                if (!$this->newSessionID) {
                        // Read user session
                        $authInfo['userSession'] = $this->fetchUserSession($skipSessionUpdate);
-                       $haveSession = is_array($authInfo['userSession']) ? TRUE : FALSE;
+                       $haveSession = is_array($authInfo['userSession']);
                }
                if ($this->writeDevLog) {
                        if ($haveSession) {
@@ -1004,7 +1004,7 @@ abstract class AbstractUserAuthentication {
                $statement->execute(array(':ses_id' => $id));
                $row = $statement->fetch(\TYPO3\CMS\Core\Database\PreparedStatement::FETCH_NUM);
                $statement->free();
-               return $row[0] ? TRUE : FALSE;
+               return (bool)$row[0];
        }
 
        /**
index 7521870..616878b 100644 (file)
@@ -229,7 +229,7 @@ class Bootstrap {
        public function checkIfEssentialConfigurationExists() {
                $configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager;
                $this->setEarlyInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, $configurationManager);
-               return (!file_exists($configurationManager->getLocalConfigurationFileLocation()) || !file_exists(PATH_typo3conf . 'PackageStates.php')) ? FALSE : TRUE;
+               return file_exists($configurationManager->getLocalConfigurationFileLocation()) && file_exists(PATH_typo3conf . 'PackageStates.php');
        }
 
        /**
index fba7422..f69b490 100644 (file)
@@ -3112,7 +3112,7 @@ class DataHandler {
                // IRRE with a pointer field (database normalization):
                if ($tcaFieldConf['foreign_field']) {
                        // if the record was imported, sorting was also imported, so skip this
-                       $skipSorting = $this->callFromImpExp ? TRUE : FALSE;
+                       $skipSorting = (bool)$this->callFromImpExp;
                        // update record in intermediate table (sorting & pointer uid to parent record)
                        $dbAnalysis->writeForeignField($tcaFieldConf, $id, 0, $skipSorting);
                        $newValue = $keepTranslation ? 0 : $dbAnalysis->countItems(FALSE);
@@ -6107,7 +6107,7 @@ class DataHandler {
         */
        public function tableReadOnly($table) {
                // Returns TRUE if table is readonly
-               return $GLOBALS['TCA'][$table]['ctrl']['readOnly'] ? TRUE : FALSE;
+               return (bool)$GLOBALS['TCA'][$table]['ctrl']['readOnly'];
        }
 
        /**
@@ -6118,7 +6118,7 @@ class DataHandler {
         */
        public function tableAdminOnly($table) {
                // Returns TRUE if table is admin-only
-               return $GLOBALS['TCA'][$table]['ctrl']['adminOnly'] ? TRUE : FALSE;
+               return (bool)$GLOBALS['TCA'][$table]['ctrl']['adminOnly'];
        }
 
        /**
index bba714c..7fa3b25 100644 (file)
@@ -151,7 +151,7 @@ class ExtDirectApi {
         * @return string $javascriptNamespaces
         */
        protected function getExtDirectApi(array $filterNamespaces) {
-               $noCache = GeneralUtility::_GET('no_cache') ? TRUE : FALSE;
+               $noCache = (bool)GeneralUtility::_GET('no_cache');
                // Look up into the cache
                $cacheIdentifier = 'ExtDirectApi';
                $cacheHash = md5($cacheIdentifier . implode(',', $filterNamespaces) . GeneralUtility::getIndpEnv('TYPO3_SSL') . serialize($this->settings) . TYPO3_MODE . GeneralUtility::getIndpEnv('HTTP_HOST'));
index 42a2f56..3b94e71 100755 (executable)
@@ -3456,7 +3456,7 @@ Connection: close
                                if (self::cmpIP($_SERVER['REMOTE_ADDR'], $proxySSL)) {
                                        $retVal = TRUE;
                                } else {
-                                       $retVal = $_SERVER['SSL_SESSION_ID'] || strtolower($_SERVER['HTTPS']) === 'on' || (string)$_SERVER['HTTPS'] === '1' ? TRUE : FALSE;
+                                       $retVal = $_SERVER['SSL_SESSION_ID'] || strtolower($_SERVER['HTTPS']) === 'on' || (string)$_SERVER['HTTPS'] === '1';
                                }
                                break;
                        case '_ARRAY':
@@ -3949,11 +3949,7 @@ Connection: close
         * @return bool TRUE if the page should be hidden
         */
        static public function hideIfNotTranslated($l18n_cfg_fieldValue) {
-               if ($GLOBALS['TYPO3_CONF_VARS']['FE']['hidePagesIfNotTranslatedByDefault']) {
-                       return $l18n_cfg_fieldValue & 2 ? FALSE : TRUE;
-               } else {
-                       return $l18n_cfg_fieldValue & 2 ? TRUE : FALSE;
-               }
+               return $GLOBALS['TYPO3_CONF_VARS']['FE']['hidePagesIfNotTranslatedByDefault'] XOR ($l18n_cfg_fieldValue & 2);
        }
 
        /**
@@ -3964,7 +3960,7 @@ Connection: close
         * @return bool
         */
        static public function hideIfDefaultLanguage($localizationConfiguration) {
-               return $localizationConfiguration & 1;
+               return (bool)($localizationConfiguration & 1);
        }
 
        /**
index 66f6114..84c1496 100644 (file)
@@ -98,7 +98,7 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
         * @return void
         */
        public function setDispatched($flag) {
-               $this->dispatched = $flag ? TRUE : FALSE;
+               $this->dispatched = (bool)$flag;
        }
 
        /**
index ae75044..d24bf3e 100644 (file)
@@ -114,12 +114,11 @@ class Request implements RequestInterface {
         * Sets the dispatched flag
         *
         * @param bool $flag If this request has been dispatched
-        *
         * @return void
         * @api
         */
        public function setDispatched($flag) {
-               $this->dispatched = $flag ? TRUE : FALSE;
+               $this->dispatched = (bool)$flag;
        }
 
        /**
index b649ab6..d00300d 100644 (file)
@@ -496,7 +496,7 @@ class TemplateParser {
                        if (preg_match(self::$SCAN_PATTERN_CDATA, $templateElement, $matchedVariables) > 0) {
                                $this->textHandler($state, $matchedVariables[1]);
                        } elseif (preg_match($regularExpression_openingViewHelperTag, $templateElement, $matchedVariables) > 0) {
-                               $this->openingViewHelperTagHandler($state, $matchedVariables['NamespaceIdentifier'], $matchedVariables['MethodIdentifier'], $matchedVariables['Attributes'], ($matchedVariables['Selfclosing'] === '' ? FALSE : TRUE));
+                               $this->openingViewHelperTagHandler($state, $matchedVariables['NamespaceIdentifier'], $matchedVariables['MethodIdentifier'], $matchedVariables['Attributes'], ($matchedVariables['Selfclosing'] !== ''));
                        } elseif (preg_match($regularExpression_closingViewHelperTag, $templateElement, $matchedVariables) > 0) {
                                $this->closingViewHelperTagHandler($state, $matchedVariables['NamespaceIdentifier'], $matchedVariables['MethodIdentifier']);
                        } else {
index ea14ce2..ec101b9 100644 (file)
@@ -59,13 +59,10 @@ class ContentContentObject extends AbstractContentObject {
                        $slideCollect = 0;
                }
                $slideCollectReverse = isset($conf['slide.']['collectReverse.']) ? (int)$this->cObj->stdWrap($conf['slide.']['collectReverse'], $conf['slide.']['collectReverse.']) : (int)$conf['slide.']['collectReverse'];
-               $slideCollectReverse = $slideCollectReverse ? TRUE : FALSE;
-               $slideCollectFuzzy = isset($conf['slide.']['collectFuzzy.']) ? (int)$this->cObj->stdWrap($conf['slide.']['collectFuzzy'], $conf['slide.']['collectFuzzy.']) : (int)$conf['slide.']['collectFuzzy'];
-               if ($slideCollectFuzzy) {
-                       $slideCollectFuzzy = TRUE;
-               } else {
-                       $slideCollectFuzzy = FALSE;
-               }
+               $slideCollectReverse = (bool)$slideCollectReverse;
+               $slideCollectFuzzy = isset($conf['slide.']['collectFuzzy.'])
+                       ? (bool)$this->cObj->stdWrap($conf['slide.']['collectFuzzy'], $conf['slide.']['collectFuzzy.'])
+                       : (bool)$conf['slide.']['collectFuzzy'];
                if (!$slideCollect) {
                        $slideCollectFuzzy = TRUE;
                }
index 6e37e73..4ed75cf 100644 (file)
@@ -4110,7 +4110,7 @@ class ContentObjectRenderer {
                $chars = (int)$options[0];
                $absChars = abs($chars);
                $replacementForEllipsis = trim($options[1]);
-               $crop2space = trim($options[2]) === '1' ? TRUE : FALSE;
+               $crop2space = trim($options[2]) === '1';
                // Split $content into an array(even items in the array are outside the tags, odd numbers are tag-blocks).
                $tags = 'a|b|blockquote|body|div|em|font|form|h1|h2|h3|h4|h5|h6|i|li|map|ol|option|p|pre|sub|sup|select|span|strong|table|thead|tbody|tfoot|td|textarea|tr|u|ul|br|hr|img|input|area|link';
                // @todo We should not crop inside <script> tags.
index 2c0fe6b..afb0587 100644 (file)
@@ -3621,7 +3621,7 @@ class TypoScriptFrontendController {
                                header(
                                        trim($options['header']),
                                        // "replace existing headers" is turned on by default, unless turned off
-                                       ($options['replace'] === '0' ? FALSE : TRUE),
+                                       ($options['replace'] !== '0'),
                                        ((int)$options['httpResponseCode'] ?: NULL)
                                );
                        }
index 2fe2551..81cb6fb 100644 (file)
@@ -88,7 +88,7 @@ class EidRequestHandler implements RequestHandlerInterface {
         * @return bool If the request is not an eID request, TRUE otherwise FALSE
         */
        public function canHandleRequest(ServerRequestInterface $request) {
-               return $request->getQueryParams()['eID'] || $request->getParsedBody()['eID'] ? TRUE : FALSE;
+               return $request->getQueryParams()['eID'] || $request->getParsedBody()['eID'];
        }
 
        /**
index 5736f9a..7ccb46b 100644 (file)
@@ -458,7 +458,7 @@ class PageGenerator {
                                                                // To fix MSIE 6 that cannot handle these as relative paths (according to Ben v Ende)
                                                                $ss = GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/' . $ss;
                                                        }
-                                                       $pageRenderer->addCssInlineBlock('import_' . $key, '@import url("' . htmlspecialchars($ss) . '") ' . htmlspecialchars($cssFileConfig['media']) . ';', empty($cssFileConfig['disableCompression']), $cssFileConfig['forceOnTop'] ? TRUE : FALSE, '');
+                                                       $pageRenderer->addCssInlineBlock('import_' . $key, '@import url("' . htmlspecialchars($ss) . '") ' . htmlspecialchars($cssFileConfig['media']) . ';', empty($cssFileConfig['disableCompression']), (bool)$cssFileConfig['forceOnTop'], '');
                                                } else {
                                                        $pageRenderer->addCssFile(
                                                                $ss,
@@ -466,9 +466,9 @@ class PageGenerator {
                                                                $cssFileConfig['media'] ?: 'all',
                                                                $cssFileConfig['title'] ?: '',
                                                                empty($cssFileConfig['disableCompression']),
-                                                               $cssFileConfig['forceOnTop'] ? TRUE : FALSE,
+                                                               (bool)$cssFileConfig['forceOnTop'],
                                                                $cssFileConfig['allWrap'],
-                                                               $cssFileConfig['excludeFromConcatenation'] ? TRUE : FALSE,
+                                                               (bool)$cssFileConfig['excludeFromConcatenation'],
                                                                $cssFileConfig['allWrap.']['splitChar']
                                                        );
                                                        unset($cssFileConfig);
@@ -491,7 +491,7 @@ class PageGenerator {
                                                                // To fix MSIE 6 that cannot handle these as relative paths (according to Ben v Ende)
                                                                $ss = GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/' . $ss;
                                                        }
-                                                       $pageRenderer->addCssInlineBlock('import_' . $key, '@import url("' . htmlspecialchars($ss) . '") ' . htmlspecialchars($cssFileConfig['media']) . ';', empty($cssFileConfig['disableCompression']), $cssFileConfig['forceOnTop'] ? TRUE : FALSE, '');
+                                                       $pageRenderer->addCssInlineBlock('import_' . $key, '@import url("' . htmlspecialchars($ss) . '") ' . htmlspecialchars($cssFileConfig['media']) . ';', empty($cssFileConfig['disableCompression']), (bool)$cssFileConfig['forceOnTop'], '');
                                                } else {
                                                        $pageRenderer->addCssLibrary(
                                                                $ss,
@@ -499,9 +499,9 @@ class PageGenerator {
                                                                $cssFileConfig['media'] ?: 'all',
                                                                $cssFileConfig['title'] ?: '',
                                                                empty($cssFileConfig['disableCompression']),
-                                                               $cssFileConfig['forceOnTop'] ? TRUE : FALSE,
+                                                               (bool)$cssFileConfig['forceOnTop'],
                                                                $cssFileConfig['allWrap'],
-                                                               $cssFileConfig['excludeFromConcatenation'] ? TRUE : FALSE,
+                                                               (bool)$cssFileConfig['excludeFromConcatenation'],
                                                                $cssFileConfig['allWrap.']['splitChar']
                                                        );
                                                        unset($cssFileConfig);
@@ -593,8 +593,8 @@ class PageGenerator {
                                $pageRenderer->loadJQuery($version, $source, $namespace);
                        }
                        if ($tsfe->pSetup['javascriptLibs.']['ExtJs']) {
-                               $css = $tsfe->pSetup['javascriptLibs.']['ExtJs.']['css'] ? TRUE : FALSE;
-                               $theme = $tsfe->pSetup['javascriptLibs.']['ExtJs.']['theme'] ? TRUE : FALSE;
+                               $css = (bool)$tsfe->pSetup['javascriptLibs.']['ExtJs.']['css'];
+                               $theme = (bool)$tsfe->pSetup['javascriptLibs.']['ExtJs.']['theme'];
                                $pageRenderer->loadExtJs($css, $theme);
                                if ($tsfe->pSetup['javascriptLibs.']['ExtJs.']['debug']) {
                                        $pageRenderer->enableExtJsDebug();
@@ -637,11 +637,11 @@ class PageGenerator {
                                                        $ss,
                                                        $type,
                                                        empty($jsFileConfig['disableCompression']),
-                                                       $jsFileConfig['forceOnTop'] ? TRUE : FALSE,
+                                                       (bool)$jsFileConfig['forceOnTop'],
                                                        $jsFileConfig['allWrap'],
-                                                       $jsFileConfig['excludeFromConcatenation'] ? TRUE : FALSE,
+                                                       (bool)$jsFileConfig['excludeFromConcatenation'],
                                                        $jsFileConfig['allWrap.']['splitChar'],
-                                                       $jsFileConfig['async'] ? TRUE : FALSE,
+                                                       (bool)$jsFileConfig['async'],
                                                        $jsFileConfig['integrity']
                                                );
                                                unset($jsFileConfig);
@@ -667,11 +667,11 @@ class PageGenerator {
                                                        $ss,
                                                        $type,
                                                        empty($jsFileConfig['disableCompression']),
-                                                       $jsFileConfig['forceOnTop'] ? TRUE : FALSE,
+                                                       (bool)$jsFileConfig['forceOnTop'],
                                                        $jsFileConfig['allWrap'],
-                                                       $jsFileConfig['excludeFromConcatenation'] ? TRUE : FALSE,
+                                                       (bool)$jsFileConfig['excludeFromConcatenation'],
                                                        $jsFileConfig['allWrap.']['splitChar'],
-                                                       $jsFileConfig['async'] ? TRUE : FALSE,
+                                                       (bool)$jsFileConfig['async'],
                                                        $jsFileConfig['integrity']
                                                );
                                                unset($jsFileConfig);
@@ -697,11 +697,11 @@ class PageGenerator {
                                                        $ss,
                                                        $type,
                                                        empty($jsConfig['disableCompression']),
-                                                       $jsConfig['forceOnTop'] ? TRUE : FALSE,
+                                                       (bool)$jsConfig['forceOnTop'],
                                                        $jsConfig['allWrap'],
-                                                       $jsConfig['excludeFromConcatenation'] ? TRUE : FALSE,
+                                                       (bool)$jsConfig['excludeFromConcatenation'],
                                                        $jsConfig['allWrap.']['splitChar'],
-                                                       $jsConfig['async'] ? TRUE : FALSE,
+                                                       (bool)$jsConfig['async'],
                                                        $jsConfig['integrity']
                                                );
                                                unset($jsConfig);
@@ -726,11 +726,11 @@ class PageGenerator {
                                                        $ss,
                                                        $type,
                                                        empty($jsConfig['disableCompression']),
-                                                       $jsConfig['forceOnTop'] ? TRUE : FALSE,
+                                                       (bool)$jsConfig['forceOnTop'],
                                                        $jsConfig['allWrap'],
-                                                       $jsConfig['excludeFromConcatenation'] ? TRUE : FALSE,
+                                                       (bool)$jsConfig['excludeFromConcatenation'],
                                                        $jsConfig['allWrap.']['splitChar'],
-                                                       $jsConfig['async'] ? TRUE : FALSE,
+                                                       (bool)$jsConfig['async'],
                                                        $jsConfig['integrity']
                                                );
                                                unset($jsConfig);
index 47c983f..db72696 100644 (file)
@@ -41,7 +41,7 @@ class EidUtility {
         * @return bool
         */
        static public function isEidRequest() {
-               return GeneralUtility::_GP('eID') ? TRUE : FALSE;
+               return (bool)GeneralUtility::_GP('eID');
        }
 
        /**
index cf23af8..4e19e4e 100644 (file)
@@ -149,7 +149,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                }
                // Indexer configuration from Extension Manager interface:
                $this->indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']);
-               $this->enableMetaphoneSearch = $this->indexerConfig['enableMetaphoneSearch'] ? TRUE : FALSE;
+               $this->enableMetaphoneSearch = (bool)$this->indexerConfig['enableMetaphoneSearch'];
                $this->initializeExternalParsers();
                // If "_sections" is set, this value overrides any existing value.
                if ($searchData['_sections']) {
index 784482f..5d67ef7 100644 (file)
@@ -165,6 +165,9 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         */
        public $indexerConfig = array();
 
+       /**
+        * @var bool
+        */
        public $enableMetaphoneSearch = FALSE;
 
        public $storeMetaphoneInfoAsWords;
@@ -210,7 +213,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        public function initialize() {
                // Indexer configuration from Extension Manager interface:
                $this->indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']);
-               $this->enableMetaphoneSearch = $this->indexerConfig['enableMetaphoneSearch'] ? TRUE : FALSE;
+               $this->enableMetaphoneSearch = (bool)$this->indexerConfig['enableMetaphoneSearch'];
                $this->storeMetaphoneInfoAsWords = !\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_words');
                // Initialize external document parsers for icon display and other soft operations
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'])) {
index 05324c1..dc4860e 100644 (file)
@@ -526,7 +526,7 @@ class CrawlerHook {
                // (Re)-Indexing a row from a table:
                $indexerObj = GeneralUtility::makeInstance(\TYPO3\CMS\IndexedSearch\Indexer::class);
                parse_str(str_replace('###UID###', $r['uid'], $cfgRec['get_params']), $GETparams);
-               $indexerObj->backend_initIndexer($cfgRec['pid'], 0, $sys_language_uid, '', $rl, $GETparams, $cfgRec['chashcalc'] ? TRUE : FALSE);
+               $indexerObj->backend_initIndexer($cfgRec['pid'], 0, $sys_language_uid, '', $rl, $GETparams, (bool)$cfgRec['chashcalc']);
                $indexerObj->backend_setFreeIndexUid($cfgRec['uid'], $cfgRec['set_id']);
                $indexerObj->forceIndexing = TRUE;
                $theContent = '';
index 2cbb34b..e04eb80 100644 (file)
@@ -369,8 +369,8 @@ class Indexer {
                $this->maxExternalFiles = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->indexerConfig['maxExternalFiles'], 0, 1000, 5);
                $this->flagBitMask = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->indexerConfig['flagBitMask'], 0, 255);
                // Workaround: If the extension configuration was not updated yet, the value is not existing
-               $this->enableMetaphoneSearch = isset($this->indexerConfig['enableMetaphoneSearch']) ? ($this->indexerConfig['enableMetaphoneSearch'] ? TRUE : FALSE) : TRUE;
-               $this->storeMetaphoneInfoAsWords = \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_words') ? FALSE : ($this->enableMetaphoneSearch ? TRUE : FALSE);
+               $this->enableMetaphoneSearch = !isset($this->indexerConfig['enableMetaphoneSearch']) || $this->indexerConfig['enableMetaphoneSearch'];
+               $this->storeMetaphoneInfoAsWords = !\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_words') && $this->enableMetaphoneSearch;
                // Initialize external document parsers:
                // Example configuration, see ext_localconf.php of this file!
                if ($this->conf['index_externals']) {
index 35f4a36..66b8d67 100644 (file)
@@ -96,8 +96,8 @@ class AllConfiguration extends Action\AbstractAction {
                                }
 
                                $description = trim($commentArray[$sectionName][$key]);
-                               $isTextarea = preg_match('/^(<.*?>)?string \\(textarea\\)/i', $description) ? TRUE : FALSE;
-                               $doNotRender = preg_match('/^(<.*?>)?string \\(exclude\\)/i', $description) ? TRUE : FALSE;
+                               $isTextarea = (bool)preg_match('/^(<.*?>)?string \\(textarea\\)/i', $description);
+                               $doNotRender = (bool)preg_match('/^(<.*?>)?string \\(exclude\\)/i', $description);
 
                                if (!is_array($value) && !$doNotRender && (!preg_match('/[' . LF . CR . ']/', $value) || $isTextarea)) {
                                        $itemData = array();
index cf1d607..db4f35e 100644 (file)
@@ -116,7 +116,7 @@ class Language extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         * @return void
         */
        public function setSelected($selected) {
-               $this->selected = $selected ? TRUE : FALSE;
+               $this->selected = (bool)$selected;
        }
 
        /**
index 7c9df9a..6342ecf 100644 (file)
@@ -271,7 +271,7 @@ class DatabaseIntegrityView extends BaseScriptClass {
                $this->view->assign('PATH_typo3', PATH_typo3);
 
                if (GeneralUtility::_GP('_update') || GeneralUtility::_GP('_check')) {
-                       $testOnly = GeneralUtility::_GP('_check') ? TRUE : FALSE;
+                       $testOnly = (bool)GeneralUtility::_GP('_check');
                        // Call the functionality
                        $refIndexObj = GeneralUtility::makeInstance(ReferenceIndex::class);
                        list(,$bodyContent) = $refIndexObj->updateIndex($testOnly);
index 2dce8dc..c47a344 100644 (file)
@@ -357,7 +357,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList {
                $this->searchLevels = (int)$levels;
                $this->showLimit = MathUtility::forceIntegerInRange($showLimit, 0, 10000);
                // Setting GPvars:
-               $this->csvOutput = GeneralUtility::_GP('csv') ? TRUE : FALSE;
+               $this->csvOutput = (bool)GeneralUtility::_GP('csv');
                $this->sortField = GeneralUtility::_GP('sortField');
                $this->sortRev = GeneralUtility::_GP('sortRev');
                $this->displayFields = GeneralUtility::_GP('displayFields');
index 16139da..4d7a079 100644 (file)
@@ -50,11 +50,11 @@ class RecyclerUtility {
                        if ($table === 'pages') {
                                // If pages:
                                $calculatedPermissions = $backendUser->calcPerms($calcPRec);
-                               $hasAccess = $calculatedPermissions & Permission::PAGE_EDIT ? TRUE : FALSE;
+                               $hasAccess = (bool)($calculatedPermissions & Permission::PAGE_EDIT);
                        } else {
                                $calculatedPermissions = $backendUser->calcPerms(BackendUtility::getRecord('pages', $calcPRec['pid']));
                                // Fetching pid-record first.
-                               $hasAccess = $calculatedPermissions & Permission::CONTENT_EDIT ? TRUE : FALSE;
+                               $hasAccess = (bool)($calculatedPermissions & Permission::CONTENT_EDIT);
                        }
                        // Check internals regarding access:
                        if ($hasAccess) {
index d32add1..9527d11 100644 (file)
@@ -85,7 +85,7 @@ class Spellchecker extends RteHtmlAreaApi {
                        $spellCheckerMode = 'normal';
                }
                // Set the use of personal dictionary
-               $enablePersonalDicts = $this->configuration['thisConfig']['buttons.'][$button . '.']['enablePersonalDictionaries'] ? (isset($GLOBALS['BE_USER']->userTS['options.']['enablePersonalDicts']) && $GLOBALS['BE_USER']->userTS['options.']['enablePersonalDicts'] ? TRUE : FALSE) : FALSE;
+               $enablePersonalDicts = $this->configuration['thisConfig']['buttons.'][$button . '.']['enablePersonalDictionaries'] && !empty($GLOBALS['BE_USER']->userTS['options.']['enablePersonalDicts']);
                if (in_array($button, $this->toolbar)) {
                        if (!is_array($this->configuration['thisConfig']['buttons.']) || !is_array($this->configuration['thisConfig']['buttons.'][($button . '.')])) {
                                $jsArray[] = 'RTEarea[editornumber].buttons.' . $button . ' = new Object();';
index be7c4e4..33a8059 100644 (file)
@@ -246,7 +246,7 @@ class BlowfishSalt extends Md5Salt {
         */
        public function isValidSaltedPW($saltedPW) {
                $isValid = FALSE;
-               $isValid = !strncmp($this->getSetting(), $saltedPW, strlen($this->getSetting())) ? TRUE : FALSE;
+               $isValid = !strncmp($this->getSetting(), $saltedPW, strlen($this->getSetting()));
                if ($isValid) {
                        $isValid = $this->isValidSalt($saltedPW);
                }
index c98950f..a2edbce 100644 (file)
@@ -216,7 +216,7 @@ class Md5Salt extends AbstractSalt implements SaltInterface {
         */
        public function isValidSaltedPW($saltedPW) {
                $isValid = FALSE;
-               $isValid = !strncmp($this->getSetting(), $saltedPW, strlen($this->getSetting())) ? TRUE : FALSE;
+               $isValid = !strncmp($this->getSetting(), $saltedPW, strlen($this->getSetting()));
                if ($isValid) {
                        $isValid = $this->isValidSalt($saltedPW);
                }
index e5ee395..0b676d4 100644 (file)
@@ -337,7 +337,7 @@ class PhpassSalt extends AbstractSalt implements SaltInterface {
         */
        public function isValidSaltedPW($saltedPW) {
                $isValid = FALSE;
-               $isValid = !strncmp($this->getSetting(), $saltedPW, strlen($this->getSetting())) ? TRUE : FALSE;
+               $isValid = !strncmp($this->getSetting(), $saltedPW, strlen($this->getSetting()));
                if ($isValid) {
                        $isValid = $this->isValidSalt($saltedPW);
                }
index 356f2a7..f22f537 100644 (file)
@@ -640,7 +640,7 @@ class SetupModuleController {
                                        $localizedName = htmlspecialchars($name);
                                }
                                $localLabel = '  -  [' . htmlspecialchars($defaultName) . ']';
-                               $available = is_dir(PATH_typo3conf . 'l10n/' . $locale) ? TRUE : FALSE;
+                               $available = is_dir(PATH_typo3conf . 'l10n/' . $locale);
                                if ($available) {
                                        $languageOptions[$defaultName] = '<option value="' . $locale . '"' . ($this->getBackendUser()->uc['lang'] === $locale ? ' selected="selected"' : '') . '>' . $localizedName . $localLabel . '</option>';
                                }
index 5f1b701..be9e897 100644 (file)
@@ -104,7 +104,7 @@ class TypoScriptTemplateInfoHook {
                        $tmpl->init();
                        // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
                        $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
-                       $existTemplate = is_array($tplRow) ? TRUE : FALSE;
+                       $existTemplate = is_array($tplRow);
                        if ($existTemplate) {
                                $saveId = $tplRow['_ORIG_uid'] ?: $tplRow['uid'];
                                // Update template ?
index 44f2b9b..5bc30bd 100644 (file)
@@ -63,7 +63,7 @@ class ReviewController extends AbstractController {
                                }
                        }
                }
-               $this->pageRenderer->addInlineSetting('Workspaces', 'isLiveWorkspace', (int)$GLOBALS['BE_USER']->workspace === 0 ? TRUE : FALSE);
+               $this->pageRenderer->addInlineSetting('Workspaces', 'isLiveWorkspace', (int)$GLOBALS['BE_USER']->workspace === 0);
                $this->pageRenderer->addInlineSetting('Workspaces', 'workspaceTabs', $this->prepareWorkspaceTabs($wsList, $activeWorkspace));
                $this->pageRenderer->addInlineSetting('Workspaces', 'activeWorkspaceId', $activeWorkspace);
                $this->pageRenderer->addInlineSetting('FormEngine', 'moduleUrl', BackendUtility::getModuleUrl('record_edit'));
index 965eb6c..520ee42 100644 (file)
@@ -424,7 +424,7 @@ class ActionHandler extends AbstractHandler {
                return array(
                        'success' => TRUE,
                        // force refresh after publishing changes
-                       'refreshLivePanel' => $parameters->stageId == -20 ? TRUE : FALSE
+                       'refreshLivePanel' => $parameters->stageId == -20
                );
        }