Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
nullx27 authored and StyleCIBot committed Jan 7, 2018
1 parent f1e8ef1 commit 2b4f998
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function setUseragent(string $useragent)
*
* @return Configuration
*/
public static function getInstance(): Configuration
public static function getInstance(): self
{
if (is_null(static::$instance)) {
static::$instance = new self();
Expand Down
11 changes: 7 additions & 4 deletions src/Easi.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ public function setToken(string $token): void
*
* @return Easi
*/
public function __get(string $name): Easi
public function __get(string $name): self
{
$endpoint = __NAMESPACE__.'\\Api\\Endpoints\\'.ucfirst($name);

if (!class_exists($endpoint)) {
$this->getConfig()->getLogger()->error('Endpoint {endpoint] not found!', ['endpoint' => $endpoint]);

throw new EndpointNotFoundException();
}

Expand All @@ -99,13 +100,14 @@ public function getConfig(): Configuration
/**
* Call endpoint method.
*
* @param string $name Method name
* @param array $arguments
* @param string $name Method name
* @param array $arguments
*
* @return Response
* @throws EndpointNotFoundException
* @throws Exceptions\ApiException
* @throws MethodNotFoundException
*
* @return Response
*/
public function __call(string $name, array $arguments): Response
{
Expand All @@ -126,6 +128,7 @@ public function __call(string $name, array $arguments): Response

if (!method_exists($instance, $name)) {
$this->getConfig()->getLogger()->error('{endpoint}::{method} not found!', ['endpoint' => $endpoint, 'method' => $name]);

throw new MethodNotFoundException();
}

Expand Down

0 comments on commit 2b4f998

Please sign in to comment.