golden hour
/opt/cpanel/ea-wappspector/vendor/rector/rector/rules/TypeDeclaration/AlreadyAssignDetector
⬆️ Go Up
Upload
File/Folder
Size
Actions
ConstructorAssignDetector.php
8.05 KB
Del
OK
NullTypeAssignDetector.php
2.61 KB
Del
OK
PropertyDefaultAssignDetector.php
524 B
Del
OK
Edit: PropertyDefaultAssignDetector.php
<?php declare (strict_types=1); namespace Rector\TypeDeclaration\AlreadyAssignDetector; use PhpParser\Node\Expr; use PhpParser\Node\Stmt\ClassLike; use PhpParser\Node\Stmt\Property; final class PropertyDefaultAssignDetector { public function detect(ClassLike $classLike, string $propertyName) : bool { $property = $classLike->getProperty($propertyName); if (!$property instanceof Property) { return \false; } return $property->props[0]->default instanceof Expr; } }
Save