2020-09-01 14:31:23 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Phabel\Target\Php80;
|
|
|
|
|
|
|
|
use Phabel\Plugin;
|
|
|
|
use Phabel\Plugin\IssetExpressionFixer as fixer;
|
|
|
|
|
2020-09-05 22:35:30 +02:00
|
|
|
/**
|
|
|
|
* @author Daniil Gentili <daniil@daniil.it>
|
|
|
|
* @license MIT
|
|
|
|
*/
|
2020-09-01 14:31:23 +02:00
|
|
|
class IssetExpressionFixer extends Plugin
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Expression fixer for PHP 80.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public static function runAfter(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
fixer::class => [
|
|
|
|
'PhpParser\\Node\\Expr\\ClassConstFetch' =>
|
|
|
|
[
|
|
|
|
'class' =>
|
|
|
|
[
|
|
|
|
'PhpParser\\Node\\Scalar\\Encapsed' => true,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'PhpParser\\Node\\Expr\\PropertyFetch' =>
|
|
|
|
[
|
|
|
|
'var' =>
|
|
|
|
[
|
|
|
|
'PhpParser\\Node\\Expr\\ConstFetch' => true,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|