Skip to content

Commit

Permalink
Merge pull request #297 from rakutentech/feature/lint
Browse files Browse the repository at this point in the history
lint fix and change log
  • Loading branch information
kevincobain2000 authored Oct 2, 2023
2 parents 649bdfd + cf2faec commit f4f0f3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Fixing lints
- v2.14 Adds path params support
- v2.16 Top Navbar is fixed
- v2.19 Publish _astro assets
- v2.20 `laravel-request-docs:export` command to export
# Contributors
Expand Down
16 changes: 8 additions & 8 deletions src/Commands/ExportRequestDocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(LaravelRequestDocs $laravelRequestDoc, LaravelReques
{
parent::__construct();

$this->laravelRequestDocs = $laravelRequestDoc;
$this->laravelRequestDocs = $laravelRequestDoc;
$this->laravelRequestDocsToOpenApi = $laravelRequestDocsToOpenApi;
}

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

//filter while method apis to export
$showGet = !in_array('get', $excludedMethods);
$showPost = !in_array('post', $excludedMethods);
$showPut = !in_array('put', $excludedMethods);
$showPatch = !in_array('patch', $excludedMethods);
$showGet = !in_array('get', $excludedMethods);
$showPost = !in_array('post', $excludedMethods);
$showPut = !in_array('put', $excludedMethods);
$showPatch = !in_array('patch', $excludedMethods);
$showDelete = !in_array('delete', $excludedMethods);
$showHead = !in_array('head', $excludedMethods);
$showHead = !in_array('head', $excludedMethods);

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

/**
* @param $docs
* @return false|int
* @return bool
*/
private function writeApiDocsToFile(Collection $docs): bool
{
Expand All @@ -134,6 +134,6 @@ private function writeApiDocsToFile(Collection $docs): bool
mkdir($targetDirectory, 0755, true);
}

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

0 comments on commit f4f0f3f

Please sign in to comment.