-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathProxy.php
More file actions
38 lines (30 loc) · 846 Bytes
/
Proxy.php
File metadata and controls
38 lines (30 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* This file is part of Temporal package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Temporal\Internal\Workflow;
use Temporal\Internal\Declaration\Prototype\Prototype;
abstract class Proxy
{
abstract public function __call(string $method, array $args);
/**
* @template T of Prototype
*
* @param array<T> $prototypes
* @return T|null
*/
protected function findPrototypeByHandlerName(array $prototypes, string $name): ?Prototype
{
foreach ($prototypes as $prototype) {
$handler = $prototype->getHandler();
if ($handler->getName() === $name) {
return $prototype;
}
}
return null;
}
}