Skip to content

Commit

Permalink
Add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Oct 1, 2023
1 parent dd315cc commit 3004daf
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 39 deletions.
8 changes: 1 addition & 7 deletions src/EventListener/ORM/SortableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,8 @@

final class SortableListener implements EventSubscriber
{
/**
* @var PropertyAccessor
*/
private $propertyAccessor;
private PropertyAccessor $propertyAccessor;

/**
* @param PropertyAccessor $propertyAccessor
*/
public function __construct(PropertyAccessor $propertyAccessor = null)
{
if (null === $propertyAccessor) {
Expand Down
5 changes: 1 addition & 4 deletions src/EventListener/ORM/TablePrefixEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

final class TablePrefixEventListener implements EventSubscriber
{
/**
* @var string|null
*/
private $prefix;
private ?string $prefix;

public function __construct(?string $prefix)
{
Expand Down
8 changes: 1 addition & 7 deletions src/EventListener/ORM/UniqueActiveListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@

final class UniqueActiveListener implements EventSubscriber
{
/**
* @var PropertyAccessor
*/
private $propertyAccessor;
private PropertyAccessor $propertyAccessor;

/**
* @param PropertyAccessor $propertyAccessor
*/
public function __construct(PropertyAccessor $propertyAccessor = null)
{
if (null === $propertyAccessor) {
Expand Down
5 changes: 1 addition & 4 deletions src/Model/Traits/ConfirmableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

trait ConfirmableTrait
{
/**
* @var DateTime|null
*/
protected $confirmedAt;
protected ?DateTime $confirmedAt = null;

public function getConfirmedAt(): ?DateTime
{
Expand Down
5 changes: 1 addition & 4 deletions src/Model/Traits/DeleteableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

trait DeleteableTrait
{
/**
* @var DateTime|null
*/
protected $deletedAt;
protected ?DateTime $deletedAt = null;

public function getDeletedAt(): ?DateTime
{
Expand Down
12 changes: 3 additions & 9 deletions src/Model/Traits/LifecycleDateTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@

trait LifecycleDateTimeTrait
{
/**
* @var DateTime|null
*/
protected $createdAt;

/**
* @var DateTime|null
*/
protected $updatedAt;
protected ?DateTime $createdAt = null;

protected ?DateTime $updatedAt = null;

public function setCreatedAt(?DateTime $createdAt): void
{
Expand Down
5 changes: 1 addition & 4 deletions src/Model/Traits/SortableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@

trait SortableTrait
{
/**
* @var int|null
*/
protected $position;
protected ?int $position = null;

public function setPosition(?int $position): void
{
Expand Down

0 comments on commit 3004daf

Please sign in to comment.