Skip to content

Commit bf286c2

Browse files
Backport type fixes
1 parent e2185bc commit bf286c2

File tree

123 files changed

+202
-410
lines changed

Some content is hidden

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

123 files changed

+202
-410
lines changed

src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function configureOptions(OptionsResolver $resolver)
5050
*
5151
* @return ORMQueryBuilderLoader
5252
*/
53-
public function getLoader(ObjectManager $manager, $queryBuilder, string $class)
53+
public function getLoader(ObjectManager $manager, object $queryBuilder, string $class)
5454
{
5555
if (!$queryBuilder instanceof QueryBuilder) {
5656
throw new \TypeError(sprintf('Expected an instance of "%s", but got "%s".', QueryBuilder::class, get_debug_type($queryBuilder)));
@@ -76,7 +76,7 @@ public function getBlockPrefix()
7676
* @internal This method is public to be usable as callback. It should not
7777
* be used in user code.
7878
*/
79-
public function getQueryBuilderPartsForCachingHash($queryBuilder): ?array
79+
public function getQueryBuilderPartsForCachingHash(object $queryBuilder): ?array
8080
{
8181
if (!$queryBuilder instanceof QueryBuilder) {
8282
throw new \TypeError(sprintf('Expected an instance of "%s", but got "%s".', QueryBuilder::class, get_debug_type($queryBuilder)));

src/Symfony/Bridge/Twig/Node/DumpNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class DumpNode extends Node
2121
{
2222
private $varPrefix;
2323

24-
public function __construct($varPrefix, ?Node $values, int $lineno, string $tag = null)
24+
public function __construct(string $varPrefix, ?Node $values, int $lineno, string $tag = null)
2525
{
2626
$nodes = [];
2727
if (null !== $values) {

src/Symfony/Bundle/FrameworkBundle/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)) {

src/Symfony/Bundle/FrameworkBundle/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

src/Symfony/Bundle/FrameworkBundle/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.

src/Symfony/Bundle/FrameworkBundle/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.');

src/Symfony/Bundle/FrameworkBundle/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.');

src/Symfony/Bundle/FrameworkBundle/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.');

src/Symfony/Bundle/FrameworkBundle/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

src/Symfony/Bundle/FrameworkBundle/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".';

0 commit comments

Comments
 (0)