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