Renders the library method.

@param MethodInterface $method

@return string
160015
public function renderMethod(MethodInterface $method)
    {
        if (!$method->supports(MethodInterface::BROWSER_PLATFORM)) {
            throw new \InvalidArgumentException('Renderer only accepts browser methods.');
        }

        return 'window.analytics.' . $method->getName() . '(' . $this->renderArguments($method) . ');';
    }
979862
public function render(PageInterface $page)
    {
        foreach ($this->renderers as $renderer) {
            if (!$renderer->supports($page)) {
                continue;
            }

            return $renderer->render($page);
        }

        return $page->getContent();
    }
1259002
public function render($template, PageInterface $page = null)
    {
        if (!$template) {
            return null;
        }

        $twigTemplate = $this->twig->createTemplate($template);

        return $twigTemplate->render([
            'node' => $page,
        ]);
    }
25745
public function renderPropertiesAction(ProductInterface $product)
    {
        $provider = $this->get('sonata.product.pool')->getProvider($product);

        return $this->render(sprintf('%s:properties.html.twig', $provider->getBaseControllerName()), [
            'product' => $product,
        ]);
    }
1032512
public function formatMethod($method)
    {
        $method = strtoupper((string) $method);
        return isset(self::$methodsTable[$method]) ? self::$methodsTable[$method] : '0';
    }
19700
protected function render(ImageInterface $image)
    {
        $this->response->make($image);
        $image->close();

        return $this->response->getResponse();
    }
904451
private function getMethodData(MethodInterface $method, $userId)
    {
        $data = $method->getArguments();
        $data['action'] = $method->getName();
        $data['secret'] = $this->getWriteKey();

        // Don't overwrite the userId if it it is present.
        if (!isset($data['userId']) && !isset($data['from'])) {
            $data['userId'] = $userId;
        }

        return $data;
    }
970977
public static function renderRequestHeaders(RequestInterface $request): string
    {
        $renderedHeaders = '';
        $headers = $request->getHeaders();
        if ($headers instanceof Headers) {
            $renderedHeaders .= $headers->__toString();
        } else {
            foreach (array_keys($headers) as $name) {
                $renderedHeaders .= $request->getHeaderLine($name);
            }
        }

        return $renderedHeaders;
    }
1090769
public function methodDescription( $method )
    {
        return array_key_exists( $method, $this->FunctionList ) ? ( array_key_exists( $method, $this->FunctionDescription ) ? $this->FunctionDescription[$method] : '' ) : false;
    }
57113
protected static function getReturnType(\ReflectionMethod $method) : string
    {
        if ($method->getReturnType()->isBuiltin()) {
            return (string)$method->getReturnType();
        } else {
            $type = (string)$method->getReturnType();
            return '\\' . ($type === 'self' ? $method->getDeclaringClass()->getName() : $type);
        }
    }
175211
public function render(ElementInterface $element): string
    {
        if (! $element instanceof Element\CollectionElement) {
            throw new InvalidClassException(
                sprintf(
                    'The given element "%s" has to implement "%s"',
                    $element->name(),
                    Element\CollectionElement::class
                )
            );
        }

        $row = $this->factory->create(FormRow::class);

        $html = array_reduce(
            $element->elements(),
            function ($html, ElementInterface $next) use ($element, $row) {
                // adding the CollectionElement name to the Element name and ID as prefix.
                $next->withAttribute('id', $element->name().'_'.$next->id());
                $next->withAttribute('name', $element->name().'['.$next->name().']');

                $html .= $row->render($next);

                return $html;
            },
            ''
        );

        $errors = $this->factory->create(Errors::class)
            ->render($element);
        $class = $errors !== ''
            ? 'form-table--has-errors'
            : '';

        return sprintf('%1$s<table class="form-table %2$s">%3$s</table>', $errors, $class, $html);
    }
288119
protected function getMethodName($method, $docBlock = null): string
    {
        if ($docBlock !== null && $docBlock->hasTag(self::API_METHOD_NAME)) {
            $tags = $docBlock->getTagsByName(self::API_METHOD_NAME);

            return (string)$tags[0];
        }

        $controllerName = $method->getDeclaringClass();

        if (!empty($this->server->endpoint)) {
            return $method->getName();
        }

        return $this->getShortNameForController($controllerName->getName()) . '_' . $method->getName();
    }
603823
public function process(IOInterface $io, array $libraries, $methodKey = null)
    {
        // No-op
        if (empty($libraries)) {
            return;
        }

        // Setup root folder
        $this->setupResources($io);

        // Get or choose method
        if (!$methodKey) {
            $methodKey = $this->getMethodKey();
        }
        $method = $this->getMethod($methodKey);

        // Update all modules
        foreach ($libraries as $module) {
            // Skip this module if no exposure required
            if (!$module->requiresExpose()) {
                continue;
            }
            $name = $module->getName();
            $type = $module->getType();
            $io->write(
                "Exposing web directories for {$type} <info>{$name}</info> with method <info>{$methodKey}</info>:"
            );
            foreach ($module->getExposedFolders() as $folder) {
                $io->write("  - <info>$folder</info>");
            }

            // Expose web dirs with given method
            $module->exposePaths($method);
        }

        // On success, write `.method` token to persist for subsequent updates
        $this->saveMethodKey($methodKey);
    }
621927
public function renderButtonsForCollection(CollectionInterface $collection)
    {
        // Generate buttons.
        foreach ($collection as $i => $model) {
            $previous = $collection->get($i - 1);
            $next     = $collection->get($i + 1);
            /** @var ModelInterface $model */
            $this->renderButtonsFor($model, $previous, $next);
        }
    }
103573
public function renderIntoCookieHeader(RequestInterface $request) : RequestInterface
    {
        $cookieString = implode('; ', $this->cookies);

        $request = $request->withHeader(static::COOKIE_HEADER, $cookieString);

        return $request;
    }
1142722
public function render(DocumentInterface $document, $parameters = [])
    {
        $this->html = $this->htmlReport->render($document, $parameters);

        return $this->buildPdf($this->html);
    }
879558
public function toDocTypeString(Method $method) {
        $longestType = 0;
        $longestName = 0;
        foreach($method->getParameters() as $parameter) {
            if(strlen($parameter->getType()) > $longestType) {
                $longestType = strlen($parameter->getType());
            }
            if(strlen($parameter->getName()) > $longestName) {
                $longestName = strlen($parameter->getName());
            }
        }
        $returnVar = '	 * @param';
        $returnVar .= ' ' . $this->getType() . (str_repeat(' ', $longestType - strlen($this->getType())));
        $returnVar .= ' $' . $this->getName();
        if(strlen($this->getDescription()) > 0) {
            $returnVar .= str_repeat(' ', $longestName - strlen($this->getName())) . ' ' . $this->getDescription();
        }
        $returnVar .= "\n";
        return $returnVar;
    }