Skip to content

Commit b665010

Browse files
committed
Apply changes;
1 parent 4a387c2 commit b665010

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Drivers/LocalDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct()
2222

2323
$this->mainFilePath = storage_path("$directory{$this->config['base_file_name']}.json");
2424

25-
if (!preg_match('/\/[\w]+\.json/ms', $this->mainFilePath)) {
25+
if (empty($this->config['base_file_name']) || !str_ends_with($this->mainFilePath, '.json')) {
2626
throw new MissedProductionFilePathException();
2727
}
2828
}

tests/AutoDocControllerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ public function setUp(): void
1919
parent::setUp();
2020

2121
$documentationDirectory = config('auto-doc.drivers.local.directory');
22-
if (!str_ends_with($documentationDirectory, DIRECTORY_SEPARATOR)) {
23-
$documentationDirectory .= DIRECTORY_SEPARATOR;
24-
}
2522

26-
self::$baseFile ??= $documentationDirectory.'documentation.json';
23+
self::$baseFile ??= $documentationDirectory.'/documentation.json';
2724
self::$documentation ??= $this->getJsonFixture('tmp_data');
2825

2926
if (!is_dir(storage_path($documentationDirectory))) {

0 commit comments

Comments
 (0)