| Total Complexity | 6 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class GetRelatedSigner |
||
| 13 | { |
||
| 14 | public const DEFAULT_PACRFC = 'CVD110412TF6'; |
||
| 15 | |||
| 16 | /** @var string */ |
||
| 17 | private $uuid; |
||
| 18 | |||
| 19 | /** @var RfcRole */ |
||
| 20 | private $role; |
||
| 21 | |||
| 22 | /** @var string */ |
||
| 23 | private $pacRfc; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * GetRelatedSigner constructor. |
||
| 27 | * |
||
| 28 | * @param string $uuid |
||
| 29 | * @param RfcRole|null $role If null or ommited then uses issuer role |
||
| 30 | * @param string $pacRfc If empty or ommited then uses DEFAULT_PACRFC |
||
| 31 | */ |
||
| 32 | 1 | public function __construct(string $uuid, RfcRole $role = null, string $pacRfc = self::DEFAULT_PACRFC) |
|
| 33 | { |
||
| 34 | 1 | $this->uuid = $uuid; |
|
| 35 | 1 | $this->role = $role ?? RfcRole::issuer(); |
|
| 36 | 1 | $this->pacRfc = $pacRfc ?: static::DEFAULT_PACRFC; |
|
| 37 | 1 | } |
|
| 38 | |||
| 39 | 1 | public function uuid(): string |
|
| 40 | { |
||
| 41 | 1 | return $this->uuid; |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | public function role(): RfcRole |
|
| 45 | { |
||
| 46 | 1 | return $this->role; |
|
| 47 | } |
||
| 48 | |||
| 49 | 1 | public function pacRfc(): string |
|
| 50 | { |
||
| 51 | 1 | return $this->pacRfc; |
|
| 52 | } |
||
| 53 | |||
| 54 | 1 | public function sign(Credential $credential): string |
|
| 58 | } |
||
| 59 | } |
||
| 60 |