Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
RemoteObjectFactory.php
01 <?php
02
03 declare(strict_types=1);
04
05 namespace ProxyManager\Factory;
06
07 use ProxyManager\Configuration;
08 use ProxyManager\Factory\RemoteObject\AdapterInterface;
09 use ProxyManager\Proxy\RemoteObjectInterface;
10 use ProxyManager\ProxyGenerator\ProxyGeneratorInterface;
11 use ProxyManager\ProxyGenerator\RemoteObjectGenerator;
12 use ProxyManager\Signature\Exception\InvalidSignatureException;
13 use ProxyManager\Signature\Exception\MissingSignatureException;
14
15 /**
16 * Factory responsible of producing remote proxy objects
17 *
18 * @author Vincent Blanchon <blanchon.vincent@gmail.com>
19 * @license MIT
20 */
21 class RemoteObjectFactory extends AbstractBaseFactory
22 {
23 /**
24 * @var AdapterInterface
25 */
26 protected $adapter;
27
28 /**
29 * @var \ProxyManager\ProxyGenerator\RemoteObjectGenerator|null
30 */
31 private $generator;
32
33 /**
34 * {@inheritDoc}
35 *
36 * @param AdapterInterface $adapter
37 * @param Configuration $configuration
38 */
39 public function __construct(AdapterInterface $adapter, Configuration $configuration = null)
40 {
41 parent::__construct($configuration);
42
43 $this->adapter = $adapter;
44 }
45
46 /**
47 * @param string|object $instanceOrClassName
48 *
49 * @throws InvalidSignatureException
50 * @throws MissingSignatureException
51 * @throws \OutOfBoundsException
52 */
53 public function createProxy($instanceOrClassName) : RemoteObjectInterface
54 {
55 $proxyClassName = $this->generateProxy(
56 is_object($instanceOrClassName) ? get_class($instanceOrClassName) : $instanceOrClassName
57 );
58
59 return $proxyClassName::staticProxyConstructor($this->adapter);
60 }
61
62 /**
63 * {@inheritDoc}
64 */
65 protected function getGenerator() : ProxyGeneratorInterface
66 {
67 return $this->generator ?: $this->generator = new RemoteObjectGenerator();
68 }
69 }
70