Completed
Push — master ( b8acd8...13d185 )
by Maciej
14:05
created

Post   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 4
Bugs 0 Features 3
Metric Value
wmc 2
c 4
b 0
f 3
lcom 0
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findByIds() 0 5 1
A findOneById() 0 6 1
1
<?php
2
/**
3
 * Created by Maciej Paprocki for Bureau-VA.
4
 * Date: 17/02/2016
5
 * Project Name: MaciekPaprocki\WordpressGuzzle
6
 * Time: 12:17
7
 */
8
9
namespace BureauVa\WordpressGuzzle\Repository;
10
11
12
/**
13
 * Class Post
14
 * @package MaciekPaprocki\WordpressGuzzle
15
 */
16
17
class Post extends RepositoryAbstract
18
{
19
    const PATH = 'posts';
20
21
    /**
22
     * finds Multiple posts by array of ids
23
     * @param $id
24
     * @return null
25
     */
26
    public function findByIds($ids)
27
    {
28
29
        return $this->createPromise(self::PATH, ['post__in' => $ids]);
30
    }
31
32
    /**
33
     * finds post by id
34
     * @param $id
35
     * @return null
36
     */
37
    public function findOneById($id)
38
    {
39
40
41
        return $this->createPromise(self::PATH . '/' . $id);
42
    }
43
}