Skip to content

Commit

Permalink
Use Docker image provided by friendsofphp/php-cs-fixer (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude authored Aug 27, 2024
1 parent ccca471 commit 5b47ed3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/fix-cs-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
ref: ${{ github.head_ref }}

- name: Run PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
uses: docker://ghcr.io/php-cs-fixer/php-cs-fixer:3.62.0-php8.3
with:
args: "fix --show-progress=dots"

- name: Commit and push back changes
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRules([
'@Symfony' => true,
'phpdoc_separation' => false,
'@Symfony:risky' => true,
'array_syntax' => array('syntax' => 'short'),
'no_unreachable_default_argument_value' => false,
Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/PersistentTranslatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function translate(?string $locale = null): mixed

return $this->primaryValue;
} catch (Exception $e) {
$message = sprintf(
$message = \sprintf(
'Cannot translate property %s::%s into locale %s',
\get_class($this->entity),
$this->translationProperty->getName(),
Expand Down Expand Up @@ -271,7 +271,7 @@ private function stringifyException(Throwable $e): string
if (!empty($exceptionAsString)) {
$exceptionAsString .= \PHP_EOL.'Previous exception: '.\PHP_EOL;
}
$exceptionAsString .= sprintf(
$exceptionAsString .= \sprintf(
"Exception '%s' with message '%s' in %s:%d\n%s",
$e::class,
$e->getMessage(),
Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/TranslatableClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function isClassWithoutTranslations(): bool
private function assertAttributesAreComplete(string $class): void
{
if (null === $this->translationClass) {
throw new RuntimeException(sprintf('Unable to find the translations for %s. There should be a one-to-may collection holding the translation entities, and it should be marked with %s.', $class, Attribute\TranslationCollection::class));
throw new RuntimeException(\sprintf('Unable to find the translations for %s. There should be a one-to-may collection holding the translation entities, and it should be marked with %s.', $class, Attribute\TranslationCollection::class));
}

if (null === $this->translationLocaleProperty) {
Expand All @@ -175,7 +175,7 @@ private function assertAttributesAreComplete(string $class): void
}

if (null === $this->primaryLocale) {
throw new RuntimeException(sprintf('Class %s uses translations, so it needs to provide the primary locale with the %s attribute at the class level. This can either be at the class itself, or in one of its parent classes.', $class, Attribute\Locale::class));
throw new RuntimeException(\sprintf('Class %s uses translations, so it needs to provide the primary locale with the %s attribute at the class level. This can either be at the class itself, or in one of its parent classes.', $class, Attribute\Locale::class));
}
}

Expand Down

0 comments on commit 5b47ed3

Please sign in to comment.