| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php namespace Tuiter; |
||
| 20 | public static function factory( |
||
| 21 | $consumerKey, |
||
| 22 | $consumerSecret, |
||
| 23 | $token, |
||
| 24 | $tokenSecret |
||
| 25 | ) { |
||
| 26 | $client = new self([ |
||
| 27 | 'base_url' => [ |
||
| 28 | 'https://api.twitter.com/{version}/', |
||
| 29 | ['version' => 'v1.1'] |
||
| 30 | ], |
||
| 31 | 'defaults' => ['auth' => 'oauth'] |
||
| 32 | ]); |
||
| 33 | |||
| 34 | $oauth = new Oauth1([ |
||
| 35 | 'consumer_key' => $consumerKey, |
||
| 36 | 'consumer_secret' => $consumerSecret, |
||
| 37 | 'token' => $token, |
||
| 38 | 'token_secret' => $tokenSecret |
||
| 39 | ]); |
||
| 40 | |||
| 41 | $client->getEmitter()->attach($oauth); |
||
| 42 | |||
| 43 | return $client; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |