Skip to content

Commit 6353f5e

Browse files
Add types to private and internal properties
1 parent 8ec0d08 commit 6353f5e

File tree

139 files changed

+484
-739
lines changed

Some content is hidden

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

139 files changed

+484
-739
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
*/
2626
abstract class AbstractDoctrineMiddleware implements MiddlewareInterface
2727
{
28-
protected $managerRegistry;
29-
protected $entityManagerName;
28+
protected ManagerRegistry $managerRegistry;
29+
protected ?string $entityManagerName;
3030

3131
public function __construct(ManagerRegistry $managerRegistry, string $entityManagerName = null)
3232
{

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Doctrine\ORM\EntityManagerInterface;
1515
use Doctrine\Persistence\ManagerRegistry;
1616
use Psr\Log\LoggerInterface;
17-
use Psr\Log\NullLogger;
1817
use Symfony\Component\Messenger\Envelope;
1918
use Symfony\Component\Messenger\Middleware\StackInterface;
2019

@@ -25,13 +24,13 @@
2524
*/
2625
class DoctrineOpenTransactionLoggerMiddleware extends AbstractDoctrineMiddleware
2726
{
28-
private $logger;
27+
private ?LoggerInterface $logger;
2928

3029
public function __construct(ManagerRegistry $managerRegistry, string $entityManagerName = null, LoggerInterface $logger = null)
3130
{
3231
parent::__construct($managerRegistry, $entityManagerName);
3332

34-
$this->logger = $logger ?? new NullLogger();
33+
$this->logger = $logger;
3534
}
3635

3736
protected function handleForManager(EntityManagerInterface $entityManager, Envelope $envelope, StackInterface $stack): Envelope
@@ -40,7 +39,7 @@ protected function handleForManager(EntityManagerInterface $entityManager, Envel
4039
return $stack->next()->handle($envelope, $stack);
4140
} finally {
4241
if ($entityManager->getConnection()->isTransactionActive()) {
43-
$this->logger->error('A handler opened a transaction but did not close it.', [
42+
$this->logger?->error('A handler opened a transaction but did not close it.', [
4443
'message' => $envelope->getMessage(),
4544
]);
4645
}

src/Symfony/Bundle/DebugBundle/Command/ServerDumpPlaceholderCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#[AsCommand(name: 'server:dump', description: 'Start a dump server that collects and displays dumps in a single place')]
3030
class ServerDumpPlaceholderCommand extends Command
3131
{
32-
private $replacedCommand;
32+
private ServerDumpCommand $replacedCommand;
3333

3434
public function __construct(DumpServer $server = null, array $descriptors = [])
3535
{

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
*/
3434
abstract class Descriptor implements DescriptorInterface
3535
{
36-
/**
37-
* @var OutputInterface
38-
*/
39-
protected $output;
36+
protected OutputInterface $output;
4037

4138
public function describe(OutputInterface $output, mixed $object, array $options = []): void
4239
{

src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionPanelController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
*/
2626
class ExceptionPanelController
2727
{
28-
private $errorRenderer;
29-
private $profiler;
28+
private HtmlErrorRenderer $errorRenderer;
29+
private ?Profiler $profiler;
3030

3131
public function __construct(HtmlErrorRenderer $errorRenderer, Profiler $profiler = null)
3232
{

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
*/
3333
class ProfilerController
3434
{
35-
private $templateManager;
36-
private $generator;
37-
private $profiler;
38-
private $twig;
39-
private $templates;
40-
private $cspHandler;
41-
private $baseDir;
35+
private TemplateManager $templateManager;
36+
private UrlGeneratorInterface $generator;
37+
private ?Profiler $profiler;
38+
private Environment $twig;
39+
private array $templates;
40+
private ?ContentSecurityPolicyHandler $cspHandler;
41+
private ?string $baseDir;
4242

4343
public function __construct(UrlGeneratorInterface $generator, Profiler $profiler = null, Environment $twig, array $templates, ContentSecurityPolicyHandler $cspHandler = null, string $baseDir = null)
4444
{
@@ -174,7 +174,6 @@ public function searchBarAction(Request $request): Response
174174

175175
$this->cspHandler?->disableCsp();
176176

177-
178177
$session = null;
179178
if ($request->attributes->getBoolean('_stateless') && $request->hasSession()) {
180179
$session = $request->getSession();

src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
*/
3131
class RouterController
3232
{
33-
private $profiler;
34-
private $twig;
35-
private $matcher;
36-
private $routes;
33+
private ?Profiler $profiler;
34+
private Environment $twig;
35+
private ?UrlMatcherInterface $matcher;
36+
private ?RouteCollection $routes;
3737

3838
/**
3939
* @var ExpressionFunctionProviderInterface[]
4040
*/
41-
private $expressionLanguageProviders = [];
41+
private iterable $expressionLanguageProviders;
4242

4343
public function __construct(Profiler $profiler = null, Environment $twig, UrlMatcherInterface $matcher = null, RouteCollection $routes = null, iterable $expressionLanguageProviders = [])
4444
{

src/Symfony/Bundle/WebProfilerBundle/Csp/ContentSecurityPolicyHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
*/
2424
class ContentSecurityPolicyHandler
2525
{
26-
private $nonceGenerator;
27-
private $cspDisabled = false;
26+
private NonceGenerator $nonceGenerator;
27+
private bool $cspDisabled = false;
2828

2929
public function __construct(NonceGenerator $nonceGenerator)
3030
{

src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
*/
2525
class TemplateManager
2626
{
27-
protected $twig;
28-
protected $templates;
29-
protected $profiler;
27+
protected Environment $twig;
28+
protected array $templates;
29+
protected Profiler $profiler;
3030

3131
public function __construct(Profiler $profiler, Environment $twig, array $templates)
3232
{

src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,14 @@
2727
*/
2828
class WebProfilerExtension extends ProfilerExtension
2929
{
30-
/**
31-
* @var HtmlDumper
32-
*/
33-
private $dumper;
30+
private HtmlDumper $dumper;
3431

3532
/**
3633
* @var resource
3734
*/
3835
private $output;
3936

40-
/**
41-
* @var int
42-
*/
43-
private $stackLevel = 0;
37+
private int $stackLevel = 0;
4438

4539
public function __construct(HtmlDumper $dumper = null)
4640
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy