Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-potts authored and github-actions[bot] committed Jun 29, 2024
1 parent 7424ca7 commit a5cf439
Show file tree
Hide file tree
Showing 51 changed files with 59 additions and 144 deletions.
3 changes: 1 addition & 2 deletions examples/Bank/src/Events/MoneyDeposited.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class MoneyDeposited extends Event
public function __construct(
#[StateId(AccountState::class)] public int $account_id,
public int $cents = 0,
) {
}
) {}

public function apply(AccountState $state)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Bank/src/Mail/DepositAvailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class DepositAvailable extends Mailable

public function __construct(
public int $user_id
) {
}
) {}

public function build()
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Bank/src/Mail/WelcomeEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class WelcomeEmail extends Mailable

public function __construct(
public int $user_id
) {
}
) {}

public function build()
{
Expand Down
4 changes: 1 addition & 3 deletions examples/Bank/src/States/UserState.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Thunk\Verbs\State;

class UserState extends State
{
}
class UserState extends State {}
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Gameplay/EndedTurn.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class EndedTurn extends Event
public function __construct(
public int $game_id,
public int $player_id,
) {
}
) {}

public function validateGame(GameState $game)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Gameplay/FlippedTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class FlippedTable extends Event
public function __construct(
public int $game_id,
public int $player_id,
) {
}
) {}

public function validateGame(GameState $game)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Gameplay/PaidRent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
public int $game_id,
public int $player_id,
public Property $property,
) {
}
) {}

public function validatePlayer(PlayerState $player)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Gameplay/PlayerMoved.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
public int $game_id,
public int $player_id,
public Space $to,
) {
}
) {}

public function validateGame(GameState $game)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Gameplay/PurchasedProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
public int $game_id,
public int $player_id,
public Property $property,
) {
}
) {}

public function validatePlayer(PlayerState $player)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Setup/FirstPlayerSelected.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class FirstPlayerSelected extends Event
public function __construct(
public int $game_id,
public int $player_id,
) {
}
) {}

public function validateGame(GameState $game)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Setup/GameStarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class GameStarted extends Event
{
public function __construct(
public ?int $game_id = null,
) {
}
) {}

public function validate(GameState $game)
{
Expand Down
3 changes: 1 addition & 2 deletions examples/Monopoly/src/Events/Setup/PlayerJoinedGame.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
public int $game_id,
public int $player_id,
public Token $token,
) {
}
) {}

public function validateGame(GameState $game)
{
Expand Down
4 changes: 1 addition & 3 deletions examples/Monopoly/src/Game/DeedCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs\Examples\Monopoly\Game;

class DeedCollection extends SpaceCollection
{
}
class DeedCollection extends SpaceCollection {}
4 changes: 1 addition & 3 deletions examples/Monopoly/src/Game/Spaces/Chance.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs\Examples\Monopoly\Game\Spaces;

abstract class Chance extends Space
{
}
abstract class Chance extends Space {}
4 changes: 1 addition & 3 deletions examples/Monopoly/src/Game/Spaces/Chest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs\Examples\Monopoly\Game\Spaces;

abstract class Chest extends Space
{
}
abstract class Chest extends Space {}
4 changes: 1 addition & 3 deletions examples/Monopoly/src/Game/Spaces/Railroad.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs\Examples\Monopoly\Game\Spaces;

abstract class Railroad extends Space
{
}
abstract class Railroad extends Space {}
4 changes: 1 addition & 3 deletions examples/Monopoly/src/Game/Spaces/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs\Examples\Monopoly\Game\Spaces;

abstract class Tax extends Space
{
}
abstract class Tax extends Space {}
4 changes: 1 addition & 3 deletions examples/Monopoly/src/Game/Spaces/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs\Examples\Monopoly\Game\Spaces;

abstract class Utility extends Space
{
}
abstract class Utility extends Space {}
3 changes: 1 addition & 2 deletions src/Attributes/Hooks/On.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class On implements HookAttribute
{
public function __construct(
public Phase $phase
) {
}
) {}

public function applyToHook(Hook $hook): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/CommitsImmediately.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs;

interface CommitsImmediately
{
}
interface CommitsImmediately {}
3 changes: 1 addition & 2 deletions src/Events/VerbsStateInitialized.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public function __construct(
public string $state_class,
public array $state_data,
public bool $singleton = false,
) {
}
) {}

/** @return StateCollection<int, TStateType> */
public function states(): StateCollection
Expand Down
4 changes: 1 addition & 3 deletions src/Exceptions/ConcurrencyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use RuntimeException;

class ConcurrencyException extends RuntimeException
{
}
class ConcurrencyException extends RuntimeException {}
4 changes: 1 addition & 3 deletions src/Exceptions/EventNotAuthorized.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Illuminate\Auth\Access\AuthorizationException;

class EventNotAuthorized extends AuthorizationException
{
}
class EventNotAuthorized extends AuthorizationException {}
4 changes: 1 addition & 3 deletions src/Exceptions/EventNotValid.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use InvalidArgumentException;

class EventNotValid extends InvalidArgumentException
{
}
class EventNotValid extends InvalidArgumentException {}
4 changes: 1 addition & 3 deletions src/Exceptions/EventNotValidForCurrentState.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs\Exceptions;

class EventNotValidForCurrentState extends EventNotValid
{
}
class EventNotValidForCurrentState extends EventNotValid {}
3 changes: 1 addition & 2 deletions src/Lifecycle/AutoCommitManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class AutoCommitManager
public function __construct(
public BrokersEvents $broker,
public bool $enabled,
) {
}
) {}

public function commitIfAutoCommitting(): bool
{
Expand Down
3 changes: 1 addition & 2 deletions src/Lifecycle/Broker.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class Broker implements BrokersEvents
public function __construct(
protected Dispatcher $dispatcher,
protected MetadataManager $metadata,
) {
}
) {}

public function fire(Event $event): ?Event
{
Expand Down
3 changes: 1 addition & 2 deletions src/Lifecycle/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class Dispatcher

public function __construct(
protected Container $container
) {
}
) {}

public function register(object $target): void
{
Expand Down
3 changes: 1 addition & 2 deletions src/Lifecycle/EventStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class EventStore implements StoresEvents
{
public function __construct(
protected MetadataManager $metadata,
) {
}
) {}

public function read(
?State $state = null,
Expand Down
3 changes: 1 addition & 2 deletions src/Lifecycle/Guards.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public static function for(Event $event, ?State $state = null): static
public function __construct(
public Event $event,
public ?State $state = null,
) {
}
) {}

public function check(): static
{
Expand Down
3 changes: 1 addition & 2 deletions src/Lifecycle/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public function __construct(
public array $states = [],
public SplObjectStorage $phases = new SplObjectStorage(),
public ?string $name = null,
) {
}
) {}

public function forcePhases(Phase ...$phases): static
{
Expand Down
4 changes: 1 addition & 3 deletions src/NoWormhole.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Thunk\Verbs;

interface NoWormhole
{
}
interface NoWormhole {}
3 changes: 1 addition & 2 deletions src/StateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public function __construct(
protected ?Generator $faker = null,
protected Collection $makeCallbacks = new Collection(),
protected Collection $createCallbacks = new Collection(),
) {
}
) {}

public function definition(): array
{
Expand Down
3 changes: 1 addition & 2 deletions src/Support/EventStateRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class EventStateRegistry

public function __construct(
protected StateManager $manager
) {
}
) {}

public function getStates(Event $event): StateCollection
{
Expand Down
3 changes: 1 addition & 2 deletions src/Support/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class Serializer
public function __construct(
public SymfonySerializer $serializer,
protected array $context = [],
) {
}
) {}

public function serialize(object $class): string
{
Expand Down
3 changes: 1 addition & 2 deletions src/Support/Wormhole.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public function __construct(
protected MetadataManager $metadata,
protected DateFactory $factory,
protected bool $enabled = true,
) {
}
) {}

public function realNow(): CarbonInterface
{
Expand Down
4 changes: 1 addition & 3 deletions tests/Feature/AutoCommitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,5 @@ public function handle()

class AutoCommitTestEvent extends Event
{
public function __construct(public string $message)
{
}
public function __construct(public string $message) {}
}
6 changes: 2 additions & 4 deletions tests/Feature/DependencyInjectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class DependencyInjectionTestEvent extends Event
public function __construct(
#[StateId(DependencyInjectionTestState::class)] public ?int $test1_id,
#[StateId(DependencyInjectionTestSecondState::class)] public ?int $test2_id,
) {
}
) {}

public function validate1(DependencyInjectionTestState $state)
{
Expand Down Expand Up @@ -66,8 +65,7 @@ class DependencyInjectionTestMultiHandleEvent extends Event
public function __construct(
#[StateId(DependencyInjectionTestState::class)] public ?int $test1_id,
#[StateId(DependencyInjectionTestState::class)] public ?int $test2_id,
) {
}
) {}

public function apply(DependencyInjectionTestState $state)
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Feature/NestedEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public function __construct(
#[StateId(AccountCreditState::class)]
public string $organisation_id,
public int $credit_amount_cents,
) {
}
) {}

public function apply(AccountCreditState $state): void
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Feature/ReplayCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public function __construct(
public int $add = 0,
public int $subtract = 0,
#[StateId(ReplayCommandTestState::class)] public ?int $state_id = null,
) {
}
) {}

public function apply(ReplayCommandTestState $state)
{
Expand Down
8 changes: 2 additions & 6 deletions tests/Feature/RouteStateBindingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
$this->get('/5/6')->assertContent(json_encode([RouteStateBindingTestState1::class, 5, RouteStateBindingTestState2::class, 6]));
});

class RouteStateBindingTestState1 extends State
{
}
class RouteStateBindingTestState1 extends State {}

class RouteStateBindingTestState2 extends State
{
}
class RouteStateBindingTestState2 extends State {}
Loading

0 comments on commit a5cf439

Please sign in to comment.