Skip to content

Commit

Permalink
php84 deprecation fixes (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubomikita authored Nov 29, 2024
1 parent 7365575 commit 72b4eeb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Collection/ICollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function resetOrderBy(): ICollection;
* Limits number of rows.
* @return static
*/
public function limitBy(int $limit, int $offset = null): ICollection;
public function limitBy(int $limit, ?int $offset = null): ICollection;


/**
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getMetadata(): EntityMetadata
}


public function isModified(string $name = null): bool
public function isModified(?string $name = null): bool
{
if ($name === null) {
return (bool) $this->modified;
Expand All @@ -72,7 +72,7 @@ public function isModified(string $name = null): bool
}


public function setAsModified(string $name = null): void
public function setAsModified(?string $name = null): void
{
$this->modified[$name] = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/IEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public function getMetadata(): EntityMetadata;
/**
* Returns true if the entity is modified or the column $name is modified.
*/
public function isModified(string $name = null): bool;
public function isModified(?string $name = null): bool;


/**
* Sets the entity or the column as modified.
*/
public function setAsModified(string $name = null): void;
public function setAsModified(?string $name = null): void;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/IRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function getEntityClassNames(): array;
* Returns entity metadata.
* @param string|null $entityClass for STI (must extends base class)
*/
public function getEntityMetadata(string $entityClass = null): EntityMetadata;
public function getEntityMetadata(?string $entityClass = null): EntityMetadata;


/**
Expand Down
4 changes: 2 additions & 2 deletions src/Repository/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ abstract class Repository implements IRepository
* @param IMapper $mapper
* @param IDependencyProvider $dependencyProvider
*/
public function __construct(IMapper $mapper, IDependencyProvider $dependencyProvider = null)
public function __construct(IMapper $mapper, ?IDependencyProvider $dependencyProvider = null)
{
$this->mapper = $mapper;
$this->mapper->setRepository($this);
Expand Down Expand Up @@ -368,7 +368,7 @@ public function hydrateEntity(array $data): ?IEntity


/** {@inheritdoc} */
public function getEntityMetadata(string $entityClass = null): EntityMetadata
public function getEntityMetadata(?string $entityClass = null): EntityMetadata
{
$classNames = static::getEntityClassNames();
if ($entityClass !== null && !in_array($entityClass, $classNames, true)) {
Expand Down

0 comments on commit 72b4eeb

Please sign in to comment.