Skip to content

Commit

Permalink
Fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Jul 10, 2024
1 parent 7f3d22d commit e618563
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Definition/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ public function getForeignKeys(): ForeignKeyMap

public function addSchemaModifier(SchemaModifierInterface $modifier): self
{
$this->role ?? throw new EntityException('Entity must have a `role` to be able to add a modifier.');

$this->schemaModifiers[] = $modifier->withRole($this->role);
$this->schemaModifiers[] = $modifier->withRole($this->role ?? throw new EntityException(
'Entity must have a `role` to be able to add a modifier.'
));

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/GenerateModifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function run(Registry $registry): Registry
protected function register(Registry $registry, Entity $entity): void
{
$role = $entity->getRole();

assert($role !== null);
foreach ($entity->getSchemaModifiers() as $modifier) {
\assert($modifier instanceof SchemaModifierInterface);
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/RenderModifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function run(Registry $registry): Registry
protected function register(Registry $registry, Entity $entity): void
{
$role = $entity->getRole();

assert($role !== null);
foreach ($entity->getSchemaModifiers() as $modifier) {
\assert($modifier instanceof SchemaModifierInterface);
try {
Expand Down

0 comments on commit e618563

Please sign in to comment.