Skip to content

Commit 27d3963

Browse files
Backport type fixes
1 parent 0156b9a commit 27d3963

12 files changed

+15
-17
lines changed

CacheWarmer/CachePoolClearerCacheWarmer.php

Lines 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)) {

Console/Application.php

Lines 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

Console/Descriptor/Descriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ abstract protected function describeContainerTags(ContainerBuilder $builder, arr
113113
*
114114
* @param Definition|Alias|object $service
115115
*/
116-
abstract protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null);
116+
abstract protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null);
117117

118118
/**
119119
* Describes container services.

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
6767
$this->writeData($data, $options);
6868
}
6969

70-
protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null)
70+
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
7171
{
7272
if (!isset($options['id'])) {
7373
throw new \InvalidArgumentException('An "id" option must be provided.');

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
8888
}
8989
}
9090

91-
protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null)
91+
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
9292
{
9393
if (!isset($options['id'])) {
9494
throw new \InvalidArgumentException('An "id" option must be provided.');

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
141141
}
142142
}
143143

144-
protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null)
144+
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
145145
{
146146
if (!isset($options['id'])) {
147147
throw new \InvalidArgumentException('An "id" option must be provided.');

Console/Descriptor/XmlDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function describeContainerTags(ContainerBuilder $builder, array $optio
5353
$this->writeDocument($this->getContainerTagsDocument($builder, isset($options['show_hidden']) && $options['show_hidden']));
5454
}
5555

56-
protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null)
56+
protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null)
5757
{
5858
if (!isset($options['id'])) {
5959
throw new \InvalidArgumentException('An "id" option must be provided.');
@@ -255,7 +255,7 @@ private function getContainerTagsDocument(ContainerBuilder $builder, bool $showH
255255
return $dom;
256256
}
257257

258-
private function getContainerServiceDocument($service, string $id, ContainerBuilder $builder = null, bool $showArguments = false): \DOMDocument
258+
private function getContainerServiceDocument(object $service, string $id, ContainerBuilder $builder = null, bool $showArguments = false): \DOMDocument
259259
{
260260
$dom = new \DOMDocument('1.0', 'UTF-8');
261261

Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ protected function isCsrfTokenValid(string $id, ?string $token): bool
396396
*
397397
* @param object|Envelope $message The message or the message pre-wrapped in an envelope
398398
*/
399-
protected function dispatchMessage($message, array $stamps = []): Envelope
399+
protected function dispatchMessage(object $message, array $stamps = []): Envelope
400400
{
401401
if (!$this->container->has('messenger.default_bus')) {
402402
$message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".';

Controller/ControllerResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ControllerResolver extends ContainerControllerResolver
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
protected function instantiateController($class): object
27+
protected function instantiateController(string $class): object
2828
{
2929
$controller = parent::instantiateController($class);
3030

KernelBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function enableReboot()
112112
/**
113113
* @param UserInterface $user
114114
*/
115-
public function loginUser($user, string $firewallContext = 'main'): self
115+
public function loginUser(object $user, string $firewallContext = 'main'): self
116116
{
117117
if (!interface_exists(UserInterface::class)) {
118118
throw new \LogicException(sprintf('"%s" requires symfony/security-core to be installed.', __METHOD__));

Routing/AnnotatedRouteControllerLoader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ class AnnotatedRouteControllerLoader extends AnnotationClassLoader
2424
{
2525
/**
2626
* Configures the _controller default parameter of a given Route instance.
27-
*
28-
* @param object $annot The annotation class instance
2927
*/
30-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
28+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
3129
{
3230
if ('__invoke' === $method->getName()) {
3331
$route->setDefault('_controller', $class->getName());

Test/BrowserKitAssertionsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static function assertRequestAttributeValueSame(string $name, string $exp
112112
self::assertThat(self::getRequest(), new ResponseConstraint\RequestAttributeValueSame($name, $expectedValue), $message);
113113
}
114114

115-
public static function assertRouteSame($expectedRoute, array $parameters = [], string $message = ''): void
115+
public static function assertRouteSame(string $expectedRoute, array $parameters = [], string $message = ''): void
116116
{
117117
$constraint = new ResponseConstraint\RequestAttributeValueSame('_route', $expectedRoute);
118118
$constraints = [];

0 commit comments

Comments
 (0)