mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 07:41:43 +03:00
commit
8d699084aa
@ -1,3 +1,5 @@
|
||||
dist: trusty
|
||||
|
||||
language: php
|
||||
|
||||
sudo: false
|
||||
|
@ -18,9 +18,16 @@ class Configuration implements ConfigurationInterface
|
||||
{
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$treeBuilder
|
||||
->root('nelmio_api_doc')
|
||||
$treeBuilder = new TreeBuilder('nelmio_api_doc');
|
||||
|
||||
if (method_exists($treeBuilder, 'getRootNode')) {
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
} else {
|
||||
// symfony < 4.2 support
|
||||
$rootNode = $treeBuilder->root('nelmio_api_doc');
|
||||
}
|
||||
|
||||
$rootNode
|
||||
->children()
|
||||
->scalarNode('name')->defaultValue('API documentation')->end()
|
||||
->arrayNode('exclude_sections')
|
||||
@ -31,7 +38,7 @@ class Configuration implements ConfigurationInterface
|
||||
->arrayNode('motd')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->scalarNode('template')->defaultValue('NelmioApiDocBundle::Components/motd.html.twig')->end()
|
||||
->scalarNode('template')->defaultValue('@NelmioApiDoc/Components/motd.html.twig')->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('request_listener')
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Nelmio\ApiDocBundle\Formatter;
|
||||
|
||||
use Symfony\Component\Templating\EngineInterface;
|
||||
use Twig\Environment as TwigEnvironment;
|
||||
|
||||
class HtmlFormatter extends AbstractFormatter
|
||||
{
|
||||
@ -31,7 +32,7 @@ class HtmlFormatter extends AbstractFormatter
|
||||
protected $defaultRequestFormat;
|
||||
|
||||
/**
|
||||
* @var EngineInterface
|
||||
* @var EngineInterface|TwigEnvironment
|
||||
*/
|
||||
protected $engine;
|
||||
|
||||
@ -113,9 +114,9 @@ class HtmlFormatter extends AbstractFormatter
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EngineInterface $engine
|
||||
* @param EngineInterface|TwigEnvironment $engine
|
||||
*/
|
||||
public function setTemplatingEngine(EngineInterface $engine)
|
||||
public function setTemplatingEngine($engine)
|
||||
{
|
||||
$this->engine = $engine;
|
||||
}
|
||||
@ -197,7 +198,7 @@ class HtmlFormatter extends AbstractFormatter
|
||||
*/
|
||||
protected function renderOne(array $data)
|
||||
{
|
||||
return $this->engine->render('NelmioApiDocBundle::resource.html.twig', array_merge(
|
||||
return $this->engine->render('@NelmioApiDoc/resource.html.twig', array_merge(
|
||||
array(
|
||||
'data' => $data,
|
||||
'displayContent' => true,
|
||||
@ -211,7 +212,7 @@ class HtmlFormatter extends AbstractFormatter
|
||||
*/
|
||||
protected function render(array $collection)
|
||||
{
|
||||
return $this->engine->render('NelmioApiDocBundle::resources.html.twig', array_merge(
|
||||
return $this->engine->render('@NelmioApiDoc/resources.html.twig', array_merge(
|
||||
array(
|
||||
'resources' => $collection,
|
||||
),
|
||||
|
@ -21,7 +21,7 @@
|
||||
<service id="nelmio_api_doc.formatter.html_formatter" class="%nelmio_api_doc.formatter.html_formatter.class%"
|
||||
parent="nelmio_api_doc.formatter.abstract_formatter" public="true">
|
||||
<call method="setTemplatingEngine">
|
||||
<argument type="service" id="templating" />
|
||||
<argument type="service" id="twig" />
|
||||
</call>
|
||||
<call method="setMotdTemplate">
|
||||
<argument>%nelmio_api_doc.motd.template%</argument>
|
||||
|
@ -8,7 +8,7 @@ Configuration Reference
|
||||
exclude_sections: []
|
||||
default_sections_opened: true
|
||||
motd:
|
||||
template: 'NelmioApiDocBundle::Components/motd.html.twig'
|
||||
template: '@NelmioApiDoc/Components/motd.html.twig'
|
||||
request_listener:
|
||||
enabled: true
|
||||
parameter: _doc
|
||||
|
@ -189,7 +189,7 @@
|
||||
<tr>
|
||||
<td>{{ name }}</td>
|
||||
<td>{{ infos.dataType }}</td>
|
||||
<td>{% include 'NelmioApiDocBundle:Components:version.html.twig' with {'sinceVersion': infos.sinceVersion, 'untilVersion': infos.untilVersion} only %}</td>
|
||||
<td>{% include '@NelmioApiDoc/Components/version.html.twig' with {'sinceVersion': infos.sinceVersion, 'untilVersion': infos.untilVersion} only %}</td>
|
||||
<td>{{ infos.description }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -1,11 +1,11 @@
|
||||
{% extends "NelmioApiDocBundle::layout.html.twig" %}
|
||||
{% extends "@NelmioApiDoc/layout.html.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<li class="resource">
|
||||
<ul class="endpoints">
|
||||
<li class="endpoint">
|
||||
<ul class="operations">
|
||||
{% include 'NelmioApiDocBundle::method.html.twig' %}
|
||||
{% include '@NelmioApiDoc/method.html.twig' %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "NelmioApiDocBundle::layout.html.twig" %}
|
||||
{% extends "@NelmioApiDoc/layout.html.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div id="summary">
|
||||
@ -33,7 +33,7 @@
|
||||
<li class="endpoint">
|
||||
<ul class="operations">
|
||||
{% for data in methods %}
|
||||
{% include 'NelmioApiDocBundle::method.html.twig' %}
|
||||
{% include '@NelmioApiDoc/method.html.twig' %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -622,6 +622,9 @@ dependency_type[a]:
|
||||
|
||||
_This method is useful to test if the getDocComment works._
|
||||
|
||||
This method is useful to test if the getDocComment works.
|
||||
And, it supports multilines until the first '@' char.
|
||||
|
||||
#### Requirements ####
|
||||
|
||||
**id**
|
||||
|
@ -706,6 +706,9 @@ dependency_type[a]:
|
||||
|
||||
_This method is useful to test if the getDocComment works._
|
||||
|
||||
This method is useful to test if the getDocComment works.
|
||||
And, it supports multilines until the first '@' char.
|
||||
|
||||
#### Requirements ####
|
||||
|
||||
**id**
|
||||
|
Loading…
x
Reference in New Issue
Block a user