Completed
Push — master ( e9184f...773d4d )
by Sergey
08:29 queued 05:20
created

HasFeed   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFeed() 0 9 1
getPaginatedResponse() 0 1 ?
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
}