| Total Complexity | 9 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 76.47% |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | abstract class AbstractAclPart { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * |
||
| 17 | * @id |
||
| 18 | * @column("name"=>"name","nullable"=>false,"dbType"=>"varchar(100)") |
||
| 19 | */ |
||
| 20 | #[\Ubiquity\attributes\items\Id()] |
||
| 21 | #[\Ubiquity\attributes\items\Column(name:'name',nullable:false,dbType:'varchar(100)')] |
||
| 22 | protected $name; |
||
| 23 | |||
| 24 | 22 | public function __construct(?string $name = null) { |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * |
||
| 30 | * @return mixed |
||
| 31 | */ |
||
| 32 | 22 | public function getName() { |
|
| 33 | 22 | return $this->name; |
|
| 34 | } |
||
| 35 | |||
| 36 | public function getId_() { |
||
| 37 | return $this->name; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * |
||
| 42 | * @param string $name |
||
| 43 | */ |
||
| 44 | 4 | public function setName($name) { |
|
| 45 | 4 | $this->name = $name; |
|
| 46 | } |
||
| 47 | |||
| 48 | 5 | public function toArray(): array { |
|
| 49 | 5 | return \get_object_vars($this); |
|
| 50 | } |
||
| 51 | |||
| 52 | 6 | public function fromArray(array $values) { |
|
| 53 | 6 | foreach ($values as $k => $v) { |
|
| 54 | 6 | $this->$k = $v; |
|
| 55 | } |
||
| 56 | } |
||
| 57 | |||
| 58 | public function __toString() { |
||
| 60 | } |
||
| 61 | |||
| 62 | 3 | public function castAs(string $class) { |
|
| 63 | 3 | return unserialize(sprintf('O:%d:"%s"%s', \strlen($class), $class, \strstr(\strstr(\serialize($this), '"'), ':'))); |
|
| 64 | } |
||
| 65 | } |
||
| 66 | |||
| 67 |