Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dd44cab

Browse filesBrowse files
minor #41907 [FrameworkBundle] add union types (nicolas-grekas)
This PR was merged into the 6.0 branch. Discussion ---------- [FrameworkBundle] add union types | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Part of #41424 | License | MIT | Doc PR | - Commits ------- e85e459 [FrameworkBundle] add union types
2 parents bf5dc51 + e85e459 commit dd44cab
Copy full SHA for dd44cab

File tree

Expand file treeCollapse file tree

18 files changed

+28
-47
lines changed
Filter options
Expand file treeCollapse file tree

18 files changed

+28
-47
lines changed

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(Psr6CacheClearer $poolClearer, array $pools = [])
3939
*
4040
* @return string[]
4141
*/
42-
public function warmUp($cacheDirectory): array
42+
public function warmUp(string $cacheDirectory): array
4343
{
4444
foreach ($this->pools as $pool) {
4545
if ($this->poolClearer->hasPool($pool)) {

‎src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
120120
return 0;
121121
}
122122

123-
private function searchForEvent(EventDispatcherInterface $dispatcher, $needle): array
123+
private function searchForEvent(EventDispatcherInterface $dispatcher, string $needle): array
124124
{
125125
$output = [];
126126
$lcNeedle = strtolower($needle);

‎src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Application.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
109109
/**
110110
* {@inheritdoc}
111111
*/
112-
public function find($name)
112+
public function find(string $name)
113113
{
114114
$this->registerCommands();
115115

@@ -119,7 +119,7 @@ public function find($name)
119119
/**
120120
* {@inheritdoc}
121121
*/
122-
public function get($name)
122+
public function get(string $name)
123123
{
124124
$this->registerCommands();
125125

@@ -135,7 +135,7 @@ public function get($name)
135135
/**
136136
* {@inheritdoc}
137137
*/
138-
public function all($namespace = null)
138+
public function all(string $namespace = null)
139139
{
140140
$this->registerCommands();
141141

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
+3-13Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ abstract protected function describeContainerDefinition(Definition $definition,
129129

130130
abstract protected function describeContainerAlias(Alias $alias, array $options = [], ContainerBuilder $builder = null);
131131

132-
abstract protected function describeContainerParameter($parameter, array $options = []);
132+
abstract protected function describeContainerParameter(mixed $parameter, array $options = []);
133133

134134
abstract protected function describeContainerEnvVars(array $envs, array $options = []);
135135

@@ -141,19 +141,9 @@ abstract protected function describeContainerEnvVars(array $envs, array $options
141141
*/
142142
abstract protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = []);
143143

144-
/**
145-
* Describes a callable.
146-
*
147-
* @param mixed $callable
148-
*/
149-
abstract protected function describeCallable($callable, array $options = []);
144+
abstract protected function describeCallable(mixed $callable, array $options = []);
150145

151-
/**
152-
* Formats a value as string.
153-
*
154-
* @param mixed $value
155-
*/
156-
protected function formatValue($value): string
146+
protected function formatValue(mixed $value): string
157147
{
158148
if (\is_object($value)) {
159149
return sprintf('object(%s)', \get_class($value));

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function describeEventDispatcherListeners(EventDispatcherInterface $ev
139139
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, $options), $options);
140140
}
141141

142-
protected function describeCallable($callable, array $options = [])
142+
protected function describeCallable(mixed $callable, array $options = [])
143143
{
144144
$this->writeData($this->getCallableData($callable), $options);
145145
}

‎src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected function redirectToRoute(string $route, array $parameters = [], int $s
168168
/**
169169
* Returns a JsonResponse that uses the serializer component if enabled, or json_encode.
170170
*/
171-
protected function json($data, int $status = 200, array $headers = [], array $context = []): JsonResponse
171+
protected function json(mixed $data, int $status = 200, array $headers = [], array $context = []): JsonResponse
172172
{
173173
if ($this->container->has('serializer')) {
174174
$json = $this->container->get('serializer')->serialize($data, 'json', array_merge([

‎src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@ class ControllerResolver extends ContainerControllerResolver
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
protected function instantiateController($class): object
27+
protected function instantiateController(string $class): object
2828
{
29-
return $this->configureController(parent::instantiateController($class), $class);
30-
}
29+
$controller = parent::instantiateController($class);
3130

32-
private function configureController($controller, string $class): object
33-
{
3431
if ($controller instanceof ContainerAwareInterface) {
3532
$controller->setContainer($this->container);
3633
}

‎src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DataCollector/RouterDataCollector.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616
use Symfony\Component\HttpKernel\DataCollector\RouterDataCollector as BaseRouterDataCollector;
1717

1818
/**
19-
* RouterDataCollector.
20-
*
2119
* @author Fabien Potencier <fabien@symfony.com>
2220
*
2321
* @final
2422
*/
2523
class RouterDataCollector extends BaseRouterDataCollector
2624
{
27-
public function guessRoute(Request $request, $controller)
25+
public function guessRoute(Request $request, mixed $controller)
2826
{
2927
if (\is_array($controller)) {
3028
$controller = $controller[0];

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddDebugLogProcessorPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddDebugLogProcessorPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function process(ContainerBuilder $container)
3434
$definition->addMethodCall('pushProcessor', [new Reference('debug.log_processor')]);
3535
}
3636

37-
public static function configureLogger($logger)
37+
public static function configureLogger(mixed $logger)
3838
{
3939
if (\is_object($logger) && method_exists($logger, 'removeDebugLogger') && \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
4040
$logger->removeDebugLogger();

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ private function addAnnotationsSection(ArrayNodeDefinition $rootNode, callable $
960960
;
961961
}
962962

963-
private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone, $willBeAvailable)
963+
private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone, callable $willBeAvailable)
964964
{
965965
$rootNode
966966
->children()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.