39 lines
737 B
PHP
39 lines
737 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace KTXF\Resource\Identifier;
|
|
|
|
/**
|
|
* Service-level resource identifier (depth 2)
|
|
*
|
|
* Format: {provider}:{service}
|
|
*/
|
|
class ServiceIdentifier extends ResourceIdentifier implements ServiceIdentifierInterface {
|
|
|
|
public function __construct(
|
|
string $provider,
|
|
private readonly string $_service,
|
|
) {
|
|
parent::__construct($provider);
|
|
}
|
|
|
|
public function service(): string {
|
|
return $this->_service;
|
|
}
|
|
|
|
public function depth(): int {
|
|
return 2;
|
|
}
|
|
|
|
public function __toString(): string {
|
|
return parent::__toString() . self::SEPARATOR . $this->_service;
|
|
}
|
|
|
|
}
|