for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the DigitalOceanV2 library.
*
* (c) Antoine Corcy <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace DigitalOceanV2\Api;
use DigitalOceanV2\Adapter\AdapterInterface;
use DigitalOceanV2\Entity\Meta;
/**
* @author Antoine Corcy <[email protected]>
* @author Graham Campbell <[email protected]>
abstract class AbstractApi
{
* @var string
const ENDPOINT = 'https://api.digitalocean.com/v2';
* @var AdapterInterface
protected $adapter;
protected $endpoint;
* @var Meta
protected $meta;
* @param AdapterInterface $adapter
* @param string|null $endpoint
public function __construct(AdapterInterface $adapter, $endpoint = null)
$this->adapter = $adapter;
$this->endpoint = $endpoint ?: static::ENDPOINT;
}
* @param \stdClass $data
* @return Meta|null
protected function extractMeta(\StdClass $data)
if (isset($data->meta)) {
$this->meta = new Meta($data->meta);
return $this->meta;
public function getMeta()