mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Enable PHPDoc @link feature
This commit is contained in:
parent
4fb050175a
commit
a1517543e8
@ -49,6 +49,11 @@ class ApiDoc
|
|||||||
*/
|
*/
|
||||||
private $output = null;
|
private $output = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $link = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Most of the time, a single line of text describing the action.
|
* Most of the time, a single line of text describing the action.
|
||||||
*
|
*
|
||||||
@ -242,6 +247,14 @@ class ApiDoc
|
|||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $link
|
||||||
|
*/
|
||||||
|
public function setLink($link)
|
||||||
|
{
|
||||||
|
$this->link = $link;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $section
|
* @param string $section
|
||||||
*/
|
*/
|
||||||
@ -441,6 +454,10 @@ class ApiDoc
|
|||||||
$data['description'] = $description;
|
$data['description'] = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($link = $this->link) {
|
||||||
|
$data['link'] = $link;
|
||||||
|
}
|
||||||
|
|
||||||
if ($documentation = $this->documentation) {
|
if ($documentation = $this->documentation) {
|
||||||
$data['documentation'] = $documentation;
|
$data['documentation'] = $documentation;
|
||||||
}
|
}
|
||||||
|
@ -337,6 +337,9 @@ class ApiDocExtractor
|
|||||||
if (preg_match('{^@deprecated\b(.*)}', trim($line), $matches)) {
|
if (preg_match('{^@deprecated\b(.*)}', trim($line), $matches)) {
|
||||||
$annotation->setDeprecated(true);
|
$annotation->setDeprecated(true);
|
||||||
}
|
}
|
||||||
|
if (preg_match('{^@link\b(.*)}', trim($line), $matches)) {
|
||||||
|
$annotation->setLink($matches[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$regexp = '{(\w*) *\$%s\b *(.*)}i';
|
$regexp = '{(\w*) *\$%s\b *(.*)}i';
|
||||||
|
@ -48,6 +48,11 @@
|
|||||||
<div>{{ data.documentation|extra_markdown }}</div>
|
<div>{{ data.documentation|extra_markdown }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if data.link is defined and data.link is not empty %}
|
||||||
|
<h4>Link</h4>
|
||||||
|
<div><a href="{{ data.link }}" target="_blank">{{ data.link }}</a></div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if data.requirements is defined and data.requirements is not empty %}
|
{% if data.requirements is defined and data.requirements is not empty %}
|
||||||
<h4>Requirements</h4>
|
<h4>Requirements</h4>
|
||||||
<table class="fullwidth">
|
<table class="fullwidth">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user