Skip to content

Commit 0979712

Browse files
committed
fix phpstan
1 parent 3d8e6a8 commit 0979712

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Generator/IdentifierHashGenerator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public function getStatements(GeneratorMetadata $metadata, bool $fromSource): ar
5252

5353
// foreach property we check
5454
foreach ($identifiers as $property) {
55+
if (null === $property->source->accessor || null === $property->target->readAccessor) {
56+
continue;
57+
}
58+
5559
// check if the source is defined
5660
if ($fromSource) {
5761
if ($property->source->checkExists) {
@@ -81,6 +85,10 @@ public function getStatements(GeneratorMetadata $metadata, bool $fromSource): ar
8185
}
8286
}
8387

88+
if (count($statements) < 2) {
89+
return [];
90+
}
91+
8492
// return hash as string
8593
$statements[] = new Stmt\Return_(new Expr\FuncCall(new Name('hash_final'), [
8694
new Arg($hashCtxVariable),

0 commit comments

Comments
 (0)