Skip to content

Commit 727e274

Browse files
committed
.
1 parent fa2c85f commit 727e274

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/Commands/GenerateFormRequestsCommand.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ protected function process(): void
118118
$tsFields[] = " {$field}{$optional}: {$tsType};";
119119
}
120120

121-
$tsContent .= " export type {$entity} = {\n";
121+
$tsContent .= "
122+
/**
123+
* @see {$request['class']}
124+
* @see filePath
125+
*/
126+
export type {$entity} = {\n";
122127
$tsContent .= implode("\n", $tsFields);
123128
$tsContent .= "\n };\n";
124129
}
@@ -184,7 +189,11 @@ protected function parseRules(FormRequest $formRequest) {
184189
protected function readFormRequests(string $path)
185190
{
186191
$classes = collect(iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path))))
187-
->reject(fn ($i) => !$i->isFile() || !str_ends_with($i->getRealPath(), '.php'))
192+
->reject(fn ($i) =>
193+
$i->isDir()
194+
|| str_ends_with($i->getRealPath(), '/..')
195+
|| ! str_ends_with($i->getRealPath(), '.php')
196+
)
188197
->map(fn ($item) => $this->fqcnFromPath($item->getRealPath()))
189198
->filter( fn($class) => is_subclass_of($class, FormRequest::class))
190199
->values();

0 commit comments

Comments
 (0)