Add Codebird service
This commit is contained in:
parent
c18fcd0e2e
commit
e1e4c2e9d6
35
src/Service/Codebird.php
Normal file
35
src/Service/Codebird.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
class Codebird
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \Codebird\Codebird
|
||||
*/
|
||||
private $codebird;
|
||||
|
||||
public function __construct(\Codebird\Codebird $codebird)
|
||||
{
|
||||
$codebird::setConsumerKey(
|
||||
getenv('TWITTER_CONSUMER_KEY'),
|
||||
getenv('TWITTER_CONSUMER_SECRET')
|
||||
);
|
||||
|
||||
$codebird = $codebird::getInstance();
|
||||
|
||||
$codebird->setToken(
|
||||
getenv('TWITTER_ACCESS_TOKEN'),
|
||||
getenv('TWITTER_ACCESS_SECRET')
|
||||
);
|
||||
|
||||
$this->codebird = $codebird;
|
||||
}
|
||||
|
||||
public function get(): \Codebird\Codebird
|
||||
{
|
||||
return $this->codebird;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue