2016-11-27 00:43:42 +03:00
|
|
|
<?php
|
2019-08-23 11:28:04 +03:00
|
|
|
declare(strict_types=1);
|
2016-11-27 00:43:42 +03:00
|
|
|
|
2019-08-23 11:28:04 +03:00
|
|
|
namespace api\components\OAuth2\Entities;
|
2016-11-27 00:43:42 +03:00
|
|
|
|
2019-08-23 11:28:04 +03:00
|
|
|
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
|
|
|
use League\OAuth2\Server\Entities\Traits\ClientTrait;
|
|
|
|
use League\OAuth2\Server\Entities\Traits\EntityTrait;
|
2016-12-18 02:20:53 +03:00
|
|
|
|
2019-08-23 11:28:04 +03:00
|
|
|
class ClientEntity implements ClientEntityInterface {
|
|
|
|
use EntityTrait;
|
|
|
|
use ClientTrait;
|
2016-11-27 00:43:42 +03:00
|
|
|
|
2019-09-22 00:17:21 +03:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
private $isTrusted;
|
|
|
|
|
|
|
|
public function __construct(string $id, string $name, $redirectUri, bool $isTrusted) {
|
2019-08-23 11:28:04 +03:00
|
|
|
$this->identifier = $id;
|
2016-11-27 00:43:42 +03:00
|
|
|
$this->name = $name;
|
|
|
|
$this->redirectUri = $redirectUri;
|
2019-09-22 00:17:21 +03:00
|
|
|
$this->isTrusted = $isTrusted;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isConfidential(): bool {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isTrusted(): bool {
|
|
|
|
return $this->isTrusted;
|
2016-12-18 02:20:53 +03:00
|
|
|
}
|
|
|
|
|
2016-11-27 00:43:42 +03:00
|
|
|
}
|