Skip to content

Commit 81d5af4

Browse files
committed
Merge branch 'develop'
2 parents e914ba2 + e6a2478 commit 81d5af4

File tree

10 files changed

+27
-6
lines changed

10 files changed

+27
-6
lines changed

.github/workflows/static-analysis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ on: [push, pull_request]
44

55
jobs:
66
phpstan:
7-
name: PHPStan
87
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
11+
12+
fail-fast: false
13+
14+
name: PHP ${{ matrix.php }} PHPStan
915
steps:
1016
- uses: actions/checkout@v2
1117
- uses: shivammathur/setup-php@v2
1218
with:
13-
php-version: 7.4
19+
php-version: ${{ matrix.php }}
1420
coverage: none
1521

1622
- run: composer install --no-interaction

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: ['7.2', '7.3', '7.4', '8.0']
10+
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
1111

1212
fail-fast: false
1313

src/LeanMapper/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace LeanMapper;
1515

16+
use Dibi\Row as DibiRow;
1617
use LeanMapper\Exception\InvalidArgumentException;
1718

1819
/**
@@ -94,7 +95,7 @@ public function getWiringSchema(string $filterName): string
9495
/**
9596
* Creates new instance of Fluent
9697
*
97-
* @return Fluent
98+
* @return Fluent<int, DibiRow>
9899
*/
99100
public function command(): \Dibi\Fluent
100101
{

src/LeanMapper/Entity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ protected function getValueByPropertyWithRelationship(
761761
* @param Property|string $property micro-optimalization
762762
* @throws InvalidMethodCallException
763763
*/
764-
protected function assignEntityToProperty(?Entity $entity = null, $property):void
764+
protected function assignEntityToProperty(?Entity $entity, $property):void
765765
{
766766
if ($entity !== null) {
767767
$this->useMapper($entity->mapper);

src/LeanMapper/Fluent.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace LeanMapper;
1515

1616
use Closure;
17+
use Dibi\Row as DibiRow;
1718
use LeanMapper\Exception\InvalidArgumentException;
1819

1920
/**
@@ -76,6 +77,7 @@ public function applyFilter($filter, $args = null)
7677

7778
/**
7879
* @param array<mixed> $args
80+
* @return Fluent<int, DibiRow>
7981
*/
8082
public function createSelect(?array $args = null): self
8183
{
@@ -106,6 +108,7 @@ public function getRelatedKeys(): ?array
106108

107109
/**
108110
* @param array<int|string>|null $keys
111+
* @return Fluent<int, DibiRow>
109112
* @throws InvalidArgumentException
110113
*/
111114
public function setRelatedKeys(?array $keys): self

src/LeanMapper/Reflection/EntityReflection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public function getAliases(): Aliases
114114
/**
115115
* Gets parent entity's reflection
116116
*/
117+
#[\ReturnTypeWillChange]
117118
public function getParentClass(): ?self
118119
{
119120
return ($reflection = parent::getParentClass()) ? new self($reflection->getName(), $this->mapper, $this->entityReflectionProvider) : null;
@@ -125,6 +126,7 @@ public function getParentClass(): ?self
125126
*
126127
* @return string|false
127128
*/
129+
#[\ReturnTypeWillChange]
128130
public function getDocComment()
129131
{
130132
if ($this->docComment === null) {

src/LeanMapper/Repository.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public function &__get(string $name)
7575
}
7676

7777

78+
/**
79+
* @return Fluent<int, DibiRow>
80+
*/
7881
protected function createFluent(/*$filterArg1, $filterArg2, ...*/): Fluent
7982
{
8083
$table = $this->getTable();

src/LeanMapper/Result.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ public function __wakeup()
616616
/**
617617
* @return mixed
618618
*/
619+
#[\ReturnTypeWillChange]
619620
public function current()
620621
{
621622
$key = current($this->keys);
@@ -632,6 +633,7 @@ public function next(): void
632633
/**
633634
* @return mixed
634635
*/
636+
#[\ReturnTypeWillChange]
635637
public function key()
636638
{
637639
return current($this->keys);
@@ -901,6 +903,7 @@ private function buildUnionStrategySql(array $ids, string $table, string $viaCol
901903

902904
/**
903905
* @param array<int|string>|null $relatedKeys
906+
* @return Fluent<int, DibiRow>
904907
*/
905908
private function createTableSelection(string $table, ?array $relatedKeys = null): Fluent
906909
{
@@ -926,6 +929,7 @@ private function translateStrategy(?string $strategy): string
926929

927930

928931
/**
932+
* @param Fluent<int, DibiRow> $statement
929933
* @throws InvalidArgumentException
930934
*/
931935
private function applyFiltering(Fluent $statement, Filtering $filtering): ?FilteringResultDecorator

src/LeanMapper/ResultProxy.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function setReferencingResult(Result $referencingResult, string $table, ?
5555
/**
5656
* @return mixed
5757
*/
58+
#[\ReturnTypeWillChange]
5859
public function current()
5960
{
6061
return $this->result->current();
@@ -70,6 +71,7 @@ public function next(): void
7071
/**
7172
* @return mixed
7273
*/
74+
#[\ReturnTypeWillChange]
7375
public function key()
7476
{
7577
return $this->result->key();

src/LeanMapper/Row.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function referencing(string $table, ?string $viaColumn = null, ?Filtering
221221
}
222222

223223

224-
public function setReferencedRow(?self $row = null, string $viaColumn): void
224+
public function setReferencedRow(?self $row, string $viaColumn): void
225225
{
226226
$this->referencedRows[$viaColumn] = $row;
227227
}

0 commit comments

Comments
 (0)