Skip to content

Commit b244e12

Browse files
Add strict types to LimitOffsetInterface and class Cursor
`ipl-stdlib` introduces strict type declarations, requiring all classes implementing its interfaces to match the exact parameter and return types defined there. Updated affected classes and bumped the required `ipl-stdlib` version in `composer.json` accordingly.
1 parent e752d91 commit b244e12

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"require": {
99
"php": ">=8.2",
1010
"ext-pdo": "*",
11-
"ipl/stdlib": ">=0.12.0"
11+
"ipl/stdlib": "dev-modernize-code"
1212
},
1313
"require-dev": {
14-
"ipl/stdlib": "dev-main"
14+
"ipl/stdlib": "dev-modernize-code"
1515
},
1616
"autoload": {
1717
"files": [

src/Cursor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getLimit(): ?int
7575
return $this->select->getLimit();
7676
}
7777

78-
public function limit($limit)
78+
public function limit(?int $limit): static
7979
{
8080
$this->select->limit($limit);
8181

@@ -92,7 +92,7 @@ public function getOffset(): ?int
9292
return $this->select->getOffset();
9393
}
9494

95-
public function offset($offset)
95+
public function offset(?int $offset): static
9696
{
9797
$this->select->offset($offset);
9898

src/LimitOffset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getLimit(): ?int
3535
return $this->limit;
3636
}
3737

38-
public function limit($limit)
38+
public function limit(?int $limit): static
3939
{
4040
$this->limit = $limit < 0 ? null : $limit;
4141

@@ -59,7 +59,7 @@ public function getOffset(): ?int
5959
return $this->offset;
6060
}
6161

62-
public function offset($offset)
62+
public function offset(?int $offset): static
6363
{
6464
$this->offset = $offset <= 0 ? null : $offset;
6565

src/LimitOffsetInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getLimit(): ?int;
2828
*
2929
* @return $this
3030
*/
31-
public function limit($limit);
31+
public function limit(?int $limit): static;
3232

3333
/**
3434
* Reset the limit
@@ -59,7 +59,7 @@ public function getOffset(): ?int;
5959
*
6060
* @return $this
6161
*/
62-
public function offset($offset);
62+
public function offset(?int $offset): static;
6363

6464
/**
6565
* Reset the offset

0 commit comments

Comments
 (0)