| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class Category extends AbstractTerm { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Find by id. |
||
| 22 | * |
||
| 23 | * @param integer $id Id. |
||
| 24 | * @return Entity|null |
||
| 25 | */ |
||
| 26 | 2 | public function find_by_id( int $id ) : ?Entity { |
|
| 27 | 2 | $term = $this->get_term( $id ); |
|
| 28 | |||
| 29 | 2 | if ( ! $term ) { |
|
|
|
|||
| 30 | 1 | return null; |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | return ( new Entity() )->set_term( $term ); |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Find all. |
||
| 38 | * |
||
| 39 | * @return Collection |
||
| 40 | */ |
||
| 41 | 1 | public function find_all() : Collection { |
|
| 56 | } |
||
| 57 | } |
||
| 58 |