Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Sep 7, 2024
1 parent a5bfcb2 commit 4a61570
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ protected function localeFilename(string $locale, string $path, bool $has_inline
$path = Str::replaceFormat($path, compact('locale'), '{%s}');

$directory = PathHelper::dirname($path);
$filename = PathHelper::filename($path);
$filename = PathHelper::filename($path);
$extension = PathHelper::extension($path);

$main = "$directory/$filename.$extension";
$main = "$directory/$filename.$extension";
$inline = "$directory/$filename-inline.$extension";

return $has_inline && File::exists($inline) ? $inline : $main;
Expand Down
2 changes: 1 addition & 1 deletion src/Constants/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
enum Types: string
{
case TypeClass = 'class';
case TypeName = 'name';
case TypeName = 'name';
}
3 changes: 2 additions & 1 deletion src/Helpers/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class Config

public function __construct(
readonly protected Arr $arr = new Arr()
) {}
) {
}

public function getPlugins(): array
{
Expand Down
5 changes: 3 additions & 2 deletions src/Processors/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public function __construct(
protected ArrHelper $arr = new ArrHelper(),
protected Translation $translation = new Translation(
)
) {}
) {
}

public function prepare(): self
{
Expand Down Expand Up @@ -123,7 +124,7 @@ protected function collectLocalizations(string $directory, array $files): void
$locale_alias = $this->toAlias($locale);

foreach ($this->file_types as $type) {
$main_path = $this->localeFilename($locale_alias, "$directory/locales/$locale/$type.json");
$main_path = $this->localeFilename($locale_alias, "$directory/locales/$locale/$type.json");
$inline_path = $this->localeFilename($locale_alias, "$directory/locales/$locale/$type.json", true);

$values = $this->filesystem->load($main_path);
Expand Down
4 changes: 3 additions & 1 deletion src/Processors/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@

namespace LaravelLang\Publisher\Processors;

class Update extends Processor {}
class Update extends Processor
{
}
3 changes: 2 additions & 1 deletion src/Resources/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class Translation implements Arrayable

public function __construct(
readonly protected Arr $arr = new Arr()
) {}
) {
}

public function getSource(string $filename): array
{
Expand Down
3 changes: 2 additions & 1 deletion src/Services/Converters/Text/BaseDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ abstract class BaseDecorator implements TextDecorator
{
public function __construct(
protected Config $config
) {}
) {
}
}
2 changes: 1 addition & 1 deletion src/Services/Filesystem/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function expand(array $values): array
protected function validationSort(array $items): array
{
$attributes = Arr::get($items, 'attributes');
$custom = Arr::get($items, 'custom');
$custom = Arr::get($items, 'custom');

return Arr::of($items)
->except(['attributes', 'custom'])
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Console/InlineOff/Add/WithoutParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WithoutParameterTest extends TestCase
{
public function testNo(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down Expand Up @@ -67,7 +67,7 @@ public function testNo(): void

public function testYes(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Console/InlineOff/Remove/WithoutParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WithoutParameterTest extends TestCase

public function testNo(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down Expand Up @@ -69,7 +69,7 @@ public function testNo(): void

public function testYes(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Console/InlineOn/Add/WithoutParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WithoutParameterTest extends TestCase
{
public function testNo(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down Expand Up @@ -67,7 +67,7 @@ public function testNo(): void

public function testYes(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Console/InlineOn/Remove/WithoutParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WithoutParameterTest extends TestCase

public function testNo(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down Expand Up @@ -69,7 +69,7 @@ public function testNo(): void

public function testYes(): void
{
$installed = [Locale::English, Locale::French];
$installed = [Locale::English, Locale::French];
$notInstalled = [Locale::NorwegianBokmal, Locale::Afrikaans];

foreach ($installed as $locale) {
Expand Down

0 comments on commit 4a61570

Please sign in to comment.