Skip to content

Commit

Permalink
Renames
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBadura committed Jan 5, 2024
1 parent 24087a1 commit f86a7b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/Projection/Projector/ProjectorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Patchlevel\EventSourcing\Metadata\Projector\AttributeProjectorMetadataFactory;
use Patchlevel\EventSourcing\Metadata\Projector\ProjectorMetadata;
use Patchlevel\EventSourcing\Metadata\Projector\ProjectorMetadataFactory;
use Patchlevel\EventSourcing\Projection\Projection\ProjectionId;

final class ProjectorHelper
{
Expand All @@ -26,11 +25,11 @@ public function version(object $projector): int
return $this->getProjectorMetadata($projector)->version;
}

public function projectionId(object $projector): ProjectionId
public function projectorId(object $projector): ProjectorId
{
$metadata = $this->getProjectorMetadata($projector);

return new ProjectionId($metadata->name, $metadata->version);
return new ProjectorId($metadata->name, $metadata->version);
}

private function getProjectorMetadata(object $projector): ProjectorMetadata
Expand Down
9 changes: 4 additions & 5 deletions src/Projection/Projector/ProjectorUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Patchlevel\EventSourcing\Metadata\Projector\AttributeProjectorMetadataFactory;
use Patchlevel\EventSourcing\Metadata\Projector\ProjectorMetadataFactory;
use Patchlevel\EventSourcing\Projection\Projection\ProjectionId;

trait ProjectorUtil
{
Expand All @@ -31,18 +30,18 @@ private function getProjectorHelper(): ProjectorHelper
return new ProjectorHelper(self::metadataFactory());
}

private function projectionName(): string
private function projectorName(): string
{
return $this->getProjectorHelper()->name($this);
}

private function projectionVersion(): int
private function projectorVersion(): int
{
return $this->getProjectorHelper()->version($this);
}

private function projectionId(): ProjectionId
private function projectorId(): ProjectorId
{
return $this->getProjectorHelper()->projectionId($this);
return $this->getProjectorHelper()->projectorId($this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ private function tableName(): string
{
return sprintf(
'projection_%s_%s',
$this->projectionName(),
$this->projectionVersion(),
$this->projectorName(),
$this->projectorVersion(),
);
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Projection/Projector/ProjectorHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ class {

$helper = new ProjectorHelper();

self::assertEquals(new ProjectionId('dummy', 1), $helper->projectionId($projector));
self::assertEquals(new ProjectionId('dummy', 1), $helper->projectorId($projector));
}
}

0 comments on commit f86a7b7

Please sign in to comment.