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,27 @@
<?php

final class NoNamespaceWithOperationPlusOperation
{
private array $prop2;

public function resolve2(array $second)
{
return $this->prop2 + $second;
}
}

?>
-----
<?php

declare(strict_types=1);

final class NoNamespaceWithOperationPlusOperation
{
private array $prop2;

public function resolve2(array $second)
{
return $this->prop2 + $second;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ public function beforeTraverse(array $nodes): ?array
$stmt = current($newStmts);

if ($stmt instanceof FileWithoutNamespace) {
$stmt = current($stmt->stmts);
$currentStmt = current($stmt->stmts);

if (! $stmt instanceof Stmt) {
if (! $currentStmt instanceof Stmt) {
return null;
}

$nodes = $stmt->stmts;
$stmt = $currentStmt;
}

// when first stmt is Declare_, verify if there is strict_types definition already,
Expand Down