8000 minor #25558 [2.7] Fix issues found by PHPStan (dkarlovi) · symfony/symfony@f99eb65 · GitHub
[go: up one dir, main page]

Skip to content

Commit f99eb65

Browse files
minor #25558 [2.7] Fix issues found by PHPStan (dkarlovi)
This PR was merged into the 2.7 branch. Discussion ---------- [2.7] Fix issues found by PHPStan | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This is the subpart of #25536 that applies on 2.7. ping @dkarlovi FYI. Commits ------- afa1f14 [2.7] Fix issues found by PHPStan
2 parents 98bfe80 + afa1f14 commit f99eb65

File tree

10 files changed

+17
-25
lines changed

10 files changed

+17
-25
lines changed

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
use Symfony\Component\Form\Forms;
3232
use Symfony\Component\Form\Tests\Extension\Core\Type\BaseTypeTest;
3333
use Symfony\Component\Form\Tests\Extension\Core\Type\FormTypeTest;
34-
use Symfony\Component\PropertyAccess\PropertyAccess;
3534
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleAssociationToIntIdEntity;
3635
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity;
3736

@@ -1102,10 +1101,7 @@ public function testLoaderCaching()
11021101

11031102
$repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS);
11041103

1105-
$entityType = new EntityType(
1106-
$this->emRegistry,
1107-
PropertyAccess::createPropertyAccessor()
1108-
);
1104+
$entityType = new EntityType($this->emRegistry);
11091105

11101106
$entityTypeGuesser = new DoctrineOrmTypeGuesser($this->emRegistry);
11111107

@@ -1165,10 +1161,7 @@ public function testLoaderCachingWithParameters()
11651161

11661162
$repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS);
11671163

1168-
$entityType = new EntityType(
1169-
$this->emRegistry,
1170-
PropertyAccess::createPropertyAccessor()
1171-
D7AE );
1164+
$entityType = new EntityType($this->emRegistry);
11721165

11731166
$entityTypeGuesser = new DoctrineOrmTypeGuesser($this->emRegistry);
11741167

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function fileExcerpt($file, $line)
115115
{
116116
if (is_readable($file)) {
117117
if (extension_loaded('fileinfo')) {
118-
$finfo = new \Finfo();
118+
$finfo = new \finfo();
119119

120120
// Check if the file is an application/octet-stream (eg. Phar file) because highlight_file cannot parse these files
121121
if ('application/octet-stream' === $finfo->file($file, FILEINFO_MIME_TYPE)) {

src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Bundle\TwigBundle\Tests;
12+
namespace Symfony\Bundle\TwigBundle\Tests\Functional;
1313

1414
use Symfony\Component\HttpKernel\Kernel;
1515
use Symfony\Component\Config\Loader\LoaderInterface;
1616
use Symfony\Component\Filesystem\Filesystem;
1717
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
18+
use Symfony\Bundle\TwigBundle\Tests\TestCase;
1819
use Symfony\Bundle\TwigBundle\TwigBundle;
1920

2021
class CacheWarmingTest extends TestCase

src/Symfony/Bundle/TwigBundle/Tests/Functional/NoTemplatingEntryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Bundle\TwigBundle\Tests;
12+
namespace Symfony\Bundle\TwigBundle\Tests\Functional;
1313

1414
use Symfony\Component\HttpKernel\Kernel;
1515
use Symfony\Component\Config\Loader\LoaderInterface;
1616
use Symfony\Component\Filesystem\Filesystem;
1717
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
18+
use Symfony\Bundle\TwigBundle\Tests\TestCase;
1819
use Symfony\Bundle\TwigBundle\TwigBundle;
1920

2021
class NoTemplatingEntryTest extends TestCase

src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
namespace Symfony\Component\Config\Tests\Definition\Builder;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder as CustomNodeBuilder;
15+
use Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder as CustomNodeBuilder;
1616
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1717

18-
require __DIR__.'/../../Fixtures/Builder/NodeBuilder.php';
19-
require __DIR__.'/../../Fixtures/Builder/BarNodeDefinition.php';
20-
require __DIR__.'/../../Fixtures/Builder/VariableNodeDefinition.php';
21-
2218
class TreeBuilderTest extends TestCase
2319
{
2420
public function testUsingACustomNodeBuilder()
@@ -28,11 +24,11 @@ public function testUsingACustomNodeBuilder()
2824

2925
$nodeBuilder = $root->children();
3026

31-
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder);
27+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder', $nodeBuilder);
3228

3329
$nodeBuilder = $nodeBuilder->arrayNode('deeper')->children();
3430

35-
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder);
31+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder', $nodeBuilder);
3632
}
3733

3834
public function testOverrideABuiltInNodeType()
@@ -42,7 +38,7 @@ public function testOverrideABuiltInNodeType()
4238

4339
$definition = $root->children()->variableNode('variable');
4440

45-
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\VariableNodeDefinition', $definition);
41+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\VariableNodeDefinition', $definition);
4642
}
4743

4844
public function testAddANodeType()
@@ -52,7 +48,7 @@ public function testAddANodeType()
5248

5349
$definition = $root->children()->barNode('variable');
5450

55-
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\BarNodeDefinition', $definition);
51+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\BarNodeDefinition', $definition);
5652
}
5753

5854
public function testCreateABuiltInNodeTypeWithACustomNodeBuilder()

src/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Config\Tests\Definition\Builder;
12+
namespace Symfony\Component\Config\Tests\Fixtures\Builder;
1313

1414
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
1515
use Symfony\Component\Config\Tests\Fixtures\BarNode;

src/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Config\Tests\Definition\Builder;
12+
namespace Symfony\Component\Config\Tests\Fixtures\Builder;
1313

1414
use Symfony\Component\Config\Definition\Builder\NodeBuilder as BaseNodeBuilder;
1515

src/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Config\Tests\Definition\Builder;
12+
namespace Symfony\Component\Config\Tests\Fixtures\Builder;
1313

1414
use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition as BaseVariableNodeDefinition;
1515

src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public function flattenDataProvider()
193193

194194
public function testRecursionInArguments()
195195
{
196+
$a = null;
196197
$a = array('foo', array(2, &$a));
197198
$exception = $this->createException($a);
198199

src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ public function ianaCodesReasonPhrasesProvider()
912912

913913
$ianaCodesReasonPhrases = array();
914914

915-
$xpath = new \DomXPath($ianaHttpStatusCodes);
915+
$xpath = new \DOMXPath($ianaHttpStatusCodes);
916916
$xpath->registerNamespace('ns', 'http://www.iana.org/assignments');
917917

918918
$records = $xpath->query('//ns:record');

0 commit comments

Comments
 (0)
0