|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace SoliDry\Documentation; |
|
4
|
|
|
|
|
5
|
|
|
use SoliDry\Extension\JSONApiInterface; |
|
6
|
|
|
use SoliDry\Types\DefaultInterface; |
|
7
|
|
|
use SoliDry\Types\DocumentationInterface; |
|
8
|
|
|
use SoliDry\Types\PhpInterface; |
|
9
|
|
|
|
|
10
|
|
|
trait BulksDoc |
|
11
|
|
|
{ |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Sets OAS documentation for a bulk create method |
|
15
|
|
|
*/ |
|
16
|
|
|
private function setCreateBulk(): void |
|
17
|
|
|
{ |
|
18
|
|
|
$this->openComment(); |
|
|
|
|
|
|
19
|
|
|
|
|
20
|
|
|
$this->setStarredComment(DocumentationInterface::OA_POST . PhpInterface::OPEN_PARENTHESES); |
|
|
|
|
|
|
21
|
|
|
|
|
22
|
|
|
$this->setStarredComment('path="' . PhpInterface::SLASH . $this->generator->version . PhpInterface::SLASH |
|
23
|
|
|
. strtolower($this->generator->objectName) . PhpInterface::SLASH . 'bulk",', 1, 1); |
|
24
|
|
|
|
|
25
|
|
|
$this->setStarredComment('summary="Create ' . $this->generator->objectName . ' bulk",', 1, 1); |
|
26
|
|
|
|
|
27
|
|
|
$this->setStarredComment('tags={"' . $this->generator->objectName . DefaultInterface::CONTROLLER_POSTFIX |
|
28
|
|
|
. '"},', 1, 1); |
|
29
|
|
|
|
|
30
|
|
|
$this->setResponse([ |
|
|
|
|
|
|
31
|
|
|
'response' => '"' . JSONApiInterface::HTTP_RESPONSE_CODE_CREATED . '"', |
|
32
|
|
|
'description' => '""', |
|
33
|
|
|
]); |
|
34
|
|
|
|
|
35
|
|
|
$this->setStarredComment(PhpInterface::CLOSE_PARENTHESES); |
|
36
|
|
|
|
|
37
|
|
|
$this->closeComment(); |
|
|
|
|
|
|
38
|
|
|
$this->setNewLines(); |
|
|
|
|
|
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Sets OAS documentation for a bulk update method |
|
43
|
|
|
*/ |
|
44
|
|
|
private function setUpdateBulk(): void |
|
45
|
|
|
{ |
|
46
|
|
|
$this->openComment(); |
|
47
|
|
|
|
|
48
|
|
|
$this->setStarredComment(DocumentationInterface::OA_PATCH . PhpInterface::OPEN_PARENTHESES); |
|
49
|
|
|
|
|
50
|
|
|
$this->setStarredComment('path="' . PhpInterface::SLASH . $this->generator->version . PhpInterface::SLASH |
|
51
|
|
|
. strtolower($this->generator->objectName) . PhpInterface::SLASH . 'bulk",', 1, 1); |
|
52
|
|
|
|
|
53
|
|
|
$this->setStarredComment('summary="Update ' . $this->generator->objectName . ' bulk",', 1, 1); |
|
54
|
|
|
|
|
55
|
|
|
$this->setStarredComment('tags={"' . $this->generator->objectName . DefaultInterface::CONTROLLER_POSTFIX |
|
56
|
|
|
. '"},', 1, 1); |
|
57
|
|
|
|
|
58
|
|
|
$this->setResponse([ |
|
59
|
|
|
'response' => '"' . JSONApiInterface::HTTP_RESPONSE_CODE_OK . '"', |
|
60
|
|
|
'description' => '""', |
|
61
|
|
|
]); |
|
62
|
|
|
|
|
63
|
|
|
$this->setStarredComment(PhpInterface::CLOSE_PARENTHESES); |
|
64
|
|
|
|
|
65
|
|
|
$this->closeComment(); |
|
66
|
|
|
$this->setNewLines(); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Sets OAS documentation for a bulk delete method |
|
71
|
|
|
*/ |
|
72
|
|
|
private function setDeleteBulk(): void |
|
73
|
|
|
{ |
|
74
|
|
|
$this->openComment(); |
|
75
|
|
|
|
|
76
|
|
|
$this->setStarredComment(DocumentationInterface::OA_DELETE . PhpInterface::OPEN_PARENTHESES); |
|
77
|
|
|
|
|
78
|
|
|
$this->setStarredComment('path="' . PhpInterface::SLASH . $this->generator->version . PhpInterface::SLASH |
|
79
|
|
|
. strtolower($this->generator->objectName) . PhpInterface::SLASH . 'bulk",', 1, 1); |
|
80
|
|
|
|
|
81
|
|
|
$this->setStarredComment('summary="Delete ' . $this->generator->objectName . ' bulk",', 1, 1); |
|
82
|
|
|
|
|
83
|
|
|
$this->setStarredComment('tags={"' . $this->generator->objectName . DefaultInterface::CONTROLLER_POSTFIX |
|
84
|
|
|
. '"},', 1, 1); |
|
85
|
|
|
|
|
86
|
|
|
$this->setResponse([ |
|
87
|
|
|
'response' => '"' . JSONApiInterface::HTTP_RESPONSE_CODE_NO_CONTENT . '"', |
|
88
|
|
|
'description' => '""', |
|
89
|
|
|
]); |
|
90
|
|
|
|
|
91
|
|
|
$this->setStarredComment(PhpInterface::CLOSE_PARENTHESES); |
|
92
|
|
|
|
|
93
|
|
|
$this->closeComment(); |
|
94
|
|
|
$this->setNewLines(); |
|
95
|
|
|
} |
|
96
|
|
|
} |