Skip to content

Commit 8422187

Browse files
wouterjnicolas-grekas
authored andcommitted
Add void return types
1 parent f25cf42 commit 8422187

File tree

11 files changed

+27
-19
lines changed

11 files changed

+27
-19
lines changed

Data/Bundle/Compiler/GenrbCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(string $genrb = 'genrb', string $envVars = '')
4343
$this->genrb = ($envVars ? $envVars.' ' : '').$genrb;
4444
}
4545

46-
public function compile(string $sourcePath, string $targetDir)
46+
public function compile(string $sourcePath, string $targetDir): void
4747
{
4848
if (is_dir($sourcePath)) {
4949
$sourcePath .= '/*.txt';

Data/Bundle/Reader/BundleEntryReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(BundleReaderInterface $reader)
5353
*
5454
* @param array $localeAliases A mapping of locale aliases to locales
5555
*/
56-
public function setLocaleAliases(array $localeAliases)
56+
public function setLocaleAliases(array $localeAliases): void
5757
{
5858
$this->localeAliases = $localeAliases;
5959
}

Data/Bundle/Writer/JsonBundleWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class JsonBundleWriter implements BundleWriterInterface
2222
{
23-
public function write(string $path, string $locale, mixed $data)
23+
public function write(string $path, string $locale, mixed $data): void
2424
{
2525
if ($data instanceof \Traversable) {
2626
$data = iterator_to_array($data);

Data/Bundle/Writer/PhpBundleWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class PhpBundleWriter implements BundleWriterInterface
2222
{
23-
public function write(string $path, string $locale, mixed $data)
23+
public function write(string $path, string $locale, mixed $data): void
2424
{
2525
$template = <<<'TEMPLATE'
2626
<?php

Data/Bundle/Writer/TextBundleWriter.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
class TextBundleWriter implements BundleWriterInterface
2828
{
29-
public function write(string $path, string $locale, mixed $data, bool $fallback = true)
29+
public function write(string $path, string $locale, mixed $data, bool $fallback = true): void
3030
{
3131
$file = fopen($path.'/'.$locale.'.txt', 'w');
3232

@@ -43,7 +43,7 @@ public function write(string $path, string $locale, mixed $data, bool $fallback
4343
*
4444
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
4545
*/
46-
private function writeResourceBundle($file, string $bundleName, mixed $value, bool $fallback)
46+
private function writeResourceBundle($file, string $bundleName, mixed $value, bool $fallback): void
4747
{
4848
fwrite($file, $bundleName);
4949

@@ -60,7 +60,7 @@ private function writeResourceBundle($file, string $bundleName, mixed $value, bo
6060
*
6161
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
6262
*/
63-
private function writeResource($file, mixed $value, int $indentation, bool $requireBraces = true)
63+
private function writeResource($file, mixed $value, int $indentation, bool $requireBraces = true): void
6464
{
6565
if (\is_int($value)) {
6666
$this->writeInteger($file, $value);
@@ -109,7 +109,7 @@ private function writeResource($file, mixed $value, int $indentation, bool $requ
109109
*
110110
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
111111
*/
112-
private function writeInteger($file, int $value)
112+
private function writeInteger($file, int $value): void
113113
{
114114
fprintf($file, ':int{%d}', $value);
115115
}
@@ -121,7 +121,7 @@ private function writeInteger($file, int $value)
121121
*
122122
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
123123
*/
124-
private function writeIntVector($file, array $value, int $indentation)
124+
private function writeIntVector($file, array $value, int $indentation): void
125125
{
126126
fwrite($file, ":intvector{\n");
127127

@@ -139,7 +139,7 @@ private function writeIntVector($file, array $value, int $indentation)
139139
*
140140
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
141141
*/
142-
private function writeString($file, string $value, bool $requireBraces = true)
142+
private function writeString($file, string $value, bool $requireBraces = true): void
143143
{
144144
if ($requireBraces) {
145145
fprintf($file, '{"%s"}', $value);
@@ -157,7 +157,7 @@ private function writeString($file, string $value, bool $requireBraces = true)
157157
*
158158
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
159159
*/
160-
private function writeArray($file, array $value, int $indentation)
160+
private function writeArray($file, array $value, int $indentation): void
161161
{
162162
fwrite($file, "{\n");
163163

@@ -177,7 +177,7 @@ private function writeArray($file, array $value, int $indentation)
177177
*
178178
* @param resource $file The file handle to write to
179179
*/
180-
private function writeTable($file, iterable $value, int $indentation, bool $fallback = true)
180+
private function writeTable($file, iterable $value, int $indentation, bool $fallback = true): void
181181
{
182182
if (!$fallback) {
183183
fwrite($file, ':table(nofallback)');

Data/Generator/GeneratorConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(string $sourceDir, string $icuVersion)
3939
/**
4040
* Adds a writer to be used during the data conversion.
4141
*/
42-
public function addBundleWriter(string $targetDir, BundleWriterInterface $writer)
42+
public function addBundleWriter(string $targetDir, BundleWriterInterface $writer): void
4343
{
4444
$this->bundleWriters[$targetDir] = $writer;
4545
}

Data/Generator/LocaleDataGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function scanLocales(LocaleScanner $scanner, string $sourceDir): array
4242
return $this->locales;
4343
}
4444

45-
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir)
45+
protected function compileTemporaryBundles(BundleCompilerInterface $compiler, string $sourceDir, string $tempDir): void
4646
{
4747
$filesystem = new Filesystem();
4848
$filesystem->mkdir([
@@ -53,7 +53,7 @@ protected function compileTemporaryBundles(BundleCompilerInterface $compiler, st
5353
$compiler->compile($sourceDir.'/region', $tempDir.'/region');
5454
}
5555

56-
protected function preGenerate()
56+
protected function preGenerate(): void
5757
{
5858
// Write parents locale file for the Translation component
5959
file_put_contents(

Locale.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class Locale extends \Locale
3434
*
3535
* @see getFallback()
3636
*/
37-
public static function setDefaultFallback(?string $locale)
37+
public static function setDefaultFallback(?string $locale): void
3838
{
3939
self::$defaultFallback = $locale;
4040
}

Resources/bin/common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ function centered(string $text)
4444
return str_repeat(' ', $padding).$text;
4545
}
4646

47-
function cd(string $dir)
47+
function cd(string $dir): void
4848
{
4949
if (false === chdir($dir)) {
5050
bailout("Could not switch to directory $dir.");
5151
}
5252
}
5353

54-
function run(string $command)
54+
function run(string $command): void
5555
{
5656
exec($command, $output, $status);
5757

Util/GitRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getLastTag(callable $filter = null): string
8080
return $this->getLastLine($tags);
8181
}
8282

83-
public function checkout(string $branch)
83+
public function checkout(string $branch): void
8484
{
8585
$this->execInPath(sprintf('git checkout %s', escapeshellarg($branch)));
8686
}

0 commit comments

Comments
 (0)