[Bin] Using file_exists() for check PHPStan stub ReflectionUnionType and Attribute exists (#5581)

This commit is contained in:
Abdul Malik Ikhsan 2021-02-17 01:23:12 +07:00 committed by GitHub
parent 3cbc3ef94b
commit 648bea9305
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,13 @@
<?php
// @see https://github.com/phpstan/phpstan/issues/4541#issuecomment-779434916
if (
file_exists('phar://vendor/phpstan/phpstan/phpstan.phar/stubs/runtime/ReflectionUnionType.php')
&&
file_exists('phar://vendor/phpstan/phpstan/phpstan.phar/stubs/runtime/Attribute.php')
) {
require_once 'phar://vendor/phpstan/phpstan/phpstan.phar/stubs/runtime/ReflectionUnionType.php';
require_once 'phar://vendor/phpstan/phpstan/phpstan.phar/stubs/runtime/Attribute.php';
}
require_once __DIR__ . '/rector.php';