Skip to content

Commit

Permalink
fix php code style
Browse files Browse the repository at this point in the history
  • Loading branch information
lukadschaak committed Jun 9, 2023
1 parent c647d7d commit ab991ea
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@

// we want to leave the choice to the developer
'php_unit_test_annotation' => false,
'php_unit_method_casing' => false,
]);
4 changes: 2 additions & 2 deletions src/Command/TranslationsMigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

if ($isVerbose) {
$output->writeln('Reading from directories:');
$this->io->listing(\array_map(
$this->io->listing(array_map(
fn (string $path): string => $this->stripProjectPrefix($path),
$this->sourceProvider->getDirectories(),
));
Expand Down Expand Up @@ -102,7 +102,7 @@ function (FileCannotBeLoaded $event) use (&$ioTableRows): void {
private function stripProjectPrefix(string $string): string
{
return str_starts_with($string, self::PROJECT_ROOT)
? substr($string, strlen(self::PROJECT_ROOT))
? substr($string, \strlen(self::PROJECT_ROOT))
: $string;
}
}
6 changes: 3 additions & 3 deletions src/Model/TranslationCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function withoutIds(string ...$ids): self

$clone->translations = array_filter(
$this->translations,
static fn (string $id): bool => !in_array($id, $ids, true),
ARRAY_FILTER_USE_KEY,
static fn (string $id): bool => !\in_array($id, $ids, true),
\ARRAY_FILTER_USE_KEY,
);

return $clone;
Expand All @@ -49,6 +49,6 @@ public function getIterator(): \Generator

public function count(): int
{
return count($this->translations);
return \count($this->translations);
}
}
2 changes: 1 addition & 1 deletion src/Source/SymfonySourceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function getTranslations(string $domain): TranslationCollection
continue;
}

if ($this->enabledLocales && !in_array($file->locale(), $this->enabledLocales, true)) {
if ($this->enabledLocales && !\in_array($file->locale(), $this->enabledLocales, true)) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/Command/TranslationsMigrateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

class TranslationsMigrateCommandTest extends KernelTestCase
{
use ResetDatabase;
use MatchesSnapshots;
use ResetDatabase;

private const COMMAND_NAME = 'neusta:translations:migrate';

Expand Down Expand Up @@ -75,7 +75,7 @@ public function execute_must_not_update_modified_translation(): void
['en' => 'Some random initial value'],
);

\sleep(1);
sleep(1);
// update modification date
$translation->setTranslations(['en' => 'Modified translation value']);
$translation->save();
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/Database/PimcoreInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ protected function getDataFiles(): array

$pattern = sprintf('%s/*{%s}', $this->dumpLocation, implode(',', self::DUMP_FILE_EXTENSIONS));

return glob($pattern, GLOB_BRACE);
return glob($pattern, \GLOB_BRACE);
}
}

0 comments on commit ab991ea

Please sign in to comment.