Skip to content
Merged
26 changes: 26 additions & 0 deletions build/PHPStan/Build/TurboAttributeCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,22 @@
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprFloatNode;
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode;
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprStringNode;
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode;
use PHPStan\PhpDocParser\Ast\Type\ArrayShapeItemNode;
use PHPStan\PhpDocParser\Ast\Type\ArrayShapeNode;
use PHPStan\PhpDocParser\Ast\Type\ArrayShapeUnsealedTypeNode;
use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode;
use PHPStan\PhpDocParser\Ast\Type\CallableTypeParameterNode;
use PHPStan\PhpDocParser\Ast\Type\ConstTypeNode;
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode;
use PHPStan\PhpDocParser\Ast\Type\ObjectShapeItemNode;
use PHPStan\PhpDocParser\Ast\Type\ObjectShapeNode;
use PHPStan\PhpDocParser\Ast\Type\ThisTypeNode;
use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode;
use PHPStan\PhpDocParser\Printer\Printer;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Turbo\ShadowedByTurboExtension;
use RecursiveDirectoryIterator;
Expand Down Expand Up @@ -122,6 +135,19 @@ final class TurboAttributeCollector
'netteStrings' => Strings::class,
'netteRegexpException' => RegexpException::class,
'constExprFloatNode' => ConstExprFloatNode::class,
'thisTypeNode' => ThisTypeNode::class,
'objectShapeNode' => ObjectShapeNode::class,
'objectShapeItemNode' => ObjectShapeItemNode::class,
'constFetchNode' => ConstFetchNode::class,
'phpDocPrinter' => Printer::class,
'callableTypeNode' => CallableTypeNode::class,
'callableTypeParameterNode' => CallableTypeParameterNode::class,
'templateTagValueNode' => TemplateTagValueNode::class,
'arrayShapeNode' => ArrayShapeNode::class,
'arrayShapeItemNode' => ArrayShapeItemNode::class,
'arrayShapeUnsealedTypeNode' => ArrayShapeUnsealedTypeNode::class,
'unionTypeNode' => UnionTypeNode::class,
'intersectionTypeNode' => IntersectionTypeNode::class,
];

private string $realRoot;
Expand Down
2 changes: 2 additions & 0 deletions src/Broker/ClassNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace PHPStan\Broker;

use PHPStan\AnalysedCodeException;
use PHPStan\Turbo\ReferencedByTurboExtension;
use function sprintf;

/**
Expand All @@ -12,6 +13,7 @@
* in case the user does not check the existence of the class beforehand
* with `hasClass()` or similar.
*/
#[ReferencedByTurboExtension(key: 'classNotFoundException')]
final class ClassNotFoundException extends AnalysedCodeException
{

Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/BleedingEdgeToggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

use Generator;
use PHPStan\ShouldNotHappenException;
use PHPStan\Turbo\ReferencedByTurboExtension;

#[ReferencedByTurboExtension(key: 'bleedingEdgeToggle')]
final class BleedingEdgeToggle
{

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

use PHPStan\ShouldNotHappenException;
use PHPStan\Turbo\ReferencedByTurboExtension;
use function array_key_exists;
use function array_key_first;
use function count;
Expand All @@ -19,6 +20,7 @@
*
* @template TValue
*/
#[ReferencedByTurboExtension(key: 'lruCache')]
final class LruCache
{

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

use PHPStan\PhpDoc\ResolvedPhpDocBlock;
use PHPStan\PhpDoc\Tag\AssertTag;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use function array_filter;
Expand All @@ -28,6 +29,7 @@
*
* @api
*/
#[ReferencedByTurboExtension(key: 'assertions')]
final class Assertions
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/Callables/CallableParametersAcceptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use PHPStan\Reflection\Assertions;
use PHPStan\Reflection\ParametersAcceptor;
use PHPStan\TrinaryLogic;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* A ParametersAcceptor for callable types (closures, first-class callables).
Expand All @@ -27,6 +28,7 @@
* @api
* @api-do-not-implement
*/
#[ReferencedByTurboExtension(key: 'callableParametersAcceptor')]
interface CallableParametersAcceptor extends ParametersAcceptor
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/Callables/SimpleImpurePoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Reflection\ParametersAcceptor;
use PHPStan\TrinaryLogic;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;
use function count;
use function sprintf;
Expand All @@ -28,6 +29,7 @@
*
* @phpstan-import-type ImpurePointIdentifier from ImpurePoint
*/
#[ReferencedByTurboExtension(key: 'simpleImpurePoint')]
final class SimpleImpurePoint
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/Callables/SimpleThrowPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace PHPStan\Reflection\Callables;

use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use Throwable;
Expand All @@ -17,6 +18,7 @@
* Explicit throw points come from @throws annotations. Implicit throw points represent
* the possibility that any function call could throw.
*/
#[ReferencedByTurboExtension(key: 'simpleThrowPoint')]
final class SimpleThrowPoint
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/ExtendedParameterReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
namespace PHPStan\Reflection;

use PHPStan\TrinaryLogic;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;

/**
* @api
* @api-do-not-implement
*/
#[ReferencedByTurboExtension(key: 'extendedParameterReflection')]
interface ExtendedParameterReflection extends ParameterReflection
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/MissingConstantFromReflectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace PHPStan\Reflection;

use Exception;
use PHPStan\Turbo\ReferencedByTurboExtension;
use function sprintf;

#[ReferencedByTurboExtension(key: 'missingConstantFromReflectionException')]
final class MissingConstantFromReflectionException extends Exception
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/MissingMethodFromReflectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace PHPStan\Reflection;

use Exception;
use PHPStan\Turbo\ReferencedByTurboExtension;
use function sprintf;

#[ReferencedByTurboExtension(key: 'missingMethodFromReflectionException')]
final class MissingMethodFromReflectionException extends Exception
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/MissingPropertyFromReflectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace PHPStan\Reflection;

use Exception;
use PHPStan\Turbo\ReferencedByTurboExtension;
use function sprintf;

#[ReferencedByTurboExtension(key: 'missingPropertyFromReflectionException')]
final class MissingPropertyFromReflectionException extends Exception
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/Native/NativeParameterReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use PHPStan\Reflection\ParameterReflection;
use PHPStan\Reflection\PassedByReference;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;

#[ReferencedByTurboExtension(key: 'nativeParameterReflection')]
final class NativeParameterReflection implements ParameterReflection
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/ParametersAcceptorSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use PHPStan\Reflection\Php\ExtendedDummyParameter;
use PHPStan\ShouldNotHappenException;
use PHPStan\TrinaryLogic;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Accessory\AccessoryNonEmptyStringType;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType;
Expand Down Expand Up @@ -64,6 +65,7 @@
/**
* @api
*/
#[ReferencedByTurboExtension(key: 'parametersAcceptorSelector')]
final class ParametersAcceptorSelector
{

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

namespace PHPStan\Reflection;

use PHPStan\Turbo\ReferencedByTurboExtension;
use function array_key_exists;

/**
Expand All @@ -23,6 +24,7 @@
*
* @api
*/
#[ReferencedByTurboExtension(key: 'passedByReference')]
final class PassedByReference
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use PHPStan\Reflection\ExtendedMethodReflection;
use PHPStan\Reflection\Type\UnresolvedMethodPrototypeReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\ClosureType;
use PHPStan\Type\Type;

#[ReferencedByTurboExtension(key: 'closureCallUnresolvedMethodPrototypeReflection')]
final class ClosureCallUnresolvedMethodPrototypeReflection implements UnresolvedMethodPrototypeReflection
{

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

use PHPStan\Reflection\ParameterReflection;
use PHPStan\Reflection\PassedByReference;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;

#[ReferencedByTurboExtension(key: 'dummyParameter')]
class DummyParameter implements ParameterReflection
{

Expand Down
2 changes: 2 additions & 0 deletions src/Reflection/Php/EnumPropertyReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
use PHPStan\Reflection\ExtendedPropertyReflection;
use PHPStan\ShouldNotHappenException;
use PHPStan\TrinaryLogic;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\MixedType;
use PHPStan\Type\Type;

#[ReferencedByTurboExtension(key: 'enumPropertyReflection')]
final class EnumPropertyReflection implements ExtendedPropertyReflection
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

use PHPStan\Reflection\ExtendedPropertyReflection;
use PHPStan\Reflection\Type\UnresolvedPropertyPrototypeReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;

#[ReferencedByTurboExtension(key: 'enumUnresolvedPropertyPrototypeReflection')]
final class EnumUnresolvedPropertyPrototypeReflection implements UnresolvedPropertyPrototypeReflection
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
use PHPStan\Reflection\PropertiesClassReflectionExtension;
use PHPStan\Reflection\PropertyReflection;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\MixedType;

// autoTag: false - wired explicitly in ClassReflectionExtensionRegistry, must not be tagged
#[AutowiredService(autoTag: false)]
#[ReferencedByTurboExtension(key: 'universalObjectCratesClassReflectionExtension')]
final class UniversalObjectCratesClassReflectionExtension
implements PropertiesClassReflectionExtension
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PHPStan\Reflection\ExtendedParametersAcceptor;
use PHPStan\Reflection\Php\ExtendedDummyParameter;
use PHPStan\Reflection\ResolvedMethodReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Generic\GenericStaticType;
use PHPStan\Type\StaticType;
use PHPStan\Type\ThisType;
Expand All @@ -18,6 +19,7 @@
use function array_map;
use function count;

#[ReferencedByTurboExtension(key: 'calledOnTypeUnresolvedMethodPrototypeReflection')]
final class CalledOnTypeUnresolvedMethodPrototypeReflection implements UnresolvedMethodPrototypeReflection
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
use PHPStan\Reflection\Dummy\ChangedTypePropertyReflection;
use PHPStan\Reflection\ExtendedPropertyReflection;
use PHPStan\Reflection\ResolvedPropertyReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\StaticType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeTraverser;

#[ReferencedByTurboExtension(key: 'calledOnTypeUnresolvedPropertyPrototypeReflection')]
final class CalledOnTypeUnresolvedPropertyPrototypeReflection implements UnresolvedPropertyPrototypeReflection
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use PHPStan\Reflection\ExtendedMethodReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;
use function array_map;

#[ReferencedByTurboExtension(key: 'intersectionTypeUnresolvedMethodPrototypeReflection')]
final class IntersectionTypeUnresolvedMethodPrototypeReflection implements UnresolvedMethodPrototypeReflection
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use PHPStan\Reflection\ExtendedPropertyReflection;
use PHPStan\Reflection\PropertyReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;
use function array_map;

#[ReferencedByTurboExtension(key: 'intersectionTypeUnresolvedPropertyPrototypeReflection')]
final class IntersectionTypeUnresolvedPropertyPrototypeReflection implements UnresolvedPropertyPrototypeReflection
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use PHPStan\Reflection\ExtendedMethodReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;
use function array_map;

#[ReferencedByTurboExtension(key: 'unionTypeUnresolvedMethodPrototypeReflection')]
final class UnionTypeUnresolvedMethodPrototypeReflection implements UnresolvedMethodPrototypeReflection
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use PHPStan\Reflection\ExtendedPropertyReflection;
use PHPStan\Reflection\PropertyReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;
use function array_map;

#[ReferencedByTurboExtension(key: 'unionTypeUnresolvedPropertyPrototypeReflection')]
final class UnionTypeUnresolvedPropertyPrototypeReflection implements UnresolvedPropertyPrototypeReflection
{

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

use PHPStan\Php\PhpVersion;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType;
use PHPStan\Type\Constant\ConstantBooleanType;
Expand All @@ -19,6 +20,7 @@
use PHPStan\Type\TypeCombinator;
use PHPStan\Type\UnionType;

#[ReferencedByTurboExtension(key: 'allowedArrayKeysTypes')]
final class AllowedArrayKeysTypes
{

Expand Down
Loading
Loading