Skip to content

Commit f4f0f3f

Browse files
Merge pull request #297 from rakutentech/feature/lint
lint fix and change log
2 parents 649bdfd + cf2faec commit f4f0f3f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ Fixing lints
230230
- v2.14 Adds path params support
231231
- v2.16 Top Navbar is fixed
232232
- v2.19 Publish _astro assets
233+
- v2.20 `laravel-request-docs:export` command to export
233234
234235
235236
# Contributors

src/Commands/ExportRequestDocsCommand.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(LaravelRequestDocs $laravelRequestDoc, LaravelReques
1818
{
1919
parent::__construct();
2020

21-
$this->laravelRequestDocs = $laravelRequestDoc;
21+
$this->laravelRequestDocs = $laravelRequestDoc;
2222
$this->laravelRequestDocsToOpenApi = $laravelRequestDocsToOpenApi;
2323
}
2424

@@ -56,12 +56,12 @@ public function handle()
5656
$excludedMethods = array_map(fn($item) => strtolower($item), $excludedMethods);
5757

5858
//filter while method apis to export
59-
$showGet = !in_array('get', $excludedMethods);
60-
$showPost = !in_array('post', $excludedMethods);
61-
$showPut = !in_array('put', $excludedMethods);
62-
$showPatch = !in_array('patch', $excludedMethods);
59+
$showGet = !in_array('get', $excludedMethods);
60+
$showPost = !in_array('post', $excludedMethods);
61+
$showPut = !in_array('put', $excludedMethods);
62+
$showPatch = !in_array('patch', $excludedMethods);
6363
$showDelete = !in_array('delete', $excludedMethods);
64-
$showHead = !in_array('head', $excludedMethods);
64+
$showHead = !in_array('head', $excludedMethods);
6565

6666
// Get a list of Doc with route and rules information.
6767
$docs = $this->laravelRequestDocs->getDocs(
@@ -118,7 +118,7 @@ private function confirmFilePathAvailability(): bool
118118

119119
/**
120120
* @param $docs
121-
* @return false|int
121+
* @return bool
122122
*/
123123
private function writeApiDocsToFile(Collection $docs): bool
124124
{
@@ -134,6 +134,6 @@ private function writeApiDocsToFile(Collection $docs): bool
134134
mkdir($targetDirectory, 0755, true);
135135
}
136136

137-
return (bool)file_put_contents($this->exportFilePath, $content);
137+
return file_put_contents($this->exportFilePath, $content) !== false;
138138
}
139139
}

0 commit comments

Comments
 (0)