Skip to content

Commit

Permalink
Merge pull request #538 from patchlevel/move-trace-feature
Browse files Browse the repository at this point in the history
move trace feature into debug namespace
  • Loading branch information
DavidBadura authored Mar 13, 2024
2 parents a15c78b + 0cec9f6 commit 1e013ed
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 32 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ help:
vendor: composer.lock
composer install

vendor-tools: tools/composer.lock
cd tools && composer install

.PHONY: cs-check
cs-check: vendor ## run phpcs
vendor/bin/phpcs
Expand Down Expand Up @@ -49,11 +52,11 @@ infection: vendor
vendor/bin/infection

.PHONY: deptrac
deptrac: tools/vendor ## run deptrac
deptrac: vendor-tools ## run deptrac
cd tools && ./vendor/bin/deptrac -c ../deptrac.yaml

.PHONY: deptrac-baseline
deptrac-baseline: tools/vendor ## run deptrac and update baseline
deptrac-baseline: vendor-tools ## run deptrac and update baseline
cd tools && ./vendor/bin/deptrac -c ../deptrac.yaml --formatter=baseline --output=../deptrac-baseline.yaml

.PHONY: static
Expand Down
7 changes: 0 additions & 7 deletions deptrac-baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,3 @@ deptrac:
- Patchlevel\EventSourcing\Subscription\RunMode
Patchlevel\EventSourcing\Attribute\Subscriber:
- Patchlevel\EventSourcing\Subscription\RunMode
Patchlevel\EventSourcing\Repository\MessageDecorator\TraceHeader:
- Patchlevel\EventSourcing\Attribute\Header
Patchlevel\EventSourcing\Subscription\Subscriber\TraceableSubscriberAccessor:
- Patchlevel\EventSourcing\Repository\MessageDecorator\Trace
- Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack
Patchlevel\EventSourcing\Subscription\Subscriber\TraceableSubscriberAccessorRepository:
- Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack
9 changes: 9 additions & 0 deletions deptrac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ deptrac:
collectors:
- type: directory
value: src/Console/.*
- name: Debug
collectors:
- type: directory
value: src/Debug/.*
- name: EventBus
collectors:
- type: directory
Expand Down Expand Up @@ -100,6 +104,11 @@ deptrac:
- Serializer
- Store
- Subscription
Debug:
- Attribute
- EventBus
- Repository
- Subscription
EventBus:
- Aggregate
- Attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Repository\MessageDecorator;
namespace Patchlevel\EventSourcing\Debug\Trace;

/** @experimental */
final class Trace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Repository\MessageDecorator;
namespace Patchlevel\EventSourcing\Debug\Trace;

use Patchlevel\EventSourcing\EventBus\Message;
use Patchlevel\EventSourcing\Repository\MessageDecorator\MessageDecorator;

use function array_map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Repository\MessageDecorator;
namespace Patchlevel\EventSourcing\Debug\Trace;

use Patchlevel\EventSourcing\Attribute\Header;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Repository\MessageDecorator;
namespace Patchlevel\EventSourcing\Debug\Trace;

use function array_values;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Subscription\Subscriber;
namespace Patchlevel\EventSourcing\Debug\Trace;

use Closure;
use Patchlevel\EventSourcing\EventBus\Message;
use Patchlevel\EventSourcing\Repository\MessageDecorator\Trace;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack;
use Patchlevel\EventSourcing\Subscription\RunMode;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberAccessor;

use function array_map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Subscription\Subscriber;
namespace Patchlevel\EventSourcing\Debug\Trace;

use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberAccessorRepository;

use function array_values;

Expand Down
8 changes: 4 additions & 4 deletions tests/Integration/Subscription/SubscriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
use DateTimeImmutable;
use Doctrine\DBAL\Connection;
use Patchlevel\EventSourcing\Clock\FrozenClock;
use Patchlevel\EventSourcing\Debug\Trace\TraceableSubscriberAccessorRepository;
use Patchlevel\EventSourcing\Debug\Trace\TraceDecorator;
use Patchlevel\EventSourcing\Debug\Trace\TraceHeader;
use Patchlevel\EventSourcing\Debug\Trace\TraceStack;
use Patchlevel\EventSourcing\EventBus\DefaultEventBus;
use Patchlevel\EventSourcing\EventBus\Message;
use Patchlevel\EventSourcing\EventBus\Serializer\DefaultHeadersSerializer;
use Patchlevel\EventSourcing\Metadata\AggregateRoot\AggregateRootRegistry;
use Patchlevel\EventSourcing\Repository\DefaultRepositoryManager;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceDecorator;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceHeader;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack;
use Patchlevel\EventSourcing\Schema\ChainDoctrineSchemaConfigurator;
use Patchlevel\EventSourcing\Schema\DoctrineSchemaDirector;
use Patchlevel\EventSourcing\Serializer\DefaultEventSerializer;
Expand All @@ -26,7 +27,6 @@
use Patchlevel\EventSourcing\Subscription\Status;
use Patchlevel\EventSourcing\Subscription\Store\DoctrineSubscriptionStore;
use Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessorRepository;
use Patchlevel\EventSourcing\Subscription\Subscriber\TraceableSubscriberAccessorRepository;
use Patchlevel\EventSourcing\Subscription\Subscription;
use Patchlevel\EventSourcing\Tests\DbalManager;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Aggregate\Profile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Tests\Unit\Repository\MessageDecorator;
namespace Patchlevel\EventSourcing\Tests\Unit\Debug\Trace;

use Patchlevel\EventSourcing\Debug\Trace\Trace;
use Patchlevel\EventSourcing\Debug\Trace\TraceDecorator;
use Patchlevel\EventSourcing\Debug\Trace\TraceHeader;
use Patchlevel\EventSourcing\Debug\Trace\TraceStack;
use Patchlevel\EventSourcing\EventBus\HeaderNotFound;
use Patchlevel\EventSourcing\EventBus\Message;
use Patchlevel\EventSourcing\Repository\MessageDecorator\Trace;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceDecorator;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceHeader;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use stdClass;

/** @covers \Patchlevel\EventSourcing\Repository\MessageDecorator\TraceDecorator */
/** @covers \Patchlevel\EventSourcing\Debug\Trace\TraceDecorator */
final class TraceDecoratorTest extends TestCase
{
use ProphecyTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace Patchlevel\EventSourcing\Tests\Unit\Repository\MessageDecorator;
namespace Patchlevel\EventSourcing\Tests\Unit\Debug\Trace;

use Patchlevel\EventSourcing\Repository\MessageDecorator\Trace;
use Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack;
use Patchlevel\EventSourcing\Debug\Trace\Trace;
use Patchlevel\EventSourcing\Debug\Trace\TraceStack;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

/** @covers \Patchlevel\EventSourcing\Repository\MessageDecorator\TraceStack */
/** @covers \Patchlevel\EventSourcing\Debug\Trace\TraceStack */
final class TraceStackTest extends TestCase
{
use ProphecyTrait;
Expand Down

0 comments on commit 1e013ed

Please sign in to comment.