1: <?php declare(strict_types=1);
2:
3: namespace Salient\Sync\Support;
4:
5: use Salient\Contract\Sync\SyncEntityInterface;
6: use Salient\Contract\Sync\SyncProviderInterface;
7: use Salient\Core\IntrospectionClass;
8: use Closure;
9:
10: /**
11: * Cacheable class data shared between SyncIntrospectors
12: *
13: * @template TClass of object
14: *
15: * @extends IntrospectionClass<TClass>
16: */
17: final class SyncIntrospectionClass extends IntrospectionClass
18: {
19: /** @var bool|null */
20: public $IsSyncEntity;
21: /** @var bool|null */
22: public $IsSyncProvider;
23:
24: /**
25: * Signature => closure
26: *
27: * @var array<string,Closure>
28: */
29: public $CreateFromSignatureSyncClosures = [];
30:
31: /**
32: * Signature => (int) $strict => closure
33: *
34: * @var array<string,array<int,Closure>>
35: */
36: public $CreateSyncEntityFromSignatureClosures = [];
37:
38: /**
39: * (int) $strict => closure
40: *
41: * @var array<int,Closure>
42: */
43: public $CreateSyncEntityFromClosures = [];
44:
45: /**
46: * Lowercase "magic" sync operation method => closure
47: *
48: * @var array<string,Closure|null>
49: */
50: public $MagicSyncOperationClosures = [];
51:
52: /**
53: * @param class-string<TClass> $class
54: */
55: public function __construct(string $class)
56: {
57: parent::__construct($class);
58:
59: $class = $this->Reflector;
60: $this->IsSyncEntity = $class->implementsInterface(SyncEntityInterface::class);
61: $this->IsSyncProvider = $class->implementsInterface(SyncProviderInterface::class);
62: }
63: }
64: