add PHP8 Attribute compatibility (build 439, 2.7.0-beta4)

This commit is contained in:
crazywhalecc
2022-03-20 01:53:36 +08:00
parent 12363aebf0
commit c897da29c6
42 changed files with 355 additions and 40 deletions

View File

@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace ZM\Annotation\Http;
use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Common\Annotations\Annotation\Required;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
@@ -11,8 +13,10 @@ use ZM\Annotation\AnnotationBase;
/**
* Class MiddlewareClass
* @Annotation
* @NamedArgumentConstructor()
* @Target("CLASS")
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
class MiddlewareClass extends AnnotationBase
{
/**
@@ -20,4 +24,9 @@ class MiddlewareClass extends AnnotationBase
* @Required()
*/
public $name = '';
public function __construct($name)
{
$this->name = $name;
}
}