@@ 152-154 (lines=3) @@ | ||
149 | $classMetadata = array_values($fileMetadata->getClasses())[0]; |
|
150 | } |
|
151 | ||
152 | if (null === $classMetadata) { |
|
153 | throw new RuntimeException(sprintf('It is not possible to extract single class metadata from "%s", found %s definition(s).', $class, count($fileMetadata->getClasses()))); |
|
154 | } |
|
155 | ||
156 | if (!ClassUtils::isBuildable($classMetadata)) { |
|
157 | throw new InvalidArgumentException(sprintf('Builder class can not be generated for "%s", class has to have constructor with some parameters.', $classMetadata->getName())); |
|
@@ 200-202 (lines=3) @@ | ||
197 | if (file_exists($class)) { |
|
198 | $fileMetadata = $this->loader->load($class); |
|
199 | ||
200 | if (1 !== count($fileMetadata->getClasses())) { |
|
201 | throw new RuntimeException(sprintf('It is not possible to extract single class metadata from "%s", found %s definition(s).', $class, count($fileMetadata->getClasses()))); |
|
202 | } |
|
203 | ||
204 | $classMetadata = array_values($fileMetadata->getClasses())[0]; |
|
205 | $classChoice = new ClassChoice($fileMetadata, $classMetadata); |