Skip to content

Commit 009f699

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

File tree

66 files changed

+190
-218
lines changed

Some content is hidden

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

66 files changed

+190
-218
lines changed

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/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 & 7 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
{

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/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

src/Symfony/Component/BrowserKit/AbstractBrowser.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function getCookieJar(): CookieJar
204204
*/
205205
public function getCrawler(): Crawler
206206
{
207-
if (null === $this->crawler) {
207+
if (!isset($this->crawler)) {
208208
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
209209
}
210210

@@ -228,7 +228,7 @@ public function useHtml5Parser(bool $useHtml5Parser): static
228228
*/
229229
public function getInternalResponse(): Response
230230
{
231-
if (null === $this->internalResponse) {
231+
if (!isset($this->internalResponse)) {
232232
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
233233
}
234234

@@ -245,7 +245,7 @@ public function getInternalResponse(): Response
245245
*/
246246
public function getResponse(): object
247247
{
248-
if (null === $this->response) {
248+
if (!isset($this->response)) {
249249
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
250250
}
251251

@@ -257,7 +257,7 @@ public function getResponse(): object
257257
*/
258258
public function getInternalRequest(): Request
259259
{
260-
if (null === $this->internalRequest) {
260+
if (!isset($this->internalRequest)) {
261261
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
262262
}
263263

@@ -274,7 +274,7 @@ public function getInternalRequest(): Request
274274
*/
275275
public function getRequest(): object
276276
{
277-
if (null === $this->request) {
277+
if (!isset($this->request)) {
278278
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
279279
}
280280

@@ -300,7 +300,7 @@ public function click(Link $link): Crawler
300300
*/
301301
public function clickLink(string $linkText): Crawler
302302
{
303-
if (null === $this->crawler) {
303+
if (!isset($this->crawler)) {
304304
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
305305
}
306306

@@ -331,7 +331,7 @@ public function submit(Form $form, array $values = [], array $serverParameters =
331331
*/
332332
public function submitForm(string $button, array $fieldValues = [], string $method = 'POST', array $serverParameters = []): Crawler
333333
{
334-
if (null === $this->crawler) {
334+
if (!isset($this->crawler)) {
335335
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
336336
}
337337

src/Symfony/Component/Cache/LockRegistry.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
*/
2727
final class LockRegistry
2828
{
29-
private static $openedFiles = [];
30-
private static $lockedFiles;
31-
private static $signalingException;
32-
private static $signalingCallback;
29+
private static array $openedFiles = [];
30+
private static ?array $lockedFiles = null;
31+
private static \Exception $signalingException;
32+
private static \Closure $signalingCallback;
3333

3434
/**
3535
* The number of items in this list controls the max number of concurrent processes.
3636
*/
37-
private static $files = [
37+
private static array $files = [
3838
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'AbstractAdapter.php',
3939
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'AbstractTagAwareAdapter.php',
4040
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'AdapterInterface.php',

src/Symfony/Component/Console/Command/CompleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ final class CompleteCommand extends Command
4444
*/
4545
protected static $defaultDescription = 'Internal command to provide shell completion suggestions';
4646

47-
private $completionOutputs;
47+
private array $completionOutputs;
4848

49-
private $isDebug = false;
49+
private bool $isDebug = false;
5050

5151
/**
5252
* @param array<string, class-string<CompletionOutputInterface>> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value

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