-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAttributeTrait.php
More file actions
41 lines (32 loc) · 924 Bytes
/
AttributeTrait.php
File metadata and controls
41 lines (32 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
*/
declare(strict_types=1);
namespace OpenCodeModeling\CodeAst\Builder;
trait AttributeTrait
{
/**
* @var AttributeBuilder[]
*/
protected array $attributes = [];
public function setAttributes(AttributeBuilder ...$attributes): self
{
$this->attributes = $attributes;
return $this;
}
public function addAttribute(AttributeBuilder $attribute): self
{
$this->attributes[] = $attribute;
return $this;
}
/**
* @return AttributeBuilder[]
*/
public function getAttributes(): array
{
return $this->attributes;
}
}