Файловый менеджер - Редактировать - /opt/cpanel/ea-wappspector/vendor/rector/rector/rules/TypeDeclaration/TypeAnalyzer/PropertyTypeDefaultValueAnalyzer.php
Ðазад
<?php declare (strict_types=1); namespace Rector\TypeDeclaration\TypeAnalyzer; use PhpParser\Node\Expr; use PhpParser\Node\Stmt\PropertyProperty; use PHPStan\Type\ArrayType; use PHPStan\Type\Type; use Rector\StaticTypeMapper\StaticTypeMapper; final class PropertyTypeDefaultValueAnalyzer { /** * @readonly * @var \Rector\StaticTypeMapper\StaticTypeMapper */ private $staticTypeMapper; public function __construct(StaticTypeMapper $staticTypeMapper) { $this->staticTypeMapper = $staticTypeMapper; } public function doesConflictWithDefaultValue(PropertyProperty $propertyProperty, Type $propertyType) : bool { if (!$propertyProperty->default instanceof Expr) { return \false; } // the defaults can be in conflict $defaultType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($propertyProperty->default); if ($defaultType instanceof ArrayType && $propertyType instanceof ArrayType) { return \false; } // type is not matching, skip it return !$defaultType->isSuperTypeOf($propertyType)->yes(); } }
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка