| Total Complexity | 5 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait HasAttributes |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Undocumented variable |
||
| 11 | * |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | public $attributes; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Undocumented function |
||
| 18 | * |
||
| 19 | * @param array $attributes |
||
| 20 | * |
||
| 21 | * @return static |
||
| 22 | */ |
||
| 23 | 9 | public function setAttributes(array $attributes) |
|
| 24 | { |
||
| 25 | 9 | $this->attributes = $attributes; |
|
| 26 | |||
| 27 | 9 | return $this; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Undocumented function |
||
| 32 | * |
||
| 33 | * @param array $attributes |
||
| 34 | * |
||
| 35 | * @return static |
||
| 36 | */ |
||
| 37 | 1 | public function addAttributes(array $attributes) |
|
| 38 | { |
||
| 39 | 1 | foreach ($attributes as $name => $value) { |
|
| 40 | 1 | $this->addAttribute($name, $value); |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | return $this; |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Undocumented function |
||
| 48 | * |
||
| 49 | * @param string $name |
||
| 50 | * @param mixed $value |
||
| 51 | * |
||
| 52 | * @return static |
||
| 53 | */ |
||
| 54 | 2 | public function addAttribute(string $name, $value) |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Undocumented function |
||
| 63 | * |
||
| 64 | * @param integer $count |
||
| 65 | * |
||
| 66 | * @return static |
||
| 67 | */ |
||
| 68 | 5 | public function fakeAttributes(int $count = 5) |
|
| 75 | } |
||
| 76 | } |
||
| 77 |