Skip to content

Commit 0a13eba

Browse files
committed
bug symfony#44494 Remove FQCN type hints on properties (fabpot)
This PR was merged into the 6.0 branch. Discussion ---------- Remove FQCN type hints on properties | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Closes symfony#44364 | License | MIT | Doc PR | n/a This is an alternative for symfony#44380. Basically, we are removing all property type hints on 6.0 and reverts that for 6.1. Commits ------- 52aaa56 Remove FQCN type hints on properties
2 parents e4cfa82 + 52aaa56 commit 0a13eba

File tree

675 files changed

+1066
-1107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

675 files changed

+1066
-1107
lines changed

src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class ProxyCacheWarmer implements CacheWarmerInterface
2626
{
27-
private ManagerRegistry $registry;
27+
private $registry;
2828

2929
public function __construct(ManagerRegistry $registry)
3030
{

src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ContainerAwareEventManager extends EventManager
3333
private array $initialized = [];
3434
private bool $initializedSubscribers = false;
3535
private array $methods = [];
36-
private ContainerInterface $container;
36+
private $container;
3737

3838
/**
3939
* @param list<string|EventSubscriber|array{string[], string|object}> $subscriberIds List of subscribers, subscriber ids, or [events, listener] tuples

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
class DoctrineDataCollector extends DataCollector
3030
{
31-
private ManagerRegistry $registry;
31+
private $registry;
3232
private array $connections;
3333
private array $managers;
3434

src/Symfony/Bridge/Doctrine/DataFixtures/ContainerAwareLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
class ContainerAwareLoader extends Loader
2727
{
28-
private ContainerInterface $container;
28+
private $container;
2929

3030
public function __construct(ContainerInterface $container)
3131
{

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
*/
2323
class DoctrineChoiceLoader extends AbstractChoiceLoader
2424
{
25-
private ObjectManager $manager;
25+
private $manager;
2626
private string $class;
27-
private ?IdReader $idReader;
28-
private ?EntityLoaderInterface $objectLoader;
27+
private $idReader;
28+
private $objectLoader;
2929

3030
/**
3131
* Creates a new choice loader.

src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*/
2525
class IdReader
2626
{
27-
private ObjectManager $om;
28-
private ClassMetadata $classMetadata;
27+
private $om;
28+
private $classMetadata;
2929
private bool $singleId;
3030
private bool $intId;
3131
private string $idField;

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
3131
*
3232
* This property should only be accessed through queryBuilder.
3333
*/
34-
private QueryBuilder $queryBuilder;
34+
private $queryBuilder;
3535

3636
public function __construct(QueryBuilder $queryBuilder)
3737
{

src/Symfony/Bridge/Doctrine/IdGenerator/UlidGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
final class UlidGenerator extends AbstractIdGenerator
2020
{
21-
private ?UlidFactory $factory;
21+
private $factory;
2222

2323
public function __construct(UlidFactory $factory = null)
2424
{

src/Symfony/Bridge/Doctrine/IdGenerator/UuidGenerator.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313

1414
use Doctrine\ORM\EntityManager;
1515
use Doctrine\ORM\Id\AbstractIdGenerator;
16-
use Symfony\Component\Uid\Factory\NameBasedUuidFactory;
17-
use Symfony\Component\Uid\Factory\RandomBasedUuidFactory;
18-
use Symfony\Component\Uid\Factory\TimeBasedUuidFactory;
1916
use Symfony\Component\Uid\Factory\UuidFactory;
2017
use Symfony\Component\Uid\Uuid;
2118

2219
final class UuidGenerator extends AbstractIdGenerator
2320
{
24-
private UuidFactory $protoFactory;
25-
private UuidFactory|NameBasedUuidFactory|RandomBasedUuidFactory|TimeBasedUuidFactory $factory;
21+
private $protoFactory;
22+
private $factory;
2623
private ?string $entityGetter = null;
2724

2825
public function __construct(UuidFactory $factory = null)

src/Symfony/Bridge/Doctrine/Messenger/DoctrineClearEntityManagerWorkerSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class DoctrineClearEntityManagerWorkerSubscriber implements EventSubscriberInterface
2525
{
26-
private ManagerRegistry $managerRegistry;
26+
private $managerRegistry;
2727

2828
public function __construct(ManagerRegistry $managerRegistry)
2929
{

src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeExtractorInterface, PropertyAccessExtractorInterface
3333
{
34-
private EntityManagerInterface $entityManager;
34+
private $entityManager;
3535

3636
public function __construct(EntityManagerInterface $entityManager)
3737
{

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
*/
4444
class DoctrineTokenProvider implements TokenProviderInterface, TokenVerifierInterface
4545
{
46-
private Connection $conn;
46+
private $conn;
4747

4848
public function __construct(Connection $conn)
4949
{

src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
class EntityUserProvider implements UserProviderInterface, PasswordUpgraderInterface
3434
{
35-
private ManagerRegistry $registry;
35+
private $registry;
3636
private ?string $managerName;
3737
private string $classOrAlias;
3838
private string $class;

src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
class UniqueEntityValidator extends ConstraintValidator
2929
{
30-
private ManagerRegistry $registry;
30+
private $registry;
3131

3232
public function __construct(ManagerRegistry $registry)
3333
{

src/Symfony/Bridge/Doctrine/Validator/DoctrineLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class DoctrineLoader implements LoaderInterface
3232
{
3333
use AutoMappingTrait;
3434

35-
private EntityManagerInterface $entityManager;
35+
private $entityManager;
3636
private ?string $classValidatorRegexp;
3737

3838
public function __construct(EntityManagerInterface $entityManager, string $classValidatorRegexp = null)

src/Symfony/Bridge/Monolog/Command/ServerLogCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Monolog\Command;
1313

1414
use Monolog\Formatter\FormatterInterface;
15-
use Monolog\Handler\HandlerInterface;
1615
use Monolog\Logger;
1716
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
1817
use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
@@ -33,8 +32,8 @@ class ServerLogCommand extends Command
3332
{
3433
private const BG_COLOR = ['black', 'blue', 'cyan', 'green', 'magenta', 'red', 'white', 'yellow'];
3534

36-
private ExpressionLanguage $el;
37-
private HandlerInterface $handler;
35+
private $el;
36+
private $handler;
3837

3938
public function isEnabled(): bool
4039
{

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ class ConsoleFormatter implements FormatterInterface
4242
];
4343

4444
private array $options;
45-
private VarCloner $cloner;
45+
private $cloner;
4646

4747
/**
4848
* @var resource|null
4949
*/
5050
private $outputBuffer;
5151

52-
private CliDumper $dumper;
52+
private $dumper;
5353

5454
/**
5555
* Available options:

src/Symfony/Bridge/Monolog/Formatter/VarDumperFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class VarDumperFormatter implements FormatterInterface
2121
{
22-
private VarCloner $cloner;
22+
private $cloner;
2323

2424
public function __construct(VarCloner $cloner = null)
2525
{

src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class ChromePhpHandler extends BaseChromePhpHandler
2626
{
2727
private array $headers = [];
28-
private Response $response;
28+
private $response;
2929

3030
/**
3131
* Adds the headers to the response once it's created.

src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
*/
4444
class ConsoleHandler extends AbstractProcessingHandler implements EventSubscriberInterface
4545
{
46-
private ?OutputInterface $output;
46+
private $output;
4747
private array $verbosityLevelMap = [
4848
OutputInterface::VERBOSITY_QUIET => Logger::ERROR,
4949
OutputInterface::VERBOSITY_NORMAL => Logger::WARNING,

src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ElasticsearchLogstashHandler extends AbstractHandler
4747

4848
private string $endpoint;
4949
private string $index;
50-
private HttpClientInterface $client;
50+
private $client;
5151

5252
/**
5353
* @var \SplObjectStorage<ResponseInterface, null>

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Monolog\Handler\FingersCrossed;
1313

1414
use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
15-
use Symfony\Component\HttpFoundation\RequestStack;
1615
use Symfony\Component\HttpKernel\Exception\HttpException;
1716

1817
/**
@@ -27,9 +26,9 @@ final class HttpCodeActivationStrategy implements ActivationStrategyInterface
2726
* @param array $exclusions each exclusion must have a "code" and "urls" keys
2827
*/
2928
public function __construct(
30-
private RequestStack $requestStack,
29+
private $requestStack,
3130
private array $exclusions,
32-
private ActivationStrategyInterface $inner,
31+
private $inner,
3332
) {
3433
foreach ($exclusions as $exclusion) {
3534
if (!\array_key_exists('code', $exclusion)) {

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/NotFoundActivationStrategy.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Monolog\Handler\FingersCrossed;
1313

1414
use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
15-
use Symfony\Component\HttpFoundation\RequestStack;
1615
use Symfony\Component\HttpKernel\Exception\HttpException;
1716

1817
/**
@@ -27,9 +26,9 @@ final class NotFoundActivationStrategy implements ActivationStrategyInterface
2726
private string $exclude;
2827

2928
public function __construct(
30-
private RequestStack $requestStack,
29+
private $requestStack,
3130
array $excludedUrls,
32-
private ActivationStrategyInterface $inner
31+
private $inner
3332
) {
3433
$this->exclude = '{('.implode('|', $excludedUrls).')}i';
3534
}

src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class FirePHPHandler extends BaseFirePHPHandler
2626
{
2727
private array $headers = [];
28-
private Response $response;
28+
private $response;
2929

3030
/**
3131
* Adds the headers to the response once it's created.

src/Symfony/Bridge/Monolog/Handler/MailerHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*/
2525
class MailerHandler extends AbstractProcessingHandler
2626
{
27-
private MailerInterface $mailer;
28-
private \Closure|Email $messageTemplate;
27+
private $mailer;
28+
private $messageTemplate;
2929

3030
public function __construct(MailerInterface $mailer, callable|Email $messageTemplate, string|int $level = Logger::DEBUG, bool $bubble = true)
3131
{

src/Symfony/Bridge/Monolog/Handler/NotifierHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class NotifierHandler extends AbstractHandler
2626
{
27-
private NotifierInterface $notifier;
27+
private $notifier;
2828

2929
public function __construct(NotifierInterface $notifier, string|int $level = Logger::ERROR, bool $bubble = true)
3030
{

src/Symfony/Bridge/Monolog/Processor/DebugProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DebugProcessor implements DebugLoggerInterface, ResetInterface
2121
{
2222
private array $records = [];
2323
private array $errorCount = [];
24-
private ?RequestStack $requestStack;
24+
private $requestStack;
2525

2626
public function __construct(RequestStack $requestStack = null)
2727
{

src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/LazyLoadingValueHolderFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class LazyLoadingValueHolderFactory extends BaseFactory
2222
{
23-
private ProxyGeneratorInterface $generator;
23+
private $generator;
2424

2525
/**
2626
* {@inheritdoc}

src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
class RuntimeInstantiator implements InstantiatorInterface
2727
{
28-
private LazyLoadingValueHolderFactory $factory;
28+
private $factory;
2929

3030
public function __construct()
3131
{

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
class ProxyDumper implements DumperInterface
2727
{
2828
private string $salt;
29-
private LazyLoadingValueHolderGenerator $proxyGenerator;
30-
private BaseGeneratorStrategy $classGenerator;
29+
private $proxyGenerator;
30+
private $classGenerator;
3131

3232
public function __construct(string $salt = '')
3333
{

src/Symfony/Bridge/Twig/AppVariable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
*/
2626
class AppVariable
2727
{
28-
private TokenStorageInterface $tokenStorage;
29-
private RequestStack $requestStack;
28+
private $tokenStorage;
29+
private $requestStack;
3030
private string $environment;
3131
private bool $debug;
3232

src/Symfony/Bridge/Twig/Command/DebugCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#[AsCommand(name: 'debug:twig', description: 'Show a list of twig functions, filters, globals and tests')]
3737
class DebugCommand extends Command
3838
{
39-
private Environment $twig;
39+
private $twig;
4040
private ?string $projectDir;
4141
private array $bundlesMetadata;
4242
private ?string $twigDefaultPath;
@@ -46,7 +46,7 @@ class DebugCommand extends Command
4646
*/
4747
private array $filesystemLoaders;
4848

49-
private ?FileLinkFormatter $fileLinkFormatter;
49+
private $fileLinkFormatter;
5050

5151
public function __construct(Environment $twig, string $projectDir = null, array $bundlesMetadata = [], string $twigDefaultPath = null, FileLinkFormatter $fileLinkFormatter = null)
5252
{

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#[AsCommand(name: 'lint:twig', description: 'Lint a Twig template and outputs encountered errors')]
4040
class LintCommand extends Command
4141
{
42-
private Environment $twig;
42+
private $twig;
4343
private string $format;
4444

4545
public function __construct(Environment $twig)

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
*/
2929
class TwigDataCollector extends DataCollector implements LateDataCollectorInterface
3030
{
31-
private Profile $profile;
32-
private ?Environment $twig;
31+
private $profile;
32+
private $twig;
3333
private array $computed;
3434

3535
public function __construct(Profile $profile, Environment $twig = null)

src/Symfony/Bridge/Twig/ErrorRenderer/TwigErrorRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
*/
2626
class TwigErrorRenderer implements ErrorRendererInterface
2727
{
28-
private Environment $twig;
29-
private HtmlErrorRenderer $fallbackErrorRenderer;
28+
private $twig;
29+
private $fallbackErrorRenderer;
3030
private \Closure|bool $debug;
3131

3232
/**

src/Symfony/Bridge/Twig/Extension/AssetExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
final class AssetExtension extends AbstractExtension
2424
{
25-
private Packages $packages;
25+
private $packages;
2626

2727
public function __construct(Packages $packages)
2828
{

0 commit comments

Comments
 (0)