Skip to content
This repository was archived by the owner on Jun 2, 2022. It is now read-only.

Commit d6bede8

Browse files
committed
Fix argument types separator in table for methods
1 parent ae173d6 commit d6bede8

File tree

14 files changed

+44
-22
lines changed

14 files changed

+44
-22
lines changed

CHANGELOG.md

100644100755
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ All notable changes to `simple-php-apidoc` will be documented in this file.
44

55
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
66

7-
## NEXT - YYYY-MM-DD
8-
7+
<!--
8+
## [X.Y.Z] - YYYY-MM-DD
99
### Added
1010
- Nothing
1111
@@ -20,3 +20,16 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
2020
2121
### Security
2222
- Nothing
23+
-->
24+
25+
## [1.0.1] - 2019-10-14
26+
### Fixed
27+
- Fix argument types separator in table for methods
28+
29+
## [1.0.0] - 2019-10-13
30+
### Added
31+
- Reflection elements decorators
32+
- Collections for some decorated elements
33+
- DocBlock resolvers for inherit doc blocks from parent classes, methods and properties
34+
- Renderer interface and simple markdown renderer
35+
- CLI tool

docs/spaceonfire/SimplePhpApiDoc/Context.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Decorate phpDocumentor elements with custom element classes
4040

4141
|Param|Type|Description|
4242
|---|---|---|
43-
|`$element`|*\phpDocumentor\Reflection\Element|mixed*|Element to decorate|
44-
|**Return**|*\spaceonfire\SimplePhpApiDoc\Elements\ElementInterface|mixed*|Decorated element or source element if there no mappings for this type|
43+
|`$element`|*\phpDocumentor\Reflection\Element&#124;mixed*|Element to decorate|
44+
|**Return**|*\spaceonfire\SimplePhpApiDoc\Elements\ElementInterface&#124;mixed*|Decorated element or source element if there no mappings for this type|
4545

4646
```php
4747
public function Context::elementFactory(mixed $element): mixed
@@ -84,7 +84,7 @@ Get element object by name
8484
|Param|Type|Description|
8585
|---|---|---|
8686
|`$fqsen`|*string*|Fully Qualified Structural Element Name|
87-
|**Return**|*mixed|null*||
87+
|**Return**|*mixed&#124;null*||
8888

8989
```php
9090
public function Context::getElement(string $fqsen): mixed
@@ -99,7 +99,7 @@ Get file by element name
9999
|Param|Type|Description|
100100
|---|---|---|
101101
|`$fqsen`|*string*|Fully Qualified Structural Element Name|
102-
|**Return**|*\phpDocumentor\Reflection\Php\File|null*||
102+
|**Return**|*\phpDocumentor\Reflection\Php\File&#124;null*||
103103

104104
```php
105105
public function Context::getFile(string $fqsen): ?\spaceonfire\SimplePhpApiDoc\phpDocumentor\Reflection\Php\File
@@ -155,7 +155,7 @@ Getter for `project` property
155155

156156
|Param|Type|Description|
157157
|---|---|---|
158-
|**Return**|*\phpDocumentor\Reflection\Php\Project|\phpDocumentor\Reflection\Project*||
158+
|**Return**|*\phpDocumentor\Reflection\Php\Project&#124;\phpDocumentor\Reflection\Project*||
159159

160160
```php
161161
public function Context::getProject(): \spaceonfire\SimplePhpApiDoc\phpDocumentor\Reflection\Project

docs/spaceonfire/SimplePhpApiDoc/Elements/ClassElement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Returns the superclass this class is extending if available.
156156

157157
|Param|Type|Description|
158158
|---|---|---|
159-
|**Return**|*\phpDocumentor\Reflection\Fqsen|null*||
159+
|**Return**|*\phpDocumentor\Reflection\Fqsen&#124;null*||
160160

161161
```php
162162
public function ClassElement::getParentFqsen(): ?\spaceonfire\SimplePhpApiDoc\Elements\phpDocumentor\Reflection\Fqsen

docs/spaceonfire/SimplePhpApiDoc/Elements/Collections/MethodsCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ TODO: move to BaseCollection
4949
|Param|Type|Description|
5050
|---|---|---|
5151
|`$callback`|*callable*||
52-
|**Return**|*mixed|null*||
52+
|**Return**|*mixed&#124;null*||
5353

5454
```php
5555
public function TypedCollection::find(callable $callback): mixed

docs/spaceonfire/SimplePhpApiDoc/Elements/Collections/NamespacesCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ TODO: move to BaseCollection
3232
|Param|Type|Description|
3333
|---|---|---|
3434
|`$callback`|*callable*||
35-
|**Return**|*mixed|null*||
35+
|**Return**|*mixed&#124;null*||
3636

3737
```php
3838
public function TypedCollection::find(callable $callback): mixed

docs/spaceonfire/SimplePhpApiDoc/Elements/Collections/PropertiesCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ TODO: move to BaseCollection
4949
|Param|Type|Description|
5050
|---|---|---|
5151
|`$callback`|*callable*||
52-
|**Return**|*mixed|null*||
52+
|**Return**|*mixed&#124;null*||
5353

5454
```php
5555
public function TypedCollection::find(callable $callback): mixed

docs/spaceonfire/SimplePhpApiDoc/Elements/Collections/TraitsCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ TODO: move to BaseCollection
3232
|Param|Type|Description|
3333
|---|---|---|
3434
|`$callback`|*callable*||
35-
|**Return**|*mixed|null*||
35+
|**Return**|*mixed&#124;null*||
3636

3737
```php
3838
public function TypedCollection::find(callable $callback): mixed

docs/spaceonfire/SimplePhpApiDoc/Elements/Collections/TypedCollection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TODO: move to BaseCollection
3434
|Param|Type|Description|
3535
|---|---|---|
3636
|`$callback`|*callable*||
37-
|**Return**|*mixed|null*||
37+
|**Return**|*mixed&#124;null*||
3838

3939
```php
4040
public function TypedCollection::find(callable $callback): mixed

docs/spaceonfire/SimplePhpApiDoc/Elements/ElementVisibilityInterface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Returns the Visibility of this method.
1010

1111
|Param|Type|Description|
1212
|---|---|---|
13-
|**Return**|*\phpDocumentor\Reflection\Php\Visibility|null*||
13+
|**Return**|*\phpDocumentor\Reflection\Php\Visibility&#124;null*||
1414

1515
```php
1616
public function ElementVisibilityInterface::getVisibility(): ?\spaceonfire\SimplePhpApiDoc\Elements\phpDocumentor\Reflection\Php\Visibility

docs/spaceonfire/SimplePhpApiDoc/Elements/MethodElement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Returns the Visibility of this method.
184184

185185
|Param|Type|Description|
186186
|---|---|---|
187-
|**Return**|*\phpDocumentor\Reflection\Php\Visibility|null*||
187+
|**Return**|*\phpDocumentor\Reflection\Php\Visibility&#124;null*||
188188

189189
```php
190190
public function MethodElement::getVisibility(): ?\spaceonfire\SimplePhpApiDoc\Elements\phpDocumentor\Reflection\Php\Visibility

docs/spaceonfire/SimplePhpApiDoc/Elements/PropertyElement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Returns the Visibility of this method.
167167

168168
|Param|Type|Description|
169169
|---|---|---|
170-
|**Return**|*\phpDocumentor\Reflection\Php\Visibility|null*||
170+
|**Return**|*\phpDocumentor\Reflection\Php\Visibility&#124;null*||
171171

172172
```php
173173
public function PropertyElement::getVisibility(): ?\spaceonfire\SimplePhpApiDoc\Elements\phpDocumentor\Reflection\Php\Visibility

docs/spaceonfire/SimplePhpApiDoc/GeneratorCommand.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ GeneratorCommand constructor.
1717

1818
|Param|Type|Description|
1919
|---|---|---|
20-
|`$name`|*string|null*||
20+
|`$name`|*string&#124;null*||
2121
|`$composer`|*array*||
2222

2323
```php

docs/spaceonfire/SimplePhpApiDoc/Renderers/Markdown/MarkdownRenderer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ MarkdownRenderer constructor.
2828

2929
|Param|Type|Description|
3030
|---|---|---|
31-
|`$context`|*\spaceonfire\SimplePhpApiDoc\Context|null*||
32-
|`$outputDir`|*string|null*||
31+
|`$context`|*\spaceonfire\SimplePhpApiDoc\Context&#124;null*||
32+
|`$outputDir`|*string&#124;null*||
3333

3434
```php
3535
public function MarkdownRenderer::__construct(\spaceonfire\SimplePhpApiDoc\Context $context = null, string $outputDir = null): mixed

src/Renderers/Markdown/views/_methods.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,21 @@
3131

3232
$tagsTable = [['Param', 'Type', 'Description']];
3333
foreach ($docblock->getTags() as $tag) {
34+
if (!in_array($tag->getName(), ['param', 'return', 'throw'], true)) {
35+
continue;
36+
}
37+
38+
$types = trim(implode('&#124;', explode('|', $tag->getType() ?? '')));
39+
if ($types !== '') {
40+
$types = MarkdownHelper::italic($types);
41+
}
42+
3443
switch ($tag->getName()) {
3544
case 'param':
3645
/** @var Param $tag */
3746
$tagsTable[] = [
3847
MarkdownHelper::code(($tag->isVariadic() ? '...' : '') . '$' . $tag->getVariableName()),
39-
$tag->getType() ? MarkdownHelper::italic((string)$tag->getType()) : null,
48+
$types,
4049
(string)$tag->getDescription(),
4150
];
4251
break;
@@ -45,7 +54,7 @@
4554
/** @var Return_ $tag */
4655
$tagsTable[] = [
4756
MarkdownHelper::strong('Return'),
48-
$tag->getType() ? MarkdownHelper::italic((string)$tag->getType()) : null,
57+
$types,
4958
(string)$tag->getDescription(),
5059
];
5160
break;
@@ -54,7 +63,7 @@
5463
/** @var Throws $tag */
5564
$tagsTable[] = [
5665
MarkdownHelper::strong('Throws'),
57-
$tag->getType() ? MarkdownHelper::italic((string)$tag->getType()) : null,
66+
$types,
5867
(string)$tag->getDescription(),
5968
];
6069
break;

0 commit comments

Comments
 (0)