Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\NarrowUnusedSetUpDefinedPropertyRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\CodeQuality\Rector\FuncCall\AssertFuncCallToPHPUnitAssertRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;

Expand All @@ -40,5 +41,6 @@
NullToStrictStringFuncCallArgRector::class,
PreferPHPUnitThisCallRector::class,
NarrowUnusedSetUpDefinedPropertyRector::class,
AssertFuncCallToPHPUnitAssertRector::class,
]);
};
4 changes: 2 additions & 2 deletions src/Command/ReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private function selectProject(InputInterface $input, OutputInterface $output):
$question = new Question('<info>Please enter the name of the project to release:</info> ');
$question->setAutocompleterValues(array_keys($this->projects->all()));
$question->setTrimmable(true);
$question->setValidator(fn ($answer): Project => $this->projects->byName($answer));
$question->setValidator($this->projects->byName(...));
$question->setMaxAttempts(3);

$project = $helper->ask($input, $output, $question);
Expand All @@ -154,7 +154,7 @@ private function selectBranch(InputInterface $input, OutputInterface $output, Pr
$default
);
$question->setTrimmable(true);
$question->setValidator(static fn ($answer): Branch => $project->branch($answer));
$question->setValidator($project->branch(...));
$question->setMaxAttempts(3);

$branch = $helper->ask($input, $output, $question);
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Value/Branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function fromValues(string $name, array $config): self
}

$phpExtensions = array_map(
static fn (string $phpExtension): PhpExtension => PhpExtension::fromString($phpExtension),
PhpExtension::fromString(...),
$config['php_extensions']
);

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Value/Changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function fromPullRequests(array $pullRequests, Tag $next, Tag $cur

$changelog = array_reduce(
$changelogs,
'array_merge_recursive',
array_merge_recursive(...),
[]
);

Expand Down
2 changes: 1 addition & 1 deletion src/Github/Api/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(private GithubClient $github, private ResultPagerInt
public function all(Repository $repository, PullRequest $pullRequest, ?string $username = null): array
{
$comments = array_map(
static fn (array $response): Comment => Comment::fromResponse($response),
Comment::fromResponse(...),
$this->githubPager->fetchAll($this->github->issues()->comments(), 'all', [
$repository->username(),
$repository->name(),
Expand Down
2 changes: 1 addition & 1 deletion src/Github/Api/Commits.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(private GithubClient $github, private ResultPagerInt
public function all(Repository $repository, PullRequest $pullRequest): array
{
return array_map(
static fn (array $response): Commit => Commit::fromResponse($response),
Commit::fromResponse(...),
$this->githubPager->fetchAll($this->github->pullRequest(), 'commits', [
$repository->username(),
$repository->name(),
Expand Down
2 changes: 1 addition & 1 deletion src/Github/Api/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(private GithubClient $github)
public function all(Repository $repository): array
{
return array_map(
static fn (array $response): Hook => Hook::fromResponse($response),
Hook::fromResponse(...),
$this->github->repo()->hooks()->all($repository->username(), $repository->name())
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Github/Api/Labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(private GithubClient $github)
public function all(Repository $repository): array
{
return array_map(
static fn (array $response): Label => Label::fromResponse($response),
Label::fromResponse(...),
$this->github->repo()->labels()->all($repository->username(), $repository->name())
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Util/Factory/Github/Response/CheckRunsFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

$response = [
'check_runs' => array_map(
static fn ($item): array => CheckRunFactory::create(),
CheckRunFactory::create(...),

Check failure on line 33 in tests/Util/Factory/Github/Response/CheckRunsFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan

Parameter #1 $callback of function array_map expects (callable(int): mixed)|null, Closure(array<mixed>=): array<mixed> given.

Check failure on line 33 in tests/Util/Factory/Github/Response/CheckRunsFactory.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidArgument

tests/Util/Factory/Github/Response/CheckRunsFactory.php:33:17: InvalidArgument: Parameter 1 of closure passed to function array_map expects array<array-key, mixed>, but int provided (see https://psalm.dev/004)
range(0, $faker->numberBetween(2, 3))
),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$response = [
'state' => $state,
'statuses' => array_map(
static fn ($item): array => StatusFactory::create(),
StatusFactory::create(...),

Check failure on line 40 in tests/Util/Factory/Github/Response/CombinedStatusFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan

Parameter #1 $callback of function array_map expects (callable(int): mixed)|null, Closure(array<mixed>=): array<mixed> given.

Check failure on line 40 in tests/Util/Factory/Github/Response/CombinedStatusFactory.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidArgument

tests/Util/Factory/Github/Response/CombinedStatusFactory.php:40:17: InvalidArgument: Parameter 1 of closure passed to function array_map expects array<array-key, mixed>, but int provided (see https://psalm.dev/004)
range('pending' === $state ? 0 : 1, $faker->numberBetween(2, 3))
),
];
Expand Down
2 changes: 1 addition & 1 deletion tests/Util/Factory/Github/Response/PullRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
),
'html_url' => $faker->url(),
'labels' => array_map(
static fn ($item): array => LabelFactory::create(),
LabelFactory::create(...),

Check failure on line 73 in tests/Util/Factory/Github/Response/PullRequestFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan

Parameter #1 $callback of function array_map expects (callable(int): mixed)|null, Closure(array<mixed>=): array<mixed> given.

Check failure on line 73 in tests/Util/Factory/Github/Response/PullRequestFactory.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidArgument

tests/Util/Factory/Github/Response/PullRequestFactory.php:73:17: InvalidArgument: Parameter 1 of closure passed to function array_map expects array<array-key, mixed>, but int provided (see https://psalm.dev/004)
range(0, $faker->numberBetween(0, 5))
),
];
Expand Down
Loading