Skip to content

Commit

Permalink
Add mutator LogicalAnd (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Dec 4, 2021
1 parent 3400009 commit 8d4aaea
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .dev-tools/infection.json
Expand Up @@ -71,6 +71,11 @@
"InstanceOf_": true,
"LessThanNegotiation": true,
"LessThanOrEqualToNegotiation": true,
"LogicalAnd": {
"ignore": [
"PhpCsFixerCustomFixers\\Fixer\\*::isCandidate"
]
},
"LogicalLowerAnd": true,
"LogicalLowerOr": true,
"LogicalOr": true,
Expand Down
7 changes: 6 additions & 1 deletion .dev-tools/src/InfectionConfigBuilder.php
Expand Up @@ -26,7 +26,6 @@ final class InfectionConfigBuilder
'IntegerNegation',
'LessThan',
'LessThanOrEqualTo',
'LogicalAnd',
'LogicalNot',
'Minus',
'NotIdentical',
Expand Down Expand Up @@ -79,6 +78,12 @@ public function build(): array
],
];

$config['mutators']['LogicalAnd'] = [
'ignore' => [
'PhpCsFixerCustomFixers\\Fixer\\*::isCandidate',
],
];

$config['mutators']['PublicVisibility'] = [
'ignore' => [
'PhpCsFixerCustomFixers\\Fixer\\AbstractFixer::name',
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@
[![Latest stable version](https://img.shields.io/packagist/v/kubawerlos/php-cs-fixer-custom-fixers.svg?label=current%20version)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)
[![PHP version](https://img.shields.io/packagist/php-v/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://php.net)
[![License](https://img.shields.io/github/license/kubawerlos/php-cs-fixer-custom-fixers.svg)](LICENSE)
![Tests](https://img.shields.io/badge/tests-3106-brightgreen.svg)
![Tests](https://img.shields.io/badge/tests-3108-brightgreen.svg)
[![Downloads](https://img.shields.io/packagist/dt/kubawerlos/php-cs-fixer-custom-fixers.svg)](https://packagist.org/packages/kubawerlos/php-cs-fixer-custom-fixers)

[![CI Status](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/actions)
Expand Down
1 change: 1 addition & 0 deletions tests/Fixer/NoUselessParenthesisFixerTest.php
Expand Up @@ -83,6 +83,7 @@ public function createStatic() {
yield ['<?php return ($object->function)(new stdClass());'];
yield ['<?php return ($object->getFunction())(42);'];
yield ['<?php return ($foo)($bar)($baz);'];
yield ['<?php return (1 + 2) * 3;'];

yield [
'<?php return $bar;',
Expand Down
5 changes: 5 additions & 0 deletions tests/Fixer/SingleSpaceAfterStatementFixerTest.php
Expand Up @@ -136,6 +136,11 @@ public static function provideFixCases(): iterable
yield ['<?php if (true): echo "yes"; else: echo "no"; endif;'];
yield ['<?php new class() {};'];

yield [
'<?php new class {};',
'<?php new class{};',
];

yield [
'<?php echo "100";',
'<?php echo"100";',
Expand Down

0 comments on commit 8d4aaea

Please sign in to comment.