Skip to content

Commit

Permalink
Merge pull request #417 from Roave/dependabot/composer/doctrine/codin…
Browse files Browse the repository at this point in the history
…g-standard-10.0.0

chore(deps-dev): bump doctrine/coding-standard from 9.0.2 to 10.0.0
  • Loading branch information
Ocramius authored Aug 29, 2022
2 parents a96cb6b + c81138a commit 34a06cf
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 74 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vimeo/psalm": "^4.26.0"
},
"require-dev": {
"doctrine/coding-standard": "^9.0.2",
"doctrine/coding-standard": "^10.0.0",
"phpunit/phpunit": "^9.5.23"
},
"autoload": {
Expand Down
46 changes: 23 additions & 23 deletions composer.lock

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

2 changes: 1 addition & 1 deletion src/Roave/InfectionStaticAnalysis/Bootstrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class Bootstrapper
{
public static function bootstrap(
Container $container,
RunStaticAnalysisAgainstMutant $runStaticAnalysis
RunStaticAnalysisAgainstMutant $runStaticAnalysis,
): Container {
$reflectionOffsetSet = (new ReflectionMethod(Container::class, 'offsetSet'));

Expand Down
10 changes: 3 additions & 7 deletions src/Roave/InfectionStaticAnalysis/CliUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
use function strpos;
use function substr;

/**
* @internal
*/
/** @internal */
final class CliUtility
{
private function __construct()
Expand Down Expand Up @@ -68,10 +66,8 @@ public static function extractArgument(array $arguments, string $argument): arra
return [$arguments, $value];
}

/**
* @return non-empty-string|null
*/
private static function removeSurroundingQuites(?string $argument): ?string
/** @return non-empty-string|null */
private static function removeSurroundingQuites(string|null $argument): string|null
{
if ($argument === null || $argument === '') {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function isMutantStillValidAccordingToStaticAnalysis(Mutant $mutant): boo
$path,
$projectAnalyzer->getCodebase()
->file_reference_provider
->getExistingIssues()
->getExistingIssues(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,13 @@
*/
class RunStaticAnalysisAgainstEscapedMutant extends MutantExecutionResultFactory
{
private MutantExecutionResultFactory $next;
private RunStaticAnalysisAgainstMutant $runStaticAnalysis;
private ReflectionProperty $reflectionOriginalStartFileLocation;
private ReflectionProperty $reflectionOriginalEndFilePosition;

public function __construct(
MutantExecutionResultFactory $next,
RunStaticAnalysisAgainstMutant $runStaticAnalysis
private MutantExecutionResultFactory $next,
private RunStaticAnalysisAgainstMutant $runStaticAnalysis,
) {
$this->next = $next;
$this->runStaticAnalysis = $runStaticAnalysis;

$this->reflectionOriginalStartFileLocation = new ReflectionProperty(MutantExecutionResult::class, 'originalStartFilePosition');
$this->reflectionOriginalEndFilePosition = new ReflectionProperty(MutantExecutionResult::class, 'originalEndFilePosition');

Expand Down Expand Up @@ -73,7 +68,7 @@ public function createFromProcess(MutantProcess $mutantProcess): MutantExecution
$originalEndFilePosition,
later(static fn () => yield $result->getOriginalCode()),
later(static fn () => yield $result->getMutatedCode()),
$result->getTests()
$result->getTests(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ public function testWillNotTestAnything(): void
$runStaticAnalysis = $this->createMock(RunStaticAnalysisAgainstMutant::class);
Bootstrapper::bootstrap(
Container::create(),
$runStaticAnalysis
$runStaticAnalysis,
);

self::assertInstanceOf(
RunStaticAnalysisAgainstEscapedMutant::class,
Bootstrapper::bootstrap(
Container::create(),
$runStaticAnalysis
)->getMutantExecutionResultFactory()
$runStaticAnalysis,
)->getMutantExecutionResultFactory(),
);
}
}
14 changes: 5 additions & 9 deletions test/unit/Roave/InfectionStaticAnalysisTest/CliUtilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

use function sprintf;

/**
* @covers \Roave\InfectionStaticAnalysis\CliUtility
*/
/** @covers \Roave\InfectionStaticAnalysis\CliUtility */
final class CliUtilityTest extends TestCase
{
/**
Expand All @@ -25,9 +23,9 @@ final class CliUtilityTest extends TestCase
*/
public function testExtractArgument(
array $expectedNewArguments,
?string $expectedArgumentValue,
string|null $expectedArgumentValue,
array $arguments,
string $argument
string $argument,
): void {
$result = CliUtility::extractArgument($arguments, $argument);

Expand Down Expand Up @@ -135,17 +133,15 @@ public function provideExtractionData(): array
*/
public function testExtractArgumentThrowsForMissingValue(
array $arguments,
string $argument
string $argument,
): void {
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage(sprintf('Please provide a value for "%s" argument.', $argument));

CliUtility::extractArgument($arguments, $argument);
}

/**
* @return list<array{0: list<non-empty-string>, 1: non-empty-string}>
*/
/** @return list<array{0: list<non-empty-string>, 1: non-empty-string}> */
public function provideExtractionMissingValueData(): array
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function hasMethod(object $input, string $method): bool {

$mutationAttributes = array_combine(
MutationAttributeKeys::ALL,
array_map('strlen', MutationAttributeKeys::ALL)
array_map('strlen', MutationAttributeKeys::ALL),
);

$this->mutantWithValidCode = new Mutant(
Expand All @@ -111,11 +111,11 @@ function hasMethod(object $input, string $method): bool {
'',
MutatedNode::wrap([]),
0,
[]
[],
),
now($validCode),
now(''),
now('')
now(''),
);

$this->mutantWithInvalidCode = new Mutant(
Expand All @@ -128,11 +128,11 @@ function hasMethod(object $input, string $method): bool {
'',
MutatedNode::wrap([]),
0,
[]
[],
),
now($invalidCode),
now(''),
now('')
now(''),
);

$this->mutantWithValidCodeReferencingProjectFiles = new Mutant(
Expand All @@ -145,11 +145,11 @@ function hasMethod(object $input, string $method): bool {
'',
MutatedNode::wrap([]),
0,
[]
[],
),
now($validCodeReferencingProjectFiles),
now(''),
now('')
now(''),
);

$this->mutantWithValidCodeReferencingReflectionApi = new Mutant(
Expand All @@ -162,11 +162,11 @@ function hasMethod(object $input, string $method): bool {
'',
MutatedNode::wrap([]),
0,
[]
[],
),
now($validCodeReferencingProjectFiles),
now(''),
now('')
now(''),
);

if (! defined('PSALM_VERSION')) {
Expand All @@ -182,15 +182,15 @@ function hasMethod(object $input, string $method): bool {

$config = Config::getConfigForPath(
self::PSALM_WORKING_DIRECTORY,
self::PSALM_WORKING_DIRECTORY
self::PSALM_WORKING_DIRECTORY,
);

$config->setIncludeCollector(new IncludeCollector());

return new ProjectAnalyzer(
$config,
new Providers(new FileProvider()),
new ReportOptions()
new ReportOptions(),
);
});
}
Expand All @@ -209,7 +209,7 @@ public function testWillConsiderMutantValidIfNoErrorsAreDetectedByStaticAnalysis
{
$psalmConfig = Config::getConfigForPath(
self::PSALM_WORKING_DIRECTORY,
self::PSALM_WORKING_DIRECTORY
self::PSALM_WORKING_DIRECTORY,
);

$psalmConfig->setIncludeCollector(new IncludeCollector());
Expand All @@ -221,7 +221,7 @@ public function testWillConsiderMutantInvalidIfErrorsAreDetectedByStaticAnalysis
{
$psalmConfig = Config::getConfigForPath(
self::PSALM_WORKING_DIRECTORY,
self::PSALM_WORKING_DIRECTORY
self::PSALM_WORKING_DIRECTORY,
);

$psalmConfig->setIncludeCollector(new IncludeCollector());
Expand All @@ -233,7 +233,7 @@ public function testWillConsiderMutantReferencingProjectFilesAsValid(): void
{
$psalmConfig = Config::getConfigForPath(
self::PSALM_WORKING_DIRECTORY,
self::PSALM_WORKING_DIRECTORY
self::PSALM_WORKING_DIRECTORY,
);

$psalmConfig->setIncludeCollector(new IncludeCollector());
Expand All @@ -245,7 +245,7 @@ public function testWillConsiderMutantReferencingReflectionApiAsValid(): void
{
$psalmConfig = Config::getConfigForPath(
self::PSALM_WORKING_DIRECTORY,
self::PSALM_WORKING_DIRECTORY
self::PSALM_WORKING_DIRECTORY,
);

$psalmConfig->setIncludeCollector(new IncludeCollector());
Expand Down
Loading

0 comments on commit 34a06cf

Please sign in to comment.