Add Codebird service

This commit is contained in:
Oliver Davies 2019-01-11 00:15:37 +00:00
parent c18fcd0e2e
commit e1e4c2e9d6

35
src/Service/Codebird.php Normal file
View 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;
}
}