Skip to content

More DynamicFunctionReturnTypeExtension converted to #[AutowiredService] attribute usage #4019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
506 changes: 14 additions & 492 deletions conf/config.neon

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Type/Php/ArgumentBasedFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Accessory\NonEmptyArrayType;
use PHPStan\Type\ArrayType;
Expand All @@ -13,6 +14,7 @@
use PHPStan\Type\TypeCombinator;
use function array_key_exists;

#[AutowiredService]
final class ArgumentBasedFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Accessory\AccessoryArrayListType;
use PHPStan\Type\Accessory\AccessoryLowercaseStringType;
Expand All @@ -29,6 +30,7 @@
use const CASE_LOWER;
use const CASE_UPPER;

#[AutowiredService]
final class ArrayChangeKeyCaseFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayChunkFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Constant\ConstantBooleanType;
Expand All @@ -14,6 +15,7 @@
use PHPStan\Type\Type;
use function count;

#[AutowiredService]
final class ArrayChunkFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayColumnFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use function count;

#[AutowiredService]
final class ArrayColumnFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayColumnHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace PHPStan\Type\Php;

use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\ShouldNotHappenException;
use PHPStan\TrinaryLogic;
Expand All @@ -17,6 +18,7 @@
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;

#[AutowiredService]
final class ArrayColumnHelper
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayCombineFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\Variable;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Accessory\NonEmptyArrayType;
Expand All @@ -23,6 +24,7 @@
use PHPStan\Type\UnionType;
use function count;

#[AutowiredService]
final class ArrayCombineFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayCurrentDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Constant\ConstantBooleanType;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;

#[AutowiredService]
final class ArrayCurrentDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayFillFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Accessory\AccessoryArrayListType;
Expand All @@ -20,6 +21,7 @@
use PHPStan\Type\TypeCombinator;
use function count;

#[AutowiredService]
final class ArrayFillFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayFillKeysFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
Expand All @@ -12,6 +13,7 @@
use PHPStan\Type\Type;
use function count;

#[AutowiredService]
final class ArrayFillKeysFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayFilterFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\Type;

#[AutowiredService]
final class ArrayFilterFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayFilterFunctionReturnTypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use PhpParser\Node\Stmt\Return_;
use PHPStan\Analyser\MutatingScope;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\ShouldNotHappenException;
use PHPStan\TrinaryLogic;
Expand All @@ -38,6 +39,7 @@
use function sprintf;
use function substr;

#[AutowiredService]
final class ArrayFilterFunctionReturnTypeHelper
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayFindFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use function array_map;
use function count;

#[AutowiredService]
final class ArrayFindFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayFindKeyFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use function count;

#[AutowiredService]
final class ArrayFindKeyFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayFlipFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Accessory\NonEmptyArrayType;
Expand All @@ -14,6 +15,7 @@
use PHPStan\Type\TypeCombinator;
use function count;

#[AutowiredService]
final class ArrayFlipFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayIntersectKeyFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
Expand All @@ -14,6 +15,7 @@
use function array_slice;
use function count;

#[AutowiredService]
final class ArrayIntersectKeyFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayKeyDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;

#[AutowiredService]
final class ArrayKeyDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayKeyFirstDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;

#[AutowiredService]
final class ArrayKeyFirstDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayKeyLastDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;

#[AutowiredService]
final class ArrayKeyLastDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayKeysFunctionDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
Expand All @@ -13,6 +14,7 @@
use function count;
use function strtolower;

#[AutowiredService]
final class ArrayKeysFunctionDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayMapFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PhpParser\Node;
use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\Type\Accessory\AccessoryArrayListType;
Expand All @@ -23,6 +24,7 @@
use function array_slice;
use function count;

#[AutowiredService]
final class ArrayMapFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\TrinaryLogic;
use PHPStan\Type\Accessory\AccessoryArrayListType;
Expand All @@ -22,6 +23,7 @@
use function count;
use function in_array;

#[AutowiredService]
final class ArrayMergeFunctionDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayNextDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Constant\ConstantBooleanType;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use function in_array;

#[AutowiredService]
final class ArrayNextDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\Constant\ConstantBooleanType;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
Expand All @@ -12,6 +13,7 @@
use function count;
use function in_array;

#[AutowiredService]
final class ArrayPointerFunctionsDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayPopFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\DynamicFunctionReturnTypeExtension;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;

#[AutowiredService]
final class ArrayPopFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
2 changes: 2 additions & 0 deletions src/Type/Php/ArrayRandFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PhpParser\Node\Expr\FuncCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Type\ArrayType;
use PHPStan\Type\Constant\ConstantIntegerType;
Expand All @@ -16,6 +17,7 @@
use PHPStan\Type\UnionType;
use function count;

#[AutowiredService]
final class ArrayRandFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
{

Expand Down
Loading
Loading