[TypeDeclaration] Handle UnitEnum not exists check on ParamTypeByParentCallTypeRector (#841)

This commit is contained in:
Abdul Malik Ikhsan 2021-09-07 12:48:24 +07:00 committed by GitHub
parent ee95517c5d
commit b8a6c976b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View File

@ -36,3 +36,16 @@ spl_autoload_register(function (string $class): void {
}
}
});
if (! interface_exists('UnitEnum')) {
/**
* @since 8.1
*/
interface UnitEnum
{
/**
* @return static[]
*/
public static function cases(): array;
}
}

View File

@ -0,0 +1,13 @@
<?php
class SomeException extends \Exception
{
protected $message = '';
public function __construct($message = '', $code = 0, $previous = null)
{
parent::__construct($message, $code, $previous);
$this->message = $message;
$this->code = $code;
}
}

View File

@ -11,8 +11,6 @@ if (interface_exists('UnitEnum')) {
*/
interface UnitEnum
{
public string $name;
/**
* @return static[]
*/