Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pint.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"binary_operator_spaces": true,
"clean_namespace": true,
"declare_strict_types": true,
"final_class": true,
"list_syntax": true,
"new_expression_parentheses": true,
"no_empty_phpdoc": true,
Expand Down
3 changes: 2 additions & 1 deletion src/Application/ApplicationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

namespace CloudCreativity\Modules\Application;

use CloudCreativity\Modules\Contracts\Application\ApplicationException as IApplicationException;
use RuntimeException;

class ApplicationException extends RuntimeException
final class ApplicationException extends RuntimeException implements IApplicationException
{
}
21 changes: 19 additions & 2 deletions src/Application/Bus/AbortOnFailureException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,25 @@

namespace CloudCreativity\Modules\Application\Bus;

use CloudCreativity\Modules\Toolkit\Result\FailedResultException;
use CloudCreativity\Modules\Contracts\Toolkit\Result\FailedResultException;
use CloudCreativity\Modules\Contracts\Toolkit\Result\Result;
use RuntimeException;

final class AbortOnFailureException extends FailedResultException
/**
* @internal
*/
final class AbortOnFailureException extends RuntimeException implements FailedResultException
{
/**
* @param Result<mixed> $result
*/
public function __construct(private readonly Result $result)
{
parent::__construct();
}

public function getResult(): Result
{
return $this->result;
}
}
2 changes: 1 addition & 1 deletion src/Application/Bus/CommandQueuer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use CloudCreativity\Modules\Contracts\Bus\CommandQueuer as ICommandQueuer;
use CloudCreativity\Modules\Contracts\Messaging\Command;

class CommandQueuer implements ICommandQueuer
abstract class CommandQueuer implements ICommandQueuer
{
public function __construct(private readonly Queue $queue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use CloudCreativity\Modules\Contracts\Domain\Events\DomainEvent;
use CloudCreativity\Modules\Contracts\Domain\Events\OccursImmediately;

class DeferredDispatcher extends Dispatcher implements IDeferredDispatcher
abstract class DeferredDispatcher extends Dispatcher implements IDeferredDispatcher
{
/**
* @var array<DomainEvent>
Expand Down
2 changes: 1 addition & 1 deletion src/Application/DomainEventDispatching/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use Psr\Container\ContainerInterface;
use ReflectionClass;

class Dispatcher implements DomainEventDispatcher
abstract class Dispatcher implements DomainEventDispatcher
{
private readonly IListenerContainer $listeners;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;

class UnitOfWorkAwareDispatcher extends Dispatcher
abstract class UnitOfWorkAwareDispatcher extends Dispatcher
{
public function __construct(
private readonly UnitOfWorkManager $unitOfWorkManager,
Expand Down
3 changes: 2 additions & 1 deletion src/Bus/BusException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Contracts\Bus\BusException as IBusException;
use RuntimeException;

class BusException extends RuntimeException
final class BusException extends RuntimeException implements IBusException
{
}
2 changes: 1 addition & 1 deletion src/Bus/CommandDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Psr\Container\ContainerInterface;
use ReflectionClass;

class CommandDispatcher implements ICommandDispatcher
abstract class CommandDispatcher implements ICommandDispatcher
{
private readonly ICommandHandlerContainer $handlers;

Expand Down
2 changes: 1 addition & 1 deletion src/Bus/InboundEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use CloudCreativity\Modules\Toolkit\Pipeline\Through;
use Psr\Container\ContainerInterface;

class InboundEventDispatcher implements IInboundEventDispatcher
abstract class InboundEventDispatcher implements IInboundEventDispatcher
{
private readonly IEventHandlerContainer $handlers;

Expand Down
2 changes: 1 addition & 1 deletion src/Bus/QueryDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Psr\Container\ContainerInterface;
use ReflectionClass;

class QueryDispatcher implements IQueryDispatcher
abstract class QueryDispatcher implements IQueryDispatcher
{
private readonly IQueryHandlerContainer $handlers;

Expand Down
19 changes: 19 additions & 0 deletions src/Contracts/Application/ApplicationException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* Copyright 2026 Cloud Creativity Limited
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/

declare(strict_types=1);

namespace CloudCreativity\Modules\Contracts\Application;

use Throwable;

interface ApplicationException extends Throwable
{
}
19 changes: 19 additions & 0 deletions src/Contracts/Bus/BusException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* Copyright 2026 Cloud Creativity Limited
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/

declare(strict_types=1);

namespace CloudCreativity\Modules\Contracts\Bus;

use Throwable;

interface BusException extends Throwable
{
}
19 changes: 19 additions & 0 deletions src/Contracts/Infrastructure/InfrastructureException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* Copyright 2026 Cloud Creativity Limited
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/

declare(strict_types=1);

namespace CloudCreativity\Modules\Contracts\Infrastructure;

use Throwable;

interface InfrastructureException extends Throwable
{
}
19 changes: 19 additions & 0 deletions src/Contracts/Toolkit/ContractException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* Copyright 2026 Cloud Creativity Limited
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/

declare(strict_types=1);

namespace CloudCreativity\Modules\Contracts\Toolkit;

use Throwable;

interface ContractException extends Throwable
{
}
23 changes: 23 additions & 0 deletions src/Contracts/Toolkit/Result/FailedResultException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/*
* Copyright 2026 Cloud Creativity Limited
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/

declare(strict_types=1);

namespace CloudCreativity\Modules\Contracts\Toolkit\Result;

use Throwable;

interface FailedResultException extends Throwable
{
/**
* @return Result<mixed>
*/
public function getResult(): Result;
}
3 changes: 2 additions & 1 deletion src/Infrastructure/InfrastructureException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

namespace CloudCreativity\Modules\Infrastructure;

use CloudCreativity\Modules\Contracts\Infrastructure\InfrastructureException as IInfrastructureException;
use RuntimeException;

class InfrastructureException extends RuntimeException
final class InfrastructureException extends RuntimeException implements IInfrastructureException
{
}
2 changes: 1 addition & 1 deletion src/Infrastructure/OutboundEventBus/ClosurePublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Psr\Container\ContainerInterface;
use ReflectionClass;

class ClosurePublisher implements OutboundEventPublisher
abstract class ClosurePublisher implements OutboundEventPublisher
{
private readonly ?IPipeContainer $middleware;

Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/OutboundEventBus/ComponentPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Psr\Container\ContainerInterface;
use ReflectionClass;

class ComponentPublisher implements OutboundEventPublisher
abstract class ComponentPublisher implements OutboundEventPublisher
{
private readonly IPublisherHandlerContainer $handlers;

Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Queue/ClosureQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Psr\Container\ContainerInterface;
use ReflectionClass;

class ClosureQueue implements Queue
abstract class ClosureQueue implements Queue
{
private readonly ?IPipeContainer $middleware;

Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Queue/ComponentQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Psr\Container\ContainerInterface;
use ReflectionClass;

class ComponentQueue implements Queue
abstract class ComponentQueue implements Queue
{
private readonly IEnqueuerContainer $enqueuers;

Expand Down
2 changes: 1 addition & 1 deletion src/Testing/FakeDomainEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @implements ArrayAccess<int, DomainEvent>
* @implements IteratorAggregate<int, DomainEvent>
*/
class FakeDomainEventDispatcher implements DomainEventDispatcher, Countable, ArrayAccess, IteratorAggregate
abstract class FakeDomainEventDispatcher implements DomainEventDispatcher, Countable, ArrayAccess, IteratorAggregate
{
/**
* @var list<DomainEvent>
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/FakeOutboundEventPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @implements ArrayAccess<int, IntegrationEvent>
* @implements IteratorAggregate<int, IntegrationEvent>
*/
class FakeOutboundEventPublisher implements OutboundEventPublisher, Countable, ArrayAccess, IteratorAggregate
abstract class FakeOutboundEventPublisher implements OutboundEventPublisher, Countable, ArrayAccess, IteratorAggregate
{
/**
* @var list<IntegrationEvent>
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/FakeQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @implements ArrayAccess<int, Command>
* @implements IteratorAggregate<int, Command>
*/
class FakeQueue implements Queue, Countable, ArrayAccess, IteratorAggregate
abstract class FakeQueue implements Queue, Countable, ArrayAccess, IteratorAggregate
{
/**
* @var list<Command>
Expand Down
3 changes: 2 additions & 1 deletion src/Toolkit/ContractException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

namespace CloudCreativity\Modules\Toolkit;

use CloudCreativity\Modules\Contracts\Toolkit\ContractException as IContractException;
use LogicException;

class ContractException extends LogicException
final class ContractException extends LogicException implements IContractException
{
}
2 changes: 1 addition & 1 deletion src/Toolkit/Result/ContextualResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use CloudCreativity\Modules\Contracts\Toolkit\Result\Error;
use CloudCreativity\Modules\Contracts\Toolkit\Result\Result;

readonly class ContextualResult implements Contextual
final readonly class ContextualResult implements Contextual
{
/**
* @param Result<mixed> $result
Expand Down
3 changes: 2 additions & 1 deletion src/Toolkit/Result/FailedResultException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@

namespace CloudCreativity\Modules\Toolkit\Result;

use CloudCreativity\Modules\Contracts\Toolkit\Result\FailedResultException as IFailedResultException;
use CloudCreativity\Modules\Contracts\Toolkit\Result\Result;
use RuntimeException;
use Throwable;

use function CloudCreativity\Modules\Toolkit\enum_string;

class FailedResultException extends RuntimeException
final class FailedResultException extends RuntimeException implements IFailedResultException
{
/**
* @param Result<mixed> $result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use CloudCreativity\Modules\Testing\FakeContainer;
use PHPUnit\Framework\TestCase;

class MathDomainEventDispatcherTest extends TestCase
final class MathDomainEventDispatcherTest extends TestCase
{
public function test(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Bus/MathCommandBusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use CloudCreativity\Modules\Testing\FakeContainer;
use PHPUnit\Framework\TestCase;

class MathCommandBusTest extends TestCase
final class MathCommandBusTest extends TestCase
{
public function test(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Bus/MathEventBusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use CloudCreativity\Modules\Testing\FakeContainer;
use PHPUnit\Framework\TestCase;

class MathEventBusTest extends TestCase
final class MathEventBusTest extends TestCase
{
public function test(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Bus/MathQueryBusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use CloudCreativity\Modules\Testing\FakeContainer;
use PHPUnit\Framework\TestCase;

class MathQueryBusTest extends TestCase
final class MathQueryBusTest extends TestCase
{
public function test(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use CloudCreativity\Modules\Tests\Integration\Bus\NumbersSubtracted;
use PHPUnit\Framework\TestCase;

class MathEventPublisherTest extends TestCase
final class MathEventPublisherTest extends TestCase
{
public function test(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use CloudCreativity\Modules\Tests\Integration\Bus\NumbersAdded;
use PHPUnit\Framework\TestCase;

class TestClosurePublisherTest extends TestCase
final class TestClosurePublisherTest extends TestCase
{
public function test(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Infrastructure/Queue/MathQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use CloudCreativity\Modules\Tests\Integration\Bus\MultiplyCommand;
use PHPUnit\Framework\TestCase;

class MathQueueTest extends TestCase
final class MathQueueTest extends TestCase
{
public function test(): void
{
Expand Down
Loading
Loading