| 1 |
<?php |
| 2 |
|
| 3 |
declare (strict_types=1); |
| 4 |
namespace WCPOS\Vendor\Sentry\State; |
| 5 |
|
| 6 |
use WCPOS\Vendor\Sentry\ClientInterface; |
| 7 |
/** |
| 8 |
* This class holds a pair of client and scope instances for each element in the |
| 9 |
* stack of a {@see Hub}. |
| 10 |
* |
| 11 |
* @internal |
| 12 |
*/ |
| 13 |
final class Layer |
| 14 |
{ |
| 15 |
/** |
| 16 |
* @var ClientInterface|null The client held by this layer |
| 17 |
*/ |
| 18 |
private $client; |
| 19 |
/** |
| 20 |
* @var Scope The scope held by this layer |
| 21 |
*/ |
| 22 |
private $scope; |
| 23 |
/** |
| 24 |
* Constructor. |
| 25 |
* |
| 26 |
* @param ClientInterface|null $client The client held by this layer |
| 27 |
* @param Scope $scope The scope held by this layer |
| 28 |
*/ |
| 29 |
public function __construct(?ClientInterface $client, Scope $scope) |
| 30 |
{ |
| 31 |
$this->client = $client; |
| 32 |
$this->scope = $scope; |
| 33 |
} |
| 34 |
/** |
| 35 |
* Gets the client held by this layer. |
| 36 |
*/ |
| 37 |
public function getClient() : ?ClientInterface |
| 38 |
{ |
| 39 |
return $this->client; |
| 40 |
} |
| 41 |
/** |
| 42 |
* Sets the client held by this layer. |
| 43 |
* |
| 44 |
* @param ClientInterface|null $client The client instance |
| 45 |
* |
| 46 |
* @return $this |
| 47 |
*/ |
| 48 |
public function setClient(?ClientInterface $client) : self |
| 49 |
{ |
| 50 |
$this->client = $client; |
| 51 |
return $this; |
| 52 |
} |
| 53 |
/** |
| 54 |
* Gets the scope held by this layer. |
| 55 |
*/ |
| 56 |
public function getScope() : Scope |
| 57 |
{ |
| 58 |
return $this->scope; |
| 59 |
} |
| 60 |
/** |
| 61 |
* Sets the scope held by this layer. |
| 62 |
* |
| 63 |
* @param Scope $scope The scope instance |
| 64 |
* |
| 65 |
* @return $this |
| 66 |
*/ |
| 67 |
public function setScope(Scope $scope) : self |
| 68 |
{ |
| 69 |
$this->scope = $scope; |
| 70 |
return $this; |
| 71 |
} |
| 72 |
} |
| 73 |
|