Generates $dependencies, $classes and normalizes class names.
public prepareClassList ( ) : array | ||
Résultat | array |
/** @internal */ public function generateCode(string $className, string $parentName = NULL) : array { $this->builder->prepareClassList(); foreach ($this->extensions as $extension) { $extension->beforeCompile(); $this->dependencies[] = (new \ReflectionClass($extension))->getFileName(); } $classes = $this->builder->generateClasses($className, $parentName); $classes[0]->addMethod('initialize'); $this->addDependencies($this->builder->getDependencies()); foreach ($this->extensions as $extension) { $extension->afterCompile($classes[0]); } return $classes; }
/** @internal */ public function generateCode() { if (func_num_args()) { trigger_error(__METHOD__ . ' arguments are deprecated, use Compiler::setClassName().', E_USER_DEPRECATED); $this->className = func_get_arg(0) ?: $this->className; } $this->builder->prepareClassList(); foreach ($this->extensions as $extension) { $extension->beforeCompile(); $this->dependencies->add([(new \ReflectionClass($extension))->getFileName()]); } $generator = new PhpGenerator($this->builder); $classes = $generator->generate($this->className); $classes[0]->addMethod('initialize'); $this->dependencies->add($this->builder->getDependencies()); foreach ($this->extensions as $extension) { $extension->afterCompile($classes[0]); } return $classes; }
/** @internal */ public function generateCode($className, $parentName = NULL) { $this->builder->prepareClassList(); $state = serialize($this->builder->getDefinitions()); foreach ($this->extensions as $extension) { $extension->beforeCompile(); $rc = new \ReflectionClass($extension); $this->dependencies[] = $rc->getFileName(); if ($state !== serialize($this->builder->getDefinitions())) { $this->builder->prepareClassList(); $state = serialize($this->builder->getDefinitions()); } } $classes = $this->builder->generateClasses($className, $parentName); $classes[0]->addMethod('initialize'); $this->addDependencies($this->builder->getDependencies()); foreach ($this->extensions as $extension) { $extension->afterCompile($classes[0]); } return $classes; }