8000 minor #46788 CS fixes (nicolas-grekas) · symfony/symfony@0c38f36 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c38f36

Browse files
minor #46788 CS fixes (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- CS fixes | Q | A | ------------- | --- | Branch? | 4. | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - I generated this using the latest version of php-cs-fixer after spotting new changes that fabbot generates. Note that I had to revert many changes done by php-cs-fixer. Looks like it have some rough edges at the moment. Commits ------- 76f5031 CS fixes
2 parents 8f9b736 + 76f5031 commit 0c38f36

File tree

171 files changed

+456
-456
lines changed
  • Tests
  • Routing
  • Serializer
  • Templating
  • Translation
  • Validator
  • VarDumper
  • Yaml
  • Contracts/Translation/Test
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    171 files changed

    +456
    -456
    lines changed

    src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -345,7 +345,7 @@ protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheD
    345345
    $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManagerName)), $memcachedInstance);
    346346
    $cacheDef->addMethodCall('setMemcached', [new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManagerName)))]);
    347347
    break;
    348-
    case 'redis':
    348+
    case 'redis':
    349349
    $redisClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.redis.class').'%';
    350350
    $redisInstanceClass = !empty($cacheDriver['instance_class']) ? $cacheDriver['instance_class'] : '%'.$this->getObjectManagerElementName('cache.redis_instance.class').' 698 %';
    351351
    $redisHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%' 10528 .$this->getObjectManagerElementName('cache.redis_host').'%';

    src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -114,16 +114,16 @@ public function getTypes($class, $property, array $context = [])
    114114
    $fieldName = $associationMapping['indexBy'];
    115115
    if (null === ($typeOfField = $subMetadata->getTypeOfField($fieldName))) {
    116116
    $fieldName = $subMetadata->getFieldForColumn($associationMapping['indexBy']);
    117-
    //Not a property, maybe a column name?
    117+
    // Not a property, maybe a column name?
    118118
    if (null === ($typeOfField = $subMetadata->getTypeOfField($fieldName))) {
    119-
    //Maybe the column name is the association join column?
    119+
    // Maybe the column name is the association join column?
    120120
    $associationMapping = $subMetadata->getAssociationMapping($fieldName);
    121121

    122122
    /** @var ClassMetadataInfo $subMetadata */
    123123
    $indexProperty = $subMetadata->getSingleAssociationReferencedJoinColumnName($fieldName);
    124124
    $subMetadata = $this->entityManager ? $this->entityManager->getClassMetadata($associationMapping['targetEntity']) : $this->classMetadataFactory->getMetadataFor($associationMapping['targetEntity']);
    125125

    126-
    //Not a property, maybe a column name?
    126+
    // Not a property, maybe a column name?
    127127
    if (null === ($typeOfField = $subMetadata->getTypeOfField($indexProperty))) {
    128128
    $fieldName = $subMetadata->getFieldForColumn($indexProperty);
    129129
    $typeOfField = $subMetadata->getTypeOfField($fieldName);

    src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -185,9 +185,9 @@ public function testExtractEnum()
    185185
    }
    186186
    $this->assertEquals([new Type(Type::BUILTIN_TYPE_OBJECT, false, EnumString::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumString', []));
    187187
    $this->assertEquals([new Type(Type::BUILTIN_TYPE_OBJECT, false, EnumInt::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumInt', []));
    188-
    $this->assertEquals(null, $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumStringArray', []));
    188+
    $this->assertNull($this->createExtractor()->getTypes(DoctrineEnum::class, 'enumStringArray', []));
    189189
    $this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, EnumInt::class))], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumIntArray', []));
    190-
    $this->assertEquals(null, $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumCustom', []));
    190+
    $this->assertNull($this->createExtractor()->getTypes(DoctrineEnum::class, 'enumCustom', []));
    191191
    }
    192192

    193193
    public function typesProvider()

    src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -66,14 +66,14 @@
    6666
    $phpunitConfigFilename = $phpunitConfigFilename ?: $getPhpUnitConfig('phpunit.xml');
    6767

    6868
    if ($phpunitConfigFilename) {
    69-
    $phpunitConfig = new DomDocument();
    69+
    $phpunitConfig = new DOMDocument();
    7070
    $phpunitConfig->load($phpunitConfigFilename);
    7171
    } else {
    7272
    $phpunitConfig = false;
    7373
    }
    7474
    }
    7575
    if (false !== $phpunitConfig) {
    76-
    $var = new DOMXpath($phpunitConfig);
    76+
    $var = new DOMXPath($phpunitConfig);
    7777
    foreach ($var->query('//php/server[@name="'.$name.'"]') as $var) {
    7878
    return $var->getAttribute('value');
    7979
    }

    src/Symfony/Bridge/Twig/Extension/CodeExtension.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,7 +35,7 @@ class CodeExtension extends AbstractExtension
    3535
    */
    3636
    public function __construct($fileLinkFormat, string $projectDir, string $charset)
    3737
    {
    38-
    $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
    38+
    $this->fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
    3939
    $this->projectDir = str_replace('\\', '/', $projectDir).'/';
    4040
    $this->charset = $charset;
    4141
    }
    @@ -241,7 +241,7 @@ public function formatLogMessage(string $message, array $context): string
    241241
    if ($context && str_contains($message, '{')) {
    242242
    $replacements = [];
    243243
    foreach ($context as $key => $val) {
    244-
    if (is_scalar($val)) {
    244+
    if (\is_scalar($val)) {
    245245
    $replacements['{'.$key.'}'] = $val;
    246246
    }
    247247
    }

    src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -64,7 +64,7 @@ public function testCompile()
    6464
    sprintf(
    6565
    '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [0 => "tpl1", 1 => "tpl2"], true);',
    6666
    $this->getVariableGetter('form')
    67-
    ),
    67+
    ),
    6868
    trim($compiler->compile($node)->getSource())
    6969
    );
    7070

    @@ -74,7 +74,7 @@ public function testCompile()
    7474
    sprintf(
    7575
    '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [0 => "tpl1", 1 => "tpl2"], false);',
    7676
    $this->getVariableGetter('form')
    77-
    ),
    77+
    ),
    7878
    trim($compiler->compile($node)->getSource())
    7979
    );
    8080

    @@ -86,7 +86,7 @@ public function testCompile()
    8686
    sprintf(
    8787
    '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, "tpl1", true);',
    8888
    $this->getVariableGetter('form')
    89-
    ),
    89+
    ),
    9090
    trim($compiler->compile($node)->getSource())
    9191
    );
    9292

    @@ -96,7 +96,7 @@ public function testCompile()
    9696
    sprintf(
    9797
    '$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, "tpl1", false);',
    9898
    $this->getVariableGetter('form')
    99-
    ),
    99+
    ),
    100100
    trim($compiler->compile($node)->getSource())
    101101
    );
    102102
    }

    src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -38,7 +38,7 @@ public function testCompileWidget()
    3838
    sprintf(
    3939
    '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'widget\')',
    4040
    $this->getVariableGetter('form')
    41-
    ),
    41+
    ),
    4242
    trim($compiler->compile($node)->getSource())
    4343
    );
    4444
    }

    src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -38,8 +38,8 @@ public function testCompileStrict()
    3838
    'echo $this->env->getExtension(\'Symfony\Bridge\Twig\Extension\TranslationExtension\')->trans("trans %%var%%", array_merge(["%%var%%" => %s], %s), "messages");',
    3939
    $this->getVariableGetterWithoutStrictCheck('var'),
    4040
    $this->getVariableGetterWithStrictCheck('foo')
    41-
    ),
    42-
    trim($compiler->compile($node)->getSource())
    41+
    ),
    42+
    trim($compiler->compile($node)->getSource())
    4343
    );
    4444
    }
    4545

    src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -84,8 +84,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
    8484
    ['Architecture', (\PHP_INT_SIZE * 8).' bits'],
    8585
    ['Intl locale', class_exists(\Locale::class, false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'],
    8686
    ['Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'],
    87-
    ['OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
    88-
    ['APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
    87+
    ['OPcache', \extension_loaded('Zend OPcache') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
    88+
    ['APCu', \extension_loaded('apcu') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
    8989
    ['Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'],
    9090
    ];
    9191

    src/Symfony/Bundle/FrameworkBundle/Command/XliffLintCommand.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -57,6 +57,6 @@ protected function configure()
    5757
    <info>php %command.full_name% @AcmeDemoBundle</info>
    5858

    5959
    EOF
    60-
    );
    60+
    );
    6161
    }
    6262
    }

    0 commit comments

    Comments
     (0)
    0