| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 85 | public function setVisibility($visibility, $value = null) |
||
| 86 | { |
||
| 87 | if(is_string($visibility) && is_string($value)) { |
||
| 88 | $visibility = ['type' => $visibility, 'value' => $value]; |
||
| 89 | } |
||
| 90 | |||
| 91 | if (is_null($this->visibility)) { |
||
| 92 | $this->visibility = new Visibility(); |
||
| 93 | } |
||
| 94 | |||
| 95 | $visibility = (array) $visibility; |
||
| 96 | |||
| 97 | $this->visibility->setType($visibility['type']); |
||
| 98 | $this->visibility->setValue($visibility['value']); |
||
| 99 | |||
| 100 | return $this; |
||
| 101 | } |
||
| 102 | |||
| 108 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.