Skip to content

Commit 8ef0933

Browse files
committed
improve include, removed side effects.
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 11 and the first side effect is on line 9. (PSR1.Files.SideEffects.FoundWithSymbols)
1 parent 5f5f5e5 commit 8ef0933

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

tests/Rules/ContainerInterfacePrivateServiceRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
final class ContainerInterfacePrivateServiceRuleTest extends \PHPStan\Testing\RuleTestCase
1111
{
1212

13+
protected function setUp()
14+
{
15+
include_once __DIR__ . '/data/Controller.php';
16+
}
17+
1318
protected function getRule(): Rule
1419
{
1520
$serviceMap = new ServiceMap(__DIR__ . '/../container.xml');

tests/Rules/ContainerInterfaceUnknownServiceRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
final class ContainerInterfaceUnknownServiceRuleTest extends \PHPStan\Testing\RuleTestCase
1111
{
1212

13+
protected function setUp()
14+
{
15+
include_once __DIR__ . '/data/Controller.php';
16+
}
17+
1318
protected function getRule(): Rule
1419
{
1520
$serviceMap = new ServiceMap(__DIR__ . '/../container.xml');

tests/Rules/data/ExampleController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
88

9-
include __DIR__ . '/Controller.php';
10-
119
final class ExampleController extends Controller
1210
{
1311

0 commit comments

Comments
 (0)