REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.36 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/rules/Naming/Guard/DateTimeAtNamingConventionGuard.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\Naming\Guard; use DateTimeInterface; use PHPStan\Type\TypeWithClassName; use Rector\Naming\ValueObject\PropertyRename; use Rector\NodeTypeResolver\NodeTypeResolver; use Rector\PHPStanStaticTypeMapper\Utils\TypeUnwrapper; use Rector\Util\StringUtils; final class DateTimeAtNamingConventionGuard { /** * @readonly * @var \Rector\NodeTypeResolver\NodeTypeResolver */ private $nodeTypeResolver; /** * @readonly * @var \Rector\PHPStanStaticTypeMapper\Utils\TypeUnwrapper */ private $typeUnwrapper; public function __construct(NodeTypeResolver $nodeTypeResolver, TypeUnwrapper $typeUnwrapper) { $this->nodeTypeResolver = $nodeTypeResolver; $this->typeUnwrapper = $typeUnwrapper; } public function isConflicting(PropertyRename $propertyRename) : bool { $type = $this->nodeTypeResolver->getType($propertyRename->getProperty()); $type = $this->typeUnwrapper->unwrapFirstObjectTypeFromUnionType($type); if (!$type instanceof TypeWithClassName) { return \false; } if (!\is_a($type->getClassName(), DateTimeInterface::class, \true)) { return \false; } return StringUtils::isMatch($propertyRename->getCurrentName(), \Rector\Naming\Guard\BreakingVariableRenameGuard::AT_NAMING_REGEX); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
PropertyConflictingNameGuard
DIR
-
drwxr-xr-x
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BreakingVariableRenameGuard.php
8.22 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
DateTimeAtNamingConventionGuard.php
1.36 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
HasMagicGetSetGuard.php
901 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).