Skip to content

Commit cc6494d

Browse files
committed
move files in new namespaces
1 parent 5b32b5f commit cc6494d

35 files changed

Lines changed: 101 additions & 93 deletions

baseline.xml

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,7 @@
3333
<code><![CDATA[setPrimaryKey]]></code>
3434
</DeprecatedMethod>
3535
</file>
36-
<file src="src/DCB/AttributeEventTagExtractor.php">
37-
<RiskyTruthyFalsyComparison>
38-
<code><![CDATA[$attribute->hash]]></code>
39-
<code><![CDATA[$attribute->prefix]]></code>
40-
</RiskyTruthyFalsyComparison>
41-
</file>
42-
<file src="src/DCB/CompositeProjection.php">
43-
<MissingClosureReturnType>
44-
<code><![CDATA[static function (Projection $projection) {]]></code>
45-
</MissingClosureReturnType>
46-
<MixedAssignment>
47-
<code><![CDATA[$state[$name]]]></code>
48-
</MixedAssignment>
49-
</file>
50-
<file src="src/DCB/DecisionModel.php">
36+
<file src="src/DecisionModel/DecisionModel.php">
5137
<ImplementedReturnTypeMismatch>
5238
<code><![CDATA[T[TKey]]]></code>
5339
</ImplementedReturnTypeMismatch>
@@ -97,6 +83,19 @@
9783
<code><![CDATA[require_once $file]]></code>
9884
</UnresolvableInclude>
9985
</file>
86+
<file src="src/Projection/BasicProjection.php">
87+
<MixedReturnStatement>
88+
<code><![CDATA[$this->{$applyMethods[$event::class]}($state, $event)]]></code>
89+
</MixedReturnStatement>
90+
</file>
91+
<file src="src/Projection/CompositeProjection.php">
92+
<MissingClosureReturnType>
93+
<code><![CDATA[static function (Projection $projection) {]]></code>
94+
</MissingClosureReturnType>
95+
<MixedAssignment>
96+
<code><![CDATA[$state[$name]]]></code>
97+
</MixedAssignment>
98+
</file>
10099
<file src="src/QueryBus/ServiceHandlerProvider.php">
101100
<MixedArgument>
102101
<code><![CDATA[$service::{$handler->method}(...)]]></code>
@@ -123,12 +122,13 @@
123122
<code><![CDATA[getName]]></code>
124123
</InternalMethod>
125124
</file>
126-
<file src="src/Serializer/Normalizer/IdNormalizer.php">
127-
<PropertyTypeCoercion>
128-
<code><![CDATA[$type->getClassName()]]></code>
129-
</PropertyTypeCoercion>
125+
<file src="src/Serializer/AttributeEventTagExtractor.php">
126+
<RiskyTruthyFalsyComparison>
127+
<code><![CDATA[$attribute->hash]]></code>
128+
<code><![CDATA[$attribute->prefix]]></code>
129+
</RiskyTruthyFalsyComparison>
130130
</file>
131-
<file src="src/Serializer/Normalizer/StringableNormalizer.php">
131+
<file src="src/Serializer/Normalizer/IdNormalizer.php">
132132
<PropertyTypeCoercion>
133133
<code><![CDATA[$type->getClassName()]]></code>
134134
</PropertyTypeCoercion>
@@ -184,14 +184,6 @@
184184
<code><![CDATA[json_decode($data['tags'], true, 512, JSON_THROW_ON_ERROR)]]></code>
185185
</MixedArgument>
186186
</file>
187-
<file src="src/Subscription/Engine/DefaultSubscriptionEngine.php">
188-
<DeprecatedInterface>
189-
<code><![CDATA[SubscriberAccessor|null]]></code>
190-
</DeprecatedInterface>
191-
<DeprecatedMethod>
192-
<code><![CDATA[realSubscriber]]></code>
193-
</DeprecatedMethod>
194-
</file>
195187
<file src="src/Subscription/Engine/GapResolverStoreMessageLoader.php">
196188
<InvalidReturnType>
197189
<code><![CDATA[Generator<int, Message>]]></code>

deptrac.yaml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ deptrac:
2929
collectors:
3030
- type: directory
3131
value: src/Cryptography/.*
32+
- name: DecisionModel
33+
collectors:
34+
- type: directory
35+
value: src/DecisionModel/.*
3236
- name: EventBus
3337
collectors:
3438
- type: directory
@@ -72,6 +76,10 @@ deptrac:
7276
value: MetadataMessage
7377
- type: layer
7478
value: MetadataSubscriber
79+
- name: Projection
80+
collectors:
81+
- type: directory
82+
value: src/Projection/.*
7583
- name: QueryBus
7684
collectors:
7785
- type: directory
@@ -100,11 +108,6 @@ deptrac:
100108
collectors:
101109
- type: directory
102110
value: src/Subscription/.*
103-
- name: Test
104-
collectors:
105-
- type: directory
106-
value: src/Test/.*
107-
108111
ruleset:
109112
Aggregate:
110113
- Attribute
@@ -118,6 +121,7 @@ deptrac:
118121
- Identifier
119122
- MetadataAggregate
120123
- Repository
124+
- Store
121125
Console:
122126
- Aggregate
123127
- Message
@@ -130,11 +134,12 @@ deptrac:
130134
- Subscription
131135
Cryptography:
132136
- Schema
133-
Debug:
137+
DecisionModel:
134138
- Attribute
135139
- Message
136-
- Repository
137-
- Subscription
140+
- Projection
141+
- Serializer
142+
- Store
138143
EventBus:
139144
- Attribute
140145
- Message
@@ -161,16 +166,9 @@ deptrac:
161166
- Attribute
162167
- Metadata
163168
- Subscription
164-
Subscription:
165-
- Aggregate
169+
Projection:
166170
- Attribute
167-
- Clock
168-
- Identifier
169171
- Message
170-
- MetadataEvent
171-
- MetadataSubscriber
172-
- Repository
173-
- Schema
174172
- Store
175173
QueryBus:
176174
- Attribute
@@ -182,10 +180,12 @@ deptrac:
182180
- MetadataAggregate
183181
- MetadataEvent
184182
- EventBus
183+
- Serializer
185184
- Snapshot
186185
- Store
187186
Schema:
188187
Serializer:
188+
- Attribute
189189
- Cryptography
190190
- Identifier
191191
- MetadataEvent
@@ -200,6 +200,17 @@ deptrac:
200200
- Clock
201201
- Message
202202
- Metadata
203+
- MetadataEvent
203204
- Schema
204205
- Serializer
205-
Test:
206+
Subscription:
207+
- Aggregate
208+
- Attribute
209+
- Clock
210+
- Identifier
211+
- Message
212+
- MetadataEvent
213+
- MetadataSubscriber
214+
- Repository
215+
- Schema
216+
- Store

docs/pages/dynamic_consistency_boundary.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ Each projection:
149149
The first projection answers only whether the hotel already exists.
150150

151151
```php
152-
use Patchlevel\EventSourcing\Attribute\Apply;
153-
use Patchlevel\EventSourcing\DCB\BasicProjection;
152+
use Patchlevel\EventSourcing\Attribute\Apply;use Patchlevel\EventSourcing\Projection\BasicProjection;
154153

155154
final class HotelExists extends BasicProjection
156155
{
@@ -181,8 +180,7 @@ final class HotelExists extends BasicProjection
181180
The second projection counts the guests currently checked in.
182181

183182
```php
184-
use Patchlevel\EventSourcing\Attribute\Apply;
185-
use Patchlevel\EventSourcing\DCB\BasicProjection;
183+
use Patchlevel\EventSourcing\Attribute\Apply;use Patchlevel\EventSourcing\Projection\BasicProjection;
186184

187185
final class NumberOfGuestsInHotel extends BasicProjection
188186
{
@@ -219,8 +217,7 @@ final class NumberOfGuestsInHotel extends BasicProjection
219217
The third projection answers whether the given guest is already checked into this hotel.
220218

221219
```php
222-
use Patchlevel\EventSourcing\Attribute\Apply;
223-
use Patchlevel\EventSourcing\DCB\BasicProjection;
220+
use Patchlevel\EventSourcing\Attribute\Apply;use Patchlevel\EventSourcing\Projection\BasicProjection;
224221

225222
final class GuestAlreadyCheckedIn extends BasicProjection
226223
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Patchlevel\EventSourcing\DCB;
5+
namespace Patchlevel\EventSourcing\DecisionModel;
66

77
use ArrayAccess;
88
use LogicException;

src/DCB/DecisionModelBuilder.php renamed to src/DecisionModel/DecisionModelBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace Patchlevel\EventSourcing\DCB;
5+
namespace Patchlevel\EventSourcing\DecisionModel;
6+
7+
use Patchlevel\EventSourcing\Projection\Projection;
68

79
/** @experimental */
810
interface DecisionModelBuilder
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Patchlevel\EventSourcing\DCB;
5+
namespace Patchlevel\EventSourcing\DecisionModel;
66

77
use Patchlevel\EventSourcing\Store\AppendCondition;
88

src/DCB/StoreDecisionModelBuilder.php renamed to src/DecisionModel/StoreDecisionModelBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace Patchlevel\EventSourcing\DCB;
5+
namespace Patchlevel\EventSourcing\DecisionModel;
66

7+
use Patchlevel\EventSourcing\Projection\CompositeProjection;
8+
use Patchlevel\EventSourcing\Projection\Projection;
79
use Patchlevel\EventSourcing\Store\AppendCondition;
810
use Patchlevel\EventSourcing\Store\AppendStore;
911

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace Patchlevel\EventSourcing\DCB;
5+
namespace Patchlevel\EventSourcing\DecisionModel;
66

77
use Patchlevel\EventSourcing\Message\Message;
8+
use Patchlevel\EventSourcing\Serializer\AttributeEventTagExtractor;
9+
use Patchlevel\EventSourcing\Serializer\EventTagExtractor;
810
use Patchlevel\EventSourcing\Store\AppendCondition;
911
use Patchlevel\EventSourcing\Store\AppendStore;
1012
use Patchlevel\EventSourcing\Store\Header\StreamNameHeader;

src/Message/Translator/ExtractEventTagTranslator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Patchlevel\EventSourcing\Message\Translator;
66

7-
use Patchlevel\EventSourcing\DCB\AttributeEventTagExtractor;
8-
use Patchlevel\EventSourcing\DCB\EventTagExtractor;
97
use Patchlevel\EventSourcing\Message\Message;
8+
use Patchlevel\EventSourcing\Serializer\AttributeEventTagExtractor;
9+
use Patchlevel\EventSourcing\Serializer\EventTagExtractor;
1010
use Patchlevel\EventSourcing\Store\Header\TagsHeader;
1111

1212
/** @experimental */

src/DCB/ApplyMethodDetectionError.php renamed to src/Projection/ApplyMethodDetectionError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Patchlevel\EventSourcing\DCB;
5+
namespace Patchlevel\EventSourcing\Projection;
66

77
use RuntimeException;
88

0 commit comments

Comments
 (0)