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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class AcmeBlamableProvider implements BlamableProviderInterface
return $this->username;
}

public function getChangedAt(): \DateTimeInterface
public function getChangedAt(): \DateTime
{
return new \DateTimeImmutable();
}
Expand All @@ -152,10 +152,10 @@ class MyEntity implements BlamableInterface
private ?string $updated_by = null;

#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private ?\DateTimeInterface $updated_at = null;
private ?\DateTime $updated_at = null;

#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private ?\DateTimeInterface $created_at = null;
private ?\DateTime $created_at = null;

public function setUpdatedBy(string $by): static
{
Expand All @@ -164,14 +164,14 @@ class MyEntity implements BlamableInterface
return $this;
}

public function setUpdatedAt(\DateTimeInterface $at): static
public function setUpdatedAt(\DateTime $at): static
{
$this->updated_at = $at;

return $this;
}

public function setCreatedAt(\DateTimeInterface $at): static
public function setCreatedAt(\DateTime $at): static
{
$this->created_at = $at;

Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"hostnet/phpcs-tool": "^9.1.0",
"phpunit/phpunit": "^9.5.6"
},
"conflict": {
"hostnet/entity-plugin-lib": "<4.1.0"
},
"autoload": {
"psr-4": {
"Hostnet\\Component\\EntityBlamable\\": "src/"
Expand Down
4 changes: 2 additions & 2 deletions src/BlamableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface BlamableInterface
{
public function setUpdatedBy(string $by): static;

public function setUpdatedAt(\DateTimeInterface $at): static;
public function setUpdatedAt(\DateTime $at): static;

public function setCreatedAt(\DateTimeInterface $at): static;
public function setCreatedAt(\DateTime $at): static;
}
2 changes: 1 addition & 1 deletion src/Provider/BlamableProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ interface BlamableProviderInterface
{
public function getUpdatedBy(): string;

public function getChangedAt(): \DateTimeInterface;
public function getChangedAt(): \DateTime;
}
14 changes: 7 additions & 7 deletions test/Listener/EntityWithAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#[Blamable]
class EntityWithAttribute implements BlamableInterface
{
private ?\DateTimeInterface $created_at = null;
private ?\DateTime $created_at = null;

private ?string $updated_by = null;
private ?\DateTimeInterface $updated_at = null;
private ?string $updated_by = null;
private ?\DateTime $updated_at = null;

public function setUpdatedBy(string $by): static
{
Expand All @@ -29,26 +29,26 @@ public function getUpdatedBy(): ?string
return $this->updated_by;
}

public function setUpdatedAt(\DateTimeInterface $at): static
public function setUpdatedAt(\DateTime $at): static
{
$this->updated_at = $at;

return $this;
}

public function getUpdatedAt(): ?\DateTimeInterface
public function getUpdatedAt(): ?\DateTime
{
return $this->updated_at;
}

public function setCreatedAt(\DateTimeInterface $at): static
public function setCreatedAt(\DateTime $at): static
{
$this->created_at = $at;

return $this;
}

public function getCreatedAt(): ?\DateTimeInterface
public function getCreatedAt(): ?\DateTime
{
return $this->created_at;
}
Expand Down
14 changes: 7 additions & 7 deletions test/Listener/EntityWithInterfaceOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

class EntityWithInterfaceOnly implements BlamableInterface
{
private ?\DateTimeInterface $created_at = null;
private ?\DateTime $created_at = null;

private ?string $updated_by = null;
private ?\DateTimeInterface $updated_at = null;
private ?string $updated_by = null;
private ?\DateTime $updated_at = null;

public function setUpdatedBy(string $by): static
{
Expand All @@ -27,26 +27,26 @@ public function getUpdatedBy(): ?string
return $this->updated_by;
}

public function setUpdatedAt(\DateTimeInterface $at): static
public function setUpdatedAt(\DateTime $at): static
{
$this->updated_at = $at;

return $this;
}

public function getUpdatedAt(): ?\DateTimeInterface
public function getUpdatedAt(): ?\DateTime
{
return $this->updated_at;
}

public function setCreatedAt(\DateTimeInterface $at): static
public function setCreatedAt(\DateTime $at): static
{
$this->created_at = $at;

return $this;
}

public function getCreatedAt(): ?\DateTimeInterface
public function getCreatedAt(): ?\DateTime
{
return $this->created_at;
}
Expand Down
Loading