Skip to content

Commit c6ee417

Browse files
committed
Update coding standard
1 parent 553b859 commit c6ee417

14 files changed

+40
-62
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"phpstan/phpstan": "^0.9.0",
1919
"phpunit/phpunit": "^6.4",
2020
"phpstan/phpstan-phpunit": "^0.9.0",
21-
"lookyman/coding-standard": "^0.0.6",
2221
"symfony/framework-bundle": "^4.0",
23-
"phpstan/phpstan-strict-rules": "^0.9.0"
22+
"phpstan/phpstan-strict-rules": "^0.9.0",
23+
"lookyman/coding-standard": "0.1.0"
2424
},
2525
"autoload": {
2626
"psr-4": {

phpcs.xml.dist

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ruleset name="PHPStan Symfony">
3-
<rule ref="vendor/lookyman/coding-standard/LookymanCodingStandard/ruleset-7.0.xml">
4-
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName"/>
5-
</rule>
3+
<rule ref="vendor/lookyman/coding-standard/LookymanCodingStandard/ruleset.xml"/>
64
</ruleset>

src/Exception/XmlContainerNotExistsException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony\Exception;
65

src/Rules/ContainerInterfacePrivateServiceRule.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony\Rules;
65

src/Rules/ContainerInterfaceUnknownServiceRule.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony\Rules;
65

src/ServiceMap.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony;
65

@@ -56,21 +55,13 @@ public function __construct(string $containerXml)
5655
}
5756
}
5857

59-
/**
60-
* @param Node $node
61-
* @return array|null
62-
*/
63-
public function getServiceFromNode(Node $node)
58+
public function getServiceFromNode(Node $node): ?array
6459
{
6560
$serviceId = self::getServiceIdFromNode($node);
6661
return $serviceId !== \null && \array_key_exists($serviceId, $this->services) ? $this->services[$serviceId] : \null;
6762
}
6863

69-
/**
70-
* @param Node $node
71-
* @return string|null
72-
*/
73-
public static function getServiceIdFromNode(Node $node)
64+
public static function getServiceIdFromNode(Node $node): ?string
7465
{
7566
if ($node instanceof String_) {
7667
return $node->value;

src/Type/ContainerInterfaceDynamicReturnTypeExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony\Type;
65

src/Type/ControllerDynamicReturnTypeExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony\Type;
65

tests/Rules/ContainerInterfacePrivateServiceRuleTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony\Rules;
65

@@ -17,12 +16,12 @@ protected function getRule(): Rule
1716
return new ContainerInterfacePrivateServiceRule($serviceMap);
1817
}
1918

20-
public function testGetPrivateService()
19+
public function testGetPrivateService(): void
2120
{
2221
$this->analyse([__DIR__ . '/data/ExampleController.php'], [
2322
[
2423
'Service "private" is private.',
25-
15,
24+
14,
2625
],
2726
]);
2827
}

tests/Rules/ContainerInterfaceUnknownServiceRuleTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
declare(strict_types = 1);
2+
declare(strict_types=1);
43

54
namespace Lookyman\PHPStan\Symfony\Rules;
65

@@ -17,20 +16,20 @@ protected function getRule(): Rule
1716
return new ContainerInterfaceUnknownServiceRule($serviceMap);
1817
}
1918

20-
public function testGetUnknownService()
19+
public function testGetUnknownService(): void
2120
{
2221
$this->analyse([__DIR__ . '/data/ExampleController.php'], [
2322
[
2423
'Service "service.not.found" is not registered in the container.',
25-
21,
24+
20,
2625
],
2726
[
2827
'Service "Lookyman\PHPStan\Symfony\ServiceMap" is not registered in the container.',
29-
27,
28+
26,
3029
],
3130
[
3231
'Service "service.Lookyman\PHPStan\Symfony\ServiceMap" is not registered in the container.',
33-
39,
32+
38,
3433
],
3534
]);
3635
}

0 commit comments

Comments
 (0)