Skip to content

Commit 189d25f

Browse files
committed
Fix up PHPStan issues.
1 parent 6ec8d5a commit 189d25f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Annotator/ClassAnnotatorTask/FormClassAnnotatorTask.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public function shouldRun(string $path, string $content): bool {
4242
*/
4343
public function annotate(string $path): bool {
4444
preg_match('#\buse (\w+)\\\\Form\\\\(.+)Form\b#', $this->content, $matches);
45+
if (empty($matches[1]) || empty($matches[2])) {
46+
return false;
47+
}
48+
4549
$appNamespace = $matches[1];
4650
$name = $matches[2] . 'Form';
4751

src/Annotator/Traits/ModelTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function getUsedModels(string $content): array {
2323
$models = array_combine($properties, $tables);
2424

2525
preg_match_all('/\b(public|protected|private) \$([a-z]+)\b/i', $content, $propertyMatches);
26-
$excluded = $propertyMatches[2] ?? [];
26+
$excluded = $propertyMatches[2];
2727
foreach ($excluded as $property) {
2828
if (isset($models[$property])) {
2929
unset($models[$property]);

0 commit comments

Comments
 (0)