Skip to content

Commit 7896580

Browse files
committed
chore: fix/revert ide formatting changes
1 parent 29c4f3b commit 7896580

File tree

4 files changed

+19
-29
lines changed

4 files changed

+19
-29
lines changed

src/Console/LarexImportCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ public function handle(): int
114114

115115
//set source languages
116116
if (!$this->option('skip-source-reordering')) {
117-
$this->callSilently(
118-
LarexLangOrderCommand::class,
119-
['from' => config('larex.source_language', 'en'), 'to' => 1]
120-
);
117+
$this->callSilently(LarexLangOrderCommand::class,
118+
['from' => config('larex.source_language', 'en'), 'to' => 1]);
121119
}
122120

123121
$this->info('Data imported successfully.');

src/Exporters/LaravelExporter.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ public function handle(LarexExportCommand $command, CsvReader $reader): int
5555

5656
foreach ($groups as $group => $keys) {
5757
$write = fopen(lang_path("$folder/$group.php"), 'wb');
58-
fwrite(
59-
$write,
60-
/** @lang text */
61-
"<?php$eol{$eol}return [$eol$eol"
62-
);
58+
fwrite($write, /** @lang text */ "<?php$eol{$eol}return [$eol$eol");
6359

6460
foreach ($keys as $key => $value) {
6561
self::writeKeyValue($key, $value, $write, 1, $eol);
@@ -84,24 +80,24 @@ protected static function writeKeyValue($key, $value, &$file, int $level = 1, $e
8480
$enclosure = '"';
8581

8682
if (is_array($value)) {
87-
fwrite($file, str_repeat(' ', $level) . "'$key' => [$eol");
83+
fwrite($file, str_repeat(' ', $level)."'$key' => [$eol");
8884
$level++;
8985
foreach ($value as $childKey => $childValue) {
9086
self::writeKeyValue($childKey, $childValue, $file, $level, $eol);
9187
}
92-
fwrite($file, str_repeat(' ', $level - 1) . "],$eol");
88+
fwrite($file, str_repeat(' ', $level - 1)."],$eol");
9389

9490
return;
9591
}
9692

9793
$value = (string)$value;
98-
$value = str_replace(["'", '\\' . $enclosure], ["\'", $enclosure], $value);
94+
$value = str_replace(["'", '\\'.$enclosure], ["\'", $enclosure], $value);
9995

10096
if (is_int($key) || (is_numeric($key) && ctype_digit($key))) {
10197
$key = (int)$key;
102-
fwrite($file, str_repeat(' ', $level) . "$key => '$value',$eol");
98+
fwrite($file, str_repeat(' ', $level)."$key => '$value',$eol");
10399
} else {
104-
fwrite($file, str_repeat(' ', $level) . "'$key' => '$value',$eol");
100+
fwrite($file, str_repeat(' ', $level)."'$key' => '$value',$eol");
105101
}
106102
}
107103
}

tests/Exporters/LaravelExporterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797

9898
$this->artisan(LarexExportCommand::class, ['exporter' => 'laravel', '--exclude' => 'en'])
9999
->expectsOutput(sprintf("Processing the '%s' file...", csv_path(true)))
100-
->expectsOutput(lang_rpath('it/app.php') . ' created successfully.')
101-
->expectsOutput(lang_rpath('it/another.php') . ' created successfully.')
100+
->expectsOutput(lang_rpath('it/app.php').' created successfully.')
101+
->expectsOutput(lang_rpath('it/another.php').' created successfully.')
102102
->assertExitCode(0);
103103

104104
expect(lang_path('en/app.php'))->not->toBeFile();

tests/Importers/LaravelImporterTest.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@
8383
->toEqualStub('importers.laravel.territory.output');
8484
});
8585

86-
it(
87-
'imports strings and set the source language',
86+
it('imports strings and set the source language',
8887
function (string $source, string $expected, bool $skipSourceReordering) {
8988
File::makeDirectory(lang_path('ar'), 0755, true, true);
9089
File::makeDirectory(lang_path('en'), 0755, true, true);
@@ -96,10 +95,8 @@ function (string $source, string $expected, bool $skipSourceReordering) {
9695

9796
config(['larex.source_language' => $source]);
9897

99-
$this->artisan(
100-
LarexImportCommand::class,
101-
['importer' => 'laravel', '--skip-source-reordering' => $skipSourceReordering]
102-
)
98+
$this->artisan(LarexImportCommand::class,
99+
['importer' => 'laravel', '--skip-source-reordering' => $skipSourceReordering])
103100
->expectsOutput('Importing entries...')
104101
->expectsOutput('Data imported successfully.')
105102
->assertExitCode(0);
@@ -108,13 +105,12 @@ function (string $source, string $expected, bool $skipSourceReordering) {
108105
->toBeFile()
109106
->fileContent()
110107
->toEqualStub($expected);
111-
}
112-
)->with([
113-
'ar' => ['ar', 'importers.laravel.source.output-ar', false],
114-
'en' => ['en', 'importers.laravel.source.output-en', false],
115-
'en-skip' => ['en', 'importers.laravel.source.output-ar', true],
116-
'invalid-lang' => ['es', 'importers.laravel.source.output-ar', false],
117-
]);
108+
})->with([
109+
'ar' => ['ar', 'importers.laravel.source.output-ar', false],
110+
'en' => ['en', 'importers.laravel.source.output-en', false],
111+
'en-skip' => ['en', 'importers.laravel.source.output-ar', true],
112+
'invalid-lang' => ['es', 'importers.laravel.source.output-ar', false],
113+
]);
118114

119115
it('imports strings with normalize option on', function () {
120116
File::makeDirectory(lang_path('en'), 0755, true, true);

0 commit comments

Comments
 (0)