| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class PostsToIdsDataFormatter implements DataFormatterInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @param WP_Post[] $posts |
||
| 13 | * |
||
| 14 | * @return array |
||
| 15 | */ |
||
| 16 | public function formatData($posts) |
||
| 17 | { |
||
| 18 | $posts = new PostCollection(...$posts); |
||
| 19 | |||
| 20 | return array_map('strval', $posts->getIds()); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param array $terms |
||
| 25 | * |
||
| 26 | * @return array |
||
| 27 | */ |
||
| 28 | public function formatInput($posts) |
||
| 35 | } |
||
| 36 | } |
||
| 37 |