Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 815df93

Browse files
committed
minor #53718 [HttpKernel] Use CPP (derrabus)
This PR was merged into the 7.1 branch. Discussion ---------- [HttpKernel] Use CPP | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | N/A | License | MIT Commits ------- 54faed6 [HttpKernel] Use CPP
2 parents 749ad6e + 54faed6 commit 815df93

Some content is hidden

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

52 files changed

+271
-386
lines changed

src/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020
*/
2121
class ChainCacheClearer implements CacheClearerInterface
2222
{
23-
private iterable $clearers;
24-
2523
/**
2624
* @param iterable<mixed, CacheClearerInterface> $clearers
2725
*/
28-
public function __construct(iterable $clearers = [])
29-
{
30-
$this->clearers = $clearers;
26+
public function __construct(
27+
private iterable $clearers = [],
28+
) {
3129
}
3230

3331
public function clear(string $cacheDir): void

src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,17 @@
2222
*/
2323
class CacheWarmerAggregate implements CacheWarmerInterface
2424
{
25-
private iterable $warmers;
26-
private bool $debug;
27-
private ?string $deprecationLogsFilepath;
2825
private bool $optionalsEnabled = false;
2926
private bool $onlyOptionalsEnabled = false;
3027

3128
/**
3229
* @param iterable<mixed, CacheWarmerInterface> $warmers
3330
*/
34-
public function __construct(iterable $warmers = [], bool $debug = false, ?string $deprecationLogsFilepath = null)
35-
{
36-
$this->warmers = $warmers;
37-
$this->debug = $debug;
38-
$this->deprecationLogsFilepath = $deprecationLogsFilepath;
31+
public function __construct(
32+
private iterable $warmers = [],
33+
private bool $debug = false,
34+
private ?string $deprecationLogsFilepath = null,
35+
) {
3936
}
4037

4138
public function enableOptionalWarmers(): void

src/Symfony/Component/HttpKernel/Config/FileLocator.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@
2121
*/
2222
class FileLocator extends BaseFileLocator
2323
{
24-
private KernelInterface $kernel;
25-
26-
public function __construct(KernelInterface $kernel)
27-
{
28-
$this->kernel = $kernel;
29-
24+
public function __construct(
25+
private KernelInterface $kernel,
26+
) {
3027
parent::__construct();
3128
}
3229

src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/ServiceValueResolver.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
*/
2525
final class ServiceValueResolver implements ValueResolverInterface
2626
{
27-
private ContainerInterface $container;
28-
29-
public function __construct(ContainerInterface $container)
30-
{
31-
$this->container = $container;
27+
public function __construct(
28+
private ContainerInterface $container,
29+
) {
3230
}
3331

3432
public function resolve(Request $request, ArgumentMetadata $argument): array

src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
*/
2424
class ContainerControllerResolver extends ControllerResolver
2525
{
26-
protected ContainerInterface $container;
27-
28-
public function __construct(ContainerInterface $container, ?LoggerInterface $logger = null)
29-
{
30-
$this->container = $container;
31-
26+
public function __construct(
27+
protected ContainerInterface $container,
28+
?LoggerInterface $logger = null,
29+
) {
3230
parent::__construct($logger);
3331
}
3432

src/Symfony/Component/HttpKernel/Controller/ControllerReference.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*/
2727
class ControllerReference
2828
{
29-
public string $controller;
3029
public array $attributes = [];
3130
public array $query = [];
3231

@@ -35,9 +34,11 @@ class ControllerReference
3534
* @param array $attributes An array of parameters to add to the Request attributes
3635
* @param array $query An array of parameters to add to the Request query string
3736
*/
38-
public function __construct(string $controller, array $attributes = [], array $query = [])
39-
{
40-
$this->controller = $controller;
37+
public function __construct(
38+
public string $controller,
39+
array $attributes = [],
40+
array $query = [],
41+
) {
4142
$this->attributes = $attributes;
4243
$this->query = $query;
4344
}

src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
*/
2626
class ControllerResolver implements ControllerResolverInterface
2727
{
28-
private ?LoggerInterface $logger;
2928
private array $allowedControllerTypes = [];
3029
private array $allowedControllerAttributes = [AsController::class => AsController::class];
3130

32-
public function __construct(?LoggerInterface $logger = null)
33-
{
34-
$this->logger = $logger;
31+
public function __construct(
32+
private ?LoggerInterface $logger = null,
33+
) {
3534
}
3635

3736
/**

src/Symfony/Component/HttpKernel/Controller/ErrorController.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,11 @@
2525
*/
2626
class ErrorController
2727
{
28-
private HttpKernelInterface $kernel;
29-
private string|object|array|null $controller;
30-
private ErrorRendererInterface $errorRenderer;
31-
32-
public function __construct(HttpKernelInterface $kernel, string|object|array|null $controller, ErrorRendererInterface $errorRenderer)
33-
{
34-
$this->kernel = $kernel;
35-
$this->controller = $controller;
36-
$this->errorRenderer = $errorRenderer;
28+
public function __construct(
29+
private HttpKernelInterface $kernel,
30+
private string|object|array|null $controller,
31+
private ErrorRendererInterface $errorRenderer,
32+
) {
3733
}
3834

3935
public function __invoke(\Throwable $exception): Response

src/Symfony/Component/HttpKernel/Controller/TraceableArgumentResolver.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@
1919
*/
2020
class TraceableArgumentResolver implements ArgumentResolverInterface
2121
{
22-
private ArgumentResolverInterface $resolver;
23-
private Stopwatch $stopwatch;
24-
25-
public function __construct(ArgumentResolverInterface $resolver, Stopwatch $stopwatch)
26-
{
27-
$this->resolver = $resolver;
28-
$this->stopwatch = $stopwatch;
22+
public function __construct(
23+
private ArgumentResolverInterface $resolver,
24+
private Stopwatch $stopwatch,
25+
) {
2926
}
3027

3128
public function getArguments(Request $request, callable $controller, ?\ReflectionFunctionAbstract $reflector = null): array

src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@
1919
*/
2020
class TraceableControllerResolver implements ControllerResolverInterface
2121
{
22-
private ControllerResolverInterface $resolver;
23-
private Stopwatch $stopwatch;
24-
25-
public function __construct(ControllerResolverInterface $resolver, Stopwatch $stopwatch)
26-
{
27-
$this->resolver = $resolver;
28-
$this->stopwatch = $stopwatch;
22+
public function __construct(
23+
private ControllerResolverInterface $resolver,
24+
private Stopwatch $stopwatch,
25+
) {
2926
}
3027

3128
public function getController(Request $request): callable|false

0 commit comments

Comments
 (0)