Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
[CodingStandard] Add fix for ForbiddenParentClassSniff in case of mis…
Browse files Browse the repository at this point in the history
…sing parent
  • Loading branch information
TomasVotruba committed Jul 24, 2018
1 parent 367782c commit 5ff1e61
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public function process(File $file, $position): void
}

$parentClassName = $classWrapper->getParentClassName();
// no parent class
if ($parentClassName === null) {
return;
}

if ($this->shouldSkip($parentClassName)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function testCorrect(string $file): void
public function provideCorrectCases(): Iterator
{
yield [__DIR__ . '/correct/correct.php.inc'];
yield [__DIR__ . '/correct/correct2.php.inc'];
}

protected function provideConfig(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

namespace SomeOtherNamespace;

<<<<<<< HEAD
class SomeClass extends SomeUnForbiddenParentClass
=======
class SomeClass extends SomeForbiddenParentClass
>>>>>>> ad916c1c... [CodingStandard] Add ForbiddenParentClassSniff [closes #993]
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace SomeOtherNamespace;

class SomeClass
{
}

0 comments on commit 5ff1e61

Please sign in to comment.