Refactor, add traits

This commit is contained in:
Oliver Davies 2020-05-31 00:39:48 +01:00
parent 506b5689fe
commit 0426632a08
4 changed files with 41 additions and 17 deletions

View file

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Opdavies\Glassboxx\Traits;
trait UsesAuthTokenTrait
{
public function withAuthToken(string $authToken): self
{
$this->authToken = $authToken;
return $this;
}
}

View file

@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Opdavies\Glassboxx\Traits;
use Opdavies\Glassboxx\Config;
trait UsesConfigTrait
{
/** @var Config */
protected $config;
public function withConfig(Config $config): self
{
$this->config = $config;
return $this;
}
}