-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Scoper] Remove PHPStanStubLoader: move to dedicated file to define n…
…ative classes (#2249) * [Scoper] Remove PHPStanStubLoader: move to dedicated file to define native classes * clean up * load internal early, just in case * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
c2ade05
commit 81ba0c9
Showing
5 changed files
with
87 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
build/target-repository/stubs-rector/Internal/NativeClasses.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
|
||
if (PHP_VERSION_ID < 80000 && ! class_exists('ReflectionUnionType', false)) { | ||
class ReflectionUnionType extends ReflectionType | ||
{ | ||
/** @return ReflectionType[] */ | ||
public function getTypes() | ||
{ | ||
return []; | ||
} | ||
} | ||
} | ||
|
||
if (\PHP_VERSION_ID < 80000 && ! class_exists('Attribute', false)) { | ||
#[Attribute(Attribute::TARGET_CLASS)] | ||
class Attribute | ||
{ | ||
|
||
/** @var int */ | ||
public $flags; | ||
|
||
/** | ||
* Marks that attribute declaration is allowed only in classes. | ||
*/ | ||
const TARGET_CLASS = 1; | ||
|
||
/** | ||
* Marks that attribute declaration is allowed only in functions. | ||
*/ | ||
const TARGET_FUNCTION = 1 << 1; | ||
|
||
/** | ||
* Marks that attribute declaration is allowed only in class methods. | ||
*/ | ||
const TARGET_METHOD = 1 << 2; | ||
|
||
/** | ||
* Marks that attribute declaration is allowed only in class properties. | ||
*/ | ||
const TARGET_PROPERTY = 1 << 3; | ||
|
||
/** | ||
* Marks that attribute declaration is allowed only in class constants. | ||
*/ | ||
const TARGET_CLASS_CONSTANT = 1 << 4; | ||
|
||
/** | ||
* Marks that attribute declaration is allowed only in function or method parameters. | ||
*/ | ||
const TARGET_PARAMETER = 1 << 5; | ||
|
||
/** | ||
* Marks that attribute declaration is allowed anywhere. | ||
*/ | ||
const TARGET_ALL = (1 << 6) - 1; | ||
|
||
/** | ||
* Notes that an attribute declaration in the same place is | ||
* allowed multiple times. | ||
*/ | ||
const IS_REPEATABLE = 1 << 6; | ||
|
||
/** | ||
* @param int $flags A value in the form of a bitmask indicating the places | ||
* where attributes can be defined. | ||
*/ | ||
public function __construct($flags = self::TARGET_ALL) | ||
{ | ||
$this->flags = $flags; | ||
} | ||
|
||
} | ||
} | ||
|
||
if (\PHP_VERSION_ID < 80100 && ! class_exists('ReturnTypeWillChange', false)) { | ||
#[Attribute(Attribute::TARGET_METHOD)] | ||
final class ReturnTypeWillChange | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.