Skip to content
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

feat: apply rule TypedPropertyFromStrictConstructor from rector #2283

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
9 changes: 3 additions & 6 deletions src/ApiDocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ final class ApiDocGenerator
/** @var iterable|ModelDescriberInterface[] */
private $modelDescribers;

/** @var CacheItemPoolInterface|null */
private $cacheItemPool;
private ?CacheItemPoolInterface $cacheItemPool;

/** @var string */
private $cacheItemId;
private string $cacheItemId;

/** @var string[] */
private $alternativeNames = [];
Expand All @@ -53,8 +51,7 @@ final class ApiDocGenerator
*/
private $openApiVersion;

/** @var Generator */
private $generator;
private Generator $generator;

/**
* @param DescriberInterface[]|iterable $describers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,14 @@ class SymfonyConstraintAnnotationReader
{
use SetsContextTrait;

/**
* @var Reader|null
*/
private $annotationsReader;
private ?Reader $annotationsReader;

/**
* @var OA\Schema
*/
private $schema;

/**
* @var bool
*/
private $useValidationGroups;
private bool $useValidationGroups;

public function __construct(?Reader $annotationsReader, bool $useValidationGroups = false)
{
Expand Down
16 changes: 6 additions & 10 deletions src/ModelDescriber/ObjectModelDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,16 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar
use ModelRegistryAwareTrait;
use ApplyOpenApiDiscriminatorTrait;

/** @var PropertyInfoExtractorInterface */
private $propertyInfo;
/** @var ClassMetadataFactoryInterface|null */
private $classMetadataFactory;
/** @var Reader|null */
private $doctrineReader;
private PropertyInfoExtractorInterface $propertyInfo;
private ?ClassMetadataFactoryInterface $classMetadataFactory;
private ?Reader $doctrineReader;
/** @var PropertyDescriberInterface|PropertyDescriberInterface[] */
private $propertyDescriber;
/** @var string[] */
private $mediaTypes;
private array $mediaTypes;
/** @var (NameConverterInterface&AdvancedNameConverterInterface)|null */
private $nameConverter;
/** @var bool */
private $useValidationGroups;
private ?NameConverterInterface $nameConverter;
private bool $useValidationGroups;

/**
* @param PropertyDescriberInterface|PropertyDescriberInterface[] $propertyDescribers
Expand Down
5 changes: 1 addition & 4 deletions tests/Functional/Entity/VirtualProperty80.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ class VirtualProperty80
*/
private $id;

/**
* @var User
*/
private $user;
private User $user;

/**
* @Serializer\Accessor(getter="getFoo", setter="setFoo")
Expand Down
5 changes: 1 addition & 4 deletions tests/Functional/Entity/VirtualProperty81.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ class VirtualProperty81
#[Serializer\Expose]
private $id;

/**
* @var User
*/
private $user;
private User $user;

#[Serializer\Accessor(getter: 'getFoo', setter: 'setFoo')]
#[Serializer\Type('string')]
Expand Down
5 changes: 1 addition & 4 deletions tests/Functional/ModelDescriber/NameConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@

class NameConverter implements AdvancedNameConverterInterface
{
/**
* @var MetadataAwareNameConverter
*/
private $inner;
private MetadataAwareNameConverter $inner;

public function __construct(MetadataAwareNameConverter $inner)
{
Expand Down
Loading