8000 some backports from master · symfony/symfony@8073b8a · GitHub
[go: up one dir, main page]

Skip to content

Commit 8073b8a

Browse files
some backports from master
1 parent 31b668b commit 8073b8a

File tree

14 files changed

+48
-60
lines changed

14 files changed

+48
-60
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,9 @@ protected function formatParameter($value): string
206206
}
207207

208208
/**
209-
* @param string $serviceId
210-
*
211209
* @return mixed
212210
*/
213-
protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceId)
211+
protected function resolveServiceDefinition(ContainerBuilder $builder, string $serviceId)
214212
{
215213
if ($builder->hasDefinition($serviceId)) {
216214
return $builder->getDefinition($serviceId);
@@ -229,10 +227,7 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI
229227
return $builder->get($serviceId);
230228
}
231229

232-
/**
233-
* @param bool $showHidden
234-
*/
235-
protected function findDefinitionsByTag(ContainerBuilder $builder, $showHidden): array
230+
protected function findDefinitionsByTag(ContainerBuilder $builder, bool $showHidden): array
236231
{
237232
$definitions = [];
238233
$tags = $builder->findTags();

src/Symfony/Component/Console/Formatter/OutputFormatter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ public static function escapeTrailingBackslash(string $text): string
5959
/**
6060
* Initializes console output formatter.
6161
*
62-
* @param bool $decorated Whether this formatter should actually decorate strings
63-
* @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
62+
* @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
6463
*/
6564
public function __construct(bool $decorated = false, array $styles = [])
6665
{

src/Symfony/Component/DependencyInjection/LazyProxy/ProxyHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ProxyHelper
2121
/**
2222
* @return string|null The FQCN or builtin name of the type hint, or null when the type hint references an invalid self|parent context
2323
*/
24-
public static function getTypeHint(\ReflectionFunctionAbstract $r, \ReflectionParameter $p = null, $noBuiltin = false): ?string
24+
public static function getTypeHint(\ReflectionFunctionAbstract $r, \ReflectionParameter $p = null, bool $noBuiltin = false): ?string
2525
{
2626
if ($p instanceof \ReflectionParameter) {
2727
$type = $p->getType();

src/Symfony/Component/DomCrawler/FormFieldRegistry.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FormFieldRegistry
2222
{
2323
private $fields = [];
2424

25-
private $base;
25+
private $base = '';
2626

2727
/**
2828
* Adds a field to the registry.
@@ -47,7 +47,7 @@ public function add(FormField $field)
4747
}
4848

4949
/**
50-
* Removes a field and its children from the registry.
50+
* Removes a field based on the fully qualifed name and its children from the registry.
5151
*/
5252
public function remove(string $name)
5353
{
@@ -64,7 +64,7 @@ public function remove(string $name)
6464
}
6565

6666
/**
67-
* Returns the value of the field and its children.
67+
* Returns the value of the field based on the fully qualifed name and its children.
6868
*
6969
* @return mixed The value of the field
7070
*
@@ -86,7 +86,7 @@ public function &get(string $name)
8686
}
8787

8888
/**
89-
* Tests whether the form has the given field.
89+
* Tests whether the form has the given field based on the fully qualified name.
9090
*
9191
* @return bool Whether the form has the given field
9292
*/
@@ -102,7 +102,7 @@ public function has(string $name): bool
102102
}
103103

104104
/**
105-
* Set the value of a field and its children.
105+
* Set the value of a field based on the fully qualified name and its children.
106106
*
107107
* @param mixed $value The value
108108
*

src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ class CurrencyDataGenerator extends AbstractDataGenerator
5151
/**
5252
* {@inheritdoc}
5353
*/
54-
protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
54+
protected function scanLocales(LocaleScanner $scanner, string $sourceDir): array
5555
{
5656
return $scanner->scanLocales($sourceDir.'/curr');
5757
}
5858

5959
/**
6060
* {@inheritdoc}
6161
*/
62-
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, $sourceDir, $tempDir)
62+
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir)
6363
{
6464
$compiler->compile($sourceDir.'/curr', $tempDir);
6565
$compiler->compile($sourceDir.'/misc/currencyNumericCodes.txt', $tempDir);
@@ -76,7 +76,7 @@ protected function preGenerate()
7676
/**
7777
* {@inheritdoc}
7878
*/
79-
protected function generateDataForLocale(BundleEntryReaderInterface $reader, $tempDir, $displayLocale): ?array
79+
protected function generateDataForLocale(BundleEntryReaderInterface $reader, string $tempDir, string $displayLocale): ?array
8080
{
8181
$localeBundle = $reader->read($tempDir, $displayLocale);
8282

@@ -97,7 +97,7 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
9797
/**
9898
* {@inheritdoc}
9999
*/
100-
protected function generateDataForRoot(BundleEntryReaderInterface $reader, $tempDir): ?array
100+
protected function generateDataForRoot(BundleEntryReaderInterface $reader, string $tempDir): ?array
101101
{
102102
$rootBundle = $reader->read($tempDir, 'root');
103103

@@ -110,7 +110,7 @@ protected function generateDataForRoot(BundleEntryReaderInterface $reader, $temp
110110
/**
111111
* {@inheritdoc}
112112
*/
113-
protected function generateDataForMeta(BundleEntryReaderInterface $reader, $tempDir): ?array
113+
protected function generateDataForMeta(BundleEntryReaderInterface $reader, string $tempDir): ?array
114114
{
115115
$rootBundle = $reader->read($tempDir, 'root');
116116
$supplementalDataBundle = $reader->read($tempDir, 'supplementalData');

src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ class LanguageDataGenerator extends AbstractDataGenerator
101101
/**
102102
* {@inheritdoc}
103103
*/
104-
protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
104+
protected function scanLocales(LocaleScanner $scanner, string $sourceDir): array
105105
{
106106
return $scanner->scanLocales($sourceDir.'/lang');
107107
}
108108

109109
/**
110110
* {@inheritdoc}
111111
*/
112-
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, $sourceDir, $tempDir)
112+
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir)
113113
{
114114
$compiler->compile($sourceDir.'/lang', $tempDir);
115115
$compiler->compile($sourceDir.'/misc/metadata.txt', $tempDir);
@@ -126,7 +126,7 @@ protected function preGenerate()
126126
/**
127127
* {@inheritdoc}
128128
*/
129-
protected function generateDataForLocale(BundleEntryReaderInterface $reader, $tempDir, $displayLocale): ?array
129+
protected function generateDataForLocale(BundleEntryReaderInterface $reader, string $tempDir, string $displayLocale): ?array
130130
{
131131
$localeBundle = $reader->read($tempDir, $displayLocale);
132132

@@ -148,14 +148,14 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
148148
/**
149149
* {@inheritdoc}
150150
*/
151-
protected function generateDataForRoot(BundleEntryReaderInterface $reader, $tempDir): ?array
151+
protected function generateDataForRoot(BundleEntryReaderInterface $reader, string $tempDir): ?array
152152
{
153153
}
154154

155155
/**
156156
* {@inheritdoc}
157157
*/
158-
protected function generateDataForMeta(BundleEntryReaderInterface $reader, $tempDir): ?array
158+
protected function generateDataForMeta(BundleEntryReaderInterface $reader, string $tempDir): ?array
159159
{
160160
$rootBundle = $reader->read($tempDir, 'root');
161161
$metadataBundle = $reader->read($tempDir, 'metadata');

src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LocaleDataGenerator extends AbstractDataGenerator
3636
/**
3737
* {@inheritdoc}
3838
*/
39-
protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
39+
protected function scanLocales(LocaleScanner $scanner, string $sourceDir): array
4040
{
4141
$this->locales = $scanner->scanLocales($sourceDir.'/locales');
4242
$this->localeAliases = $scanner->scanAliases($sourceDir.'/locales');
@@ -48,7 +48,7 @@ protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
4848
/**
4949
* {@inheritdoc}
5050
*/
51-
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, $sourceDir, $tempDir)
51+
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir)
5252
{
5353
$filesystem = new Filesystem();
5454
$filesystem->mkdir([
@@ -74,7 +74,7 @@ protected function preGenerate()
7474
/**
7575
* {@inheritdoc}
7676
*/
77-
protected function generateDataForLocale(BundleEntryReaderInterface $reader, $tempDir, $displayLocale): ?array
77+
protected function generateDataForLocale(BundleEntryReaderInterface $reader, string $tempDir, string $displayLocale): ?array
7878
{
7979
// Don't generate aliases, as they are resolved during runtime
8080
// Unless an alias is needed as fallback for de-duplication purposes
@@ -133,14 +133,14 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
133133
/**
134134
* {@inheritdoc}
135135
*/
136-
protected function generateDataForRoot(BundleEntryReaderInterface $reader, $tempDir): ?array
136+
protected function generateDataForRoot(BundleEntryReaderInterface $reader, string $tempDir): ?array
137137
{
138138
}
139139

140140
/**
141141
* {@inheritdoc}
142142
*/
143-
protected function generateDataForMeta(BundleEntryReaderInterface $reader, $tempDir): ?array
143+
protected function generateDataForMeta(BundleEntryReaderInterface $reader, string $tempDir): ?array
144144
{
145145
return [
146146
'Locales' => $this->locales,

src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ public static function isValidCountryCode($region)
8484
/**
8585
* {@inheritdoc}
8686
*/
87-
protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
87+
protected function scanLocales(LocaleScanner $scanner, string $sourceDir): array
8888
{
8989
return $scanner->scanLocales($sourceDir.'/region');
9090
}
9191

9292
/**
9393
* {@inheritdoc}
9494
*/
95-
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, $sourceDir, $tempDir)
95+
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir)
9696
{
9797
$compiler->compile($sourceDir.'/region', $tempDir);
9898
$compiler->compile($sourceDir.'/misc/metadata.txt', $tempDir);
@@ -109,7 +109,7 @@ protected function preGenerate()
109109
/**
110110
* {@inheritdoc}
111111
*/
112-
protected function generateDataForLocale(BundleEntryReaderInterface $reader, $tempDir, $displayLocale): ?array
112+
protected function generateDataForLocale(BundleEntryReaderInterface $reader, string $tempDir, string $displayLocale): ?array
113113
{
114114
$localeBundle = $reader->read($tempDir, $displayLocale);
115115

@@ -131,14 +131,14 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
131131
/**
132132
* {@inheritdoc}
133133
*/
134-
protected function generateDataForRoot(BundleEntryReaderInterface $reader, $tempDir): ?array
134+
protected function generateDataForRoot(BundleEntryReaderInterface $reader, string $tempDir): ?array
135135
{
136136
}
137137

138138
/**
139139
* {@inheritdoc}
140140
*/
141-
protected function generateDataForMeta(BundleEntryReaderInterface $reader, $tempDir): ?array
141+
protected function generateDataForMeta(BundleEntryReaderInterface $reader, string $tempDir): ?array
142142
{
143143
$rootBundle = $reader->read($tempDir, 'root');
144144
$metadataBundle = $reader->read($tempDir, 'metadata');

src/Symfony/Component/Intl/Data/Generator/ScriptDataGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ class ScriptDataGenerator extends AbstractDataGenerator
3838
/**
3939
* {@inheritdoc}
4040
*/
41-
protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
41+
protected function scanLocales(LocaleScanner $scanner, string $sourceDir): array
4242
{
4343
return $scanner->scanLocales($sourceDir.'/lang');
4444
}
4545

4646
/**
4747
* {@inheritdoc}
4848
*/
49-
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, $sourceDir, $tempDir)
49+
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir)
5050
{
5151
$compiler->compile($sourceDir.'/lang', $tempDir);
5252
}
@@ -62,7 +62,7 @@ protected function preGenerate()
6262
/**
6363
* {@inheritdoc}
6464
*/
65-
protected function generateDataForLocale(BundleEntryReaderInterface $reader, $tempDir, $displayLocale): ?array
65+
protected function generateDataForLocale(BundleEntryReaderInterface $reader, string $tempDir, string $displayLocale): ?array
6666
{
6767
$localeBundle = $reader->read($tempDir, $displayLocale);
6868

@@ -84,14 +84,14 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
8484
/**
8585
* {@inheritdoc}
8686
*/
87-
protected function generateDataForRoot(BundleEntryReaderInterface $reader, $tempDir): ?array
87+
protected function generateDataForRoot(BundleEntryReaderInterface $reader, string $tempDir): ?array
8888
{
8989
}
9090

9191
/**
9292
* {@inheritdoc}
9393
*/
94-
protected function generateDataForMeta(BundleEntryReaderInterface $reader, $tempDir): ?array
94+
protected function generateDataForMeta(BundleEntryReaderInterface $reader, string $tempDir): ?array
9595
{
9696
$rootBundle = $reader->read($tempDir, 'root');
9797

src/Symfony/Component/Intl/Data/Generator/TimezoneDataGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TimezoneDataGenerator extends AbstractDataGenerator
4242
/**
4343
* {@inheritdoc}
4444
*/
45-
protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
45+
protected function scanLocales(LocaleScanner $scanner, string $sourceDir): array
4646
{
4747
$this->localeAliases = $scanner->scanAliases($sourceDir.'/locales');
4848

@@ -52,7 +52,7 @@ protected function scanLocales(LocaleScanner $scanner, $sourceDir): array
5252
/**
5353
* {@inheritdoc}
5454
*/
55-
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, $sourceDir, $tempDir)
55+
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir)
5656
{
5757
$filesystem = new Filesystem();
5858
$filesystem->mkdir($tempDir.'/region');
@@ -75,7 +75,7 @@ protected function preGenerate()
7575
/**
7676
* {@inheritdoc}
7777
*/
78-
protected function generateDataForLocale(BundleEntryReaderInterface $reader, $tempDir, $displayLocale): ?array
78+
protected function generateDataForLocale(BundleEntryReaderInterface $reader, string $tempDir, string $displayLocale): ?array
7979
{
8080
if (!$this->zoneToCountryMapping) {
8181
$this->zoneToCountryMapping = self::generateZoneToCountryMapping($reader->read($tempDir, 'windowsZones'));
@@ -126,7 +126,7 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, $te
126126
/**
127127
* {@inheritdoc}
128128
*/
129-
protected function generateDataForRoot(BundleEntryReaderInterface $reader, $tempDir): ?array
129+
protected function generateDataForRoot(BundleEntryReaderInterface $reader, string $tempDir): ?array
130130
{
131131
$rootBundle = $reader->read($tempDir, 'root');
132132

@@ -139,7 +139,7 @@ protected function generateDataForRoot(BundleEntryReaderInterface $reader, $temp
139139
/**
140140
* {@inheritdoc}
141141
*/
142-
protected function generateDataForMeta(BundleEntryReaderInterface $reader, $tempDir): ?array
142+
protected function generateDataForMeta(BundleEntryReaderInterface $reader, string $tempDir): ?array
143143
{
144144
$rootBundle = $reader->read($tempDir, 'root');
145145

src/Symfony/Component/Process/Pipes/PipesInterface.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ interface PipesInterface
2424

2525
/**
2626
* Returns an array of descriptors for the use of proc_open.
27-
*
28-
* @return array
2927
*/
30-
public function getDescriptors();
28+
public function getDescriptors(): array;
3129

3230
/**
3331
* Returns an array of filenames indexed by their related stream in case these pipes use temporary files.
3432
*
3533
* @return string[]
3634
*/
37-
public function getFiles();
35+
public function getFiles(): array;
3836

3937
/**
4038
* Reads data in file handles and pipes.
@@ -44,21 +42,17 @@ public function getFiles();
4442
*
4543
* @return string[] An array of read data indexed by their fd
4644
*/
47-
public function readAndWrite($blocking, $close = false);
45+
public function readAndWrite(bool $blocking, bool $close = false): array;
4846

4947
/**
5048
* Returns if the current state has open file handles or pipes.
51-
*
52-
* @return bool
5349
*/
54-
public function areOpen();
50+
public function areOpen(): bool;
5551

5652
/**
5753
* Returns if pipes are able to read output.
58-
*
59-
* @return bool
6054
*/
61-
public function haveReadSupport();
55+
public function haveReadSupport(): bool;
6256

6357
/**
6458
* Closes file handles and pipes.

0 commit comments

Comments
 (0)
0