8000 [Meta] fix issues found via PHPStan in Bundle · symfony/symfony@9183062 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9183062

Browse files
committed
[Meta] fix issues found via PHPStan in Bundle
1 parent bfb3048 commit 9183062

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ QA_DOCKER_IMAGE=jakzal/phpqa:latest
22
QA_DOCKER_COMMAND=docker run -it --rm -v "$(shell pwd):/project" -w /project ${QA_DOCKER_IMAGE}
33

44
phpstan:
5-
sh -c "${QA_DOCKER_COMMAND} phpstan analyse --configuration phpstan.neon --level 0 src/Symfony/Bridge"
5+
sh -c "${QA_DOCKER_COMMAND} phpstan analyse --configuration phpstan.neon --level 0 src/Symfony/Bundle"
66

77
##
88
# Special operations

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@
127127
]
128128
},
129129
"autoload-dev": {
130-
"files": [ "src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
130+
"files": [
131+
"src/Symfony/Component/VarDumper/Resources/functions/dump.php",
132+
"vendor/twig/twig/src/Extension/CoreExtension.php"
133+
]
131134
},
132135
"minimum-stability": "dev",
133136
"extra": {

phpstan.neon

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,30 @@ parameters:
33
- vendor/autoload.php
44
- .phpunit/phpunit-6.0/vendor/autoload.php
55
- vendor/bin/.phpunit/phpunit-5.7/vendor/autoload.php
6+
ignoreErrors:
7+
- '#__construct\(\) does not call parent constructor from .+#'
8+
- '#Function pcntl_[^\s]* not found.#'
9+
10+
# not errors, actually expected to fail
11+
- '#Class Symfony\\Bundle\\FrameworkBundle\\Tests\\DependencyInjection\\Compiler\\NotFound not found.#'
612
excludes_analyse:
713
- */src/Symfony/Bridge/*/Tests/Fixtures/*
814
- */src/Symfony/Bridge/*/Tests/*/Fixtures/*
915
- src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/fake_vendor/
1016

1117
- */src/Symfony/Bundle/*/Tests/Fixtures/*
18+
- */src/Symfony/Bundle/*/Tests/*/Fixtures/*
19+
- src/Symfony/Bundle/FrameworkBundle/Resources/views
20+
- src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Resources/views
21+
- src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources
1222

1323
- */src/Symfony/Component/*/Tests/Fixtures/*
1424

1525
- vendor/
1626

1727
# temporary, it's currently incompatible with the interface
1828
- src/Symfony/Bridge/ProxyManager
29+
30+
# temporary, currently crashing PHPStan 0.9.1
31+
- src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php
32+
- src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php

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

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

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

src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.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\Bundle\SecurityBundle\Tests;
12+
namespace Symfony\Bundle\SecurityBundle\Tests\Debug;
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener;

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

0 commit comments

Comments
 (0)
0