| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 1 | public function count(): int |
|
| 24 | { |
||
| 25 | 1 | $this->CoreTrait_fireEvents($this, __CLASS__, __METHOD__, __TRAIT__); |
|
|
|
|||
| 26 | |||
| 27 | $object = $this |
||
| 28 | 1 | ->CoreTrait_getCoreObject() |
|
| 29 | 1 | ->unWrap() |
|
| 30 | ; |
||
| 31 | |||
| 32 | 1 | if ($object instanceof Countable || method_exists($object, 'count')) { |
|
| 33 | 1 | return $object->count(); |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | return is_null($object) ? 0 : 1; |
|
| 37 | } |
||
| 39 |