[CLEANUP] Replace count with empty in EXT:rtehtmlarea 57/40957/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 7 Jul 2015 13:47:19 +0000 (15:47 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 7 Jul 2015 14:28:33 +0000 (16:28 +0200)
Replace occurences of count() with matching empty() pendants.

Resolves: #67953
Releases: master
Change-Id: I22eef6d10406f5cc1d1d85a7179f98240083f178
Reviewed-on: http://review.typo3.org/40957
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>
typo3/sysext/rtehtmlarea/Classes/BrowseLinks.php
typo3/sysext/rtehtmlarea/Classes/Controller/SpellCheckingController.php
typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php
typo3/sysext/rtehtmlarea/Classes/Hook/Install/DeprecatedRteProperties.php
typo3/sysext/rtehtmlarea/Classes/Hook/Install/RteAcronymButtonRenamedToAbbreviation.php
typo3/sysext/rtehtmlarea/Classes/Hook/SoftReferenceHook.php
typo3/sysext/rtehtmlarea/Classes/Hook/StatusReportConflictsCheckHook.php

index 42939bf..3e3f171 100644 (file)
@@ -303,7 +303,7 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                        var add_class=' . GeneralUtility::quoteJSvalue($this->setClass ? '&curUrl[class]=' . rawurlencode($this->setClass) : '') . ';
                        var add_title=' . GeneralUtility::quoteJSvalue($this->setTitle ? '&curUrl[title]=' . rawurlencode($this->setTitle) : '') . ';
                        var add_params=' . GeneralUtility::quoteJSvalue($this->bparams ? '&bparams=' . rawurlencode($this->bparams) : '') . ';
-                       var additionalValues = ' . (count($this->additionalAttributes) ? json_encode($this->additionalAttributes, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) : '{}') . ';';
+                       var additionalValues = ' . (!empty($this->additionalAttributes) ? json_encode($this->additionalAttributes, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) : '{}') . ';';
                // Attributes setting functions
                $JScode .= '
                        var cur_href=' . GeneralUtility::quoteJSvalue($this->curUrlArray['href'] ? ($this->curUrlInfo['query'] ? substr($this->curUrlArray['href'], 0, -strlen($this->curUrlInfo['query'])) : $this->curUrlArray['href']) : '') . ';
index c557805..f1c7cc1 100644 (file)
@@ -172,7 +172,7 @@ class SpellCheckingController {
                if ($restrictToDictionaries) {
                        $dictionaryArray = array_intersect($dictionaryArray, GeneralUtility::trimExplode(',', $restrictToDictionaries, 1));
                }
-               if (!count($dictionaryArray)) {
+               if (empty($dictionaryArray)) {
                        $dictionaryArray[] = 'en';
                }
                $this->dictionary = GeneralUtility::_POST('dictionary');
index e4a36cf..4ae9341 100644 (file)
@@ -734,7 +734,7 @@ class RichTextElement extends AbstractFormElement {
                $jsArray[] = 'RTEarea[editornumber].keepButtonGroupTogether = ' . (trim($this->processedRteConfiguration['keepButtonGroupTogether']) ? 'true;' : 'false;');
                $jsArray[] = 'RTEarea[editornumber].disablePCexamples = ' . (trim($this->processedRteConfiguration['disablePCexamples']) ? 'true;' : 'false;');
                $jsArray[] = 'RTEarea[editornumber].showTagFreeClasses = ' . (trim($this->processedRteConfiguration['showTagFreeClasses']) ? 'true;' : 'false;');
-               $jsArray[] = 'RTEarea[editornumber].tceformsNested = ' . (count($this->globalOptions) ? json_encode($this->globalOptions['tabAndInlineStack']) : '[]') . ';';
+               $jsArray[] = 'RTEarea[editornumber].tceformsNested = ' . (!empty($this->globalOptions) ? json_encode($this->globalOptions['tabAndInlineStack']) : '[]') . ';';
                $jsArray[] = 'RTEarea[editornumber].dialogueWindows = new Object();';
                if (isset($this->processedRteConfiguration['dialogueWindows.']['defaultPositionFromTop'])) {
                        $jsArray[] = 'RTEarea[editornumber].dialogueWindows.positionFromTop = ' . (int)$this->processedRteConfiguration['dialogueWindows.']['defaultPositionFromTop'] . ';';
index 6670e2a..e9676cb 100644 (file)
@@ -127,7 +127,7 @@ class DeprecatedRteProperties extends AbstractUpdate {
                }
                if ($pagesCount) {
                        $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
-                       if (count($updateablePages)) {
+                       if (!empty($updateablePages)) {
                                $replacementProperties = '';
                                foreach ($this->replacementRteProperties as $deprecatedProperty => $replacementProperty) {
                                        $replacementProperties .= '<tr><td>' . $deprecatedProperty . '</td><td>' . $replacementProperty . '</td></tr>' . LF;
@@ -170,7 +170,7 @@ class DeprecatedRteProperties extends AbstractUpdate {
                        $pagesCount = count($pages);
                        if ($pagesCount) {
                                $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
-                               if (count($updateablePages)) {
+                               if (!empty($updateablePages)) {
                                        $this->updatePages($updateablePages, $dbQueries, $customMessages);
                                        // If the update was successful
                                        if (empty($customMessages)) {
@@ -178,7 +178,7 @@ class DeprecatedRteProperties extends AbstractUpdate {
                                                if (count($updateablePages) === $pagesCount) {
                                                        $pagesAfter = $this->getPagesWithDeprecatedRteProperties($dbQueries, $customMessages);
                                                        if (empty($customMessages)) {
-                                                               if (count($pagesAfter)) {
+                                                               if (!empty($pagesAfter)) {
                                                                        $customMessages = 'Some deprecated Page TSconfig properties were found. However, the wizard was unable to automatically replace all the deprecated properties found. Some properties will have to be replaced manually.';
                                                                }
                                                        }
index 1fa4739..a7eac67 100644 (file)
@@ -48,7 +48,7 @@ class RteAcronymButtonRenamedToAbbreviation extends AbstractUpdate {
                }
                if ($pagesCount) {
                        $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
-                       if (count($updateablePages)) {
+                       if (!empty($updateablePages)) {
                                $description .= '<p>This wizard will perform automatic replacement of the string "acronym" by the string "abbreviation" on the Page TSconfig of <strong>' . strval(count($updateablePages)) . '&nbsp;pages</strong> (including deleted and hidden):</p>' . LF;
                        }
                        $result = TRUE;
@@ -81,7 +81,7 @@ class RteAcronymButtonRenamedToAbbreviation extends AbstractUpdate {
                        $pagesCount = count($pages);
                        if ($pagesCount) {
                                $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
-                               if (count($updateablePages)) {
+                               if (!empty($updateablePages)) {
                                        $this->updatePages($updateablePages, $dbQueries, $customMessages);
                                        // If the update was successful
                                        if (empty($customMessages)) {
index 0a9a6f8..a9a55ad 100644 (file)
@@ -87,7 +87,7 @@ class SoftReferenceHook extends \TYPO3\CMS\Core\Database\SoftReferenceIndex {
                        }
                }
                // Assemble result array
-               if (count($elements)) {
+               if (!empty($elements)) {
                        $retVal = array(
                                'content' => implode('', $imgTags),
                                'elements' => $elements
index fd6dc2c..4d93845 100644 (file)
@@ -53,7 +53,7 @@ class StatusReportConflictsCheckHook implements StatusProviderInterface {
                                }
                        }
                }
-               if (count($conflictingExtensions)) {
+               if (!empty($conflictingExtensions)) {
                        $value = $languageService->sL('LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_statusreport.xlf:keys')
                                . ' ' . implode(', ', $conflictingExtensions);
                        $message = $languageService->sL('LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_statusreport.xlf:uninstall');