Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Dec 12, 2024
1 parent 429a950 commit aa0d511
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/CommandBus/Handler/ServiceNotResolvable.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
<?php

declare(strict_types=1);

namespace Patchlevel\EventSourcing\CommandBus\Handler;

use RuntimeException;

use function sprintf;

final class ServiceNotResolvable extends RuntimeException
{
public static function missingType(string $class, $propertyName): self
/** @param class-string $class */
public static function missingType(string $class, string $propertyName): self
{
return new self(sprintf('Missing type for property "%s" in class "%s"', $propertyName, $class));
}

public static function typeNotObject(string $class, $propertyName): self
/** @param class-string $class */
public static function typeNotObject(string $class, string $propertyName): self
{
return new self(sprintf('Type for property "%s" in class "%s" must be object', $propertyName, $class));
}
Expand All @@ -20,4 +26,4 @@ public static function missingContainer(): self
{
return new self('Container is not configured');
}
}
}
6 changes: 4 additions & 2 deletions tests/Integration/BasicImplementation/ProfileWithCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ final class ProfileWithCommands extends BasicAggregateRoot
public static function create(
CreateProfile $command,
ClockInterface $clock,
#[Inject('env')] string $env,
#[Inject('env')]
string $env,
): self {
$self = new self();
$self->recordThat(new ProfileCreated($command->id, $command->name));
Expand All @@ -41,7 +42,8 @@ public static function create(
public function changeName(
ChangeProfileName $command,
ClockInterface $clock,
#[Inject('env')] string $env,
#[Inject('env')]
string $env,
): void {
$this->recordThat(new NameChanged($command->name));
}
Expand Down

0 comments on commit aa0d511

Please sign in to comment.