Skip to content

Commit f9b43cb

Browse files
committed
Correct PHP Notices
1 parent f06b00b commit f9b43cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Generators/Statements/FormRequestGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function output(array $tree): array
3030

3131
$stub = $this->files->get(STUBS_PATH . '/form-request.stub');
3232

33-
$this->registerModels($tree['models']);
33+
$this->registerModels($tree['models'] ?? []);
3434

3535
/** @var \Blueprint\Models\Controller $controller */
3636
foreach ($tree['controllers'] as $controller) {
@@ -104,7 +104,7 @@ private function getContextFromController(string $name)
104104

105105
private function modelForContext(string $context)
106106
{
107-
return $this->models[Str::studly($context)] ?? $this->models[Str::lower($context)];
107+
return $this->models[Str::studly($context)] ?? $this->models[Str::lower($context)] ?? null;
108108
}
109109

110110
private function getName(string $context, string $method)
@@ -137,7 +137,7 @@ private function validationRules(string $qualifier, string $column)
137137

138138
private function registerModels(?array $models)
139139
{
140-
$this->models = $models ?? [];
140+
$this->models = $models;
141141
}
142142

143143

0 commit comments

Comments
 (0)