getDefinitionsFromArguments example

EOF;
        }

        if ($definition->hasErrors() && $e = $definition->getErrors()) {
            $this->addThrow = true;

            $code .= sprintf(" \$this->throw(%s);\n", $this->export(reset($e)));
        } else {
            $this->serviceCalls = [];
            $this->inlinedDefinitions = $this->getDefinitionsFromArguments([$definition], null, $this->serviceCalls);

            if ($definition->isDeprecated()) {
                $code .= sprintf(" @trigger_error(%s, E_USER_DEPRECATED);\n\n", $this->export($definition->getDeprecationMessage($id)));
            } else {
                foreach ($this->inlinedDefinitions as $def) {
                    foreach ($this->getClasses($def) as $class) {
                        $this->preload[$class] = $class;
                    }
                }
            }

            
if ($asFile) {
            $file = $methodName.'.php';
            $code = str_replace("protected static function {$methodName}(", 'public static function do(', $code);
        } else {
            $file = null;
        }

        if ($definition->hasErrors() && $e = $definition->getErrors()) {
            $code .= sprintf(" throw new RuntimeException(%s);\n", $this->export(reset($e)));
        } else {
            $this->serviceCalls = [];
            $this->inlinedDefinitions = $this->getDefinitionsFromArguments([$definition], null, $this->serviceCalls);

            if ($definition->isDeprecated()) {
                $deprecation = $definition->getDeprecation($id);
                $code .= sprintf(" trigger_deprecation(%s, %s, %s);\n\n", $this->export($deprecation['package'])$this->export($deprecation['version'])$this->export($deprecation['message']));
            } elseif ($definition->hasTag($this->hotPathTag) || !$definition->hasTag($this->preloadTags[1])) {
                foreach ($this->inlinedDefinitions as $def) {
                    foreach ($this->getClasses($def$id) as $class) {
                        $this->preload[$class] = $class;
                    }
                }
            }

            
if ($asFile) {
            $file = $methodName.'.php';
            $code = str_replace("protected static function {$methodName}(", 'public static function do(', $code);
        } else {
            $file = null;
        }

        if ($definition->hasErrors() && $e = $definition->getErrors()) {
            $code .= sprintf(" throw new RuntimeException(%s);\n", $this->export(reset($e)));
        } else {
            $this->serviceCalls = [];
            $this->inlinedDefinitions = $this->getDefinitionsFromArguments([$definition], null, $this->serviceCalls);

            if ($definition->isDeprecated()) {
                $deprecation = $definition->getDeprecation($id);
                $code .= sprintf(" trigger_deprecation(%s, %s, %s);\n\n", $this->export($deprecation['package'])$this->export($deprecation['version'])$this->export($deprecation['message']));
            } elseif ($definition->hasTag($this->hotPathTag) || !$definition->hasTag($this->preloadTags[1])) {
                foreach ($this->inlinedDefinitions as $def) {
                    foreach ($this->getClasses($def$id) as $class) {
                        $this->preload[$class] = $class;
                    }
                }
            }

            
Home | Imprint | This part of the site doesn't use cookies.