Skip to content

Commit

Permalink
Remove interface and abstraction checks in public visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
BackEndTea committed Mar 9, 2019
1 parent 648ba9c commit 6593925
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 75 deletions.
11 changes: 0 additions & 11 deletions src/Mutator/FunctionSignature/PublicVisibility.php
Expand Up @@ -35,7 +35,6 @@

namespace Infection\Mutator\FunctionSignature;

use Infection\Mutator\Util\InterfaceParentTrait;
use Infection\Mutator\Util\Mutator;
use Infection\Visitor\ReflectionVisitor;
use PhpParser\Node;
Expand All @@ -47,8 +46,6 @@
*/
final class PublicVisibility extends Mutator
{
use InterfaceParentTrait;

/**
* Replaces "public function..." with "protected function ..."
*
Expand Down Expand Up @@ -81,18 +78,10 @@ protected function mutatesNode(Node $node): bool
return false;
}

if ($node->isAbstract()) {
return false;
}

if ($node->isMagic()) {
return false;
}

if ($this->isBelongsToInterface($node)) {
return false;
}

return !$this->hasSamePublicParentMethod($node);
}

Expand Down
64 changes: 0 additions & 64 deletions src/Mutator/Util/InterfaceParentTrait.php

This file was deleted.

2 changes: 2 additions & 0 deletions tests/Mutator/AbstractMutatorTestCase.php
Expand Up @@ -42,6 +42,7 @@
use Infection\Tests\Fixtures\SimpleMutatorVisitor;
use Infection\Visitor\CloneVisitor;
use Infection\Visitor\FullyQualifiedClassNameVisitor;
use Infection\Visitor\NotMutableIgnoreVisitor;
use Infection\Visitor\ParentConnectorVisitor;
use Infection\Visitor\ReflectionVisitor;
use PhpParser\Lexer;
Expand Down Expand Up @@ -152,6 +153,7 @@ private function getMutationsFromCode(string $code, Parser $parser, array $setti

$mutationsCollectorVisitor = new SimpleMutationsCollectorVisitor($this->getMutator($settings), $initialStatements);

$traverser->addVisitor(new NotMutableIgnoreVisitor());
$traverser->addVisitor($mutationsCollectorVisitor);
$traverser->addVisitor(new ParentConnectorVisitor());
$traverser->addVisitor(new FullyQualifiedClassNameVisitor());
Expand Down

0 comments on commit 6593925

Please sign in to comment.