Skip to content

Commit 4975dfa

Browse files
authored
cs: fix native_function_invocation & trailing_comma_in_multiline (#178)
1 parent 42e6fae commit 4975dfa

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/FileExtractor/PHPFileExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getSourceLocations(SplFileInfo $file, SourceCollection $collecti
4444
$tokens = $parser->parse($file->getContents());
4545
$traverser->traverse($tokens);
4646
} catch (Error $e) {
47-
trigger_error(sprintf('Skipping file "%s" because of parse Error: %s. ', $path, $e->getMessage()));
47+
trigger_error(\sprintf('Skipping file "%s" because of parse Error: %s. ', $path, $e->getMessage()));
4848
}
4949
}
5050

src/Model/Error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class Error
2121
public function __construct(
2222
private readonly string $message,
2323
private readonly string $path,
24-
private readonly int $line
24+
private readonly int $line,
2525
) {
2626
}
2727

src/Model/SourceLocation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(
2020
private readonly string $message, /** Translation key. */
2121
private readonly string $path,
2222
private readonly int $line,
23-
private readonly array $context = []
23+
private readonly array $context = [],
2424
) {
2525
}
2626

src/Visitor/Php/SourceLocationContainerVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function enterNode(Node $node): ?Node
7676

7777
foreach ($sourceLocations as $sourceLocation) {
7878
if (!$sourceLocation instanceof SourceLocation) {
79-
throw new \RuntimeException(sprintf('%s::getTranslationSourceLocations() was expected to return an array of SourceLocations, but got an array which contains an item of type %s.', $this->namespace.'\\'.$node->name, \gettype($sourceLocation)));
79+
throw new \RuntimeException(\sprintf('%s::getTranslationSourceLocations() was expected to return an array of SourceLocations, but got an array which contains an item of type %s.', $this->namespace.'\\'.$node->name, \gettype($sourceLocation)));
8080
}
8181

8282
$this->collection->addLocation($sourceLocation);

src/Visitor/Php/Symfony/ValidationAnnotation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function enterNode(Node $node): ?Node
6464
/** @var ClassMetadata $metadata */
6565
$metadata = $this->metadataFactory->getMetadataFor($name);
6666
} catch (AnnotationException $e) {
67-
$this->addError($node, sprintf('Could not parse class "%s" for annotations. %s', $this->namespace, $e->getMessage()));
67+
$this->addError($node, \sprintf('Could not parse class "%s" for annotations. %s', $this->namespace, $e->getMessage()));
6868

6969
return null;
7070
}

src/Visitor/Twig/Worker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ private function extractContextFromJoinedFilters(): array
8989
} elseif ('desc' === $name) {
9090
$arguments = $this->stack[$i]->getNode('arguments');
9191
if (!$arguments->hasNode(0)) {
92-
throw new \LogicException(sprintf('The "%s" filter requires exactly one argument, the description text.', $name));
92+
throw new \LogicException(\sprintf('The "%s" filter requires exactly one argument, the description text.', $name));
9393
}
9494
$text = $arguments->getNode(0);
9595
if (!$text instanceof ConstantExpression) {
96-
throw new \LogicException(sprintf('The first argument of the "%s" filter must be a constant expression, such as a string.', $name));
96+
throw new \LogicException(\sprintf('The first argument of the "%s" filter must be a constant expression, such as a string.', $name));
9797
}
9898
$context['desc'] = $text->getAttribute('value');
9999
}

tests/Smoke/AllExtractorsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testNoException()
103103
private function translationExists(SourceCollection $sc, string $translationKey, ?string $message = null): SourceLocation
104104
{
105105
if (empty($message)) {
106-
$message = sprintf('Tried to find "%s" but failed', $translationKey);
106+
$message = \sprintf('Tried to find "%s" but failed', $translationKey);
107107
}
108108

109109
$source = null;
@@ -127,7 +127,7 @@ private function translationExists(SourceCollection $sc, string $translationKey,
127127
private function translationMissing(SourceCollection $sc, string $translationKey, ?string $message = null): void
128128
{
129129
if (empty($message)) {
130-
$message = sprintf('The translation key "%s" should not exist', $translationKey);
130+
$message = \sprintf('The translation key "%s" should not exist', $translationKey);
131131
}
132132

133133
$found = false;

0 commit comments

Comments
 (0)