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

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture;

final class PartialApplication
{
private $data;

public function __construct()
{
$this->data = array_map(trim(?), [' x ']);
}
}

?>
-----
<?php

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture;

final class PartialApplication
{
private array $data;

public function __construct()
{
$this->data = array_map(trim(?), [' x ']);
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ private function processCallLike(CallLike $callLike, MutatingScope $mutatingScop
$callLike->class->setAttribute(AttributeKey::SCOPE, $mutatingScope);
}

if ($callLike->isFirstClassCallable()) {
if ($callLike->isPartialFunctionApplication()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function enterNode(Node $node): ?Node
return null;
}

if ($node->isFirstClassCallable()) {
if ($node->isPartialFunctionApplication()) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/PhpParser/NodeVisitor/NameAndArgNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function enterNode(Node $node): ?Node
if ($node instanceof FuncCall && $node->name instanceof Name) {
$node->name->setAttribute(AttributeKey::IS_FUNCCALL_NAME, true);

if (! $node->isFirstClassCallable()) {
if (! $node->isPartialFunctionApplication()) {
$funcCallName = $node->name->toString();
foreach ($node->getArgs() as $arg) {
$arg->value->setAttribute(AttributeKey::FROM_FUNC_CALL_NAME, $funcCallName);
Expand Down
Loading