| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | trait TweetsService |
||
| 10 | { |
||
| 11 | /** @var Tweets */ |
||
| 12 | private $tweets; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Get the resource API Provider instance. |
||
| 16 | * |
||
| 17 | * @return ApiProvider |
||
| 18 | */ |
||
| 19 | abstract public function getApiProvider(); |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Get the tweets service instance. |
||
| 23 | * |
||
| 24 | * @return Tweets |
||
| 25 | */ |
||
| 26 | public function getTweetsService() |
||
| 27 | { |
||
| 28 | if (is_null($this->tweets)) { |
||
| 29 | return $this->tweets = new Tweets($this->getApiProvider()); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $this->tweets; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Get tweets list. |
||
| 37 | * |
||
| 38 | * @param TweetsRequest $request |
||
| 39 | * |
||
| 40 | * @see Tweets::getTweets() |
||
| 41 | * |
||
| 42 | * @return array|\Osnova\Services\Tweets\Tweet[] |
||
| 43 | */ |
||
| 44 | public function getTweets(TweetsRequest $request) |
||
| 47 | } |
||
| 48 | } |
||
| 49 |