Skip to content
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
22 changes: 22 additions & 0 deletions build/PHPStan/Build/TurboAttributeCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
use PhpParser\Node\Expr\ArrayDimFetch;
use PhpParser\Node\Expr\ArrowFunction;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\AssignOp;
use PhpParser\Node\Expr\AssignOp\Coalesce;
use PhpParser\Node\Expr\AssignRef;
use PhpParser\Node\Expr\CallLike;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\Instanceof_;
use PhpParser\Node\Expr\List_;
use PhpParser\Node\Expr\Match_;
use PhpParser\Node\Expr\MethodCall;
Expand All @@ -43,14 +47,21 @@
use PhpParser\Node\Scalar;
use PhpParser\Node\Scalar\Float_;
use PhpParser\Node\Scalar\Int_;
use PhpParser\Node\Scalar\InterpolatedString;
use PhpParser\Node\Scalar\MagicConst;
use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Catch_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassConst;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Declare_;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\HaltCompiler;
use PhpParser\Node\Stmt\InlineHTML;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Trait_;
use PhpParser\Node\Stmt\TryCatch;
use PhpParser\Node\VariadicPlaceholder;
use PhpParser\Node\VarLikeIdentifier;
use PhpParser\NodeTraverser;
Expand Down Expand Up @@ -214,6 +225,17 @@ final class TurboAttributeCollector
'classMethodStmt' => ClassMethod::class,
'adapterReflectionClass' => \PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass::class,
'betterReflectionClass' => \PHPStan\BetterReflection\Reflection\ReflectionClass::class,
'magicConst' => MagicConst::class,
'assignRefExpr' => AssignRef::class,
'assignOpExpr' => AssignOp::class,
'traitStmt' => Trait_::class,
'inlineHtmlStmt' => InlineHTML::class,
'interpolatedString' => InterpolatedString::class,
'instanceofExpr' => Instanceof_::class,
'tryCatchStmt' => TryCatch::class,
'catchStmt' => Catch_::class,
'coalesceAssignOpExpr' => Coalesce::class,
'classConstStmt' => ClassConst::class,
];

private string $realRoot;
Expand Down
3 changes: 3 additions & 0 deletions src/Node/ClassMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

namespace PHPStan\Node;

use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'gatheredClassMethod')]
final class ClassMethod
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/ClassPropertyNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
use PhpParser\Node\Expr;
use PhpParser\NodeAbstract;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\Type;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'classPropertyNode')]
final class ClassPropertyNode extends NodeAbstract implements VirtualNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/ClassStatementsGatherer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\ShouldNotHappenException;
use PHPStan\Turbo\ShadowedByTurboExtension;
use PHPStan\Type\TypeUtils;
use ReflectionProperty;
use function count;
use function in_array;
use function is_string;
use function strtolower;

#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ClassStatementsGatherer.cpp')]
final class ClassStatementsGatherer
{

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

use PhpParser\Node\Expr\ClassConstFetch;
use PHPStan\Analyser\Scope;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'classConstantFetch')]
final class ClassConstantFetch
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/Expr/SetOffsetValueTypeExpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
use Override;
use PhpParser\Node\Expr;
use PHPStan\Node\VirtualNode;
use PHPStan\Turbo\ReferencedByTurboExtension;

#[ReferencedByTurboExtension(key: 'setOffsetValueTypeExpr')]
final class SetOffsetValueTypeExpr extends Expr implements VirtualNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/FunctionCallableNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
use Override;
use PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'functionCallableNode')]
final class FunctionCallableNode extends Expr implements VirtualNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/InstantiationCallableNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
use Override;
use PhpParser\Node\Expr;
use PhpParser\Node\Name;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'instantiationCallableNode')]
final class InstantiationCallableNode extends Expr implements VirtualNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/Method/MethodCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\StaticCall;
use PHPStan\Analyser\Scope;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'gatheredMethodCall')]
final class MethodCall
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/MethodCallableNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
use Override;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'methodCallableNode')]
final class MethodCallableNode extends Expr implements VirtualNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/MethodReturnStatementsNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
use PHPStan\Analyser\StatementResult;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\Php\PhpMethodFromParserNodeReflection;
use PHPStan\Turbo\ReferencedByTurboExtension;
use function count;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'methodReturnStatementsNode')]
final class MethodReturnStatementsNode extends NodeAbstract implements ReturnStatementsNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/Printer/ExprPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

use PhpParser\Node\Expr;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;

/**
* @api
*/
#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../../turbo-ext/src/ExprPrinter.cpp')]
final class ExprPrinter
{

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

use PHPStan\Analyser\Scope;
use PHPStan\Node\PropertyAssignNode;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'propertyAssign')]
final class PropertyAssign
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/Property/PropertyRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PHPStan\Analyser\Scope;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'propertyRead')]
final class PropertyRead
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/Property/PropertyWrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
use PHPStan\Analyser\Scope;
use PHPStan\Node\ClassPropertyNode;
use PHPStan\Node\PropertyAssignNode;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'propertyWrite')]
final class PropertyWrite
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/PropertyAssignNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
use PHPStan\Node\Expr\SetExistingOffsetValueTypeExpr;
use PHPStan\Node\Expr\SetOffsetValueTypeExpr;
use PHPStan\Node\Expr\UnsetOffsetExpr;
use PHPStan\Turbo\ReferencedByTurboExtension;
use PHPStan\Type\ObjectType;

#[ReferencedByTurboExtension(key: 'propertyAssignNode')]
final class PropertyAssignNode extends NodeAbstract implements VirtualNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Node/StaticMethodCallableNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PHPStan\Turbo\ReferencedByTurboExtension;

/**
* @api
*/
#[ReferencedByTurboExtension(key: 'staticMethodCallableNode')]
final class StaticMethodCallableNode extends Expr implements VirtualNode
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ArrayFilterArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ArrayFilterArgVisitor.cpp')]
final class ArrayFilterArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ArrayFindArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;
use function in_array;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ArrayFindArgVisitor.cpp')]
final class ArrayFindArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ArrayMapArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;
use function array_slice;
use function count;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ArrayMapArgVisitor.cpp')]
final class ArrayMapArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ArrayOffsetNormalizingVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PhpParser\Node\Scalar\String_;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;
use function preg_match;

/**
Expand All @@ -28,6 +29,7 @@
* for these nodes.
*/
#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ArrayOffsetNormalizingVisitor.cpp')]
final class ArrayOffsetNormalizingVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ArrayWalkArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ArrayWalkArgVisitor.cpp')]
final class ArrayWalkArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ArrowFunctionArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;
use function count;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ArrowFunctionArgVisitor.cpp')]
final class ArrowFunctionArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ClosureArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;
use function count;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ClosureArgVisitor.cpp')]
final class ClosureArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ClosureBindArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
use PhpParser\Node\Identifier;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;
use function count;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ClosureBindArgVisitor.cpp')]
final class ClosureBindArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/ClosureBindToVarVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use PhpParser\Node\Identifier;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ClosureBindToVarVisitor.cpp')]
final class ClosureBindToVarVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/CurlSetOptArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/CurlSetOptArgVisitor.cpp')]
final class CurlSetOptArgVisitor extends NodeVisitorAbstract
{

Expand Down
2 changes: 2 additions & 0 deletions src/Parser/CurlSetOptArrayArgVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Turbo\ShadowedByTurboExtension;

#[AutowiredService]
#[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/CurlSetOptArrayArgVisitor.cpp')]
final class CurlSetOptArrayArgVisitor extends NodeVisitorAbstract
{

Expand Down
Loading
Loading