| Total Complexity | 4 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class Post extends AbstractPost { |
||
| 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 | $post = $this->get_post( $id ); |
|
| 28 | |||
| 29 | 2 | if ( ! $post ) { |
|
|
|
|||
| 30 | 1 | return null; |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | return ( new Entity() )->set_post( $post ); |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Find by author id. |
||
| 38 | * |
||
| 39 | * @param integer $author_id Author id. |
||
| 40 | * @param integer $quantity Quantity. |
||
| 41 | * @return Collection |
||
| 42 | */ |
||
| 43 | 1 | public function find_by_author_id( int $author_id, int $quantity ) : Collection { |
|
| 58 | } |
||
| 59 | } |
||
| 60 |