File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Pdsinterop \Solid \Auth \Entity ;
4+
5+ use League \OAuth2 \Server \Entities \ClientEntityInterface ;
6+
7+ trait ClientEntityTrait
8+ {
9+ /** @var ClientEntityInterface */
10+ private $ clientEntity ;
11+
12+ public function __construct (ClientEntityInterface $ clientEntity )
13+ {
14+ $ this ->setClientEntity ($ clientEntity );
15+ }
16+
17+ public function getClientEntity () : ClientEntityInterface
18+ {
19+ if (method_exists ($ this , 'getClient ' )) {
20+ $ clientEntity = $ this ->getClient ();
21+ } else {
22+ $ clientEntity = $ this ->clientEntity ;
23+ }
24+
25+ return $ clientEntity ;
26+ }
27+
28+ public function setClientEntity (ClientEntityInterface $ client ) : void
29+ {
30+ if (method_exists ($ this , 'setClient ' )) {
31+ $ this ->setClient ($ client );
32+ } else {
33+ $ this ->clientEntity = $ client ;
34+ }
35+
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments