Completed
Pull Request — master (#182)
by Sergey
05:28 queued 02:24
created

HasFeed::getFeed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Traits;
4
5
use Generator;
6
7
trait HasFeed
8
{
9
    /**
10
     * @param array $data
11
     * @param string $feedUrl
12
     * @param int $limit
13
     * @return Generator
14
     */
15
    protected function getFeed($data, $feedUrl, $limit)
16
    {
17
        $params = [
18
            'data' => $data,
19
            'url'  => $feedUrl
20
        ];
21
22
        return $this->getPaginatedResponse($params, $limit);
23
    }
24
25
    /**
26
     * @param array $params
27
     * @param int $limit
28
     * @param string $method
29
     * @return Generator
30
     */
31
    abstract protected function getPaginatedResponse(array $params, $limit, $method = 'getPaginatedData');
32
}