add isActive in UptimeRobotApiService
This commit is contained in:
parent
b981b3cfdb
commit
918584c35b
@ -9,6 +9,8 @@ use Vdhicts\UptimeRobot\Client\Configuration;
|
|||||||
|
|
||||||
class UptimeRobotApiService
|
class UptimeRobotApiService
|
||||||
{
|
{
|
||||||
|
private $apiKey;
|
||||||
|
|
||||||
/** @var $client */
|
/** @var $client */
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
||||||
@ -28,12 +30,22 @@ class UptimeRobotApiService
|
|||||||
|
|
||||||
public function __construct(string $apiKey, SerializerInterface $serializer)
|
public function __construct(string $apiKey, SerializerInterface $serializer)
|
||||||
{
|
{
|
||||||
$configuration = new Configuration($apiKey);
|
$this->apiKey = $apiKey;
|
||||||
|
$configuration = new Configuration($this->apiKey);
|
||||||
|
|
||||||
$this->client = new Client($configuration);
|
$this->client = new Client($configuration);
|
||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if apikey is setted and suppose that api is valid
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isActive(){
|
||||||
|
return !empty($this->apiKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getIo(): SymfonyStyle
|
public function getIo(): SymfonyStyle
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user