From f11c57890db78be5e137ee53d045e14d95531444 Mon Sep 17 00:00:00 2001 From: Farhad Safarov Date: Sun, 10 Apr 2022 23:35:50 +0300 Subject: [PATCH] add UnitEnum stub (PHP 8.1) (#249) --- src/Plugin.php | 1 + src/Stubs/php/UnitEnum.stubphp | 7 +++++++ tests/acceptance/acceptance/NamingConventions.feature | 2 +- tests/acceptance/acceptance/ParameterBag.feature | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/Stubs/php/UnitEnum.stubphp diff --git a/src/Plugin.php b/src/Plugin.php index f11eb2f..b82be3a 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -90,6 +90,7 @@ class Plugin implements PluginEntryPointInterface $this->addStubs($api, __DIR__.'/Stubs/common'); $this->addStubs($api, __DIR__.'/Stubs/'.Kernel::MAJOR_VERSION); + $this->addStubs($api, __DIR__.'/Stubs/php'); if (isset($config->twigCachePath)) { $twig_cache_path = getcwd().DIRECTORY_SEPARATOR.ltrim((string) $config->twigCachePath, DIRECTORY_SEPARATOR); diff --git a/src/Stubs/php/UnitEnum.stubphp b/src/Stubs/php/UnitEnum.stubphp new file mode 100644 index 0000000..7548730 --- /dev/null +++ b/src/Stubs/php/UnitEnum.stubphp @@ -0,0 +1,7 @@ +\|null\|scalar | + | Type | Message | + | Trace | $nonExistentParameter: UnitEnum\|array\|null\|scalar | And I see no other errors