Skip to content

Commit a0961f7

Browse files
committed
Fixes
1 parent e71954a commit a0961f7

7 files changed

+9
-26
lines changed

src/Rules/Deprecations/DefaultDeprecationProvider.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,9 @@ public function getDeprecation($reflection): ?Deprecation
2323
: null;
2424
}
2525

26-
if (
27-
$reflection instanceof ConstantReflection
28-
|| $reflection instanceof EnumCaseReflection
29-
|| $reflection instanceof ExtendedPropertyReflection
30-
|| $reflection instanceof ExtendedMethodReflection
31-
|| $reflection instanceof FunctionReflection
32-
) {
33-
return $reflection->isDeprecated()->yes()
34-
? Deprecation::create()->withDescription($reflection->getDeprecatedDescription())
35-
: null;
36-
}
37-
38-
return null;
26+
return $reflection->isDeprecated()->yes()
27+
? Deprecation::create()->withDescription($reflection->getDeprecatedDescription())
28+
: null;
3929
}
30+
4031
}

src/Rules/Deprecations/Deprecation.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
namespace PHPStan\Rules\Deprecations;
44

5-
use PHPStan\BetterReflection\Reflection\ReflectionClass;
6-
use PHPStan\BetterReflection\Reflection\ReflectionFunction;
7-
use PHPStan\BetterReflection\Reflection\ReflectionMethod;
8-
use PHPStan\BetterReflection\Reflection\ReflectionProperty;
9-
use PHPStan\Reflection\PropertyReflection;
10-
115
/**
126
* @api
137
*/
@@ -20,11 +14,13 @@ private function __construct()
2014
{
2115
}
2216

23-
public static function create(): self {
17+
public static function create(): self
18+
{
2419
return new self();
2520
}
2621

27-
public function withDescription(?string $description): self {
22+
public function withDescription(?string $description): self
23+
{
2824
$clone = clone $this;
2925
$clone->description = $description;
3026
return $clone;

src/Rules/Deprecations/DeprecationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace PHPStan\Rules\Deprecations;
44

tests/Rules/Deprecations/CallWithDeprecatedIniOptionRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ protected function getRule(): Rule
2020
$this->createReflectionProvider(),
2121
new DeprecatedScopeHelper([new DefaultDeprecatedScopeResolver($deprecationHelper)]),
2222
self::getContainer()->getByType(PhpVersion::class),
23-
$deprecationHelper,
2423
);
2524
}
2625

tests/Rules/Deprecations/TypeHintDeprecatedInClassMethodSignatureRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ protected function getRule(): Rule
1717
return new TypeHintDeprecatedInClassMethodSignatureRule(
1818
new DeprecatedClassHelper($this->createReflectionProvider(), $deprecationHelper),
1919
new DeprecatedScopeHelper([new DefaultDeprecatedScopeResolver($deprecationHelper)]),
20-
$deprecationHelper,
2120
);
2221
}
2322

tests/Rules/Deprecations/TypeHintDeprecatedInClosureSignatureRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ protected function getRule(): Rule
1717
return new TypeHintDeprecatedInClosureSignatureRule(
1818
new DeprecatedClassHelper($this->createReflectionProvider(), $deprecationHelper),
1919
new DeprecatedScopeHelper([new DefaultDeprecatedScopeResolver($deprecationHelper)]),
20-
$deprecationHelper,
2120
);
2221
}
2322

tests/Rules/Deprecations/TypeHintDeprecatedInFunctionSignatureRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ protected function getRule(): Rule
1717
return new TypeHintDeprecatedInFunctionSignatureRule(
1818
new DeprecatedClassHelper($this->createReflectionProvider(), $deprecationHelper),
1919
new DeprecatedScopeHelper([new DefaultDeprecatedScopeResolver($deprecationHelper)]),
20-
$deprecationHelper,
2120
);
2221
}
2322

0 commit comments

Comments
 (0)