[CLEANUP] Replace count with empty in EXT:backend 83/40683/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 27 Jun 2015 11:20:29 +0000 (13:20 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 4 Jul 2015 00:05:49 +0000 (02:05 +0200)
Replace occurences of count() with matching empty() pendants.

Resolves: #67774
Releases: master
Change-Id: Ie75551a9410affe8840b521e15a0daf68655ba2a
Reviewed-on: http://review.typo3.org/40683
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
44 files changed:
typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php
typo3/sysext/backend/Classes/Controller/BackendLayoutWizardController.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/File/FileController.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
typo3/sysext/backend/Classes/Form/Container/FlexFormLanguageContainer.php
typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php
typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php
typo3/sysext/backend/Classes/Form/DataPreprocessor.php
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
typo3/sysext/backend/Classes/Form/Element/GroupElement.php
typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php
typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php
typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php
typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php
typo3/sysext/backend/Classes/Form/ElementConditionMatcher.php
typo3/sysext/backend/Classes/Form/FormDataTraverser.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/Form/InlineStackProcessor.php
typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizard.php
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php
typo3/sysext/backend/Classes/Module/ModuleController.php
typo3/sysext/backend/Classes/Module/ModuleSettings.php
typo3/sysext/backend/Classes/RecordList/ElementBrowserRecordList.php
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
typo3/sysext/backend/Classes/Sprite/SpriteGenerator.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Template/FrontendDocumentTemplate.php
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php
typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeCommands.php
typo3/sysext/backend/Classes/Tree/TreeNode.php
typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Tree/View/BrowseTreeView.php
typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Classes/View/PageTreeView.php

index da5374d..3b33129 100644 (file)
@@ -372,7 +372,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
                $backendUser = $this->getBackendUser();
                // Groups from TSConfig
                $bookmarkGroups = $backendUser->getTSConfigProp('options.bookmarkGroups');
-               if (is_array($bookmarkGroups) && count($bookmarkGroups)) {
+               if (is_array($bookmarkGroups) && !empty($bookmarkGroups)) {
                        foreach ($bookmarkGroups as $groupId => $label) {
                                if (!empty($label)) {
                                        $this->shortcutGroups[$groupId] = (string)$label;
@@ -382,7 +382,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
                        }
                }
                // Generate global groups, all global groups have negative IDs.
-               if (count($this->shortcutGroups)) {
+               if (!empty($this->shortcutGroups)) {
                        $groups = $this->shortcutGroups;
                        foreach ($groups as $groupId => $groupLabel) {
                                $this->shortcutGroups[$groupId * -1] = $groupLabel;
@@ -518,7 +518,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
                        $pageId = $shortcut['recordid'] ? $shortcut['recordid'] : $this->getLinkedPageId($url);
                        if (MathUtility::canBeInterpretedAsInteger($pageId)) {
                                $page = BackendUtility::getRecord('pages', $pageId);
-                               if (count($page)) {
+                               if (!empty($page)) {
                                        // Set the name to the title of the page
                                        if ($shortcut['type'] == 'other') {
                                                $shortcutName = $page['title'];
index 3d1ca76..adf47b3 100644 (file)
@@ -129,7 +129,7 @@ class BackendLayoutWizardController {
                                for ($j = 1; $j <= $colCount; $j++) {
                                        $cellData = array();
                                        if (!$spannedMatrix[$i][$j]) {
-                                               if (is_array($columns) && count($columns)) {
+                                               if (is_array($columns) && !empty($columns)) {
                                                        $column = array_shift($columns);
                                                        if (isset($column['colspan'])) {
                                                                $cellData['colspan'] = (int)$column['colspan'];
index 81972cf..e2786b4 100644 (file)
@@ -619,7 +619,7 @@ class ElementInformationController {
                // Compile information for title tag:
                $infoData = array();
                $infoDataHeader = '';
-               if (count($rows)) {
+               if (!empty($rows)) {
                        $infoDataHeader = '
                                <tr>
                                        <th class="col-icon"></th>
@@ -690,7 +690,7 @@ class ElementInformationController {
                        }
                }
                $referenceLine = '';
-               if (count($infoData)) {
+               if (!empty($infoData)) {
                        $referenceLine = '
                                <div class="table-fit">
                                        <table class="table table-striped table-hover">
@@ -720,7 +720,7 @@ class ElementInformationController {
                // Compile information for title tag:
                $infoData = array();
                $infoDataHeader = '';
-               if (count($rows)) {
+               if (!empty($rows)) {
                        $infoDataHeader = '
                                <tr>
                                        <th class="col-icon"></th>
index 226e530..8c241c0 100644 (file)
@@ -385,7 +385,7 @@ class NewContentElementController {
                                                        }
                                                }
                                        }
-                                       if (count($groupItems)) {
+                                       if (!empty($groupItems)) {
                                                $wizardItems[$groupKey] = $this->wizard_getGroupHeader($groupKey, $wizardGroup);
                                                $wizardItems = array_merge($wizardItems, $groupItems);
                                        }
@@ -496,7 +496,7 @@ class NewContentElementController {
                                                if (!isset($keepItems[$fN])) {
                                                        $keepItems[$fN] = GeneralUtility::trimExplode(',', $TCEFORM_TSconfig[$fN]['keepItems'], TRUE);
                                                }
-                                               $isNotInKeepItems = count($keepItems[$fN]) && !in_array($fV, $keepItems[$fN]);
+                                               $isNotInKeepItems = !empty($keepItems[$fN]) && !in_array($fV, $keepItems[$fN]);
                                                if ($authModeDeny || $fN === 'CType' && in_array($fV, $removeItems[$fN]) || $isNotInKeepItems) {
                                                        // Remove element all together:
                                                        unset($wizardItems[$key]);
index 3a4fec5..47a7bd1 100644 (file)
@@ -570,17 +570,17 @@ class EditDocumentController {
                        $tce->process_datamap();
                        $tce->process_cmdmap();
                        // If pages are being edited, we set an instruction about updating the page tree after this operation.
-                       if ($tce->pagetreeNeedsRefresh && (isset($this->data['pages']) || $beUser->workspace != 0 && count($this->data))) {
+                       if ($tce->pagetreeNeedsRefresh && (isset($this->data['pages']) || $beUser->workspace != 0 && !empty($this->data))) {
                                BackendUtility::setUpdateSignal('updatePageTree');
                        }
                        // If there was saved any new items, load them:
-                       if (count($tce->substNEWwithIDs_table)) {
+                       if (!empty($tce->substNEWwithIDs_table)) {
                                // save the expanded/collapsed states for new inline records, if any
                                FormEngineUtility::updateInlineView($this->uc, $tce);
                                $newEditConf = array();
                                foreach ($this->editconf as $tableName => $tableCmds) {
                                        $keys = array_keys($tce->substNEWwithIDs_table, $tableName);
-                                       if (count($keys) > 0) {
+                                       if (!empty($keys)) {
                                                foreach ($keys as $key) {
                                                        $editId = $tce->substNEWwithIDs[$key];
                                                        // Check if the $editId isn't a child record of an IRRE action
@@ -601,7 +601,7 @@ class EditDocumentController {
                                        }
                                }
                                // Resetting editconf if newEditConf has values:
-                               if (count($newEditConf)) {
+                               if (!empty($newEditConf)) {
                                        $this->editconf = $newEditConf;
                                }
                                // Finally, set the editconf array in the "getvars" so they will be passed along in URLs as needed.
@@ -612,7 +612,7 @@ class EditDocumentController {
                                $this->compileStoreDat();
                        }
                        // See if any records was auto-created as new versions?
-                       if (count($tce->autoVersionIdMap)) {
+                       if (!empty($tce->autoVersionIdMap)) {
                                $this->fixWSversioningInEditConf($tce->autoVersionIdMap);
                        }
                        // If a document is saved and a new one is created right after.
@@ -1608,7 +1608,7 @@ class EditDocumentController {
                if ($retUrl === '') {
                        return;
                }
-               if (!$this->modTSconfig['properties']['disableDocSelector'] && is_array($this->docHandler) && count($this->docHandler)) {
+               if (!$this->modTSconfig['properties']['disableDocSelector'] && is_array($this->docHandler) && !empty($this->docHandler)) {
                        if (isset($this->docHandler[$currentDocFromHandlerMD5])) {
                                $setupArr = $this->docHandler[$currentDocFromHandlerMD5];
                        } else {
index 3918ffa..1d4365a 100644 (file)
@@ -174,7 +174,7 @@ class FileController {
                $this->init();
                $this->main();
                $errors = $this->fileProcessor->getErrorMessages();
-               if (count($errors)) {
+               if (!empty($errors)) {
                        $ajaxObj->setError(implode(',', $errors));
                } else {
                        $flatResult = array();
index 5d57b6b..3857a44 100644 (file)
@@ -511,7 +511,7 @@ class NewRecordController {
         * @return int -1 for lower, 0 for equal, 1 for greater
         */
        public function sortNewRecordsByConfig($a, $b) {
-               if (count($this->newRecordSortList)) {
+               if (!empty($this->newRecordSortList)) {
                        if (in_array($a, $this->newRecordSortList) && in_array($b, $this->newRecordSortList)) {
                                // Both are in the list, return relative to position in array
                                $sub = array_search($a, $this->newRecordSortList) - array_search($b, $this->newRecordSortList);
@@ -612,13 +612,11 @@ class NewRecordController {
                $allowedNewTables = $allowedNewTables ?: $this->allowedNewTables;
                $deniedNewTables = $deniedNewTables ?: $this->deniedNewTables;
                // No deny/allow tables are set:
-               if (!count($allowedNewTables) && !count($deniedNewTables)) {
+               if (empty($allowedNewTables) && empty($deniedNewTables)) {
                        return TRUE;
-               } elseif (!in_array($table, $deniedNewTables) && (!count($allowedNewTables) || in_array($table, $allowedNewTables))) {
-                       return TRUE;
-               } else {
-                       return FALSE;
                }
+
+               return !in_array($table, $deniedNewTables) && (empty($allowedNewTables) || in_array($table, $allowedNewTables));
        }
 
        /**
index 757ceb5..cd03409 100644 (file)
@@ -608,7 +608,7 @@ class PageLayoutController {
                        $languageMenu = count($this->MOD_MENU['language']) > 1 ? $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.language', TRUE) . BackendUtility::getFuncMenu($this->id, 'SET[language]', $this->current_sys_language, $this->MOD_MENU['language'], '', '') : '';
                        // Find backend layout / coumns
                        $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);
-                       if (count($backendLayout['__colPosList'])) {
+                       if (!empty($backendLayout['__colPosList'])) {
                                $this->colPosList = implode(',', $backendLayout['__colPosList']);
                        }
                        // Removing duplicates, if any
index 9e1488e..f08f100 100644 (file)
@@ -104,7 +104,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface {
                                return $entry;
                        }
                        $children = $entry->getChildren();
-                       if (count($children) > 0) {
+                       if (!empty($children)) {
                                $childRecord = $this->findByModuleNameInGivenEntries($name, $children);
                                if ($childRecord !== FALSE) {
                                        return $childRecord;
index 4c93256..fa2f6b6 100644 (file)
@@ -63,7 +63,7 @@ class FlexFormLanguageContainer extends AbstractContainer {
                                $flexFormRowData['meta']['currentLangId'][] = $langInfo['ISOcode'];
                        }
                }
-               if (!is_array($flexFormRowData['meta']['currentLangId']) || !count($flexFormRowData['meta']['currentLangId'])) {
+               if (!is_array($flexFormRowData['meta']['currentLangId']) || empty($flexFormRowData['meta']['currentLangId'])) {
                        $flexFormRowData['meta']['currentLangId'] = array('DEF');
                }
                $flexFormRowData['meta']['currentLangId'] = array_unique($flexFormRowData['meta']['currentLangId']);
index 8a6b09e..87b6994 100644 (file)
@@ -276,7 +276,7 @@ class InlineControlContainer extends AbstractContainer {
         */
        protected function getUniqueIds($records, $conf = array(), $splitValue = FALSE) {
                $uniqueIds = array();
-               if (isset($conf['foreign_unique']) && $conf['foreign_unique'] && count($records)) {
+               if (isset($conf['foreign_unique']) && $conf['foreign_unique'] && !empty($records)) {
                        foreach ($records as $rec) {
                                // Skip virtual records (e.g. shown in localization mode):
                                if (!isset($rec['__virtual']) || !$rec['__virtual']) {
index 75da98f..ea6f338 100644 (file)
@@ -533,7 +533,7 @@ class SingleFieldContainer extends AbstractContainer {
        protected function arrayCompareComplex($subjectArray, $searchArray, $type = '') {
                $localMatches = 0;
                $localEntries = 0;
-               if (is_array($searchArray) && count($searchArray)) {
+               if (is_array($searchArray) && !empty($searchArray)) {
                        // If no type was passed, try to determine
                        if (!$type) {
                                reset($searchArray);
@@ -587,7 +587,7 @@ class SingleFieldContainer extends AbstractContainer {
         * @return bool Returns TRUE, if the object is an associative array
         */
        protected function isAssociativeArray($object) {
-               return is_array($object) && count($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) ? TRUE : FALSE;
        }
 
        /**
index 6a1c69b..fba4d6c 100644 (file)
@@ -405,7 +405,7 @@ class DataPreprocessor {
                        if ($GLOBALS['TCA'][$fieldConfig['config']['foreign_table']]) {
                                // Getting the data
                                $dataIds = $this->getDataIdList($elements, $fieldConfig, $row, $table);
-                               if (!count($dataIds)) {
+                               if (empty($dataIds)) {
                                        $dataIds = array(0);
                                }
                                $dataAcc[] = $dataIds[0];
index 9ed114a..8001442 100644 (file)
@@ -622,7 +622,7 @@ abstract class AbstractFormElement extends AbstractNode {
                                }
                        }
                        $clipElements = $this->getClipboardElements($allowed, $mode);
-                       if (count($clipElements)) {
+                       if (!empty($clipElements)) {
                                $aOnClick = '';
                                foreach ($clipElements as $elValue) {
                                        if ($mode == 'db') {
index 226a58a..092255b 100644 (file)
@@ -97,7 +97,7 @@ class GroupElement extends AbstractFormElement {
                                // Fall through
                        case 'file':
                                // Creating string showing allowed types:
-                               if (!count($allowed)) {
+                               if (empty($allowed)) {
                                        $allowed = array('*');
                                }
                                // Making the array of file items:
index 8739d0f..0c2bd92 100644 (file)
@@ -124,7 +124,7 @@ class SelectCheckBoxElement extends AbstractFormElement {
                                        $hasHelp = FALSE;
                                        $help = '';
                                        $helpArray = array();
-                                       if (is_array($p[3]) && count($p[3]) > 0 || !empty($p[3])) {
+                                       if (!empty($p[3])) {
                                                $hasHelp = TRUE;
                                                if (is_array($p[3])) {
                                                        $helpArray = $p[3];
@@ -160,7 +160,7 @@ class SelectCheckBoxElement extends AbstractFormElement {
                        }
                }
                // Remaining values (invalid):
-               if (count($itemArray) && !$parameterArray['fieldTSConfig']['disableNoMatchingValueElement'] && !$config['disableNoMatchingValueElement']) {
+               if (!empty($itemArray) && !$parameterArray['fieldTSConfig']['disableNoMatchingValueElement'] && !$config['disableNoMatchingValueElement']) {
                        $currentGroup++;
                        foreach ($itemArray as $theNoMatchValue => $temp) {
                                // Build item array
index 410fe7f..cc3ff37 100644 (file)
@@ -120,7 +120,7 @@ class SelectSingleBoxElement extends AbstractFormElement {
                        $c++;
                }
                // Remaining values:
-               if (count($itemArray) && !$parameterArray['fieldTSConfig']['disableNoMatchingValueElement'] && !$config['disableNoMatchingValueElement']) {
+               if (!empty($itemArray) && !$parameterArray['fieldTSConfig']['disableNoMatchingValueElement'] && !$config['disableNoMatchingValueElement']) {
                        foreach ($itemArray as $theNoMatchValue => $temp) {
                                // Compile <option> tag:
                                array_unshift($opt, '<option value="' . htmlspecialchars($theNoMatchValue) . '" selected="selected">'
index f248c06..4001e77 100644 (file)
@@ -255,7 +255,7 @@ class SelectSingleElement extends AbstractFormElement {
                        </div>';
 
                // Create icon table:
-               if (count($selectIcons) && !$config['noIconsBelowSelect']) {
+               if (!empty($selectIcons) && !$config['noIconsBelowSelect']) {
                        $selectIconColumns = (int)$config['selicon_cols'];
                        if (!$selectIconColumns) {
                                $selectIconColumns = count($selectIcons);
@@ -264,7 +264,8 @@ class SelectSingleElement extends AbstractFormElement {
                        $selectIconRows = ceil(count($selectIcons) / $selectIconColumns);
                        $selectIcons = array_pad($selectIcons, $selectIconRows * $selectIconColumns, '');
                        $out .= '<div class="table-fit table-fit-inline-block"><table class="table table-condensed table-white table-center"><tbody><tr>';
-                       for ($selectIconCount = 0; $selectIconCount < count($selectIcons); $selectIconCount++) {
+                       $selectIconTotalCount = count($selectIcons);
+                       for ($selectIconCount = 0; $selectIconCount < $selectIconTotalCount; $selectIconCount++) {
                                if ($selectIconCount % $selectIconColumns === 0 && $selectIconCount !== 0) {
                                        $out .= '</tr><tr>';
                                }
index cd2da26..f842663 100644 (file)
@@ -87,7 +87,7 @@ class SelectTreeElement extends AbstractFormElement {
                if (!empty($PA['itemFormElValue'])) {
                        $valueArray = explode(',', $PA['itemFormElValue']);
                }
-               if (count($valueArray)) {
+               if (!empty($valueArray)) {
                        foreach ($valueArray as $selectedValue) {
                                $temp = explode('|', $selectedValue);
                                $selectedNodes[] = $temp[0];
index 116bd06..b7603ef 100644 (file)
@@ -87,13 +87,13 @@ class ElementConditionMatcher {
                                        }
                                }
                        }
-                       if (count($conditionEvaluations['OR']) > 0 && in_array(TRUE, $conditionEvaluations['OR'], TRUE)) {
+                       if (!empty($conditionEvaluations['OR']) && in_array(TRUE, $conditionEvaluations['OR'], TRUE)) {
                                // There are OR conditions and at least one of them is TRUE
                                $result = TRUE;
-                       } elseif (count($conditionEvaluations['AND']) > 0 && !in_array(FALSE, $conditionEvaluations['AND'], TRUE)) {
+                       } elseif (!empty($conditionEvaluations['AND']) && !in_array(FALSE, $conditionEvaluations['AND'], TRUE)) {
                                // There are AND conditions and none of them is FALSE
                                $result = TRUE;
-                       } elseif (count($conditionEvaluations['OR']) > 0 || count($conditionEvaluations['AND']) > 0) {
+                       } elseif (!empty($conditionEvaluations['OR']) || !empty($conditionEvaluations['AND'])) {
                                // There are some conditions. But no OR was TRUE and at least one AND was FALSE
                                $result = FALSE;
                        } else {
index f58dfda..8db2d8d 100644 (file)
@@ -86,7 +86,7 @@ class FormDataTraverser {
                $this->currentRow = $row;
                $this->inlineFirstPid = $inlineFirstPid;
                $fieldValue = '';
-               if (count($fieldNameArray) > 0) {
+               if (!empty($fieldNameArray)) {
                        $this->initializeOriginalLanguageUid();
                        $fieldValue = $this->getFieldValueRecursive($fieldNameArray);
                }
@@ -208,7 +208,7 @@ class FormDataTraverser {
                        $relatedUids[] = $foreignUid;
                }
 
-               if (count($relatedUids) > 0) {
+               if (!empty($relatedUids)) {
                        $this->currentTable = $allowedTable;
                }
 
index b5756e1..ccd706f 100644 (file)
@@ -449,7 +449,7 @@ class FormEngine {
        public function processInlineAjaxRequest($_, AjaxRequestHandler $ajaxObj) {
                $ajaxArguments = GeneralUtility::_GP('ajax');
                $ajaxIdParts = explode('::', $GLOBALS['ajaxID'], 2);
-               if (isset($ajaxArguments) && is_array($ajaxArguments) && count($ajaxArguments)) {
+               if (isset($ajaxArguments) && is_array($ajaxArguments) && !empty($ajaxArguments)) {
                        $ajaxMethod = $ajaxIdParts[1];
                        $ajaxObj->setContentFormat('jsonbody');
                        // Construct runtime environment for Inline Relational Record Editing
@@ -1203,7 +1203,7 @@ class FormEngine {
        public function JStop() {
                $out = '';
                // Additional top HTML:
-               if (count($this->additionalCode_pre)) {
+               if (!empty($this->additionalCode_pre)) {
                        $out .= implode('
 
                                <!-- NEXT: -->
index 4a150b5..37fd48f 100644 (file)
@@ -86,7 +86,7 @@ class InlineStackProcessor {
                                                $fieldParts = GeneralUtility::trimExplode(':', $unstable['field']);
                                                $unstable['field'] = array_shift($fieldParts);
                                                // FlexForm parts start with data:
-                                               if (count($fieldParts) > 0 && $fieldParts[0] === 'data') {
+                                               if (!empty($fieldParts) && $fieldParts[0] === 'data') {
                                                        $unstable['flexform'] = $fieldParts;
                                                }
                                        }
@@ -96,7 +96,7 @@ class InlineStackProcessor {
                                }
                                $unstable[$vector[$i % 3]] = $parts[$i];
                        }
-                       if (count($unstable)) {
+                       if (!empty($unstable)) {
                                $this->inlineStructure['unstable'] = $unstable;
                        }
                }
index d854dea..a347280 100644 (file)
@@ -86,7 +86,7 @@ class FormEngineUtility {
                                        }
                                }
                                // Override $GLOBALS['TCA'] field config by remaining TSconfig['config']:
-                               if (count($TSconfig['config'])) {
+                               if (!empty($TSconfig['config'])) {
                                        ArrayUtility::mergeRecursiveWithOverrule($fieldConfig, $TSconfig['config']);
                                }
                        }
index dbe32ab..22da6c5 100644 (file)
@@ -171,7 +171,7 @@ class SuggestWizard {
                        foreach ($flexformDSArray as $sheet) {
                                foreach ($sheet as $dataStructure) {
                                        $fieldConfig = $this->getNestedDsFieldConfig($dataStructure, $flexformElement);
-                                       if (count($fieldConfig) > 0) {
+                                       if (!empty($fieldConfig)) {
                                                $continue = FALSE;
                                                break;
                                        }
@@ -211,7 +211,7 @@ class SuggestWizard {
                // be added to the TCEForm selector, originally fetched from the "allowed" config option in the TCA
                foreach ($queryTables as $queryTable) {
                        // if the table does not exist, skip it
-                       if (!is_array($GLOBALS['TCA'][$queryTable]) || !count($GLOBALS['TCA'][$queryTable])) {
+                       if (!is_array($GLOBALS['TCA'][$queryTable]) || empty($GLOBALS['TCA'][$queryTable])) {
                                continue;
                        }
                        $config = (array)$wizardConfig['default'];
@@ -272,7 +272,7 @@ class SuggestWizard {
                        unset($rows);
                }
                $listItems = array();
-               if (count($resultRows) > 0) {
+               if (!empty($resultRows)) {
                        // traverse all found records and sort them
                        $rowsSort = array();
                        foreach ($resultRows as $key => $row) {
@@ -290,7 +290,7 @@ class SuggestWizard {
                                $listItems[] = '<li' . ($row['class'] != '' ? ' class="' . $row['class'] . '"' : '') . ' id="' . $rowId . '"' . ($row['style'] != '' ? ' style="' . $row['style'] . '"' : '') . '>' . $row['sprite'] . $row['text'] . '</li>';
                        }
                }
-               if (count($listItems) > 0) {
+               if (!empty($listItems)) {
                        $list = implode('', $listItems);
                } else {
                        $list = '<li class="suggest-noresults"><i>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.noRecordFound') . '</i></li>';
index 4cc142d..c1efce4 100644 (file)
@@ -231,9 +231,9 @@ class SuggestWizardDefaultReceiver {
                if (isset($GLOBALS['TCA'][$this->table]['ctrl']['delete'])) {
                        $this->selectClause .= ' AND ' . $GLOBALS['TCA'][$this->table]['ctrl']['delete'] . ' = 0';
                }
-               if (count($this->allowedPages)) {
+               if (!empty($this->allowedPages)) {
                        $pidList = $GLOBALS['TYPO3_DB']->cleanIntArray($this->allowedPages);
-                       if (count($pidList)) {
+                       if (!empty($pidList)) {
                                $this->selectClause .= ' AND pid IN (' . implode(', ', $pidList) . ') ';
                        }
                }
@@ -261,7 +261,7 @@ class SuggestWizardDefaultReceiver {
                        ++$level;
                        $pidList = $GLOBALS['TYPO3_DB']->cleanIntArray($pageIds);
                        $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages', 'pid IN (' . implode(', ', $pidList) . ')', '', '', '', 'uid');
-                       if (count($rows) > 0) {
+                       if (!empty($rows)) {
                                $pageIds = array_keys($rows);
                                $pages = array_merge($pages, $pageIds);
                        } else {
index d6d368d..390e564 100644 (file)
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Backend\Module;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Class with utility functions for module menu
  *
@@ -36,9 +38,9 @@ class ModuleController {
         * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, not in use, as everything can be done via the ModuleMenuRepository directly
         */
        public function __construct() {
-               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
-               $this->moduleMenu = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Module\ModuleStorage::class);
-               $this->moduleMenuRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository::class);
+               GeneralUtility::logDeprecatedFunction();
+               $this->moduleMenu = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Module\ModuleStorage::class);
+               $this->moduleMenuRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository::class);
        }
 
        /**
@@ -49,9 +51,9 @@ class ModuleController {
         * @return void
         */
        public function createModuleMenu() {
-               if (count($this->moduleMenu->getEntries()) === 0) {
+               if (empty($this->moduleMenu->getEntries())) {
                        /** @var $moduleMenu \TYPO3\CMS\Backend\View\ModuleMenuView */
-                       $moduleMenu = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\View\ModuleMenuView::class);
+                       $moduleMenu = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\View\ModuleMenuView::class);
                        $rawData = $moduleMenu->getRawModuleData();
                        $this->convertRawModuleDataToModuleMenuObject($rawData);
                        $this->createMenuEntriesForTbeModulesExt();
@@ -68,7 +70,7 @@ class ModuleController {
        protected function convertRawModuleDataToModuleMenuObject(array $rawModuleData) {
                foreach ($rawModuleData as $module) {
                        $entry = $this->createEntryFromRawData($module);
-                       if (isset($module['subitems']) && count($module['subitems']) > 0) {
+                       if (isset($module['subitems']) && !empty($module['subitems'])) {
                                foreach ($module['subitems'] as $subitem) {
                                        $subEntry = $this->createEntryFromRawData($subitem);
                                        $entry->addChild($subEntry);
@@ -86,7 +88,7 @@ class ModuleController {
         */
        protected function createEntryFromRawData(array $module) {
                /** @var $entry \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule */
-               $entry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Domain\Model\Module\BackendModule::class);
+               $entry = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Domain\Model\Module\BackendModule::class);
                if (!empty($module['name']) && is_string($module['name'])) {
                        $entry->setName($module['name']);
                }
@@ -126,7 +128,7 @@ class ModuleController {
                        $mainEntry = $this->moduleMenuRepository->findByModuleName($main);
                        if ($mainEntry !== FALSE) {
                                $subEntries = $mainEntry->getChildren();
-                               if (count($subEntries) > 0) {
+                               if (!empty($subEntries)) {
                                        $matchingSubEntry = $this->moduleMenuRepository->findByModuleName($mainModule);
                                        if ($matchingSubEntry !== FALSE) {
                                                if (array_key_exists('MOD_MENU', $tbeModuleExt) && array_key_exists('function', $tbeModuleExt['MOD_MENU'])) {
index 8c44fb1..d44a525 100644 (file)
@@ -368,7 +368,7 @@ class ModuleSettings {
                $codeTD = array();
                $code = '';
                // LOAD, REMOVE, but also show selector so you can overwrite an entry with SAVE
-               if ($storedEntries && count($showElements)) {
+               if ($storedEntries && !empty($showElements)) {
                        // Selector box
                        $onChange = 'document.forms[' . GeneralUtility::quoteJSvalue($this->formName) . '][\'storeControl[title]\'].value= this.options[this.selectedIndex].value!=0 ? this.options[this.selectedIndex].text : \'\';';
                        $code = '
index 054a4fb..ba491f3 100644 (file)
@@ -117,7 +117,7 @@ class ElementBrowserRecordList extends \TYPO3\CMS\Recordlist\RecordList\Database
                                        $parameters['values'] = array($table . '_' . $row['uid']);
                                        $parameters['tcaFieldConfig'] = $tcaFieldConfig;
                                        $valueArray = GeneralUtility::callUserFunction($filter['userFunc'], $parameters, $this);
-                                       if (count($valueArray) === 0) {
+                                       if (empty($valueArray)) {
                                                $returnValue = FALSE;
                                        }
                                }
index ff58492..279b76c 100644 (file)
@@ -179,7 +179,7 @@ class LiveSearch {
        protected function findByTable($tableName, $pageIdList, $limit) {
                $fieldsToSearchWithin = $this->extractSearchableFieldsFromTable($tableName);
                $getRecordArray = array();
-               if (count($fieldsToSearchWithin) > 0) {
+               if (!empty($fieldsToSearchWithin)) {
                        $pageBasedPermission = $tableName == 'pages' && $this->userPermissions ? $this->userPermissions : '1=1 ';
                        $where = 'pid IN (' . $pageIdList . ') AND ' . $pageBasedPermission . $this->makeQuerySearchByTable($tableName, $fieldsToSearchWithin);
                        $getRecordArray = $this->getRecordArray($tableName, $where, $this->makeOrderByTable($tableName), $limit);
@@ -334,7 +334,7 @@ class LiveSearch {
                        }
                }
                // If at least one condition was defined, create the search query
-               if (count($whereParts) > 0) {
+               if (!empty($whereParts)) {
                        $queryPart = ' AND (' . implode(' OR ', $whereParts) . ')';
                        // And the relevant conditions for deleted and versioned records
                        $queryPart .= BackendUtility::deleteClause($tableName);
index 3ca3565..f44a739 100644 (file)
@@ -525,7 +525,7 @@ class SpriteGenerator {
                foreach ($subFolders as $folder) {
                        if ($folder !== '.svn') {
                                $icons = GeneralUtility::getFilesInDir(PATH_site . $directoryPath . $folder . '/', 'gif,png,jpg');
-                               if (!in_array($folder, $this->spriteBases) && count($icons) && $folder !== '') {
+                               if (!in_array($folder, $this->spriteBases) && !empty($icons) && $folder !== '') {
                                        $this->spriteBases[] = $folder;
                                }
                                foreach ($icons as $icon) {
index 8b1efe1..84121e9 100644 (file)
@@ -839,7 +839,7 @@ function jumpToUrl(URL) {
                foreach ($this->JScodeArray as $name => $code) {
                        $this->pageRenderer->addJsInlineCode($name, $code, FALSE);
                }
-               if (count($this->JScodeLibArray)) {
+               if (!empty($this->JScodeLibArray)) {
                        GeneralUtility::deprecationLog('DocumentTemplate->JScodeLibArray is deprecated since TYPO3 CMS 7. Use the functionality within pageRenderer directly');
                        foreach ($this->JScodeLibArray as $library) {
                                $this->pageRenderer->addHeaderData($library);
@@ -1423,9 +1423,9 @@ function jumpToUrl(URL) {
                        $cls = array();
                        $valign = 'middle';
                        $cls[] = '<td valign="' . $valign . '">' . $arr1[$a][0] . '</td><td>' . $arr1[$a][1] . '</td>';
-                       if (count($arr2)) {
+                       if (!empty($arr2)) {
                                $cls[] = '<td valign="' . $valign . '">' . $arr2[$a][0] . '</td><td>' . $arr2[$a][1] . '</td>';
-                               if (count($arr3)) {
+                               if (!empty($arr3)) {
                                        $cls[] = '<td valign="' . $valign . '">' . $arr3[$a][0] . '</td><td>' . $arr3[$a][1] . '</td>';
                                }
                        }
index b3e3245..f5ad348 100644 (file)
@@ -45,7 +45,7 @@ class FrontendDocumentTemplate extends DocumentTemplate {
                if ($this->JScode) {
                        $this->pageRenderer->addHeaderData($this->JScode);
                }
-               if (count($this->JScodeArray)) {
+               if (!empty($this->JScodeArray)) {
                        foreach ($this->JScodeArray as $name => $code) {
                                $this->pageRenderer->addJsInlineCode($name, $code, FALSE);
                        }
index 1851504..2c923fb 100644 (file)
@@ -200,17 +200,17 @@ class Commands {
                $tce->stripslashes_values = 0;
                $tce->start($data, $cmd);
                $tce->copyTree = MathUtility::forceIntegerInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
-               if (count($cmd)) {
+               if (!empty($cmd)) {
                        $tce->process_cmdmap();
                        $returnValues = $tce->copyMappingArray_merged;
-               } elseif (count($data)) {
+               } elseif (!empty($data)) {
                        $tce->process_datamap();
                        $returnValues = $tce->substNEWwithIDs;
                } else {
                        $returnValues = array();
                }
                // check errors
-               if (count($tce->errorLog)) {
+               if (!empty($tce->errorLog)) {
                        throw new \RuntimeException(implode(LF, $tce->errorLog), 1333754629);
                }
                return $returnValues;
index 0613b45..16f8294 100644 (file)
@@ -135,7 +135,7 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider {
                                }
                        }
                }
-               if (is_array($subpages) && count($subpages) > 0) {
+               if (is_array($subpages) && !empty($subpages)) {
                        foreach ($subpages as $subpage) {
                                if (in_array($subpage['uid'], $this->hiddenRecords)) {
                                        continue;
@@ -346,7 +346,7 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider {
                        $isTemporaryMountPoint = TRUE;
                        $mountPoints = array($mountPoints);
                }
-               if (!count($mountPoints)) {
+               if (empty($mountPoints)) {
                        return $nodeCollection;
                }
 
index be719a2..144ff8b 100644 (file)
@@ -338,7 +338,7 @@ class ExtdirectTreeCommands {
         */
        static public function addRootlineOfNodeToStateHash($stateId, $nodeId) {
                $mountPoints = array_map('intval', $GLOBALS['BE_USER']->returnWebmounts());
-               if (count($mountPoints) == 0) {
+               if (empty($mountPoints)) {
                        $mountPoints = array(0);
                }
                $mountPoints[] = (int)$GLOBALS['BE_USER']->uc['pageTree_temporaryMountPoint'];
index aed53df..5392ab4 100644 (file)
@@ -54,7 +54,7 @@ class TreeNode implements \TYPO3\CMS\Backend\Tree\ComparableNodeInterface, \Seri
         * @param array $data
         */
        public function __construct(array $data = array()) {
-               if (count($data)) {
+               if (!empty($data)) {
                        $this->dataFromArray($data);
                }
        }
index f13d383..8974eb5 100644 (file)
@@ -31,7 +31,7 @@ class TreeNodeCollection extends \ArrayObject {
         * @param array $data
         */
        public function __construct(array $data = array()) {
-               if (count($data)) {
+               if (!empty($data)) {
                        $this->dataFromArray($data);
                }
        }
index 4587655..fac51e0 100644 (file)
@@ -778,7 +778,7 @@ abstract class AbstractTreeView {
                        $HTML_depthData = $depthData . IconUtility::getSpriteIcon('treeline-' . $LN);
                        if ($depth > 1 && $this->expandNext($newID) && !$row['php_tree_stop']) {
                                $nextCount = $this->getTree($newID, $depth - 1, $this->makeHTML ? $HTML_depthData : '', $blankLineCode . ',' . $LN, $row['_SUBCSSCLASS']);
-                               if (count($this->buffer_idH)) {
+                               if (!empty($this->buffer_idH)) {
                                        $idH[$row['uid']]['subrow'] = $this->buffer_idH;
                                }
                                // Set "did expand" flag
@@ -927,7 +927,7 @@ abstract class AbstractTreeView {
                        }
                        // Passing on default <td> class for subelements:
                        if (is_array($row) && $subCSSclass !== '') {
-                               if ($this->table === 'pages' && $this->highlightPagesWithVersions && !isset($row['_CSSCLASS']) && count(BackendUtility::countVersionsOfRecordsOnPage($this->BE_USER->workspace, $row['uid']))) {
+                               if ($this->table === 'pages' && $this->highlightPagesWithVersions && !isset($row['_CSSCLASS']) && !empty(BackendUtility::countVersionsOfRecordsOnPage($this->BE_USER->workspace, $row['uid']))) {
                                        $row['_CSSCLASS'] = 'ver-versions';
                                }
                                if (!isset($row['_CSSCLASS'])) {
index c0a7e20..755f9c2 100644 (file)
@@ -101,7 +101,7 @@ class BrowseTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
                $title = parent::getTitleStr($row, $titleLen);
                if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
                        $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain', 'pid=' . $GLOBALS['TYPO3_DB']->quoteStr(($row['uid'] . BackendUtility::deleteClause('sys_domain') . BackendUtility::BEenableFields('sys_domain')), 'sys_domain'), '', 'sorting', 1);
-                       if (is_array($rows) && count($rows) > 0) {
+                       if (is_array($rows) && !empty($rows)) {
                                $title = sprintf('%s [%s]', $title, htmlspecialchars($rows[0]['domainName']));
                        }
                }
index 6102a98..499514e 100644 (file)
@@ -249,7 +249,7 @@ class FolderTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
                // If there are filemounts, show each, otherwise just the rootlevel folder
                $fileMounts = $storageObject->getFileMounts();
                $rootLevelFolders = array();
-               if (count($fileMounts)) {
+               if (!empty($fileMounts)) {
                        foreach ($fileMounts as $fileMountInfo) {
                                $rootLevelFolders[] = array(
                                        'folder' => $fileMountInfo['folder'],
@@ -570,7 +570,7 @@ class FolderTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
                        $hashMap = array();
                        foreach ($this->storages as $storageUid => $storage) {
                                $fileMounts = $storage->getFileMounts();
-                               if (count($fileMounts)) {
+                               if (!empty($fileMounts)) {
                                        foreach ($fileMounts as $fileMount) {
                                                $nkey = hexdec(substr(GeneralUtility::md5int($fileMount['folder']->getCombinedIdentifier()), 0, 4));
                                                $this->storageHashNumbers[$storageUid . $fileMount['folder']->getCombinedIdentifier()] = $nkey;
index 6ff88b4..0598087 100644 (file)
@@ -196,7 +196,7 @@ class BackendUtility {
                                $rows[] = $row;
                        }
                        $db->sql_free_result($res);
-                       if (count($rows)) {
+                       if (!empty($rows)) {
                                return $rows;
                        }
                }
@@ -542,7 +542,7 @@ class BackendUtility {
                                }
                        }
                        // Sort fields by the translated value
-                       if (count($excludeArrayTable) > 0) {
+                       if (!empty($excludeArrayTable)) {
                                usort($excludeArrayTable, array(\TYPO3\CMS\Backend\Form\FlexFormsHelper::class, 'compareArraysByFirstValue'));
                                $finalExcludeArray = array_merge($finalExcludeArray, $excludeArrayTable);
                        }
@@ -1951,7 +1951,7 @@ class BackendUtility {
        static public function getLabelsFromItemsList($table, $column, $key) {
                $labels = array();
                $values = GeneralUtility::trimExplode(',', $key, TRUE);
-               if (count($values) > 0) {
+               if (!empty($values)) {
                        // Check if there is an "items" array
                        if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$column]) && is_array($GLOBALS['TCA'][$table]['columns'][$column]['config']['items'])) {
                                // Loop on all selected values
@@ -2186,7 +2186,7 @@ class BackendUtility {
                                                $dbGroup = GeneralUtility::makeInstance(RelationHandler::class);
                                                $dbGroup->start($value, $theColConf['foreign_table'], $theColConf['MM'], $uid, $table, $theColConf);
                                                $selectUids = $dbGroup->tableArray[$theColConf['foreign_table']];
-                                               if (is_array($selectUids) && count($selectUids) > 0) {
+                                               if (is_array($selectUids) && !empty($selectUids)) {
                                                        $MMres = $db->exec_SELECTquery('uid, ' . $MMfield, $theColConf['foreign_table'], 'uid IN (' . implode(',', $selectUids) . ')' . self::deleteClause($theColConf['foreign_table']));
                                                        $mmlA = array();
                                                        while ($MMrow = $db->sql_fetch_assoc($MMres)) {
@@ -2664,7 +2664,7 @@ class BackendUtility {
                $helpText = '';
                $abbrClassAdd = '';
                $wrappedText = $text;
-               $hasHelpTextOverload = count($overloadHelpText) > 0;
+               $hasHelpTextOverload = !empty($overloadHelpText);
                // Get the help text that should be shown on hover
                if (!$hasHelpTextOverload) {
                        $helpText = self::helpText($table, $field);
@@ -2857,7 +2857,7 @@ class BackendUtility {
                        $rootLine = self::BEgetRootLine($pageId);
                }
                // Checks alternate domains
-               if (count($rootLine) > 0) {
+               if (!empty($rootLine)) {
                        $urlParts = parse_url($domain);
                        /** @var PageRepository $sysPage */
                        $sysPage = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
@@ -2937,7 +2937,7 @@ class BackendUtility {
                foreach ($menuItems as $value => $label) {
                        $options[] = '<option value="' . htmlspecialchars($value) . '"' . ((string)$currentValue === (string)$value ? ' selected="selected"' : '') . '>' . htmlspecialchars($label, ENT_COMPAT, 'UTF-8', FALSE) . '</option>';
                }
-               if (count($options)) {
+               if (!empty($options)) {
                        $onChange = 'jumpToUrl(' . GeneralUtility::quoteJSvalue($scriptUrl . '&' . $elementName . '=') . '+this.options[this.selectedIndex].value,this);';
                        return '
 
@@ -3080,7 +3080,7 @@ class BackendUtility {
        static public function getUpdateSignalCode() {
                $signals = array();
                $modData = static::getBackendUserAuthentication()->getModuleData(\TYPO3\CMS\Backend\Utility\BackendUtility::class . '::getUpdateSignal', 'ses');
-               if (!count($modData)) {
+               if (empty($modData)) {
                        return '';
                }
                // Hook: Allows to let TYPO3 execute your JS code
@@ -3707,7 +3707,7 @@ class BackendUtility {
                                        }
                                }
                        }
-                       if (!count($GLOBALS['T3_VAR']['RTEobj'])) {
+                       if (empty($GLOBALS['T3_VAR']['RTEobj'])) {
                                $GLOBALS['T3_VAR']['RTEobj'][] = 'No RTEs configured at all';
                        }
                }
index 38689e6..d5fe12f 100644 (file)
@@ -455,7 +455,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                        }
                                        // Start wrapping div
                                        $content[$key] .= '<div data-colpos="' . $key . '" data-language-uid="' . $lP . '" class="t3js-sortable t3js-sortable-lang t3js-sortable-lang-' . $lP . ' t3-page-ce-wrapper';
-                                       if (count($contentRecordsPerColumn[$key]) === 0) {
+                                       if (empty($contentRecordsPerColumn[$key])) {
                                                $content[$key] .= ' t3-page-ce-empty';
                                        }
                                        $content[$key] .= '">';
@@ -1241,7 +1241,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        }
                        if ($pasteParams) {
                                $elFromTable = $this->clipboard->elFromTable('tt_content');
-                               if (count($elFromTable)) {
+                               if (!empty($elFromTable)) {
                                        $iconsArr['paste'] = '<a href="'
                                                . htmlspecialchars($this->clipboard->pasteUrl('tt_content', $this->id, TRUE, $pasteParams))
                                                . '" onclick="' . htmlspecialchars(('return '
@@ -1252,7 +1252,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        }
                }
                $icons = '';
-               if (count($iconsArr)) {
+               if (!empty($iconsArr)) {
                        $icons = '<div class="t3-page-column-header-icons">' . implode('', $iconsArr) . '</div>';
                }
                // Create header row:
@@ -1288,7 +1288,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                }
 
                // Display info from records fields:
-               if (count($info)) {
+               if (!empty($info)) {
                        $content = '<div class="t3-page-ce-info">
                                ' . implode('<br>', $info) . '
                                </div>';
@@ -1519,7 +1519,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                        } elseif (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['_DEFAULT'])) {
                                                $hookArr = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['_DEFAULT'];
                                        }
-                                       if (count($hookArr) > 0) {
+                                       if (!empty($hookArr)) {
                                                $_params = array('pObj' => &$this, 'row' => $row, 'infoArr' => $infoArr);
                                                foreach ($hookArr as $_funcRef) {
                                                        $hookOut .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
@@ -1631,7 +1631,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         * @return array Modified $defLanguageCount
         */
        public function getNonTranslatedTTcontentUids($defLanguageCount, $id, $lP) {
-               if ($lP && count($defLanguageCount)) {
+               if ($lP && !empty($defLanguageCount)) {
                        // Select all translations here:
                        $queryParts = $this->makeQueryArray('tt_content', $id, 'AND sys_language_uid=' . (int)$lP
                                . ' AND l18n_parent IN (' . implode(',', $defLanguageCount) . ')');
@@ -1657,7 +1657,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         * @return string "Copy languages" button, if available.
         */
        public function newLanguageButton($defLanguageCount, $lP) {
-               if (!$this->doEdit || count($defLanguageCount) === 0 || !$lP) {
+               if (!$this->doEdit || empty($defLanguageCount) || !$lP) {
                        return '';
                }
                $params = '';
@@ -1769,7 +1769,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                && $this->getBackendUser()->groupData['allowed_languages'] !== ''
                        ) {
                                $allowed_languages = array_flip(explode(',', $this->getBackendUser()->groupData['allowed_languages']));
-                               if (count($allowed_languages)) {
+                               if (!empty($allowed_languages)) {
                                        foreach ($langSelItems as $key => $value) {
                                                if (!isset($allowed_languages[$key]) && $key != 0) {
                                                        unset($langSelItems[$key]);
@@ -1782,7 +1782,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        $disableLanguages = isset($modSharedTSconfig['properties']['disableLanguages'])
                                ? GeneralUtility::trimExplode(',', $modSharedTSconfig['properties']['disableLanguages'], TRUE)
                                : array();
-                       if (count($langSelItems) && count($disableLanguages)) {
+                       if (!empty($langSelItems) && !empty($disableLanguages)) {
                                foreach ($disableLanguages as $language) {
                                        if ($language != 0 && isset($langSelItems[$language])) {
                                                unset($langSelItems[$language]);
@@ -2039,7 +2039,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         */
        public function isRTEforField($table, $row, $field) {
                $specConf = $this->getSpecConfForField($table, $row, $field);
-               if (!count($specConf)) {
+               if (empty($specConf)) {
                        return FALSE;
                }
                $p = BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
index 76bcdbd..340578c 100644 (file)
@@ -372,7 +372,7 @@ class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\BrowseTreeView {
                        }
                }
                $label_shownAlphabetically = '';
-               if (count($outOfMenuPages)) {
+               if (!empty($outOfMenuPages)) {
                        // Sort out-of-menu pages:
                        $outOfMenuPages_alphabetic = array();
                        if ($this->ext_alphasortNotinmenuPages) {
@@ -408,7 +408,7 @@ class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\BrowseTreeView {
                        // Make a recursive call to the next level
                        if ($depth > 1 && $this->expandNext($newID) && !$row['php_tree_stop']) {
                                $nextCount = $this->getTree($newID, $depth - 1, $blankLineCode . ',' . $LN, $row['_SUBCSSCLASS']);
-                               if (count($this->buffer_idH)) {
+                               if (!empty($this->buffer_idH)) {
                                        $idH[$row['uid']]['subrow'] = $this->buffer_idH;
                                }
                                // Set "did expand" flag