Skip to content

Commit 1c547e9

Browse files
committed
update php documentation
1 parent 3d12c88 commit 1c547e9

File tree

4 files changed

+68
-89
lines changed

4 files changed

+68
-89
lines changed

modules/swagger-codegen/src/main/resources/php/api.mustache

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ class {{classname}} {
3131
* {{{nickname}}}
3232
*
3333
* {{{summary}}}
34-
{{#allParams}}* {{paramName}}, {{dataType}}: {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}}
35-
* {{/allParams}}
36-
* @return {{{returnType}}}
34+
*
35+
{{#allParams}} * @param {{dataType}} ${{paramName}} {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}}
36+
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
3737
*/
38-
3938
public function {{nickname}}({{#allParams}}${{paramName}}{{#optional}}=null{{/optional}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
4039
4140
// parse inputs

samples/client/petstore/php/PetApi.php

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function __construct($apiClient) {
3030
* updatePet
3131
*
3232
* Update an existing pet
33-
* body, Pet: Pet object that needs to be added to the store (required)
34-
*
35-
* @return
33+
*
34+
* @param Pet $body Pet object that needs to be added to the store (required)
35+
* @return void
3636
*/
37-
3837
public function updatePet($body) {
3938

4039
// parse inputs
@@ -76,11 +75,10 @@ public function updatePet($body) {
7675
* addPet
7776
*
7877
* Add a new pet to the store
79-
* body, Pet: Pet object that needs to be added to the store (required)
80-
*
81-
* @return
78+
*
79+
* @param Pet $body Pet object that needs to be added to the store (required)
80+
* @return void
8281
*/
83-
8482
public function addPet($body) {
8583

8684
// parse inputs
@@ -122,11 +120,10 @@ public function addPet($body) {
122120
* findPetsByStatus
123121
*
124122
* Finds Pets by status
125-
* status, array[string]: Status values that need to be considered for filter (required)
126-
*
127-
* @return array[Pet]
123+
*
124+
* @param array[string] $status Status values that need to be considered for filter (required)
125+
* @return array[Pet]
128126
*/
129-
130127
public function findPetsByStatus($status) {
131128

132129
// parse inputs
@@ -173,11 +170,10 @@ public function findPetsByStatus($status) {
173170
* findPetsByTags
174171
*
175172
* Finds Pets by tags
176-
* tags, array[string]: Tags to filter by (required)
177-
*
178-
* @return array[Pet]
173+
*
174+
* @param array[string] $tags Tags to filter by (required)
175+
* @return array[Pet]
179176
*/
180-
181177
public function findPetsByTags($tags) {
182178

183179
// parse inputs
@@ -224,11 +220,10 @@ public function findPetsByTags($tags) {
224220
* getPetById
225221
*
226222
* Find pet by ID
227-
* pet_id, int: ID of pet that needs to be fetched (required)
228-
*
229-
* @return Pet
223+
*
224+
* @param int $pet_id ID of pet that needs to be fetched (required)
225+
* @return Pet
230226
*/
231-
232227
public function getPetById($pet_id) {
233228

234229
// parse inputs
@@ -276,13 +271,12 @@ public function getPetById($pet_id) {
276271
* updatePetWithForm
277272
*
278273
* Updates a pet in the store with form data
279-
* pet_id, string: ID of pet that needs to be updated (required)
280-
* * name, string: Updated name of the pet (required)
281-
* * status, string: Updated status of the pet (required)
282-
*
283-
* @return
274+
*
275+
* @param string $pet_id ID of pet that needs to be updated (required)
276+
* @param string $name Updated name of the pet (required)
277+
* @param string $status Updated status of the pet (required)
278+
* @return void
284279
*/
285-
286280
public function updatePetWithForm($pet_id, $name, $status) {
287281

288282
// parse inputs
@@ -330,12 +324,11 @@ public function updatePetWithForm($pet_id, $name, $status) {
330324
* deletePet
331325
*
332326
* Deletes a pet
333-
* api_key, string: (required)
334-
* * pet_id, int: Pet id to delete (required)
335-
*
336-
* @return
327+
*
328+
* @param string $api_key (required)
329+
* @param int $pet_id Pet id to delete (required)
330+
* @return void
337331
*/
338-
339332
public function deletePet($api_key, $pet_id) {
340333

341334
// parse inputs
@@ -380,13 +373,12 @@ public function deletePet($api_key, $pet_id) {
380373
* uploadFile
381374
*
382375
* uploads an image
383-
* pet_id, int: ID of pet to update (required)
384-
* * additional_metadata, string: Additional data to pass to server (required)
385-
* * file, file: file to upload (required)
386-
*
387-
* @return
376+
*
377+
* @param int $pet_id ID of pet to update (required)
378+
* @param string $additional_metadata Additional data to pass to server (required)
379+
* @param file $file file to upload (required)
380+
* @return void
388381
*/
389-
390382
public function uploadFile($pet_id, $additional_metadata, $file) {
391383

392384
// parse inputs

samples/client/petstore/php/StoreApi.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ function __construct($apiClient) {
3030
* getInventory
3131
*
3232
* Returns pet inventories by status
33-
34-
* @return map[string,int]
33+
*
34+
* @return map[string,int]
3535
*/
36-
3736
public function getInventory() {
3837

3938
// parse inputs
@@ -77,11 +76,10 @@ public function getInventory() {
7776
* placeOrder
7877
*
7978
* Place an order for a pet
80-
* body, Order: order placed for purchasing the pet (required)
81-
*
82-
* @return Order
79+
*
80+
* @param Order $body order placed for purchasing the pet (required)
81+
* @return Order
8382
*/
84-
8583
public function placeOrder($body) {
8684

8785
// parse inputs
@@ -129,11 +127,10 @@ public function placeOrder($body) {
129127
* getOrderById
130128
*
131129
* Find purchase order by ID
132-
* order_id, string: ID of pet that needs to be fetched (required)
133-
*
134-
* @return Order
130+
*
131+
* @param string $order_id ID of pet that needs to be fetched (required)
132+
* @return Order
135133
*/
136-
137134
public function getOrderById($order_id) {
138135

139136
// parse inputs
@@ -181,11 +178,10 @@ public function getOrderById($order_id) {
181178
* deleteOrder
182179
*
183180
* Delete purchase order by ID
184-
* order_id, string: ID of the order that needs to be deleted (required)
185-
*
186-
* @return
181+
*
182+
* @param string $order_id ID of the order that needs to be deleted (required)
183+
* @return void
187184
*/
188-
189185
public function deleteOrder($order_id) {
190186

191187
// parse inputs

samples/client/petstore/php/UserApi.php

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function __construct($apiClient) {
3030
* createUser
3131
*
3232
* Create user
33-
* body, User: Created user object (required)
34-
*
35-
* @return
33+
*
34+
* @param User $body Created user object (required)
35+
* @return void
3636
*/
37-
3837
public function createUser($body) {
3938

4039
// parse inputs
@@ -76,11 +75,10 @@ public function createUser($body) {
7675
* createUsersWithArrayInput
7776
*
7877
* Creates list of users with given input array
79-
* body, array[User]: List of user object (required)
80-
*
81-
* @return
78+
*
79+
* @param array[User] $body List of user object (required)
80+
* @return void
8281
*/
83-
8482
public function createUsersWithArrayInput($body) {
8583

8684
// parse inputs
@@ -122,11 +120,10 @@ public function createUsersWithArrayInput($body) {
122120
* createUsersWithListInput
123121
*
124122
* Creates list of users with given input array
125-
* body, array[User]: List of user object (required)
126-
*
127-
* @return
123+
*
124+
* @param array[User] $body List of user object (required)
125+
* @return void
128126
*/
129-
130127
public function createUsersWithListInput($body) {
131128

132129
// parse inputs
@@ -168,12 +165,11 @@ public function createUsersWithListInput($body) {
168165
* loginUser
169166
*
170167
* Logs user into the system
171-
* username, string: The user name for login (required)
172-
* * password, string: The password for login in clear text (required)
173-
*
174-
* @return string
168+
*
169+
* @param string $username The user name for login (required)
170+
* @param string $password The password for login in clear text (required)
171+
* @return string
175172
*/
176-
177173
public function loginUser($username, $password) {
178174

179175
// parse inputs
@@ -223,10 +219,9 @@ public function loginUser($username, $password) {
223219
* logoutUser
224220
*
225221
* Logs out current logged in user session
226-
227-
* @return
222+
*
223+
* @return void
228224
*/
229-
230225
public function logoutUser() {
231226

232227
// parse inputs
@@ -264,11 +259,10 @@ public function logoutUser() {
264259
* getUserByName
265260
*
266261
* Get user by user name
267-
* username, string: The name that needs to be fetched. Use user1 for testing. (required)
268-
*
269-
* @return User
262+
*
263+
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
264+
* @return User
270265
*/
271-
272266
public function getUserByName($username) {
273267

274268
// parse inputs
@@ -316,12 +310,11 @@ public function getUserByName($username) {
316310
* updateUser
317311
*
318312
* Updated user
319-
* username, string: name that need to be deleted (required)
320-
* * body, User: Updated user object (required)
321-
*
322-
* @return
313+
*
314+
* @param string $username name that need to be deleted (required)
315+
* @param User $body Updated user object (required)
316+
* @return void
323317
*/
324-
325318
public function updateUser($username, $body) {
326319

327320
// parse inputs
@@ -367,11 +360,10 @@ public function updateUser($username, $body) {
367360
* deleteUser
368361
*
369362
* Delete user
370-
* username, string: The name that needs to be deleted (required)
371-
*
372-
* @return
363+
*
364+
* @param string $username The name that needs to be deleted (required)
365+
* @return void
373366
*/
374-
375367
public function deleteUser($username) {
376368

377369
// parse inputs

0 commit comments

Comments
 (0)