Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2025 odan
Copyright (c) 2026 odan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A strictly typed array reader for PHP.

## Requirements

* PHP 8.1 - 8.4
* PHP 8.2 - 8.5

## Installation

Expand Down
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
],
"homepage": "https://github.com/selective-php/array-reader",
"require": {
"php": "8.1.* || 8.2.* || 8.3.* || 8.4.*",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"cakephp/chronos": "^2 || ^3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3",
"phpstan/phpstan": "^1 || ^2",
"phpunit/phpunit": "^10",
"phpunit/phpunit": "^11",
"squizlabs/php_codesniffer": "^3"
},
"autoload": {
Expand All @@ -37,12 +37,10 @@
},
"scripts": {
"cs:check": [
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi --allow-unsupported-php-version=yes"
],
"cs:fix": [
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
"php-cs-fixer fix --config=.cs.php --ansi --verbose --allow-unsupported-php-version=yes"
],
"sniffer:check": "phpcs --standard=phpcs.xml",
"sniffer:fix": "phpcbf --standard=phpcs.xml",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
bootstrap="vendor/autoload.php"
colors="true"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<coverage/>
Expand Down
40 changes: 14 additions & 26 deletions tests/ArrayReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Selective\ArrayReader\Test;

use InvalidArgumentException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Selective\ArrayReader\ArrayReader;

Expand All @@ -14,15 +15,14 @@ class ArrayReaderTest extends TestCase
/**
* Test.
*
* @dataProvider providerGetInt
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerGetInt')]
public function testCreateFromArray($data, $key, $default, $expected): void
{
$reader = ArrayReader::createFromArray($data);
Expand All @@ -32,15 +32,14 @@ public function testCreateFromArray($data, $key, $default, $expected): void
/**
* Test.
*
* @dataProvider providerGetInt
*
* @param mixed $data The data
* @param string|key $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerGetInt')]
public function testGetInt($data, $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand All @@ -50,14 +49,13 @@ public function testGetInt($data, $key, $default, $expected): void
/**
* Test.
*
* @dataProvider providerGetIntError
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
*
* @return void
*/
#[DataProvider('providerGetIntError')]
public function testGetIntError($data, $key, $default): void
{
$reader = new ArrayReader($data);
Expand All @@ -70,15 +68,14 @@ public function testGetIntError($data, $key, $default): void
/**
* Test.
*
* @dataProvider providerFindInt
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerFindInt')]
public function testFindInt($data, $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand All @@ -88,15 +85,14 @@ public function testFindInt($data, $key, $default, $expected): void
/**
* Test.
*
* @dataProvider providerGetFloat
*
* @param mixed $data The data
* @param string|key $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerGetFloat')]
public function testGetFloat($data, $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand All @@ -106,14 +102,13 @@ public function testGetFloat($data, $key, $default, $expected): void
/**
* Test.
*
* @dataProvider providerGetFloatError
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
*
* @return void
*/
#[DataProvider('providerGetFloatError')]
public function testGetFloatError($data, $key, $default): void
{
$reader = new ArrayReader($data);
Expand All @@ -126,15 +121,14 @@ public function testGetFloatError($data, $key, $default): void
/**
* Test.
*
* @dataProvider providerFindFloat
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerFindFloat')]
public function testFindFloat($data, $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand Down Expand Up @@ -238,15 +232,14 @@ public static function providerFindFloat(): array
/**
* Test.
*
* @dataProvider providerGetString
*
* @param mixed $data The data
* @param string $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerGetString')]
public function testGetString($data, string $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand All @@ -273,13 +266,12 @@ public static function providerGetString(): array
/**
* Test.
*
* @dataProvider providerGetStringError
*
* @param mixed $data The data
* @param string $key The lookup key
*
* @return void
*/
#[DataProvider('providerGetStringError')]
public function testGetStringError($data, string $key): void
{
$this->expectException(InvalidArgumentException::class);
Expand Down Expand Up @@ -308,15 +300,14 @@ public static function providerGetStringError(): array
/**
* Test.
*
* @dataProvider providerFindString
*
* @param mixed $data The data
* @param string $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerFindString')]
public function testFindString($data, string $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand All @@ -343,15 +334,14 @@ public static function providerFindString(): array
/**
* Test.
*
* @dataProvider providerGetArray
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerGetArray')]
public function testGetArray($data, $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand All @@ -376,14 +366,13 @@ public static function providerGetArray(): array
/**
* Test.
*
* @dataProvider providerGetArrayError
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
*
* @return void
*/
#[DataProvider('providerGetArrayError')]
public function testGetArrayError($data, $key, $default): void
{
$reader = new ArrayReader($data);
Expand All @@ -409,15 +398,14 @@ public static function providerGetArrayError(): array
/**
* Test.
*
* @dataProvider providerFindArray
*
* @param mixed $data The data
* @param string|int $key The lookup key
* @param mixed $default The default value
* @param mixed $expected The expected value
*
* @return void
*/
#[DataProvider('providerFindArray')]
public function testFindArray($data, $key, $default, $expected): void
{
$reader = new ArrayReader($data);
Expand Down