Skip to content

Commit d2bdeb0

Browse files
Add types to private properties
1 parent 503a7b3 commit d2bdeb0

File tree

75 files changed

+223
-268
lines changed

Some content is hidden

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

75 files changed

+223
-268
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/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
{

src/Symfony/Component/Asset/Exception/AssetNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class AssetNotFoundException extends RuntimeException
1818
{
19-
private $alternatives;
19+
private array $alternatives;
2020

2121
/**
2222
* @param string $message Exception message to throw

0 commit comments

Comments
 (0)