Skip to content

Commit

Permalink
Rename @zero_iteration profile to the @loop (#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidz committed Nov 2, 2020
1 parent 14f0ee0 commit b83a9c0
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 46 deletions.
30 changes: 15 additions & 15 deletions devTools/phpstan-src-baseline.neon
Expand Up @@ -480,6 +480,21 @@ parameters:
count: 1
path: ../src/Mutator/FunctionSignature/PublicVisibility.php

-
message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\For_\\) of method Infection\\\\Mutator\\\\Loop\\\\For_\\:\\:mutate\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method Infection\\\\Mutator\\\\Mutator\\:\\:mutate\\(\\)$#"
count: 1
path: ../src/Mutator/Loop/For_.php

-
message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\Foreach_\\) of method Infection\\\\Mutator\\\\Loop\\\\Foreach_\\:\\:mutate\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method Infection\\\\Mutator\\\\Mutator\\:\\:mutate\\(\\)$#"
count: 1
path: ../src/Mutator/Loop/Foreach_.php

-
message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\While_\\) of method Infection\\\\Mutator\\\\Loop\\\\While_\\:\\:mutate\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method Infection\\\\Mutator\\\\Mutator\\:\\:mutate\\(\\)$#"
count: 1
path: ../src/Mutator/Loop/While_.php

-
message: "#^Call to static method Webmozart\\\\Assert\\\\Assert\\:\\:isArray\\(\\) with array and string will always evaluate to true\\.$#"
count: 1
Expand Down Expand Up @@ -655,21 +670,6 @@ parameters:
count: 1
path: ../src/Mutator/Unwrap/AbstractUnwrapMutator.php

-
message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\For_\\) of method Infection\\\\Mutator\\\\ZeroIteration\\\\For_\\:\\:mutate\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method Infection\\\\Mutator\\\\Mutator\\:\\:mutate\\(\\)$#"
count: 1
path: ../src/Mutator/ZeroIteration/For_.php

-
message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\Foreach_\\) of method Infection\\\\Mutator\\\\ZeroIteration\\\\Foreach_\\:\\:mutate\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method Infection\\\\Mutator\\\\Mutator\\:\\:mutate\\(\\)$#"
count: 1
path: ../src/Mutator/ZeroIteration/Foreach_.php

-
message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Stmt\\\\While_\\) of method Infection\\\\Mutator\\\\ZeroIteration\\\\While_\\:\\:mutate\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method Infection\\\\Mutator\\\\Mutator\\:\\:mutate\\(\\)$#"
count: 1
path: ../src/Mutator/ZeroIteration/While_.php

-
message: "#^Call to static method Webmozart\\\\Assert\\\\Mixin\\:\\:allIsInstanceOf\\(\\) with array\\<PhpParser\\\\Node\\> and 'PhpParser\\\\\\\\Node' will always evaluate to true\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion resources/schema.json
Expand Up @@ -146,7 +146,7 @@
"@removal": { "$ref": "#/definitions/default-mutator-config" },
"@return_value": { "$ref": "#/definitions/default-mutator-config" },
"@sort": { "$ref": "#/definitions/default-mutator-config" },
"@zero_iteration": { "$ref": "#/definitions/default-mutator-config" },
"@loop": { "$ref": "#/definitions/default-mutator-config" },
"@cast": { "$ref": "#/definitions/default-mutator-config" },
"@unwrap": { "$ref": "#/definitions/default-mutator-config" },
"@extensions": { "$ref": "#/definitions/default-mutator-config" },
Expand Down
Expand Up @@ -33,7 +33,7 @@

declare(strict_types=1);

namespace Infection\Mutator\ZeroIteration;
namespace Infection\Mutator\Loop;

use Infection\Mutator\Definition;
use Infection\Mutator\GetMutatorName;
Expand Down
Expand Up @@ -33,7 +33,7 @@

declare(strict_types=1);

namespace Infection\Mutator\ZeroIteration;
namespace Infection\Mutator\Loop;

use Infection\Mutator\Definition;
use Infection\Mutator\GetMutatorName;
Expand Down
Expand Up @@ -33,7 +33,7 @@

declare(strict_types=1);

namespace Infection\Mutator\ZeroIteration;
namespace Infection\Mutator\Loop;

use Infection\Mutator\Definition;
use Infection\Mutator\GetMutatorName;
Expand Down
20 changes: 10 additions & 10 deletions src/Mutator/ProfileList.php
Expand Up @@ -57,14 +57,14 @@ final class ProfileList
'@extensions' => self::EXTENSIONS_PROFILE,
'@function_signature' => self::FUNCTION_SIGNATURE_PROFILE,
'@identical' => self::IDENTICAL_PROFILE,
'@loop' => self::LOOP_PROFILE,
'@number' => self::NUMBER_PROFILE,
'@operator' => self::OPERATOR_PROFILE,
'@regex' => self::REGEX_PROFILE,
'@removal' => self::REMOVAL_PROFILE,
'@return_value' => self::RETURN_VALUE_PROFILE,
'@sort' => self::SORT_PROFILE,
'@unwrap' => self::UNWRAP_PROFILE,
'@zero_iteration' => self::ZERO_ITERATION_PROFILE,
];

public const ARITHMETIC_PROFILE = [
Expand Down Expand Up @@ -188,10 +188,10 @@ final class ProfileList
Mutator\Sort\Spaceship::class,
];

public const ZERO_ITERATION_PROFILE = [
Mutator\ZeroIteration\For_::class,
Mutator\ZeroIteration\Foreach_::class,
Mutator\ZeroIteration\While_::class,
public const LOOP_PROFILE = [
Mutator\Loop\For_::class,
Mutator\Loop\Foreach_::class,
Mutator\Loop\While_::class,
];

public const CAST_PROFILE = [
Expand Down Expand Up @@ -268,14 +268,14 @@ final class ProfileList
'@conditional_negotiation',
'@extensions',
'@function_signature',
'@loop',
'@number',
'@operator',
'@regex',
'@removal',
'@return_value',
'@sort',
'@unwrap',
'@zero_iteration',
];

public const ALL_MUTATORS = [
Expand Down Expand Up @@ -379,10 +379,10 @@ final class ProfileList
// Sort
'Spaceship' => Mutator\Sort\Spaceship::class,

// Zero Iteration
'Foreach_' => Mutator\ZeroIteration\Foreach_::class,
'For_' => Mutator\ZeroIteration\For_::class,
'While_' => Mutator\ZeroIteration\While_::class,
// Loop
'Foreach_' => Mutator\Loop\Foreach_::class,
'For_' => Mutator\Loop\For_::class,
'While_' => Mutator\Loop\While_::class,

// Cast
'CastArray' => Mutator\Cast\CastArray::class,
Expand Down
Expand Up @@ -82,7 +82,7 @@ final class SchemaConfigurationFactoryTest extends TestCase
'@removal',
'@return_value',
'@sort',
'@zero_iteration',
'@loop',
'@default',
];

Expand Down Expand Up @@ -2045,7 +2045,7 @@ public function provideRawConfig(): iterable
"@removal": true,
"@return_value": true,
"@sort": true,
"@zero_iteration": true,
"@loop": true,
"@default": true
}
}
Expand All @@ -2066,7 +2066,7 @@ public function provideRawConfig(): iterable
'@removal' => true,
'@return_value' => true,
'@sort' => true,
'@zero_iteration' => true,
'@loop' => true,
'@default' => true,
],
]),
Expand Down Expand Up @@ -2307,7 +2307,7 @@ public function provideRawConfig(): iterable
"@removal": true,
"@return_value": true,
"@sort": true,
"@zero_iteration": true,
"@loop": true,
"@default": true
}
}
Expand Down Expand Up @@ -2521,7 +2521,7 @@ public function provideRawConfig(): iterable
'@removal' => true,
'@return_value' => true,
'@sort' => true,
'@zero_iteration' => true,
'@loop' => true,
'@default' => true,
],
]),
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Logger/CreateMetricsCalculator.php
Expand Up @@ -38,8 +38,8 @@
use Infection\Metrics\MetricsCalculator;
use Infection\Mutant\DetectionStatus;
use Infection\Mutant\MutantExecutionResult;
use Infection\Mutator\Loop\For_;
use Infection\Mutator\Regex\PregQuote;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Tests\Mutator\MutatorName;
use function Infection\Tests\normalize_trailing_spaces;

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Logger/JsonLoggerTest.php
Expand Up @@ -38,7 +38,7 @@
use Infection\Logger\JsonLogger;
use Infection\Metrics\MetricsCalculator;
use Infection\Mutant\DetectionStatus;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Mutator\Loop\For_;
use const JSON_THROW_ON_ERROR;
use const PHP_EOL;
use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Metrics/MetricsCalculatorTest.php
Expand Up @@ -39,7 +39,7 @@
use Infection\Metrics\MetricsCalculator;
use Infection\Mutant\DetectionStatus;
use Infection\Mutant\MutantExecutionResult;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Mutator\Loop\For_;
use Infection\Tests\Mutator\MutatorName;
use PHPUnit\Framework\TestCase;

Expand Down
Expand Up @@ -38,7 +38,7 @@
use Infection\Metrics\SortableMutantExecutionResults;
use Infection\Mutant\DetectionStatus;
use Infection\Mutant\MutantExecutionResult;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Mutator\Loop\For_;
use Infection\Tests\Mutator\MutatorName;
use PHPUnit\Framework\TestCase;

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Mutant/MutantExecutionResultFactoryTest.php
Expand Up @@ -41,7 +41,7 @@
use Infection\Mutant\Mutant;
use Infection\Mutant\MutantExecutionResultFactory;
use Infection\Mutation\Mutation;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Mutator\Loop\For_;
use Infection\PhpParser\MutatedNode;
use Infection\Process\MutantProcess;
use Infection\Tests\Mutator\MutatorName;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Mutant/MutantExecutionResultTest.php
Expand Up @@ -40,7 +40,7 @@
use Infection\Mutant\Mutant;
use Infection\Mutant\MutantExecutionResult;
use Infection\Mutation\Mutation;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Mutator\Loop\For_;
use Infection\PhpParser\MutatedNode;
use Infection\Tests\Mutator\MutatorName;
use PhpParser\Node\Stmt\Nop;
Expand Down
Expand Up @@ -33,7 +33,7 @@

declare(strict_types=1);

namespace Infection\Tests\Mutator\ZeroIteration;
namespace Infection\Tests\Mutator\Loop;

use Infection\Tests\Mutator\BaseMutatorTestCase;

Expand Down
Expand Up @@ -33,7 +33,7 @@

declare(strict_types=1);

namespace Infection\Tests\Mutator\ZeroIteration;
namespace Infection\Tests\Mutator\Loop;

use Infection\Tests\Mutator\BaseMutatorTestCase;

Expand Down
Expand Up @@ -33,7 +33,7 @@

declare(strict_types=1);

namespace Infection\Tests\Mutator\ZeroIteration;
namespace Infection\Tests\Mutator\Loop;

use Infection\Tests\Mutator\BaseMutatorTestCase;

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Mutator/MutatorResolverTest.php
Expand Up @@ -43,9 +43,9 @@
use Infection\Mutator\Boolean\IdenticalEqual;
use Infection\Mutator\Boolean\NotIdenticalNotEqual;
use Infection\Mutator\Boolean\TrueValue;
use Infection\Mutator\Loop\For_;
use Infection\Mutator\MutatorResolver;
use Infection\Mutator\ProfileList;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Tests\SingletonContainer;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Process/Factory/MutantProcessFactoryTest.php
Expand Up @@ -43,7 +43,7 @@
use Infection\Mutant\MutantExecutionResult;
use Infection\Mutant\MutantExecutionResultFactory;
use Infection\Mutation\Mutation;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Mutator\Loop\For_;
use Infection\PhpParser\MutatedNode;
use Infection\Process\Factory\MutantProcessFactory;
use Infection\Tests\Fixtures\Event\EventDispatcherCollector;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Process/Runner/MutationTestingRunnerTest.php
Expand Up @@ -48,7 +48,7 @@
use Infection\Mutant\Mutant;
use Infection\Mutant\MutantFactory;
use Infection\Mutation\Mutation;
use Infection\Mutator\ZeroIteration\For_;
use Infection\Mutator\Loop\For_;
use Infection\PhpParser\MutatedNode;
use Infection\Process\Factory\MutantProcessFactory;
use Infection\Process\MutantProcess;
Expand Down

0 comments on commit b83a9c0

Please sign in to comment.