Skip to content

Commit 5f948b9

Browse files
Replace more docblocks by type-hints
1 parent 07c9701 commit 5f948b9

22 files changed

+25
-43
lines changed

Collator/Collator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Collator
7474
*
7575
* @throws MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed
7676
*/
77-
public function __construct($locale)
77+
public function __construct(?string $locale)
7878
{
7979
if ('en' !== $locale && null !== $locale) {
8080
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'locale', $locale, 'Only the locale "en" is supported');

Data/Bundle/Compiler/GenrbCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GenrbCompiler implements BundleCompilerInterface
3232
*
3333
* @throws RuntimeException if the "genrb" cannot be found
3434
*/
35-
public function __construct($genrb = 'genrb', $envVars = '')
35+
public function __construct(string $genrb = 'genrb', string $envVars = '')
3636
{
3737
exec('which '.$genrb, $output, $status);
3838

Data/Bundle/Reader/BufferedBundleReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class BufferedBundleReader implements BundleReaderInterface
2929
* @param BundleReaderInterface $reader The reader to buffer
3030
* @param int $bufferSize The number of entries to store in the buffer
3131
*/
32-
public function __construct(BundleReaderInterface $reader, $bufferSize)
32+
public function __construct(BundleReaderInterface $reader, int $bufferSize)
3333
{
3434
$this->reader = $reader;
3535
$this->buffer = new RingBuffer($bufferSize);

Data/Generator/AbstractDataGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ abstract class AbstractDataGenerator
2929
private $compiler;
3030
private $dirName;
3131

32-
public function __construct(GenrbCompiler $compiler, $dirName)
32+
public function __construct(GenrbCompiler $compiler, string $dirName)
3333
{
3434
$this->compiler = $compiler;
35-
$this->dirName = (string) $dirName;
35+
$this->dirName = $dirName;
3636
}
3737

3838
public function generateData(GeneratorConfig $config)

Data/Generator/GeneratorConfig.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ class GeneratorConfig
3030
*/
3131
private $bundleWriters = array();
3232

33-
/**
34-
* @param string $sourceDir
35-
* @param string $icuVersion
36-
*/
37-
public function __construct($sourceDir, $icuVersion)
33+
public function __construct(string $sourceDir, string $icuVersion)
3834
{
3935
$this->sourceDir = $sourceDir;
4036
$this->icuVersion = $icuVersion;

Data/Generator/LocaleDataGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class LocaleDataGenerator
3434
private $scriptDataProvider;
3535
private $regionDataProvider;
3636

37-
public function __construct($dirName, LanguageDataProvider $languageDataProvider, ScriptDataProvider $scriptDataProvider, RegionDataProvider $regionDataProvider)
37+
public function __construct(string $dirName, LanguageDataProvider $languageDataProvider, ScriptDataProvider $scriptDataProvider, RegionDataProvider $regionDataProvider)
3838
{
39-
$this->dirName = (string) $dirName;
39+
$this->dirName = $dirName;
4040
$this->languageDataProvider = $languageDataProvider;
4141
$this->scriptDataProvider = $scriptDataProvider;
4242
$this->regionDataProvider = $regionDataProvider;

Data/Provider/CurrencyDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CurrencyDataProvider
3939
* @param string $path The path to the resource bundle
4040
* @param BundleEntryReaderInterface $reader The reader for reading the resource bundle
4141
*/
42-
public function __construct($path, BundleEntryReaderInterface $reader)
42+
public function __construct(string $path, BundleEntryReaderInterface $reader)
4343
{
4444
$this->path = $path;
4545
$this->reader = $reader;

Data/Provider/LocaleDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class LocaleDataProvider
3232
* @param string $path The path to the directory containing the .res files
3333
* @param BundleEntryReaderInterface $reader The reader for reading the .res files
3434
*/
35-
public function __construct($path, BundleEntryReaderInterface $reader)
35+
public function __construct(string $path, BundleEntryReaderInterface $reader)
3636
{
3737
$this->path = $path;
3838
$this->reader = $reader;

Data/Provider/RegionDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class RegionDataProvider
3232
* @param string $path The path to the directory containing the .res files
3333
* @param BundleEntryReaderInterface $reader The reader for reading the .res files
3434
*/
35-
public function __construct($path, BundleEntryReaderInterface $reader)
35+
public function __construct(string $path, BundleEntryReaderInterface $reader)
3636
{
3737
$this->path = $path;
3838
$this->reader = $reader;

Data/Provider/ScriptDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ScriptDataProvider
3232
* @param string $path The path to the directory containing the .res files
3333
* @param BundleEntryReaderInterface $reader The reader for reading the .res files
3434
*/
35-
public function __construct($path, BundleEntryReaderInterface $reader)
35+
public function __construct(string $path, BundleEntryReaderInterface $reader)
3636
{
3737
$this->path = $path;
3838
$this->reader = $reader;

0 commit comments

Comments
 (0)