[TASK] Use single quotes instead of double quotes 30/44830/3
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 20 Nov 2015 15:33:31 +0000 (16:33 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Fri, 20 Nov 2015 16:10:18 +0000 (17:10 +0100)
Resolves: #71735
Releases: master
Change-Id: Iabf78aeab4262909980351a1570d9b561e94ff7f
Reviewed-on: https://review.typo3.org/44830
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
21 files changed:
Build/.php_cs
typo3/sysext/backend/Classes/Form/Container/PaletteAndSingleContainer.php
typo3/sysext/backend/Classes/Form/Element/CheckboxElement.php
typo3/sysext/backend/Classes/Provider/PageTsBackendLayoutDataProvider.php
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/core/Classes/Package/Package.php
typo3/sysext/core/Classes/Resource/ResourceCompressor.php
typo3/sysext/core/Tests/Legacy/typo3/contrib/class.removexssTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/Typo3DatabaseBackendTest.php
typo3/sysext/core/Tests/Unit/Http/UriTest.php
typo3/sysext/core/Tests/Unit/Utility/ExtensionManagementUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php
typo3/sysext/dbal/Tests/Unit/Database/DatabaseSpecificsPostgresqlTest.php
typo3/sysext/extbase/Tests/Functional/Persistence/RelationTest.php
typo3/sysext/form/Classes/Domain/Filter/CurrencyFilter.php
typo3/sysext/form/Tests/Unit/Validator/RequiredValidatorTest.php
typo3/sysext/install/Classes/Controller/ToolController.php
typo3/sysext/install/Tests/Functional/SqlSchemaMigrationServiceTest.php
typo3/sysext/install/Tests/Unit/Service/EnableFileServiceTest.php
typo3/sysext/workspaces/Tests/Functional/Service/WorkspaceServiceTest.php

index 119b5ce..c924a6a 100644 (file)
@@ -61,6 +61,7 @@ return Symfony\CS\Config\Config::create()
         'unused_use',
         'concat_with_spaces',
         'whitespacy_lines',
-        'ordered_use'
+        'ordered_use',
+        'single_quote'
     ])
     ->finder($finder);
\ No newline at end of file
index 0756cb5..288c673 100644 (file)
@@ -263,26 +263,26 @@ class PaletteAndSingleContainer extends AbstractContainer
             $numberOfItems = count($fields);
             $colWidth = (int)floor(12 / $numberOfItems);
             // Column class calculation
-            $colClass = "col-md-12";
+            $colClass = 'col-md-12';
             $colClear = array();
             if ($colWidth == 6) {
-                $colClass = "col-sm-6";
+                $colClass = 'col-sm-6';
                 $colClear = array(
                     2 => 'visible-sm-block visible-md-block visible-lg-block',
                 );
             } elseif ($colWidth === 4) {
-                $colClass = "col-sm-4";
+                $colClass = 'col-sm-4';
                 $colClear = array(
                     3 => 'visible-sm-block visible-md-block visible-lg-block',
                 );
             } elseif ($colWidth === 3) {
-                $colClass = "col-sm-6 col-md-3";
+                $colClass = 'col-sm-6 col-md-3';
                 $colClear = array(
                     2 => 'visible-sm-block',
                     4 => 'visible-md-block visible-lg-block',
                 );
             } elseif ($colWidth <= 2) {
-                $colClass = "checkbox-column col-sm-6 col-md-3 col-lg-2";
+                $colClass = 'checkbox-column col-sm-6 col-md-3 col-lg-2';
                 $colClear = array(
                     2 => 'visible-sm-block',
                     4 => 'visible-md-block',
index f52471f..f34816d 100644 (file)
@@ -45,26 +45,26 @@ class CheckboxElement extends AbstractFormElement
         $cols = (int)$this->data['parameterArray']['fieldConf']['config']['cols'];
         if ($cols > 1) {
             $colWidth = (int)floor(12 / $cols);
-            $colClass = "col-md-12";
+            $colClass = 'col-md-12';
             $colClear = array();
             if ($colWidth == 6) {
-                $colClass = "col-sm-6";
+                $colClass = 'col-sm-6';
                 $colClear = array(
                     2 => 'visible-sm-block visible-md-block visible-lg-block',
                 );
             } elseif ($colWidth === 4) {
-                $colClass = "col-sm-4";
+                $colClass = 'col-sm-4';
                 $colClear = array(
                     3 => 'visible-sm-block visible-md-block visible-lg-block',
                 );
             } elseif ($colWidth === 3) {
-                $colClass = "col-sm-6 col-md-3";
+                $colClass = 'col-sm-6 col-md-3';
                 $colClear = array(
                     2 => 'visible-sm-block',
                     4 => 'visible-md-block visible-lg-block',
                 );
             } elseif ($colWidth <= 2) {
-                $colClass = "checkbox-column col-sm-6 col-md-3 col-lg-2";
+                $colClass = 'checkbox-column col-sm-6 col-md-3 col-lg-2';
                 $colClear = array(
                     2 => 'visible-sm-block',
                     4 => 'visible-md-block',
@@ -120,7 +120,7 @@ class CheckboxElement extends AbstractFormElement
     protected function renderSingleCheckboxElement($label, $itemCounter, $formElementValue, $numberOfItems, $additionalInformation, $disabled)
     {
         $config = $additionalInformation['fieldConf']['config'];
-        $inline = !empty($config['cols']) && $config['cols'] === "inline";
+        $inline = !empty($config['cols']) && $config['cols'] === 'inline';
         $checkboxParameters = $this->checkBoxParams(
             $additionalInformation['itemFormElName'],
             $formElementValue,
index 3acd9a1..8325a7c 100644 (file)
@@ -181,7 +181,7 @@ class PageTsBackendLayoutDataProvider implements DataProviderInterface
             $config = \TYPO3\CMS\Core\Utility\ArrayUtility::flatten($data['config.']);
             $backendLayout['config'] = '';
             foreach ($config as $row => $value) {
-                $backendLayout['config'] .= $row . " = " . $value . "\r\n";
+                $backendLayout['config'] .= $row . ' = ' . $value . "\r\n";
             }
             return $backendLayout;
         }
index 007fa68..d5b5944 100644 (file)
@@ -1373,7 +1373,7 @@ class DatabaseConnection
     public function admin_get_dbs()
     {
         $dbArr = array();
-        $db_list = $this->query("SELECT SCHEMA_NAME FROM information_schema.SCHEMATA");
+        $db_list = $this->query('SELECT SCHEMA_NAME FROM information_schema.SCHEMATA');
         if ($db_list === false) {
             throw new \RuntimeException(
                 'MySQL Error: Cannot get tablenames: "' . $this->sql_error() . '"!',
index a4eb9cb..c19645b 100644 (file)
@@ -119,8 +119,8 @@ class Package implements PackageInterface
     protected function loadFlagsFromComposerManifest()
     {
         $extraFlags = $this->getValueFromComposerManifest('extra');
-        if ($extraFlags !== null && isset($extraFlags->{"typo3/cms"}->{"Package"})) {
-            foreach ($extraFlags->{"typo3/cms"}->{"Package"} as $flagName => $flagValue) {
+        if ($extraFlags !== null && isset($extraFlags->{'typo3/cms'}->{'Package'})) {
+            foreach ($extraFlags->{'typo3/cms'}->{'Package'} as $flagName => $flagValue) {
                 if (property_exists($this, $flagName)) {
                     $this->{$flagName} = $flagValue;
                 }
index e2d59a7..b3f12cf 100644 (file)
@@ -764,7 +764,7 @@ class ResourceCompressor
         // Strip all comment blocks, but keep double/single quoted strings.
         $contents = preg_replace(
             "<($double_quot|$single_quot)|$comment>Ss",
-            "$1",
+            '$1',
             $contents
         );
         // Remove certain whitespace.
index f3e97c9..4c8b3fe 100644 (file)
@@ -36,7 +36,7 @@ class RemoveXSSTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function checkAttackScriptSrcJs()
     {
         $testString = '<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>';
-        $expectedString = "<sc<x>ript SRC=http://ha.ckers.org/xss.js></SCRIPT>";
+        $expectedString = '<sc<x>ript SRC=http://ha.ckers.org/xss.js></SCRIPT>';
         $actualString = RemoveXSS::process($testString);
 
         $this->assertEquals($expectedString, $actualString);
@@ -222,8 +222,8 @@ class RemoveXSSTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function checkAttackLayer()
     {
-        $testString = "<LAYER SRC=\"http://ha.ckers.org/scriptlet.html\"></LAYER>";
-        $expectedString = "<la<x>yer SRC=\"http://ha.ckers.org/scriptlet.html\"></LAYER>";
+        $testString = '<LAYER SRC="http://ha.ckers.org/scriptlet.html"></LAYER>';
+        $expectedString = '<la<x>yer SRC="http://ha.ckers.org/scriptlet.html"></LAYER>';
         $actualString = RemoveXSS::process($testString);
 
         $this->assertEquals($expectedString, $actualString);
index 3666b9c..4ce6d11 100644 (file)
@@ -347,7 +347,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $GLOBALS['TYPO3_DB']
             ->expects($this->at(1))
             ->method('exec_DELETEquery')
-            ->with('cf_Testing', "identifier = aIdentifier");
+            ->with('cf_Testing', 'identifier = aIdentifier');
         $GLOBALS['TYPO3_DB']
             ->expects($this->at(2))
             ->method('fullQuoteStr')
@@ -355,7 +355,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $GLOBALS['TYPO3_DB']
             ->expects($this->at(3))
             ->method('exec_DELETEquery')
-            ->with('cf_Testing_tags', "identifier = aIdentifier");
+            ->with('cf_Testing_tags', 'identifier = aIdentifier');
 
         $backend->remove('aIdentifier');
     }
index 7e15455..623a776 100644 (file)
@@ -104,7 +104,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         return [
             'int'    => [3000],
-            'string' => ["3000"]
+            'string' => ['3000']
         ];
     }
 
index 03a816a..ccbf924 100644 (file)
@@ -1027,7 +1027,7 @@ class ExtensionManagementUtilityTest extends UnitTestCase
                 'test',
             ),
             'commas' => array(
-                "test,",
+                'test,',
                 'test',
             ),
             'multiple commas with trailing spaces' => array(
index ea4d193..0ccbe61 100644 (file)
@@ -4486,7 +4486,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function callUserFunctionCanCallFunction()
     {
         $inputData = array('foo' => 'bar');
-        $result = GeneralUtility::callUserFunction(function () { return "Worked fine"; }, $inputData, $this, '');
+        $result = GeneralUtility::callUserFunction(function () { return 'Worked fine'; }, $inputData, $this, '');
         $this->assertEquals('Worked fine', $result);
     }
 
index 31cd673..0bc83b4 100644 (file)
@@ -2690,7 +2690,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection
         switch ($this->handlerCfg['_DEFAULT']['type']) {
             case 'native':
                 /** @var \mysqli_result $db_list */
-                $db_list = $this->query("SELECT SCHEMA_NAME FROM information_schema.SCHEMATA");
+                $db_list = $this->query('SELECT SCHEMA_NAME FROM information_schema.SCHEMATA');
                 $oldDb = $this->handlerCfg[$this->lastHandlerKey]['config']['database'];
                 while ($row = $db_list->fetch_object()) {
                     $this->handlerCfg[$this->lastHandlerKey]['config']['database'] = $row->SCHEMA_NAME;
index ede0465..dacfe79 100644 (file)
@@ -157,9 +157,9 @@ class DatabaseSpecificsPostgresqlTest extends DatabaseSpecificsTest
             array(array('type' => 'int4', 'has_default' => true, 'default_value' => 0), 0),
             array(array('type' => 'int4', 'has_default' => true, 'default_value' => '(-1)'), -1),
             array(array('type' => 'text', 'has_default' => false, 'default_value' => null), null),
-            array(array('type' => 'varchar', 'has_default' => true, 'default_value' => "''::character varying"), ""),
-            array(array('type' => 'varchar', 'has_default' => true, 'default_value' => "NULL::character varying"), null),
-            array(array('type' => 'varchar', 'has_default' => true, 'default_value' => "'something'::character varying"), "something"),
+            array(array('type' => 'varchar', 'has_default' => true, 'default_value' => "''::character varying"), ''),
+            array(array('type' => 'varchar', 'has_default' => true, 'default_value' => 'NULL::character varying'), null),
+            array(array('type' => 'varchar', 'has_default' => true, 'default_value' => "'something'::character varying"), 'something'),
             array(array('type' => 'varchar', 'has_default' => true, 'default_value' => "'some''thing'::character varying"), "some''thing"),
         );
     }
index 9c3c413..fd774b7 100644 (file)
@@ -425,7 +425,7 @@ class RelationTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase
         /** @var \ExtbaseTeam\BlogExample\Domain\Repository\PostRepository $postRepository */
         $postRepository = $this->objectManager->get(\ExtbaseTeam\BlogExample\Domain\Repository\PostRepository::class);
         $post = $postRepository->findByUid(1);
-        $post->setTitle("newTitle");
+        $post->setTitle('newTitle');
 
         $postRepository->update($post);
         $this->persistentManager->persistAll();
index 94d2da8..8106faa 100644 (file)
@@ -102,7 +102,7 @@ class CurrencyFilter extends AbstractFilter implements FilterInterface
         );
 
         // replace all non numeric characters, decimalPoint and negativ sign
-        $value = preg_replace("/[^0-9.-]/", "", $value);
+        $value = preg_replace('/[^0-9.-]/', '', $value);
         $value = (double)$value;
         return number_format($value, 2, $this->decimalsPoint, $this->thousandSeparator);
     }
index e08c500..4309f18 100644 (file)
@@ -40,7 +40,7 @@ class RequiredValidatorTest extends AbstractValidatorTest
             'array with value 0'      => array(array(0)),
             'array with strings "a" and "b"' => array(array('a', 'b')),
             'array with empty string and "a"' => array(array('', 'a')),
-            'array with empty string and "0"' => array(array('', "0")),
+            'array with empty string and "0"' => array(array('', '0')),
             'array with empty string and 0' => array(array('', 0)),
         );
     }
index f507b9c..9058e43 100644 (file)
@@ -99,7 +99,7 @@ class ToolController extends AbstractController
         register_shutdown_function(function () {
             $error = error_get_last();
             if ($error !== null) {
-                $errorType = $error["type"];
+                $errorType = $error['type'];
 
                 if ($errorType & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)) {
                     $getPostValues = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('install');
index 69bfc38..4e94eb2 100644 (file)
@@ -50,7 +50,7 @@ class SqlSchemaMigrationServiceTest extends \TYPO3\CMS\Core\Tests\FunctionalTest
         // Create a key and a field that belongs to that key:
         $expectedDatabaseSchemaForBeUsers = $currentDatabaseSchemaForBeUsers;
         $expectedDatabaseSchemaForBeUsers['be_users']['fields']['functional_test_field_1'] = "tinyint(1) unsigned NOT NULL default '0'";
-        $expectedDatabaseSchemaForBeUsers['be_users']['keys']['functional_test_key_1'] = "KEY functional_test_key_1 (functional_test_field_1)";
+        $expectedDatabaseSchemaForBeUsers['be_users']['keys']['functional_test_key_1'] = 'KEY functional_test_key_1 (functional_test_field_1)';
         $createFieldDiff = $this->sqlSchemaMigrationService->getDatabaseExtra($expectedDatabaseSchemaForBeUsers, $currentDatabaseSchemaForBeUsers);
         $createFieldDiff = $this->sqlSchemaMigrationService->getUpdateSuggestions($createFieldDiff);
         $this->sqlSchemaMigrationService->performUpdateQueries($createFieldDiff['add'], $createFieldDiff['add']);
index 1f914de..690fa6d 100644 (file)
@@ -64,7 +64,7 @@ class EnableFileServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function getFirstInstallFilePaths($structure, $expected)
     {
-        $vfs = vfsStream::setup("root");
+        $vfs = vfsStream::setup('root');
         vfsStream::create($structure, $vfs);
         /** @var $instance \TYPO3\CMS\Install\Service\EnableFileService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\EnableFileService::class, array('dummy'), array(), '', false);
@@ -126,7 +126,7 @@ class EnableFileServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function removeFirstInstallFile($structure, $expected)
     {
-        $vfs = vfsStream::setup("root");
+        $vfs = vfsStream::setup('root');
         vfsStream::create($structure, $vfs);
         /** @var $instance \TYPO3\CMS\Install\Service\EnableFileService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\EnableFileService::class, array('dummy'), array(), '', false);
index 4e80b4d..e7fa455 100644 (file)
@@ -37,7 +37,7 @@ class WorkspaceServiceTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase
      */
     public function emptyWorkspaceReturnsEmptyArray()
     {
-        $this->markTestSkipped("This test need a review. It is green even if all fixtures are commented out");
+        $this->markTestSkipped('This test need a review. It is green even if all fixtures are commented out');
         $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
         $result = $service->selectVersionsInWorkspace(90);
         $this->assertTrue(empty($result), 'The workspace 90 contains no changes and the result was supposed to be empty');
@@ -135,7 +135,7 @@ class WorkspaceServiceTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase
      */
     public function movedElementsCanNotBeFoundAtTheirOrigin()
     {
-        $this->markTestSkipped("This test need a review. It is green even if all fixtures are commented out");
+        $this->markTestSkipped('This test need a review. It is green even if all fixtures are commented out');
         $this->importDataSet(__DIR__ . '/Fixtures/WorkspaceServiceTestMovedContent.xml');
         // Test if the placeholder can be found when we ask using recursion (same result)
         $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();