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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ 8.2, 8.3, 8.4, 8.5 ]
php: [ 8.4, 8.5 ]

steps:
- name: Checkout Code
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. This projec

### Removed

- Dropped support for PHP 8.2 and 8.3. The minimum supported version is now PHP 8.4.
- Removed the deprecated `contains()` method from the `ListOfErrors` interface. Use `any()` instead.
- The `first()` method on the `ListOfErrors` interface no longer accepts arguments. Use `find()` instead.

Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@
},
{
"name": "Christopher Gammie",
"email": "contact@gammie.co.uk"
"email": "chris@cloudcreativity.co.uk"
}
],
"require": {
"php": "^8.2",
"php": "^8.4",
"ext-json": "*",
"psr/container": "^2.0",
"psr/log": "^2.0 || ^3.0",
"ramsey/uuid": "^4.7",
"symfony/polyfill-php84": "^1.33",
"symfony/polyfill-php85": "^1.33"
},
"require-dev": {
Expand Down
5 changes: 3 additions & 2 deletions docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
Install the package into your application using Composer:

```bash
composer config minimum-stability
composer require cloudcreativity/ddd-modules:^5.0
composer config minimum-stability dev
composer require cloudcreativity/ddd-modules:^6.0
```

## Versions

| DDD Modules | PHP |
|-------------|--------|
| `6.x` | `^8.4` |
| `5.x` | `^8.2` |
| `4.x` | `^8.2` |
| `3.x` | `^8.1` |
Expand Down
3 changes: 3 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"preset": "psr12",
"rules": {
"array_indentation": true,
"array_syntax": true,
"assign_null_coalescing_to_coalesce_equal": true,
"binary_operator_spaces": true,
"clean_namespace": true,
"declare_strict_types": true,
"list_syntax": true,
"new_expression_parentheses": true,
"no_empty_phpdoc": true,
"no_superfluous_elseif": true,
"no_superfluous_phpdoc_tags": {
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/LogMessageDispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __invoke(Message $message, Closure $next): ?Result
$this->logger->log(
$this->dispatchLevel,
"Bus dispatching {$name}.",
[$key => (new SanitizedMessage($message))->context()],
[$key => new SanitizedMessage($message)->context()],
);

$result = $next($message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __invoke(IntegrationEvent $event, Closure $next): void
$this->log->log(
$this->publishLevel,
"Publishing integration event {$name}.",
$context = ['event' => (new SanitizedMessage($event))->context()],
$context = ['event' => new SanitizedMessage($event)->context()],
);

$next($event);
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Queue/Middleware/LogPushedToQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __invoke(Command $command, Closure $next): null
$this->log->log(
$this->queueLevel,
"Queuing command {$name}.",
$context = ['command' => (new SanitizedMessage($command))->context()],
$context = ['command' => new SanitizedMessage($command)->context()],
);

$next($command);
Expand Down
2 changes: 1 addition & 1 deletion src/Toolkit/Result/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ public function withMeta(array|Meta $meta): self
*/
public function context(): array
{
return (new ContextualResult($this))->context();
return new ContextualResult($this)->context();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testWithDefaultLevels(): void

$this->assertSame($expected, $actual);
$this->assertEquals([
[LogLevel::DEBUG, "Bus dispatching {$name}.", ['command' => (new SanitizedMessage($this->message))->context()]],
[LogLevel::DEBUG, "Bus dispatching {$name}.", ['command' => new SanitizedMessage($this->message)->context()]],
[LogLevel::INFO, "Bus dispatched {$name}.", ['result' => $expected->context()]],
], $this->logs);
}
Expand All @@ -87,7 +87,7 @@ public function testWithCustomLevels(): void

$this->assertSame($expected, $actual);
$this->assertEquals([
[LogLevel::NOTICE, "Bus dispatching {$name}.", ['command' => (new SanitizedMessage($this->message))->context()]],
[LogLevel::NOTICE, "Bus dispatching {$name}.", ['command' => new SanitizedMessage($this->message)->context()]],
[LogLevel::WARNING, "Bus dispatched {$name}.", ['result' => $expected->context()]],
], $this->logs);
}
Expand All @@ -107,7 +107,7 @@ public function testItLogsAfterTheNextClosureIsInvoked(): void
} catch (LogicException $ex) {
$this->assertSame($expected, $ex);
$this->assertEquals([
[LogLevel::DEBUG, "Bus dispatching {$name}.", ['query' => (new SanitizedMessage($message))->context()]],
[LogLevel::DEBUG, "Bus dispatching {$name}.", ['query' => new SanitizedMessage($message)->context()]],
], $this->logs);
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Toolkit/Pipeline/PipelineBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function test(): void
$stages = ['strtoupper', 'strtolower'],
);

$actual = (new PipelineBuilder())
$actual = new PipelineBuilder()
->add($stages[0])
->add($stages[1])
->build($processor);
Expand All @@ -47,7 +47,7 @@ public function testServiceString(): void
'strtolower',
]);

$actual = (new PipelineBuilder($container))
$actual = new PipelineBuilder($container)
->through(['strtoupper', 'SomeService', 'strtolower'])
->build($processor);

Expand All @@ -61,7 +61,7 @@ public function testServiceStringWithoutContainer(): void
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Cannot use a string pipe name without a pipe container.');

(new PipelineBuilder())
new PipelineBuilder()
->add('strtoupper')
->add('SomeService')
->add('strtolower')
Expand Down
Loading