From 1f6c7a6a20563e0b808da14688098c4c0ed592fb Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 7 May 2022 15:41:36 +0700 Subject: [PATCH] [Scoper] Clean up bootstrap.php: move enum definitions to dedicated file and require in BootstrapFilesIncluder (#2248) * [Scoper] Clean up bootstrap.php: move enum definitions to dedicated file and require in BootstrapFilesIncluder * eol * [ci-review] Rector Rectify Co-authored-by: GitHub Action --- build/target-repository/bootstrap.php | 32 ------------------ .../stubs-rector/Internal/EnumInterfaces.php | 33 +++++++++++++++++++ src/Autoloading/BootstrapFilesIncluder.php | 14 ++++++-- 3 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 build/target-repository/stubs-rector/Internal/EnumInterfaces.php diff --git a/build/target-repository/bootstrap.php b/build/target-repository/bootstrap.php index 3da92efab97..1d4dbaab0c3 100644 --- a/build/target-repository/bootstrap.php +++ b/build/target-repository/bootstrap.php @@ -39,35 +39,3 @@ spl_autoload_register(function (string $class): void { } } }); - -if (! interface_exists('UnitEnum')) { - /** - * @since 8.1 - */ - interface UnitEnum - { - /** - * @return static[] - */ - public static function cases(): array; - } -} - -if (! interface_exists('BackedEnum')) { - /** - * @since 8.1 - */ - interface BackedEnum extends UnitEnum { - /** - * @param int|string $value - * @return $this - */ - public static function from($value); - - /** - * @param int|string $value - * @return $this|null - */ - public static function tryFrom($value); - } -} diff --git a/build/target-repository/stubs-rector/Internal/EnumInterfaces.php b/build/target-repository/stubs-rector/Internal/EnumInterfaces.php new file mode 100644 index 00000000000..6f613db3ae0 --- /dev/null +++ b/build/target-repository/stubs-rector/Internal/EnumInterfaces.php @@ -0,0 +1,33 @@ +