abdb91dc7e53f5d84eb5712eacf3d096299c6af5
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 declare(strict_types=1);
4
5 namespace CuyZ\Valinor\Mapper\Object\Factory;
6
7 use CuyZ\Valinor\Definition\ClassDefinition;
8 use CuyZ\Valinor\Mapper\Object\ReflectionObjectBuilder;
9
10 use function enum_exists;
11
12 /** @internal */
13 final class ReflectionObjectBuilderFactory implements ObjectBuilderFactory
14 {
15 public function for(ClassDefinition $class): array
16 {
17 if (enum_exists($class->name())) {
18 return [];
19 }
20
21 return [new ReflectionObjectBuilder($class)];
22 }
23 }