Skip to content

Commit 05abd55

Browse files
committed
fix cs
1 parent e1846d3 commit 05abd55

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/Console/Command/AstDiffCheckCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class AstDiffCheckCommand extends Command
2121
private DiffCollector $diffCollector;
2222
private Presenter $presenter;
2323

24-
public function __construct(string $name = null)
24+
public function __construct(?string $name = null)
2525
{
2626
parent::__construct($name);
2727

src/External/Git.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct()
2525
#[\Override]
2626
public function verifyCommit(string $commitHash): bool
2727
{
28-
$verifyBranch = shell_exec(sprintf(
28+
$verifyBranch = shell_exec(\sprintf(
2929
'git rev-parse --verify -q %s',
3030
escapeshellarg($commitHash)
3131
));
@@ -39,7 +39,7 @@ public function verifyCommit(string $commitHash): bool
3939
#[\Override]
4040
public function getCommitLog(string $commitHash): string
4141
{
42-
return (string)shell_exec(sprintf(
42+
return (string)shell_exec(\sprintf(
4343
'git log --pretty=oneline -n 1 %s',
4444
escapeshellarg($commitHash)
4545
));
@@ -48,7 +48,7 @@ public function getCommitLog(string $commitHash): string
4848
#[\Override]
4949
public function getDiffFiles($baseCommit, $headCommit): array
5050
{
51-
$diff = shell_exec(sprintf(
51+
$diff = shell_exec(\sprintf(
5252
'git --no-pager diff --name-status %s..%s',
5353
escapeshellarg($baseCommit),
5454
escapeshellarg($headCommit),
@@ -99,7 +99,7 @@ private function shellExec(string $externalCommand, string ...$args): null|false
9999
static fn($arg): string => str_starts_with($arg, $px) ? substr($arg, \strlen($px)) : escapeshellarg($arg),
100100
$args
101101
);
102-
$externalCommand = sprintf($externalCommand, ...$args);
102+
$externalCommand = \sprintf($externalCommand, ...$args);
103103
}
104104

105105
return shell_exec($externalCommand);

src/Presenter/Presenter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function consumeContents(): string
3737
*/
3838
public function processMetaContents(array $commits): void
3939
{
40-
$this->putln(sprintf('# Check diff between %s...%s', $commits['base']['hash'], $commits['head']['hash']));
40+
$this->putln(\sprintf('# Check diff between %s...%s', $commits['base']['hash'], $commits['head']['hash']));
4141
$this->put(\PHP_EOL);
4242

4343
$helper = new MarkdownTableHelper();

tests/unit/Differ/DiffCollectorTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testInitialize(): void
3333

3434
public function testInitializeInvalidCommitHash(): void
3535
{
36-
$git = new class () extends DummyGit {
36+
$git = new class extends DummyGit {
3737
public function verifyCommit(string $commitHash): bool
3838
{
3939
return false;
@@ -51,7 +51,7 @@ public function verifyCommit(string $commitHash): bool
5151
*/
5252
public function testGetCommits(): void
5353
{
54-
$git = new class () extends DummyGit {
54+
$git = new class extends DummyGit {
5555
public function getCommitLog(string $commitHash): string
5656
{
5757
$commits = [
@@ -84,7 +84,7 @@ public function getCommitLog(string $commitHash): string
8484

8585
public function testGetPhpDiffs(): void
8686
{
87-
$git = new class () extends DummyGit {
87+
$git = new class extends DummyGit {
8888
public function getDiffFiles(string $baseCommit, string $headCommit): array
8989
{
9090
return [
@@ -137,7 +137,7 @@ public function testGetPhpDiffsAstChanged(int $expectCount, bool $includeNonAstC
137137

138138
public static function getPhpDiffsAstChangedProvider(): \Generator
139139
{
140-
$git = new class () extends DummyGit {
140+
$git = new class extends DummyGit {
141141
public function getDiffFiles(string $baseCommit, string $headCommit): array
142142
{
143143
return
@@ -184,7 +184,7 @@ public function createForPhp(string $path, GitStatus $status): AstDiff
184184

185185
public function testGetNonPhpDiffs(): void
186186
{
187-
$git = new class () extends DummyGit {
187+
$git = new class extends DummyGit {
188188
public function getDiffFiles(string $baseCommit, string $headCommit): array
189189
{
190190
return

tests/unit/Differ/DiffFactoryTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public function testCreateForNonPhp(): void
3636
#[DataProvider('createForPhpProvider')]
3737
public function testCreateForPhp(GitStatus $gitStatus, ?string $expectedBase, ?string $expectedHead): void
3838
{
39-
$git = new class () extends DummyGit {
39+
$git = new class extends DummyGit {
4040
public function getSource(string $commitHash, string $path): string
4141
{
4242
return "<?php \$hash = '{$commitHash}'; \$path = '{$path}';";
4343
}
4444
};
45-
$astHasher = new class () extends DummyAstHasher {
45+
$astHasher = new class extends DummyAstHasher {
4646
public function get(string $source): string
4747
{
4848
return $source;

0 commit comments

Comments
 (0)