Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<img src="asdf">

<?php

use PHPUnit\Framework\TestCase;

final class SkipHtmlPHPMix extends TestCase
{
public function test()
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public function beforeTraverse(array $nodes): ?array
{
parent::beforeTraverse($nodes);

if ($this->file->containsHTML()) {
return null;
}

if ($this->shouldSkipNodes($nodes, $this->file)) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ public function refactor(Node $node): Node|null
return null;
}

$constructClassMethod = $node->getMethod(MethodName::CONSTRUCT);

if ($constructClassMethod instanceof ClassMethod) {
foreach ($node->stmts as $key => $stmt) {
if ($stmt instanceof ClassMethod && $this->isName($stmt, MethodName::CONSTRUCT)) {
unset($node->stmts[$key]);
foreach ($node->stmts as $key => $stmt) {
if (! $stmt instanceof ClassMethod) {
continue;
}

$node->setAttribute('hasRemovedFinalConstruct', true);
return $node;
}
if (! $this->isName($stmt, MethodName::CONSTRUCT)) {
continue;
}

unset($node->stmts[$key]);
return $node;
}

return null;
Expand Down