Skip to content

Commit a20d0df

Browse files
committed
update phpdocumentor/reflection to 4.0
1 parent 5589a86 commit a20d0df

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"license": "MIT",
55
"minimum-stability" : "stable",
66
"require": {
7-
"phpdocumentor/reflection-docblock": "^5@alpha",
8-
"phpdocumentor/reflection": "^4@alpha",
7+
"phpdocumentor/reflection": "~4.0",
98
"erusev/parsedown": "^1.7"
109
},
1110
"authors": [

src/Builder/Class_.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,15 @@ private function buildMethodParams( $docParams, $httpMethod ){
191191
$swaggerParam = [
192192
'name' => $variableName,
193193
'in' => $in,
194-
'default' => $default,
195194
'description' => $description,
196195
'required' => $required,
197196
'type' => $type,
198197
];
199198

199+
if( $default !== '' ) {
200+
$swaggerParam['default'] = $default;
201+
}
202+
200203
if( strtolower($swaggerParam['type']) == 'array' ) {
201204
$swaggerParam['collectionFormat'] = 'multi';
202205
$swaggerParam['items'] = [ 'type'=>'string' ];
@@ -230,6 +233,8 @@ private function buildMethodResponses( $docReturns, & $produces ){
230233
];
231234
}
232235

236+
$produces = array_unique( $produces );
237+
233238
return $swaggerResponses;
234239
}
235240

src/Directory.php

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ public function build(){
6060
$this->swagger['paths'] += $builderFile->build();
6161
}
6262

63+
ksort( $this->swagger['paths'], SORT_STRING );
64+
6365
return json_encode( $this->swagger );
6466
}
6567

0 commit comments

Comments
 (0)