diff --git a/build/target-repository/.github/workflows/along_other_packages.yaml b/build/target-repository/.github/workflows/along_other_packages.yaml index 01956f6ada0..0faa72d5204 100644 --- a/build/target-repository/.github/workflows/along_other_packages.yaml +++ b/build/target-repository/.github/workflows/along_other_packages.yaml @@ -26,7 +26,7 @@ jobs: - name: 'Along PHPStan' - install: composer require phpstan/phpstan:^0.12.98 --dev --ansi + install: composer require phpstan/phpstan:^0.12.99 --dev --ansi name: "PHP ${{ matrix.php_version }}" diff --git a/build/target-repository/bootstrap.php b/build/target-repository/bootstrap.php index dfc4f15a887..d1d8830a3cb 100644 --- a/build/target-repository/bootstrap.php +++ b/build/target-repository/bootstrap.php @@ -49,3 +49,13 @@ if (! interface_exists('UnitEnum')) { public static function cases(): array; } } + +if (! interface_exists('BackedEnum')) { + /** + * @since 8.1 + */ + interface BackedEnum extends UnitEnum { + public static function from(int|string $value): static; + public static function tryFrom(int|string $value): ?static; + } +} diff --git a/build/target-repository/composer.json b/build/target-repository/composer.json index 6a36511531b..4ab91629257 100644 --- a/build/target-repository/composer.json +++ b/build/target-repository/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.1|^8.0", - "phpstan/phpstan": "0.12.98" + "phpstan/phpstan": "0.12.99" }, "autoload": { "files": [ diff --git a/composer.json b/composer.json index c4922240377..472bffb1dbc 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "nette/utils": "^3.2", "nikic/php-parser": "4.12.0", "phpstan/phpdoc-parser": "^0.5.5", - "phpstan/phpstan": "0.12.98", + "phpstan/phpstan": "0.12.99", "phpstan/phpstan-phpunit": "^0.12.22", "rector/extension-installer": "^0.11.0", "rector/rector-cakephp": "^0.11.3", diff --git a/stubs/Php/BackedEnum.php b/stubs/Php/BackedEnum.php new file mode 100644 index 00000000000..920ec5bc343 --- /dev/null +++ b/stubs/Php/BackedEnum.php @@ -0,0 +1,15 @@ +