Copied!

Extracts data using PHPStan parser.

CloneableFinalInstantiable
Methods
public __construct(?array $mutatorPrefixes = NULL, ?array $accessorPrefixes = NULL, ?array $arrayMutatorPrefixes = NULL, bool $allowPrivateAccess = true)
 
  • param list<string>|null $mutatorPrefixes
  • param list<string>|null $accessorPrefixes
  • param list<string>|null $arrayMutatorPrefixes
public getLongDescription(string $class, string $property, array $context = []) : ?string
public getShortDescription(string $class, string $property, array $context = []) : ?string
public getType(string $class, string $property, array $context = []) : ?Symfony\Component\TypeInfo\Type
public getTypeFromConstructor(string $class, string $property) : ?Symfony\Component\TypeInfo\Type
public getTypes(string $class, string $property, array $context = []) : ?array
 
  • deprecated since Symfony 7.3, use "getType" instead
public getTypesFromConstructor(string $class, string $property) : ?array
 
  • deprecated since Symfony 7.3, use "getTypeFromConstructor" instead
  • return \LegacyType[]|null
Constants
private Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor::ACCESSOR = 1
private Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor::MUTATOR = 2
private Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor::PROPERTY = 0
Properties
private array $accessorPrefixes
private bool $allowPrivateAccess
private array $arrayMutatorPrefixes
private array $contexts = []
 
  • var array<string,\TypeContext>
private array $docBlocks = []
 
  • var array<string,array{\PhpDocNode|null, int|null, string|null, string|null}>
private PHPStan\PhpDocParser\Lexer\Lexer $lexer
private array $mutatorPrefixes
private PHPStan\PhpDocParser\Parser\PhpDocParser $phpDocParser
private Symfony\Component\PropertyInfo\Util\PhpStanTypeHelper $phpStanTypeHelper
private Symfony\Component\TypeInfo\TypeResolver\StringTypeResolver $stringTypeResolver
private Symfony\Component\TypeInfo\TypeContext\TypeContextFactory $typeContextFactory
Methods
private canAccessMemberBasedOnItsVisibility(ReflectionProperty|ReflectionMethod $member) : bool
private filterDocBlockParams(PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode $docNode, string $allowedParam) : ?PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode
private getDescriptionsFromDocNode(PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode $docNode) : array
 

A docblock is split into a template marker, a short description, an optional long description and a tags section.

  • The template marker is either empty, #@+ or #@-.
  • The short description is started from a non-tag character, and until one or multiple newlines.
  • The long description (optional) is started from a non-tag character, and until a new line is encountered followed by a tag.
  • Tags, and the remaining characters

This method returns the short and the long descriptions.

  • return array{0: ?string, 1: ?string}
private getDocBlock(string $class, string $property) : array
 
  • return array{\PhpDocNode|null, int|null, string|null, string|null}
private getDocBlockFromConstructor(string $class, string $property) : ?PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode
private getDocBlockFromMethod(string $class, string $ucFirstProperty, int $type) : ?array
 
  • return array{\PhpDocNode, string, string}|null
private getDocBlockFromProperty(string $class, string $property) : ?array
 
  • return array{?\PhpDocNode, ?\PhpDocNode, int, string}|null
private getPhpDocNode(string $rawDocNode) : PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode
© 2025 Bruce Wells