Skip to content

Commit bff11f3

Browse files
Merge pull request #38 from Hi-Folks/upgrade-test
Upgrade dev packages (PestPHP, PHPstan, Rector)
2 parents 88f165b + 780ae5b commit bff11f3

5 files changed

Lines changed: 14 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.0.0 - WIP
4+
- Upgrade dev package PestPHP 3
5+
- Upgrade dev package PHPstan 2
6+
- Upgrade dev package Rector 2
7+
38
## 0.4.4 - 2025-03-22
49
- Adding `getBoolean()` method for returning boolean value
510

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
}
1919
],
2020
"require": {
21-
"php": "^8.1|^8.2|^8.3|^8.4",
21+
"php": "^8.2|^8.3|^8.4",
2222
"swaggest/json-schema": "^0.12.42",
2323
"symfony/yaml": "^6.4|^7.1"
2424
},
2525
"require-dev": {
2626
"laravel/pint": "^1.2",
27-
"pestphp/pest": "^2.34",
28-
"phpstan/phpstan": "^1.6",
29-
"rector/rector": "^1"
27+
"pestphp/pest": "^3.0",
28+
"phpstan/phpstan": "^2",
29+
"rector/rector": "^2"
3030
},
3131
"autoload": {
3232
"psr-4": {

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
])
1212
// uncomment to reach your current PHP version
1313
->withPhpSets(
14-
php81: true,
14+
php82: true,
1515
)
1616
->withPreparedSets(
1717
deadCode: true,

src/Block.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@ final class Block implements Iterator, ArrayAccess, Countable
3636
/** @var array<int|string, mixed> */
3737
private array $data;
3838

39-
private bool $iteratorReturnsBlock = true;
40-
4139
/** @param array<int|string, mixed> $data */
42-
public function __construct(array $data = [], bool $iteratorReturnsBlock = true)
40+
public function __construct(array $data = [], private bool $iteratorReturnsBlock = true)
4341
{
4442
$this->data = $data;
45-
$this->iteratorReturnsBlock = $iteratorReturnsBlock;
4643
}
4744

4845
public function iterateBlock(bool $returnsBlock = true): self
@@ -204,9 +201,9 @@ public function values(): self
204201
* It returns Block or [] depending on $returnArrClass value
205202
*
206203
* @param bool $returnBlockClass true if you need Block object
207-
* @return int|string|array<int|string, mixed>|Block
204+
* @return array<int|string, mixed>|Block
208205
*/
209-
public function keys(bool $returnBlockClass = false): int|string|array|Block
206+
public function keys(bool $returnBlockClass = false): array|Block
210207
{
211208
if ($returnBlockClass) {
212209
return self::make(array_keys($this->data));

tests/Feature/BlockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
expect($composer->getBlock("require.php"))->toBeInstanceOf(Block::class);
7171
expect($composer->get("require.php"))->toBeString();
7272

73-
expect($composer->getBlock("require")->has("^8.1|^8.2|^8.3|^8.4"))->toBeTrue();
73+
expect($composer->getBlock("require")->has("^8.2|^8.3|^8.4"))->toBeTrue();
7474
expect($composer->getBlock("require")->hasKey("php"))->toBeTrue();
7575
expect($composer->getBlock("require-dev")->hasKey("pestphp/pest"))->toBeTrue();
7676
});

0 commit comments

Comments
 (0)