diff --git a/src/Collection/ICollection.php b/src/Collection/ICollection.php index 348ec78c..c3a76455 100644 --- a/src/Collection/ICollection.php +++ b/src/Collection/ICollection.php @@ -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; /** diff --git a/src/Entity/AbstractEntity.php b/src/Entity/AbstractEntity.php index 4bd14881..284022f3 100644 --- a/src/Entity/AbstractEntity.php +++ b/src/Entity/AbstractEntity.php @@ -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; @@ -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; } diff --git a/src/Entity/IEntity.php b/src/Entity/IEntity.php index 6930380c..7d7640d0 100644 --- a/src/Entity/IEntity.php +++ b/src/Entity/IEntity.php @@ -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; /** diff --git a/src/Repository/IRepository.php b/src/Repository/IRepository.php index 5ce9decc..fb096242 100644 --- a/src/Repository/IRepository.php +++ b/src/Repository/IRepository.php @@ -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; /** diff --git a/src/Repository/Repository.php b/src/Repository/Repository.php index 37aa0cda..a21dd587 100644 --- a/src/Repository/Repository.php +++ b/src/Repository/Repository.php @@ -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); @@ -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)) {