| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 4 | public function CompareToDaftSortableObject(DaftSortableObject $otherObject) : int |
|
| 20 | { |
||
| 21 | 4 | if ( ! is_a(static::class, DaftSortableObject::class, true)) { |
|
| 22 | 2 | throw new ClassDoesNotImplementClassException( |
|
| 23 | 2 | static::class, |
|
| 24 | 2 | DaftSortableObject::class |
|
| 25 | ); |
||
| 26 | } |
||
| 27 | |||
| 28 | 2 | foreach (static::DaftSortableObjectProperties() as $property) { |
|
| 29 | 2 | $sort = $this->__get($property) <=> $otherObject->__get($property); |
|
|
|
|||
| 30 | |||
| 31 | 2 | if (0 !== $sort) { |
|
| 32 | 2 | return $sort; |
|
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 2 | return 0; |
|
| 37 | } |
||
| 59 |