Skip to content

Commit 4fceb3b

Browse files
committed
Codestyle fix
1 parent 215ac3c commit 4fceb3b

File tree

14 files changed

+815
-32
lines changed

14 files changed

+815
-32
lines changed

.editorconfig

Lines changed: 787 additions & 0 deletions
Large diffs are not rendered by default.

app/add.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@
1414
}
1515

1616
echo 'You must provide a localization code.';
17-

app/main/Application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ public function basePath(): string
2323
return rtrim($this->base_path, '/\\');
2424
}
2525

26-
public function sourcePath(string $filename = null): string
26+
public function sourcePath(?string $filename = null): string
2727
{
2828
return $this->path('source/' . $this->cleanPath($filename));
2929
}
3030

31-
public function localePath(string $locale = null): string
31+
public function localePath(?string $locale = null): string
3232
{
3333
return $this->path('locales/' . $this->cleanPath($locale));
3434
}
@@ -43,7 +43,7 @@ public function resourcePath(string $filename): string
4343
return $this->path('app/resources/' . $this->cleanPath($filename));
4444
}
4545

46-
public function path(string $path = null): string
46+
public function path(?string $path = null): string
4747
{
4848
if ($value = $this->cleanPath($path)) {
4949
return $this->basePath() . '/' . $value;
@@ -52,7 +52,7 @@ public function path(string $path = null): string
5252
return $this->basePath();
5353
}
5454

55-
public function cleanPath(string $path = null): ?string
55+
public function cleanPath(?string $path = null): ?string
5656
{
5757
if (! empty($path)) {
5858
return ltrim($path, '/\\');

app/main/Constants/Machines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ class Machines
3838
'uk',
3939
'ur',
4040
'uz_Cyrl',
41-
'uz_Latn'
41+
'uz_Latn',
4242
];
4343
}

app/main/Contracts/Application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ public function __construct(string $base_path);
88

99
public function basePath(): string;
1010

11-
public function sourcePath(string $filename = null): string;
11+
public function sourcePath(?string $filename = null): string;
1212

13-
public function localePath(string $locale = null): string;
13+
public function localePath(?string $locale = null): string;
1414

1515
public function excludePath(string $locale): string;
1616

1717
public function resourcePath(string $filename): string;
1818

19-
public function path(string $path = null): string;
19+
public function path(?string $path = null): string;
2020

21-
public function cleanPath(string $path = null): ?string;
21+
public function cleanPath(?string $path = null): ?string;
2222

2323
public function processor(Processable $processor): void;
2424
}

app/main/Processors/AddLocale.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function createFiles(): void
3434
}
3535
}
3636

37-
protected function process(string $target_path, string $filename, string $locale = null): void
37+
protected function process(string $target_path, string $filename, ?string $locale = null): void
3838
{
3939
$this->store($target_path, [], $filename);
4040
}

app/main/Processors/Excludes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function handle(): void
2626
}
2727
}
2828

29-
protected function process(string $target_path, string $filename, string $locale = null): void
29+
protected function process(string $target_path, string $filename, ?string $locale = null): void
3030
{
3131
$target = $this->load($target_path);
3232

app/main/Processors/Processor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function merge(array $source, array $target, string $filename): array
4949
return ArrSupport::merge($source, $target);
5050
}
5151

52-
protected function process(string $target_path, string $filename, string $locale = null): void
52+
protected function process(string $target_path, string $filename, ?string $locale = null): void
5353
{
5454
$source = $this->source($filename);
5555
$target = $this->load($target_path);
@@ -95,7 +95,7 @@ protected function getFallbackValue(array $source, array $target, string $key)
9595
return Arr::get($target, $key) ?: Arr::get($source, $key, []);
9696
}
9797

98-
protected function getTargetPath(string $path = null): string
98+
protected function getTargetPath(?string $path = null): string
9999
{
100100
if ($path = $this->app->cleanPath($path)) {
101101
$path = '/' . $path;
@@ -104,7 +104,7 @@ protected function getTargetPath(string $path = null): string
104104
return $this->app->path($this->target_path . $path);
105105
}
106106

107-
protected function getSourcePath(string $filename = null): string
107+
protected function getSourcePath(?string $filename = null): string
108108
{
109109
return $this->app->sourcePath($filename);
110110
}
@@ -165,7 +165,7 @@ protected function loadFilesystem(Filesystem|Base|string $filesystem): Filesyste
165165
return $filesystem::make()->application($this->app);
166166
}
167167

168-
protected function store(string $path, array|string|Stringable $content, string $source_filename = null, bool $is_simple = false): void
168+
protected function store(string $path, array|string|Stringable $content, ?string $source_filename = null, bool $is_simple = false): void
169169
{
170170
$stub = $this->getStubPath($source_filename);
171171

app/main/Processors/Statuses/Locales.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function ensureDirectory(): void
4545
Directory::ensureDirectory($this->pathStatus(), can_delete: true);
4646
}
4747

48-
protected function pathStatus(string $filename = null): string
48+
protected function pathStatus(?string $filename = null): string
4949
{
5050
return $this->app->path('docs/statuses/' . $filename);
5151
}

app/main/Processors/Statuses/Processor.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function handle(): void
4747
}
4848
}
4949

50-
protected function process(string $target_path, string $filename, string $locale = null): void
50+
protected function process(string $target_path, string $filename, ?string $locale = null): void
5151
{
5252
$corrected = $this->resolveFilename($filename, $locale);
5353

@@ -93,7 +93,7 @@ protected function hasEquals($value, $key, array $source, string $locale, bool $
9393
return false;
9494
}
9595

96-
return Arr::get($source, $key) === $value;
96+
return $value === Arr::get($source, $key);
9797
}
9898

9999
protected function countMissing(string $locale): int
@@ -103,7 +103,7 @@ protected function countMissing(string $locale): int
103103
return array_sum($items);
104104
}
105105

106-
protected function getLocalePath(string $locale = null): string
106+
protected function getLocalePath(?string $locale = null): string
107107
{
108108
return $this->app->localePath($locale);
109109
}
@@ -156,6 +156,5 @@ protected function ensureLocale(string $locale): void
156156

157157
protected function ensureDirectory(): void
158158
{
159-
//
160159
}
161160
}

0 commit comments

Comments
 (0)