REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.88 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/rules/DeadCode/NodeAnalyzer/PropertyWriteonlyAnalyzer.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\DeadCode\NodeAnalyzer; use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Expr\NullsafePropertyFetch; use PhpParser\Node\Expr\PropertyFetch; use PhpParser\Node\Expr\StaticPropertyFetch; use PhpParser\Node\Stmt\Class_; use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\PhpParser\Node\BetterNodeFinder; final class PropertyWriteonlyAnalyzer { /** * @readonly * @var \Rector\PhpParser\Node\BetterNodeFinder */ private $betterNodeFinder; public function __construct(BetterNodeFinder $betterNodeFinder) { $this->betterNodeFinder = $betterNodeFinder; } public function hasClassDynamicPropertyNames(Class_ $class) : bool { return (bool) $this->betterNodeFinder->findFirst($class, static function (Node $node) : bool { if (!$node instanceof PropertyFetch && !$node instanceof NullsafePropertyFetch) { return \false; } // has dynamic name - could be anything return $node->name instanceof Expr; }); } /** * The property fetches are always only assigned to, nothing else * * @param array<PropertyFetch|StaticPropertyFetch|NullsafePropertyFetch> $propertyFetches */ public function arePropertyFetchesExclusivelyBeingAssignedTo(array $propertyFetches) : bool { foreach ($propertyFetches as $propertyFetch) { if ((bool) $propertyFetch->getAttribute(AttributeKey::IS_MULTI_ASSIGN, \false)) { return \false; } if ((bool) $propertyFetch->getAttribute(AttributeKey::IS_ASSIGNED_TO, \false)) { return \false; } if ((bool) $propertyFetch->getAttribute(AttributeKey::IS_BEING_ASSIGNED, \false)) { continue; } return \false; } return \true; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
CallCollectionAnalyzer.php
3.70 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
ExprUsedInNodeAnalyzer.php
1.39 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
IsClassMethodUsedAnalyzer.php
9.67 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
PropertyWriteonlyAnalyzer.php
1.88 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
SafeLeftTypeBooleanAndOrAnalyzer.php
3.04 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
UsedVariableNameAnalyzer.php
1021 B
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).