Skip to content

2.15.2

Compare
Choose a tag to compare
@koriym koriym released this 20 May 07:51
· 207 commits to 2.x since this release
41e5af6

What's Changed

Enumerations can now be used for attribute arguments as shown below!

enum FruitEnum
{
    case Apple;
    case Orange;
    case Grape;
}

#[Attribute(Attribute::TARGET_METHOD)]
final class FruitEnum
{
    public function __construct(
        public readonly FruitEnum $fruit1,
        public readonly FruitEnum $fruit2,
    ) {
    }
}

#[AttrFoo(fruit1: FruitEnum::Apple, fruit2: FruitEnum::Orange)]
public function methodFoo() {}

Full Changelog: 2.15.1...2.15.2