[CLEANUP] Replace count with empty in multiple extensions, part II 54/40954/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 7 Jul 2015 13:38:35 +0000 (15:38 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 7 Jul 2015 14:29:26 +0000 (16:29 +0200)
Replace occurences of count() with matching empty() pendants.
Affected extensions:
- info_pagetsconfig
- lang
- linkvalidator
- mediace
- opendocs
- recordlist
- reports
- saltedpasswords

Resolves: #67952
Releases: master
Change-Id: Ifa3e8a24a2be4d4c6373d18e446ed219cac4c30c
Reviewed-on: http://review.typo3.org/40954
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
20 files changed:
typo3/sysext/info_pagetsconfig/Classes/Controller/InfoPageTyposcriptConfigController.php
typo3/sysext/lang/Classes/Domain/Repository/LanguageRepository.php
typo3/sysext/linkvalidator/Classes/Linktype/InternalLinktype.php
typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php
typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php
typo3/sysext/mediace/Classes/ContentObject/MediaContentObject.php
typo3/sysext/mediace/Classes/ContentObject/ShockwaveFlashObjectContentObject.php
typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
typo3/sysext/recordlist/Classes/RecordList.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
typo3/sysext/reports/Classes/Report/Status/FalStatus.php
typo3/sysext/reports/Classes/Report/Status/SecurityStatus.php
typo3/sysext/reports/Classes/Report/Status/SystemStatus.php
typo3/sysext/reports/Classes/Report/Status/Typo3Status.php
typo3/sysext/saltedpasswords/Classes/Salt/SaltFactory.php
typo3/sysext/saltedpasswords/Classes/Task/BulkUpdateTask.php
typo3/sysext/saltedpasswords/Classes/Utility/ExtensionManagerConfigurationUtility.php

index 2b42387..ddb3b09 100644 (file)
@@ -124,7 +124,7 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
                                                ';
                                        }
                                }
-                               if (count($pUids)) {
+                               if (!empty($pUids)) {
                                        $params = '&edit[pages][' . implode(',', $pUids) . ']=edit&columnsOnly=TSconfig';
                                        $onclickUrl = BackendUtility::editOnClick($params);
                                        $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $this->getLanguageService()->getLL('editTSconfig_all', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '<strong>' . $this->getLanguageService()->getLL('editTSconfig_all', TRUE) . '</strong>' . '</a>';
@@ -253,7 +253,7 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
                $currentElement = current($rootlineArray);
                $hierarchicArray[$currentElement['uid']] = htmlspecialchars($currentElement['title']);
                array_shift($rootlineArray);
-               if (count($rootlineArray)) {
+               if (!empty($rootlineArray)) {
                        if (!isset($hierarchicArray[($currentElement['uid'] . '.')])) {
                                $hierarchicArray[$currentElement['uid'] . '.'] = array();
                        }
index 8aa9098..191d089 100644 (file)
@@ -79,7 +79,7 @@ class LanguageRepository {
         * @return \TYPO3\CMS\Lang\Domain\Model\Language[] The language objects
         */
        public function findAll() {
-               if (!count($this->languages)) {
+               if (empty($this->languages)) {
                        $languages = $this->locales->getLanguages();
                        array_shift($languages);
                        foreach ($languages as $locale => $language) {
@@ -135,7 +135,7 @@ class LanguageRepository {
                foreach ($languages as $language) {
                        $dependencies = array_merge($dependencies, $this->locales->getLocaleDependencies($language));
                }
-               if (count($dependencies)) {
+               if (!empty($dependencies)) {
                        $languages = array_unique(array_merge($languages, $dependencies));
                }
                $dir = count($languages) - count($this->selectedLocales);
@@ -145,7 +145,7 @@ class LanguageRepository {
                        array('availableLanguages' => $languages)
                );
                return array(
-                       'success' => count($diff) > 0,
+                       'success' => !empty($diff),
                        'dir' => $dir,
                        'diff' => array_values($diff),
                        'languages' => $languages
index 3427386..88bd20a 100644 (file)
@@ -298,7 +298,7 @@ class InternalLinktype extends AbstractLinktype {
                $domain = rtrim(GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), '/');
                $rootLine = BackendUtility::BEgetRootLine($row['record_pid']);
                // checks alternate domains
-               if (count($rootLine) > 0) {
+               if (!empty($rootLine)) {
                        $protocol = GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
                        $domainRecord = BackendUtility::firstDomainRecord($rootLine);
                        if (!empty($domainRecord)) {
index cdfa0e8..9ef192c 100644 (file)
@@ -331,7 +331,7 @@ class ValidatorTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
                $modTs = BackendUtility::getModTSconfig($page, 'mod.linkvalidator');
                $parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
                $parseObj->parse($this->configuration);
-               if (count($parseObj->errors) > 0) {
+               if (!empty($parseObj->errors)) {
                        $parseErrorMessage = $this->getLanguageService()->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.error.invalidTSconfig') . '<br />';
                        foreach ($parseObj->errors as $errorInfo) {
                                $parseErrorMessage .= $errorInfo[0] . '<br />';
index 4f85869..3bfebd8 100644 (file)
@@ -364,7 +364,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                }
                // Configure audio description
                if ($conf['type'] == 'video') {
-                       if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
+                       if (is_array($conf['audioSources']) && !empty($conf['audioSources'])) {
                                // Add videoJS audio description toggle
                                $pageRenderer->addJsFile($this->getPathToLibrary('videojs/video-js/controls/audio-description.js'));
                        }
@@ -374,11 +374,11 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                        }
                }
                // Assemble Flowplayer configuration
-               if (count($conf['videoflashvars'])) {
+               if (!empty($conf['videoflashvars'])) {
                        $flowplayerVideoConfig = array_merge_recursive($flowplayerVideoConfig, array('clip' => $conf['videoflashvars']));
                }
                $flowplayerVideoJsonConfig = str_replace(array('"true"', '"false"'), array('true', 'false'), json_encode($flowplayerVideoConfig));
-               if (count($conf['audioflashvars'])) {
+               if (!empty($conf['audioflashvars'])) {
                        $flowplayerAudioConfig = array_merge_recursive($flowplayerAudioConfig, array('clip' => $conf['audioflashvars']));
                }
                $flowplayerAudioJsonConfig = str_replace(array('"true"', '"false"'), array('true', 'false'), json_encode($flowplayerAudioConfig));
@@ -475,7 +475,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                                        $videoJsOptions[$videoJsOption] = $conf['params.'][$videoJsOption];
                                }
                        }
-                       $videoJsOptions = count($videoJsOptions) ? json_encode($videoJsOptions) : '{}';
+                       $videoJsOptions = !empty($videoJsOptions) ? json_encode($videoJsOptions) : '{}';
                        // videoJS setup and videoJS listeners for audio description synchronisation
                        if ($audioSources || isset($conf['audioFallback'])) {
                                $videoJsSetup = '
@@ -502,7 +502,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                                if ($conf['preferFlashOverHtml5']) {
                                        $videoTagAssembly = '';
                                        // Create "source" elements
-                                       if (is_array($conf['sources']) && count($conf['sources'])) {
+                                       if (is_array($conf['sources']) && !empty($conf['sources'])) {
                                                foreach ($conf['sources'] as $source) {
                                                        $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
                                                        $mimeType = $this->mimeTypes[$fileinfo['fileext']]['video'];
@@ -567,7 +567,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                var ' . $replaceElementIdString . '_videoTag = document.createElement(\'video\');
                var ' . $replaceElementIdString . '_video_box = document.getElementById("' . $replaceElementIdString . '_video");
                if (' . $replaceElementIdString . '_video_box) {
-                       if (!' . $replaceElementIdString . '_videoTag || !' . $replaceElementIdString . '_videoTag.canPlayType || !(' . (count($supported) ? implode(' || ', $supported) : 'false') . ')) {
+                       if (!' . $replaceElementIdString . '_videoTag || !' . $replaceElementIdString . '_videoTag.canPlayType || !(' . (!empty($supported) ? implode(' || ', $supported) : 'false') . ')) {
                                        // Avoid showing an empty video element
                                if (document.getElementById("' . $replaceElementIdString . '_video_js")) {
                                        document.getElementById("' . $replaceElementIdString . '_video_js").style.display = "none";
@@ -594,7 +594,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                        if ($conf['preferFlashOverHtml5']) {
                                $audioTagAssembly = '';
                                // Create "source" elements
-                               if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
+                               if (is_array($conf['audioSources']) && !empty($conf['audioSources'])) {
                                        foreach ($conf['audioSources'] as $source) {
                                                $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
                                                $mimeType = $this->mimeTypes[$fileinfo['fileext']]['audio'];
@@ -647,7 +647,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                var ' . $replaceElementIdString . '_audioTag = document.createElement(\'audio\');
                var ' . $replaceElementIdString . '_audio_box = document.getElementById("' . $replaceElementIdString . '_audio_box");
                if (' . $replaceElementIdString . '_audio_box) {
-                       if (!' . $replaceElementIdString . '_audioTag || !' . $replaceElementIdString . '_audioTag.canPlayType || !(' . (count($supported) ? implode(' || ', $supported) : 'false') . ')) {
+                       if (!' . $replaceElementIdString . '_audioTag || !' . $replaceElementIdString . '_audioTag.canPlayType || !(' . (!empty($supported) ? implode(' || ', $supported) : 'false') . ')) {
                                        // Avoid showing an empty audio element
                                if (document.getElementById("' . $replaceElementIdString . '_audio_element")) {
                                        document.getElementById("' . $replaceElementIdString . '_audio_element").style.display = "none";
index 08b86ee..7593abd 100644 (file)
@@ -43,7 +43,7 @@ class MediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                $conf['type'] = $this->doFlexFormOverlay($conf, 'type');
                // Video sources
                $sources = $this->doFlexFormOverlay($conf, 'sources', 'mmSourcesContainer');
-               if (is_array($sources) && count($sources)) {
+               if (is_array($sources) && !empty($sources)) {
                        $conf['sources'] = array();
                        foreach ($sources as $key => $source) {
                                if (isset($source['mmSource'])) {
@@ -65,7 +65,7 @@ class MediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                }
                // Audio sources
                $audioSources = $this->doFlexFormOverlay($conf, 'audioSources', 'mmAudioSourcesContainer');
-               if (is_array($audioSources) && count($audioSources)) {
+               if (is_array($audioSources) && !empty($audioSources)) {
                        $conf['audioSources'] = array();
                        foreach ($audioSources as $key => $source) {
                                if (isset($source['mmAudioSource'])) {
@@ -123,7 +123,7 @@ class MediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                                $rawTS = $val['mmParamCustomEntry'];
                                                // Read and merge
                                                $tmp = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(LF, $rawTS);
-                                               if (count($tmp)) {
+                                               if (!empty($tmp)) {
                                                        foreach ($tmp as $tsLine) {
                                                                if ($tsLine[0] !== '#' && ($pos = strpos($tsLine, '.'))) {
                                                                        $parts[0] = substr($tsLine, 0, $pos);
index 5c1455a..0e97f53 100644 (file)
@@ -92,15 +92,15 @@ class ShockwaveFlashObjectContentObject extends \TYPO3\CMS\Frontend\ContentObjec
                if (is_array($conf['flashvars.']) && is_array($typeConf['mapping.']['flashvars.'])) {
                        ArrayUtility::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
                }
-               $flashvars = 'var flashvars = ' . (count($conf['flashvars.']) ? json_encode($conf['flashvars.']) : '{}') . ';';
+               $flashvars = 'var flashvars = ' . (!empty($conf['flashvars.']) ? json_encode($conf['flashvars.']) : '{}') . ';';
                if (is_array($conf['params.']) && is_array($typeConf['mapping.']['params.'])) {
                        ArrayUtility::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
                }
-               $params = 'var params = ' . (count($conf['params.']) ? json_encode($conf['params.']) : '{}') . ';';
+               $params = 'var params = ' . (!empty($conf['params.']) ? json_encode($conf['params.']) : '{}') . ';';
                if (is_array($conf['attributes.']) && is_array($typeConf['attributes.']['params.'])) {
                        ArrayUtility::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
                }
-               $attributes = 'var attributes = ' . (count($conf['attributes.']) ? json_encode($conf['attributes.']) : '{}') . ';';
+               $attributes = 'var attributes = ' . (!empty($conf['attributes.']) ? json_encode($conf['attributes.']) : '{}') . ';';
                $flashVersion = isset($conf['flashVersion.']) ? $this->cObj->stdWrap($conf['flashVersion'], $conf['flashVersion.']) : $conf['flashVersion'];
                if (!$flashVersion) {
                        $flashVersion = '9';
index 97f307b..36f7162 100644 (file)
@@ -93,7 +93,7 @@ class OpendocsToolbarItem implements ToolbarItemInterface {
                $openDocuments = $this->openDocs;
                $recentDocuments = $this->recentDocs;
                $entries = array();
-               if (count($openDocuments)) {
+               if (!empty($openDocuments)) {
                        $entries[] = '<li class="dropdown-header">' . $languageService->getLL('open_docs', TRUE) . '</li>';
                        $i = 0;
                        foreach ($openDocuments as $md5sum => $openDocument) {
@@ -103,7 +103,7 @@ class OpendocsToolbarItem implements ToolbarItemInterface {
                        $entries[] = '<li class="divider"></li>';
                }
                // If there are "recent documents" in the list, add them
-               if (count($recentDocuments)) {
+               if (!empty($recentDocuments)) {
                        $entries[] = '<li class="dropdown-header">' . $languageService->getLL('recent_docs', TRUE) . '</li>';
                        $i = 0;
                        foreach ($recentDocuments as $md5sum => $recentDocument) {
@@ -111,7 +111,7 @@ class OpendocsToolbarItem implements ToolbarItemInterface {
                                $entries[] = $this->renderMenuEntry($recentDocument, $md5sum, TRUE, $i == 1);
                        }
                }
-               if (count($entries)) {
+               if (!empty($entries)) {
                        $content = '<ul class="dropdown-list">' . implode('', $entries) . '</ul>';
                } else {
                        $content = '<p>' . $languageService->getLL('no_docs', TRUE) . '</p>';
index 6e032be..6b1c385 100644 (file)
@@ -397,7 +397,7 @@ class ElementBrowser {
                // CurrentUrl - the current link url must be passed around if it exists
                if ($this->mode === 'wizard') {
                        $currentValues = GeneralUtility::trimExplode(LF, trim($this->P['currentValue']));
-                       if (count($currentValues) > 0) {
+                       if (!empty($currentValues)) {
                                $currentValue = array_pop($currentValues);
                        } else {
                                $currentValue = '';
index af131e6..2f416f9 100644 (file)
@@ -355,7 +355,7 @@ class RecordList {
                        // Has not to do with the clipboard but is simply the delete action. The clipboard object is used to clean up the submitted entries to only the selected table.
                        if ($this->cmd == 'delete') {
                                $items = $dblist->clipObj->cleanUpCBC(GeneralUtility::_POST('CBC'), $this->cmd_table, 1);
-                               if (count($items)) {
+                               if (!empty($items)) {
                                        $cmd = array();
                                        foreach ($items as $iK => $value) {
                                                $iKParts = explode('|', $iK);
index 8a7053d..56006eb 100644 (file)
@@ -667,7 +667,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList {
                if ($this->searchString) {
                        $result = ' AND 0=1';
                        $searchableFields = $this->getSearchFields($table);
-                       if (count($searchableFields) > 0) {
+                       if (!empty($searchableFields)) {
                                if (MathUtility::canBeInterpretedAsInteger($this->searchString)) {
                                        $whereParts = array(
                                                'uid=' . $this->searchString
@@ -716,7 +716,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList {
                                        }
                                }
                                // If search-fields were defined (and there always are) we create the query:
-                               if (count($whereParts)) {
+                               if (!empty($whereParts)) {
                                        $result = ' AND (' . implode(' OR ', $whereParts) . ')';
                                }
                        }
index efc5258..a674be3 100644 (file)
@@ -260,7 +260,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                        // Paste
                        if ($localCalcPerms & Permission::PAGE_NEW || $localCalcPerms & Permission::CONTENT_EDIT) {
                                $elFromTable = $this->clipObj->elFromTable('');
-                               if (count($elFromTable)) {
+                               if (!empty($elFromTable)) {
                                        $onClick = htmlspecialchars(('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable)));
                                        $buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id))
                                                . '" onclick="' . $onClick . '" title="' . $lang->getLL('clip_paste', TRUE) . '">'
@@ -880,7 +880,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                        // If there are elements on the clipboard for this table, then display the
                                        // "paste into" icon:
                                        $elFromTable = $this->clipObj->elFromTable($table);
-                                       if (count($elFromTable)) {
+                                       if (!empty($elFromTable)) {
                                                $href = htmlspecialchars($this->clipObj->pasteUrl($table, $this->id));
                                                $onClick = htmlspecialchars('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable));
                                                $cells['pasteAfter'] = '<a class="btn btn-default" href="' . $href . '" onclick="' . $onClick
@@ -1508,7 +1508,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                }
                // Now, looking for selected elements from the current table:
                $elFromTable = $this->clipObj->elFromTable($table);
-               if (count($elFromTable) && $GLOBALS['TCA'][$table]['ctrl']['sortby']) {
+               if (!empty($elFromTable) && $GLOBALS['TCA'][$table]['ctrl']['sortby']) {
                        // IF elements are found and they can be individually ordered, then add a "paste after" icon:
                        $cells['pasteAfter'] = $isL10nOverlay
                                ? $this->spaceIcon
@@ -1519,7 +1519,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                }
                // Now, looking for elements in general:
                $elFromTable = $this->clipObj->elFromTable('');
-               if ($table == 'pages' && count($elFromTable)) {
+               if ($table == 'pages' && !empty($elFromTable)) {
                        $cells['pasteInto'] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('', $row['uid']))
                                . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg($table, $row, 'into', $elFromTable))
                                . '" title="' . $this->getLanguageService()->getLL('clip_pasteInto', TRUE) . '">'
@@ -1758,11 +1758,11 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
         */
        public function showNewRecLink($table) {
                // No deny/allow tables are set:
-               if (!count($this->allowedNewTables) && !count($this->deniedNewTables)) {
+               if (empty($this->allowedNewTables) && empty($this->deniedNewTables)) {
                        return TRUE;
                }
                return !in_array($table, $this->deniedNewTables)
-                       && (!count($this->allowedNewTables) || in_array($table, $this->allowedNewTables));
+                       && (empty($this->allowedNewTables) || in_array($table, $this->allowedNewTables));
        }
 
        /**
index 42d2e75..4d75ebe 100644 (file)
@@ -94,7 +94,7 @@ class ConfigurationStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
        protected function isMemcachedUsed() {
                $memcachedUsed = FALSE;
                $memcachedServers = $this->getConfiguredMemcachedServers();
-               if (count($memcachedServers)) {
+               if (!empty($memcachedServers)) {
                        $memcachedUsed = TRUE;
                }
                return $memcachedUsed;
@@ -159,7 +159,7 @@ class ConfigurationStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
                                }
                        }
                }
-               if (count($failedConnections)) {
+               if (!empty($failedConnections)) {
                        $value = $GLOBALS['LANG']->getLL('status_connectionFailed');
                        $severity = \TYPO3\CMS\Reports\Status::WARNING;
                        $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:warning.memcache_not_usable') . '<br /><br />' . '<ul><li>' . implode('</li><li>', $failedConnections) . '</li></ul>';
index 4fd3601..764561b 100644 (file)
@@ -61,7 +61,7 @@ class FalStatus implements \TYPO3\CMS\Reports\StatusProviderInterface {
                        }
                }
 
-               if (count($storages)) {
+               if (!empty($storages)) {
                        $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
                                '*',
                                'sys_file',
index 7a770ae..1d8559c 100644 (file)
@@ -158,7 +158,7 @@ class SecurityStatus implements \TYPO3\CMS\Reports\StatusProviderInterface {
        protected function isMemcachedUsed() {
                $memcachedUsed = FALSE;
                $memcachedServers = $this->getConfiguredMemcachedServers();
-               if (count($memcachedServers)) {
+               if (!empty($memcachedServers)) {
                        $memcachedUsed = TRUE;
                }
                return $memcachedUsed;
index 2d52b50..f3af12b 100644 (file)
@@ -109,7 +109,7 @@ class SystemStatus implements \TYPO3\CMS\Reports\StatusProviderInterface {
                                $missingPhpModules[] = $module;
                        }
                }
-               if (count($missingPhpModules) > 0) {
+               if (!empty($missingPhpModules)) {
                        $value = $GLOBALS['LANG']->getLL('status_phpModulesMissing');
                        $message = sprintf($GLOBALS['LANG']->getLL('status_phpModulesList'), implode(', ', $missingPhpModules));
                        $message .= ' ' . $GLOBALS['LANG']->getLL('status_phpModulesInfo');
index cac9c63..e0913c4 100644 (file)
@@ -87,7 +87,7 @@ class Typo3Status implements \TYPO3\CMS\Reports\StatusProviderInterface {
                                }
                        }
                }
-               if (count($xclassFoundArray) > 0) {
+               if (!empty($xclassFoundArray)) {
                        $value = $GLOBALS['LANG']->getLL('status_xclassUsageFound');
                        $message = $GLOBALS['LANG']->getLL('status_xclassUsageFound_message') . '<br />';
                        $message .= '<ol>';
index cff3164..65816dd 100644 (file)
@@ -40,7 +40,7 @@ class SaltFactory {
                $saltMethods = static::getDefaultSaltMethods();
                if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/saltedpasswords']['saltMethods'])) {
                        $configuredMethods = (array)$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/saltedpasswords']['saltMethods'];
-                       if (count($configuredMethods) > 0) {
+                       if (!empty($configuredMethods)) {
                                if (isset($configuredMethods[0])) {
                                        // ensure the key of the array is not numeric, but a class name
                                        foreach ($configuredMethods as $method) {
index a027e3f..a5e45f4 100644 (file)
@@ -127,7 +127,7 @@ class BulkUpdateTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
                        }
                        $updateUsers[] = $user;
                }
-               if (count($updateUsers) > 0) {
+               if (!empty($updateUsers)) {
                        $this->updatePasswords($mode, $updateUsers);
                }
        }
index a9d51b5..8cff46a 100644 (file)
@@ -99,7 +99,7 @@ class ExtensionManagerConfigurationUtility {
        protected function renderMessage() {
                $message = '';
                // If there are problems, render them into an unordered list
-               if (count($this->problems) > 0) {
+               if (!empty($this->problems)) {
                        $message = '<ul><li>###PROBLEMS###</li></ul>';
                        $message = str_replace('###PROBLEMS###', implode('<br />&nbsp;</li><li>', $this->problems), $message);
                        if ($this->errorType > FlashMessage::OK) {