Skip to content

Commit

Permalink
1.5.10
Browse files Browse the repository at this point in the history
- `SettingType` fix `extends` param if `null`
  • Loading branch information
ewilan-riviere committed Jun 29, 2023
1 parent da75afd commit 7bc8a5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kiwilan/typescriptable-laravel",
"description": "PHP package for Laravel to type Eloquent models and routes with autogenerated TypeScript, ready for Inertia with associated NPM package.",
"version": "1.5.0",
"version": "1.5.10",
"keywords": [
"kiwilan",
"laravel",
Expand Down
7 changes: 6 additions & 1 deletion src/Typed/SettingType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ protected function __construct(
) {
}

public static function make(?string $settingsPath, ?string $outputPath, string $extends = 'Spatie\LaravelSettings\Settings'): self
public static function make(?string $settingsPath, ?string $outputPath, ?string $extends): self
{
if (! $settingsPath) {
$settingsPath = TypescriptableConfig::settingsDirectory();
}

$tsFilename = TypescriptableConfig::settingsFilename();

if (! $outputPath) {
$outputPath = TypescriptableConfig::setPath();
}

if (! $extends) {
$extends = 'Spatie\LaravelSettings\Settings';
}

$items = ClassItem::list($settingsPath, TypescriptableConfig::settingsSkip());
$items = array_filter($items, fn (ClassItem $item) => $item->extends === $extends);

Expand Down

0 comments on commit 7bc8a5e

Please sign in to comment.