forked from Roave/BetterReflection
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ReflectionAttribute adapter
newInstance
- Loading branch information
1 parent
77bfc36
commit c17736c
Showing
2 changed files
with
61 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Roave\BetterReflectionTest\Fixture; | ||
|
||
enum Foo: int { | ||
case ONE = 1; | ||
const MAPPING = [ | ||
self::ONE->value => 'one', | ||
]; | ||
} | ||
|
||
#[\Attribute] | ||
class MyAttr | ||
{ | ||
public function __construct(private array $mapping) | ||
{ | ||
} | ||
} | ||
|
||
#[MyAttr(Foo::MAPPING)] | ||
class Bar { | ||
|
||
} | ||
|
||
#[MyAttr([Foo::ONE])] | ||
class Baz { | ||
|
||
} |
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