Skip to content

Commit

Permalink
Merge pull request #691 from nextras/php84
Browse files Browse the repository at this point in the history
Add PHP 8.4 to CI/CD
  • Loading branch information
hrach authored Nov 9, 2024
2 parents e4e0fa5 + 020b4dc commit eec97f6
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
php-version: [ '8.1', '8.2', '8.3', '8.4' ]

steps:
- name: Checkout
Expand Down Expand Up @@ -58,13 +58,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
deps: [ 'lowest', 'newest' ]
exclude:
- php-version: '8.2'
deps: lowest
- php-version: '8.3'
deps: lowest
- php-version: '8.4'
deps: lowest
runs-on: ubuntu-latest

services:
Expand Down
7 changes: 3 additions & 4 deletions src/Collection/ArrayCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function resetOrderBy(): ICollection
}


public function limitBy(int $limit, int $offset = null): ICollection
public function limitBy(int $limit, int|null $offset = null): ICollection
{
$collection = clone $this;
$collection->collectionLimit = [$limit, $offset];
Expand Down Expand Up @@ -165,7 +165,7 @@ public function fetchAll(): array
}


public function fetchPairs(string $key = null, string $value = null): array
public function fetchPairs(string|null $key = null, string|null $value = null): array
{
return FetchPairsHelper::process($this->getIterator(), $key, $value);
}
Expand Down Expand Up @@ -232,10 +232,9 @@ public function toMemoryCollection(): MemoryCollection
}


public function setRelationshipMapper(IRelationshipMapper $mapper = null, IEntity $parent = null): ICollection
public function setRelationshipMapper(IRelationshipMapper|null $mapper): ICollection
{
$this->relationshipMapper = $mapper;
$this->relationshipParent = $parent;
return $this;
}

Expand Down
7 changes: 3 additions & 4 deletions src/Collection/DbalCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function resetOrderBy(): ICollection
}


public function limitBy(int $limit, int $offset = null): ICollection
public function limitBy(int $limit, int|null $offset = null): ICollection
{
$collection = clone $this;
$collection->queryBuilder->limitBy($limit, $offset);
Expand Down Expand Up @@ -170,7 +170,7 @@ public function fetchAll(): array
}


public function fetchPairs(string $key = null, string $value = null): array
public function fetchPairs(string|null $key = null, string|null $value = null): array
{
return FetchPairsHelper::process($this->getIterator(), $key, $value);
}
Expand Down Expand Up @@ -242,10 +242,9 @@ public function toMemoryCollection(): MemoryCollection
}


public function setRelationshipMapper(IRelationshipMapper $mapper = null, IEntity $parent = null): ICollection
public function setRelationshipMapper(IRelationshipMapper|null $mapper): ICollection
{
$this->relationshipMapper = $mapper;
$this->relationshipParent = $parent;
return $this;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Collection/EmptyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function resetOrderBy(): ICollection
}


public function limitBy(int $limit, int $offset = null): ICollection
public function limitBy(int $limit, int|null $offset = null): ICollection
{
return clone $this;
}
Expand All @@ -86,7 +86,7 @@ public function fetchAll(): array
}


public function fetchPairs(string $key = null, string $value = null): array
public function fetchPairs(string|null $key = null, string|null $value = null): array
{
return [];
}
Expand All @@ -98,7 +98,7 @@ public function getIterator(): Iterator
}


public function setRelationshipMapper(IRelationshipMapper $mapper = null, IEntity $parent = null): ICollection
public function setRelationshipMapper(IRelationshipMapper|null $mapper): ICollection
{
$this->relationshipMapper = $mapper;
return $this;
Expand Down
6 changes: 3 additions & 3 deletions src/Collection/HasManyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function resetOrderBy(): ICollection
}


public function limitBy(int $limit, int $offset = null): ICollection
public function limitBy(int $limit, int|null $offset = null): ICollection
{
$collection = clone $this;
$collection->storageCollection = $this->storageCollection->limitBy($limit, $offset);
Expand Down Expand Up @@ -153,7 +153,7 @@ public function fetchAll(): array
}


public function fetchPairs(string $key = null, string $value = null): array
public function fetchPairs(string|null $key = null, string|null $value = null): array
{
return FetchPairsHelper::process($this->getIterator(), $key, $value);
}
Expand Down Expand Up @@ -212,7 +212,7 @@ public function toMemoryCollection(): MemoryCollection
}


public function setRelationshipMapper(IRelationshipMapper $mapper = null): ICollection
public function setRelationshipMapper(IRelationshipMapper|null $mapper): ICollection
{
$this->storageCollection->setRelationshipMapper($mapper);
$this->inMemoryCollection->setRelationshipMapper($mapper);
Expand Down
6 changes: 3 additions & 3 deletions src/Collection/ICollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,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|null $offset = null): ICollection;


/**
Expand Down Expand Up @@ -189,7 +189,7 @@ public function fetchAll(): array;
* @param string|null $value value
* @return array<int|string, mixed>
*/
public function fetchPairs(?string $key = null, ?string $value = null): array;
public function fetchPairs(string|null $key = null, string|null $value = null): array;


/**
Expand All @@ -210,7 +210,7 @@ public function toMemoryCollection(): MemoryCollection;
* @return static
* @internal
*/
public function setRelationshipMapper(?IRelationshipMapper $mapper): ICollection;
public function setRelationshipMapper(IRelationshipMapper|null $mapper): 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|null $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|null $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 @@ -93,13 +93,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|null $name = null): bool;


/**
* Sets the entity or the column as modified.
*/
public function setAsModified(string $name = null): void;
public function setAsModified(string|null $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 @@ -71,7 +71,7 @@ public static function getEntityClassNames(): array;
* @template F of E
* @param class-string<F>|null $entityClass for STI (must extend a base class)
*/
public function getEntityMetadata(string $entityClass = null): EntityMetadata;
public function getEntityMetadata(string|null $entityClass = null): EntityMetadata;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function hydrateEntity(array $data): ?IEntity
}


public function getEntityMetadata(string $entityClass = null): EntityMetadata
public function getEntityMetadata(string|null $entityClass = null): EntityMetadata
{
$classNames = static::getEntityClassNames();
if ($entityClass !== null && !in_array($entityClass, $classNames, true)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/inc/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected function setUp()
/**
* @param array<mixed>|null $args
*/
public function runTest(string $method, array $args = null): void
public function runTest(string $method, array|null $args = null): void
{
$this->testId = get_class($this) . '_' . $method;
parent::runTest($method, $args);
Expand Down

0 comments on commit eec97f6

Please sign in to comment.