Skip to content

Commit 8c9c7b5

Browse files
authored
build(deps): Bump PHP and dependency versions (#32)
- Update minimum PHP version to 8.2. - Add PHP 8.4 to CI matrix, removing PHP 8.1. - Update `jbzoo/toolbox-dev`, `jbzoo/utils`, and `symfony/*` dependencies. - Remove scheduled CI workflow run. - Update `actions/upload-artifact` to v4. - Add `final` keyword to `Exception` class. - Add static analysis ignore annotations and fix namespace usage in tests.
1 parent 8666e8c commit 8c9c7b5

File tree

7 files changed

+36
-31
lines changed

7 files changed

+36
-31
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#
1212

1313
name: CI
14+
permissions:
15+
contents: read
1416

1517
on:
1618
pull_request:
@@ -19,8 +21,6 @@ on:
1921
push:
2022
branches:
2123
- 'master'
22-
schedule:
23-
- cron: '38 */8 * * *'
2424

2525
env:
2626
COLUMNS: 120
@@ -34,7 +34,7 @@ jobs:
3434
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
3535
strategy:
3636
matrix:
37-
php-version: [ 8.1, 8.2, 8.3 ]
37+
php-version: [ 8.2, 8.3, 8.4 ]
3838
coverage: [ xdebug, none ]
3939
composer_flags: [ "--prefer-lowest", "" ]
4040
steps:
@@ -65,7 +65,7 @@ jobs:
6565
run: make report-coveralls --no-print-directory || true
6666

6767
- name: Upload Artifacts
68-
uses: actions/upload-artifact@v3
68+
uses: actions/upload-artifact@v4
6969
continue-on-error: true
7070
with:
7171
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
@@ -77,7 +77,7 @@ jobs:
7777
runs-on: ubuntu-latest
7878
strategy:
7979
matrix:
80-
php-version: [ 8.1, 8.2, 8.3 ]
80+
php-version: [ 8.2, 8.3, 8.4 ]
8181
steps:
8282
- name: Checkout code
8383
uses: actions/checkout@v3
@@ -99,7 +99,7 @@ jobs:
9999
run: make codestyle --no-print-directory
100100

101101
- name: Upload Artifacts
102-
uses: actions/upload-artifact@v3
102+
uses: actions/upload-artifact@v4
103103
continue-on-error: true
104104
with:
105105
name: Linters - ${{ matrix.php-version }}
@@ -111,7 +111,7 @@ jobs:
111111
runs-on: ubuntu-latest
112112
strategy:
113113
matrix:
114-
php-version: [ 8.1, 8.2, 8.3 ]
114+
php-version: [ 8.2, 8.3, 8.4 ]
115115
steps:
116116
- name: Checkout code
117117
uses: actions/checkout@v3
@@ -133,7 +133,7 @@ jobs:
133133
run: make report-all --no-print-directory
134134

135135
- name: Upload Artifacts
136-
uses: actions/upload-artifact@v3
136+
uses: actions/upload-artifact@v4
137137
continue-on-error: true
138138
with:
139139
name: Reports - ${{ matrix.php-version }}

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JBZoo / Data
22

3-
[![CI](https://github.com/JBZoo/Data/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Data/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Data/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Data?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Data/coverage.svg)](https://shepherd.dev/github/JBZoo/Data) [![Psalm Level](https://shepherd.dev/github/JBZoo/Data/level.svg)](https://shepherd.dev/github/JBZoo/Data) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/data/badge)](https://www.codefactor.io/repository/github/jbzoo/data/issues)
3+
[![CI](https://github.com/JBZoo/Data/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Data/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Data/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Data?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Data/coverage.svg)](https://shepherd.dev/github/JBZoo/Data) [![Psalm Level](https://shepherd.dev/github/JBZoo/Data/level.svg)](https://shepherd.dev/github/JBZoo/Data) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/data/badge)](https://www.codefactor.io/repository/github/jbzoo/data/issues)
44
[![Stable Version](https://poser.pugx.org/jbzoo/data/version)](https://packagist.org/packages/jbzoo/data/) [![Total Downloads](https://poser.pugx.org/jbzoo/data/downloads)](https://packagist.org/packages/jbzoo/data/stats) [![Dependents](https://poser.pugx.org/jbzoo/data/dependents)](https://packagist.org/packages/jbzoo/data/dependents?order_by=downloads) [![GitHub License](https://img.shields.io/github/license/jbzoo/data)](https://github.com/JBZoo/Data/blob/master/LICENSE)
55

66

@@ -135,7 +135,7 @@ List of filters - [JBZoo/Utils/Filter](https://github.com/JBZoo/Utils/blob/maste
135135
* `float` - Smart converting to float
136136
* `digits` - Leaves only "0-9"
137137
* `alpha` - Leaves only "a-zA-Z"
138-
* `alphanum` - Combination of `digits` and `alpha`
138+
* `alphanum` - Combination of `digits` and `alpha`
139139
* `base64` - Returns only chars which are compatible with base64
140140
* `path` - Clean FS path
141141
* `trim` - Extend trim
@@ -279,13 +279,13 @@ a:7:{s:5:"empty";s:0:"";s:4:"zero";s:1:"0";s:6:"string";s:1:" ";s:3:"tag";s:42:"
279279
## Summary benchmark info (execution time) PHP v7.4
280280
All benchmark tests are executing without xdebug and with a huge random array and 100.000 iterations.
281281
282-
Benchmark tests based on the tool [phpbench/phpbench](https://github.com/phpbench/phpbench). See details [here](tests/phpbench).
282+
Benchmark tests based on the tool [phpbench/phpbench](https://github.com/phpbench/phpbench). See details [here](tests/phpbench).
283283
284284
Please, pay attention - `1μs = 1/1.000.000 of second!`
285285
286286
**benchmark: CreateObject**
287287
subject | groups | its | revs | mean | stdev | rstdev | mem_real | diff
288-
--- | --- | --- | --- | --- | --- | --- | --- | ---
288+
--- | --- | --- | --- | --- | --- | --- | --- | ---
289289
benchArrayObjectOrig | Native,ArrayObject | 3 | 100000 | 7.30μs | 0.01μs | 0.18% | 8,388,608b | 1.00x
290290
benchArrayObjectExtOrig | Native,ArrayObject,Extended | 3 | 100000 | 7.43μs | 0.05μs | 0.66% | 8,388,608b | 1.02x
291291
benchJson | JSON | 3 | 100000 | 7.55μs | 0.01μs | 0.15% | 8,388,608b | 1.03x
@@ -302,7 +302,7 @@ benchPhpArrayFunc | PhpArray,Func | 3 | 100000 | 7.75μs | 0.06μs | 0.72% | 8,3
302302
303303
**benchmark: GetUndefinedValue**
304304
subject | groups | its | revs | mean | stdev | rstdev | mem_real | diff
305-
--- | --- | --- | --- | --- | --- | --- | --- | ---
305+
--- | --- | --- | --- | --- | --- | --- | --- | ---
306306
benchArrayIsset | Native,Array,Undefined | 3 | 1000000 | 0.04μs | 0.00μs | 1.48% | 8,388,608b | 1.00x
307307
benchDataOffsetGet | Data,Undefined | 3 | 1000000 | 0.11μs | 0.00μs | 0.41% | 8,388,608b | 2.88x
308308
benchDataGet | Data,Undefined | 3 | 1000000 | 0.14μs | 0.00μs | 0.39% | 8,388,608b | 3.56x
@@ -315,7 +315,7 @@ benchDataFindInner | Data,Undefined | 3 | 1000000 | 0.41μs | 0.00μs | 0.14% |
315315
316316
**benchmark: GetValue**
317317
subject | groups | its | revs | mean | stdev | rstdev | mem_real | diff
318-
--- | --- | --- | --- | --- | --- | --- | --- | ---
318+
--- | --- | --- | --- | --- | --- | --- | --- | ---
319319
benchArrayRegular | Native,Array | 3 | 1000000 | 0.04μs | 0.00μs | 5.02% | 8,388,608b | 1.00x
320320
benchArrayRegularMuted | Native,Array | 3 | 1000000 | 0.04μs | 0.00μs | 1.40% | 8,388,608b | 1.06x
321321
benchArrayIsset | Native,Array | 3 | 1000000 | 0.04μs | 0.00μs | 2.04% | 8,388,608b | 1.07x
@@ -331,7 +331,7 @@ benchDataFind | Data | 3 | 1000000 | 0.35μs | 0.00μs | 0.65% | 8,388,608b | 8.
331331
332332
**benchmark: GetValueInner**
333333
subject | groups | its | revs | mean | stdev | rstdev | mem_real | diff
334-
--- | --- | --- | --- | --- | --- | --- | --- | ---
334+
--- | --- | --- | --- | --- | --- | --- | --- | ---
335335
benchArrayRegular | Native,Array | 3 | 1000000 | 0.05μs | 0.00μs | 0.23% | 8,388,608b | 1.00x
336336
benchArrayRegularMuted | Native,Array | 3 | 1000000 | 0.06μs | 0.00μs | 0.86% | 8,388,608b | 1.06x
337337
benchArrayIsset | Native,Array | 3 | 1000000 | 0.06μs | 0.00μs | 0.27% | 8,388,608b | 1.08x

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@
2727
"prefer-stable" : true,
2828

2929
"require" : {
30-
"php" : "^8.1",
30+
"php" : "^8.2",
3131
"ext-json" : "*"
3232
},
3333

3434
"require-dev" : {
35-
"jbzoo/toolbox-dev" : "^7.1",
36-
"jbzoo/utils" : "^7.1.1",
37-
"symfony/yaml" : ">=6.4",
35+
"jbzoo/toolbox-dev" : "^7.2",
36+
"jbzoo/utils" : "^7.2.2",
37+
"symfony/yaml" : ">=7.3.3",
3838

39-
"symfony/polyfill-ctype" : ">=1.28.0",
40-
"symfony/polyfill-mbstring" : ">=1.28.0",
41-
"symfony/polyfill-php73" : ">=1.28.0",
42-
"symfony/polyfill-php80" : ">=1.28.0",
43-
"symfony/polyfill-php81" : ">=1.28.0"
39+
"symfony/polyfill-ctype" : ">=1.33.0",
40+
"symfony/polyfill-mbstring" : ">=1.33.0",
41+
"symfony/polyfill-php73" : ">=1.33.0",
42+
"symfony/polyfill-php80" : ">=1.33.0",
43+
"symfony/polyfill-php81" : ">=1.33.0"
4444
},
4545

4646
"suggest" : {
47-
"symfony/yaml" : ">=6.4",
48-
"jbzoo/utils" : ">=7.1"
47+
"symfony/yaml" : ">=7.3",
48+
"jbzoo/utils" : ">=7.2"
4949
},
5050

5151
"autoload" : {

src/AbstractData.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
/**
2323
* @psalm-suppress MissingTemplateParam
24+
* @phpstan-ignore missingType.generics
2425
*/
2526
abstract class AbstractData extends \ArrayObject
2627
{
@@ -200,7 +201,7 @@ public function find(string $key, mixed $default = null, mixed $filter = null, s
200201
* Find a value also in nested arrays/objects.
201202
* @param mixed $needle The value to search for
202203
*/
203-
public function search(mixed $needle): null|bool|float|int|string
204+
public function search(mixed $needle): bool|float|int|string|null
204205
{
205206
$aIterator = new \RecursiveArrayIterator($this->getArrayCopy());
206207
$iterator = new \RecursiveIteratorIterator($aIterator);
@@ -263,6 +264,7 @@ public function is(string $key, mixed $compareWith = true, bool $strictMode = fa
263264
}
264265

265266
/** @noinspection TypeUnsafeComparisonInspection */
267+
/** @phpstan-ignore equal.notAllowed */
266268
return $value == $compareWith;
267269
}
268270

@@ -305,6 +307,9 @@ protected static function isMulti(array $array): bool
305307
return \count($arrayCount) > 0;
306308
}
307309

310+
/**
311+
* @psalm-suppress PossiblyNullArrayOffset
312+
*/
308313
private static function setNestedValue(array &$array, array $keys, mixed $value): void
309314
{
310315
$key = \array_shift($keys);

src/AliasesTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function getSelf(string $key, array|self $default = []): self
120120
* @psalm-suppress UnsafeInstantiation
121121
* @psalm-suppress ImplicitToStringCast
122122
*/
123-
public function getSelfNull(string $key, null|array|self $default = null): ?self
123+
public function getSelfNull(string $key, array|self|null $default = null): ?self
124124
{
125125
if (!$this->has($key)) {
126126
// @phpstan-ignore-next-line

src/Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616

1717
namespace JBZoo\Data;
1818

19-
class Exception extends \RuntimeException
19+
final class Exception extends \RuntimeException
2020
{
2121
}

tests/DataTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public function testGetSchema(): void
587587
'null' => 'null',
588588
'array_empty' => [],
589589
'array_not_empty' => [123 => 'string'],
590-
'objects' => '\\stdClass',
590+
'objects' => '\stdClass',
591591
'sub' => [
592592
'sub' => 'string',
593593
'sub.sub' => 'string',
@@ -599,7 +599,7 @@ public function testGetSchema(): void
599599
'sub' => ['key-sub' => 'string'],
600600
],
601601
],
602-
'data' => '\\JBZoo\\Data\\Data',
602+
'data' => '\JBZoo\Data\Data',
603603
'nested' => [
604604
'value-1' => 'string',
605605
'value-2' => 'string',

0 commit comments

Comments
 (0)