Skip to content

Commit

Permalink
build(deps-dev): update phpstan/phpstan-strict-rules requirement (#692)
Browse files Browse the repository at this point in the history
Updates the requirements on [phpstan/phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) to permit the latest version.
- [Release notes](https://github.com/phpstan/phpstan-strict-rules/releases)
- [Commits](phpstan/phpstan-strict-rules@1.5.2...1.6.1)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-strict-rules
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] authored Nov 1, 2024
1 parent b957c56 commit ec754d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"phpstan/phpstan-deprecation-rules": "1.2.1",
"phpstan/phpstan-nette": "1.3.8",
"phpstan/phpstan-mockery": "1.1.3",
"phpstan/phpstan-strict-rules": "1.5.2",
"phpstan/phpstan-strict-rules": "1.6.1",
"nextras/multi-query-parser": "~1.0",
"nextras/orm-phpstan": "^1.0.1",
"tracy/tracy": "~2.3"
Expand Down
11 changes: 6 additions & 5 deletions src/Entity/Reflection/MetadataParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,12 @@ protected function initPrimaryKey(): void
return;
}

$primaryKey = array_values(array_filter(array_map(function (PropertyMetadata $metadata): ?string {
return $metadata->isPrimary && !$metadata->isVirtual
? $metadata->name
: null;
}, $this->metadata->getProperties())));
$primaryKey = [];
foreach ($this->metadata->getProperties() as $metadata) {
if ($metadata->isPrimary && !$metadata->isVirtual) {
$primaryKey[] = $metadata->name;
}
}

if (count($primaryKey) === 0) {
throw new InvalidStateException("Entity {$this->reflection->name} does not have defined any primary key.");
Expand Down

0 comments on commit ec754d4

Please sign in to comment.