Skip to content

Commit 6fbe3c4

Browse files
staabmondrejmirtes
authored andcommitted
More DynamicFunctionReturnTypeExtension converted to #[AutowiredService] attribute usage
1 parent 339a29d commit 6fbe3c4

File tree

98 files changed

+208
-492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+208
-492
lines changed

conf/config.neon

Lines changed: 14 additions & 492 deletions
Large diffs are not rendered by default.

src/Type/Php/ArgumentBasedFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\Accessory\NonEmptyArrayType;
910
use PHPStan\Type\ArrayType;
@@ -13,6 +14,7 @@
1314
use PHPStan\Type\TypeCombinator;
1415
use function array_key_exists;
1516

17+
#[AutowiredService]
1618
final class ArgumentBasedFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1719
{
1820

src/Type/Php/ArrayChangeKeyCaseFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\Accessory\AccessoryArrayListType;
910
use PHPStan\Type\Accessory\AccessoryLowercaseStringType;
@@ -29,6 +30,7 @@
2930
use const CASE_LOWER;
3031
use const CASE_UPPER;
3132

33+
#[AutowiredService]
3234
final class ArrayChangeKeyCaseFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
3335
{
3436

src/Type/Php/ArrayChunkFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Php\PhpVersion;
89
use PHPStan\Reflection\FunctionReflection;
910
use PHPStan\Type\Constant\ConstantBooleanType;
@@ -14,6 +15,7 @@
1415
use PHPStan\Type\Type;
1516
use function count;
1617

18+
#[AutowiredService]
1719
final class ArrayChunkFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1820
{
1921

src/Type/Php/ArrayColumnFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\NullType;
1011
use PHPStan\Type\Type;
1112
use function count;
1213

14+
#[AutowiredService]
1315
final class ArrayColumnFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1416
{
1517

src/Type/Php/ArrayColumnHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPStan\Type\Php;
44

55
use PHPStan\Analyser\Scope;
6+
use PHPStan\DependencyInjection\AutowiredService;
67
use PHPStan\Php\PhpVersion;
78
use PHPStan\ShouldNotHappenException;
89
use PHPStan\TrinaryLogic;
@@ -17,6 +18,7 @@
1718
use PHPStan\Type\Type;
1819
use PHPStan\Type\TypeCombinator;
1920

21+
#[AutowiredService]
2022
final class ArrayColumnHelper
2123
{
2224

src/Type/Php/ArrayCombineFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PhpParser\Node\Expr\FuncCall;
66
use PhpParser\Node\Expr\Variable;
77
use PHPStan\Analyser\Scope;
8+
use PHPStan\DependencyInjection\AutowiredService;
89
use PHPStan\Php\PhpVersion;
910
use PHPStan\Reflection\FunctionReflection;
1011
use PHPStan\Type\Accessory\NonEmptyArrayType;
@@ -23,6 +24,7 @@
2324
use PHPStan\Type\UnionType;
2425
use function count;
2526

27+
#[AutowiredService]
2628
final class ArrayCombineFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
2729
{
2830

src/Type/Php/ArrayCurrentDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\Constant\ConstantBooleanType;
910
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\TypeCombinator;
1213

14+
#[AutowiredService]
1315
final class ArrayCurrentDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1416
{
1517

src/Type/Php/ArrayFillFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Php\PhpVersion;
89
use PHPStan\Reflection\FunctionReflection;
910
use PHPStan\Type\Accessory\AccessoryArrayListType;
@@ -20,6 +21,7 @@
2021
use PHPStan\Type\TypeCombinator;
2122
use function count;
2223

24+
#[AutowiredService]
2325
final class ArrayFillFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
2426
{
2527

src/Type/Php/ArrayFillKeysFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Php\PhpVersion;
89
use PHPStan\Reflection\FunctionReflection;
910
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
@@ -12,6 +13,7 @@
1213
use PHPStan\Type\Type;
1314
use function count;
1415

16+
#[AutowiredService]
1517
final class ArrayFillKeysFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1618
{
1719

src/Type/Php/ArrayFilterFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\Type;
1011

12+
#[AutowiredService]
1113
final class ArrayFilterFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1214
{
1315

src/Type/Php/ArrayFilterFunctionReturnTypeHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use PhpParser\Node\Stmt\Return_;
1616
use PHPStan\Analyser\MutatingScope;
1717
use PHPStan\Analyser\Scope;
18+
use PHPStan\DependencyInjection\AutowiredService;
1819
use PHPStan\Reflection\ReflectionProvider;
1920
use PHPStan\ShouldNotHappenException;
2021
use PHPStan\TrinaryLogic;
@@ -38,6 +39,7 @@
3839
use function sprintf;
3940
use function substr;
4041

42+
#[AutowiredService]
4143
final class ArrayFilterFunctionReturnTypeHelper
4244
{
4345

src/Type/Php/ArrayFindFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\Type;
1011
use PHPStan\Type\TypeCombinator;
1112
use function array_map;
1213
use function count;
1314

15+
#[AutowiredService]
1416
final class ArrayFindFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1517
{
1618

src/Type/Php/ArrayFindKeyFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\NullType;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\TypeCombinator;
1213
use function count;
1314

15+
#[AutowiredService]
1416
final class ArrayFindKeyFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1517
{
1618

src/Type/Php/ArrayFlipFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Php\PhpVersion;
89
use PHPStan\Reflection\FunctionReflection;
910
use PHPStan\Type\Accessory\NonEmptyArrayType;
@@ -14,6 +15,7 @@
1415
use PHPStan\Type\TypeCombinator;
1516
use function count;
1617

18+
#[AutowiredService]
1719
final class ArrayFlipFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1820
{
1921

src/Type/Php/ArrayIntersectKeyFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Php\PhpVersion;
89
use PHPStan\Reflection\FunctionReflection;
910
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
@@ -14,6 +15,7 @@
1415
use function array_slice;
1516
use function count;
1617

18+
#[AutowiredService]
1719
final class ArrayIntersectKeyFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1820
{
1921

src/Type/Php/ArrayKeyDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\NullType;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\TypeCombinator;
1213

14+
#[AutowiredService]
1315
final class ArrayKeyDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1416
{
1517

src/Type/Php/ArrayKeyFirstDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\NullType;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\TypeCombinator;
1213

14+
#[AutowiredService]
1315
final class ArrayKeyFirstDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1416
{
1517

src/Type/Php/ArrayKeyLastDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\NullType;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\TypeCombinator;
1213

14+
#[AutowiredService]
1315
final class ArrayKeyLastDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1416
{
1517

src/Type/Php/ArrayKeysFunctionDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Php\PhpVersion;
89
use PHPStan\Reflection\FunctionReflection;
910
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
@@ -13,6 +14,7 @@
1314
use function count;
1415
use function strtolower;
1516

17+
#[AutowiredService]
1618
final class ArrayKeysFunctionDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1719
{
1820

src/Type/Php/ArrayMapFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PhpParser\Node;
66
use PhpParser\Node\Expr\FuncCall;
77
use PHPStan\Analyser\Scope;
8+
use PHPStan\DependencyInjection\AutowiredService;
89
use PHPStan\Reflection\FunctionReflection;
910
use PHPStan\Reflection\ParametersAcceptorSelector;
1011
use PHPStan\Type\Accessory\AccessoryArrayListType;
@@ -23,6 +24,7 @@
2324
use function array_slice;
2425
use function count;
2526

27+
#[AutowiredService]
2628
final class ArrayMapFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
2729
{
2830

src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\TrinaryLogic;
910
use PHPStan\Type\Accessory\AccessoryArrayListType;
@@ -22,6 +23,7 @@
2223
use function count;
2324
use function in_array;
2425

26+
#[AutowiredService]
2527
final class ArrayMergeFunctionDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
2628
{
2729

src/Type/Php/ArrayNextDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\Constant\ConstantBooleanType;
910
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\TypeCombinator;
1213
use function in_array;
1314

15+
#[AutowiredService]
1416
final class ArrayNextDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1517
{
1618

src/Type/Php/ArrayPointerFunctionsDynamicReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\Constant\ConstantBooleanType;
910
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
@@ -12,6 +13,7 @@
1213
use function count;
1314
use function in_array;
1415

16+
#[AutowiredService]
1517
final class ArrayPointerFunctionsDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1618
{
1719

src/Type/Php/ArrayPopFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
910
use PHPStan\Type\NullType;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\TypeCombinator;
1213

14+
#[AutowiredService]
1315
final class ArrayPopFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1416
{
1517

src/Type/Php/ArrayRandFunctionReturnTypeExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node\Expr\FuncCall;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Reflection\FunctionReflection;
89
use PHPStan\Type\ArrayType;
910
use PHPStan\Type\Constant\ConstantIntegerType;
@@ -16,6 +17,7 @@
1617
use PHPStan\Type\UnionType;
1718
use function count;
1819

20+
#[AutowiredService]
1921
final class ArrayRandFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
2022
{
2123

0 commit comments

Comments
 (0)