REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.56 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/rules/CodingStyle/NodeFactory/ArrayCallableToMethodCallFactory.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\CodingStyle\NodeFactory; use PhpParser\Node\Expr\Array_; use PhpParser\Node\Expr\ArrayItem; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Expr\PropertyFetch; use PhpParser\Node\Expr\Variable; use PhpParser\Node\Scalar\String_; use PHPStan\Type\TypeWithClassName; use Rector\NodeTypeResolver\NodeTypeResolver; final class ArrayCallableToMethodCallFactory { /** * @readonly * @var \Rector\NodeTypeResolver\NodeTypeResolver */ private $nodeTypeResolver; public function __construct(NodeTypeResolver $nodeTypeResolver) { $this->nodeTypeResolver = $nodeTypeResolver; } public function create(Array_ $array) : ?MethodCall { if (\count($array->items) !== 2) { return null; } $firstItem = $array->items[0]; $secondItem = $array->items[1]; if (!$firstItem instanceof ArrayItem) { return null; } if (!$secondItem instanceof ArrayItem) { return null; } if (!$secondItem->value instanceof String_) { return null; } if (!$firstItem->value instanceof PropertyFetch && !$firstItem->value instanceof Variable) { return null; } $firstItemType = $this->nodeTypeResolver->getType($firstItem->value); if (!$firstItemType instanceof TypeWithClassName) { return null; } $string = $secondItem->value; $methodName = $string->value; return new MethodCall($firstItem->value, $methodName); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 1
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ArrayCallableToMethodCallFactory.php
1.56 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).