mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 11:50:51 +00:00
727b9f46f0
bfa1891c50
[cleanup] Remove 73 unused public methods (#3245)
27 lines
739 B
PHP
27 lines
739 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Core\NodeAnalyzer;
|
|
|
|
use PhpParser\Node\Expr;
|
|
use PhpParser\Node\Expr\ArrayDimFetch;
|
|
use PhpParser\Node\Expr\BinaryOp\Coalesce;
|
|
use PhpParser\Node\Expr\PropertyFetch;
|
|
use PhpParser\Node\Expr\StaticPropertyFetch;
|
|
use PhpParser\Node\Expr\Variable;
|
|
final class CoalesceAnalyzer
|
|
{
|
|
/**
|
|
* @var array<class-string<Expr>>
|
|
*/
|
|
private const ISSETABLE_EXPR = [Variable::class, ArrayDimFetch::class, PropertyFetch::class, StaticPropertyFetch::class];
|
|
/**
|
|
* @api downgrade
|
|
*/
|
|
public function hasIssetableLeft(Coalesce $coalesce) : bool
|
|
{
|
|
$leftClass = \get_class($coalesce->left);
|
|
return \in_array($leftClass, self::ISSETABLE_EXPR, \true);
|
|
}
|
|
}
|