Skip to content

Commit

Permalink
Change minimum to PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
odan committed Sep 6, 2023
1 parent a6abbd3 commit b1b9b34
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 81 deletions.
9 changes: 2 additions & 7 deletions .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: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
php-versions: [ '8.1', '8.2' ]
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

steps:
Expand All @@ -34,12 +34,7 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies for PHP 7
if: matrix.php-versions < '8.0'
run: composer update --prefer-dist --no-progress

- name: Install dependencies for PHP 8
if: matrix.php-versions >= '8.0'
- name: Install dependencies
run: composer update --prefer-dist --no-progress --ignore-platform-req=php

- name: Run test suite
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A strictly typed configuration component for PHP. Inspired by [Apache Commons Co

## Requirements

* PHP 7.2+ or 8
* PHP 8.1+

## Installation

Expand Down
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
],
"homepage": "https://github.com/selective-php/config",
"require": {
"php": "^7.2 || ^8.0",
"cakephp/chronos": "^1.2 || ^2.0"
"php": "^8.1",
"cakephp/chronos": "^2 || ^3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3",
"overtrue/phplint": "^2.3",
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^7 || ^8 || ^9",
"squizlabs/php_codesniffer": "^3.5"
"phpunit/phpunit": "^10",
"squizlabs/php_codesniffer": "^3"
},
"autoload": {
"psr-4": {
Expand All @@ -48,7 +47,6 @@
"sniffer:check": "phpcs --standard=phpcs.xml",
"sniffer:fix": "phpcbf --standard=phpcs.xml",
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
"start": "php -S localhost:8080 -t public/",
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
"test:all": [
"@cs:check",
Expand Down
20 changes: 11 additions & 9 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
bootstrap="vendor/autoload.php"
colors="true"
backupGlobals="false"
backupStaticAttributes="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="false">
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<coverage/>
<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>vendor</directory>
<directory>build</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
</source>
</phpunit>
17 changes: 0 additions & 17 deletions phpunit8.xml

This file was deleted.

80 changes: 39 additions & 41 deletions tests/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Test.
*/
class ConfigurationTest extends TestCase
final class ConfigurationTest extends TestCase
{
/**
* Test.
Expand All @@ -34,9 +34,9 @@ public function testGetString($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetString(): array
public static function providerGetString(): array

Check failure on line 39 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetString() return type has no value type specified in iterable type array.

Check failure on line 39 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetString() return type has no value type specified in iterable type array.
{
return [
[['key' => 'value'], 'key', null, 'value'],
Expand All @@ -63,16 +63,14 @@ public function testGetStringError($data, string $key): void

$reader = new Configuration($data);
$reader->getString($key);

$this->assertTrue(true);
}

/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetStringError(): array
public static function providerGetStringError(): array

Check failure on line 73 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetStringError() return type has no value type specified in iterable type array.

Check failure on line 73 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetStringError() return type has no value type specified in iterable type array.
{
return [
[['key' => 'value'], 'nope'],
Expand Down Expand Up @@ -103,9 +101,9 @@ public function testFindString($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerFindString(): array
public static function providerFindString(): array

Check failure on line 106 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerFindString() return type has no value type specified in iterable type array.

Check failure on line 106 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerFindString() return type has no value type specified in iterable type array.
{
return [
[['key' => 'value'], 'key', null, 'value'],
Expand Down Expand Up @@ -139,9 +137,9 @@ public function testGetInt($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetInt(): array
public static function providerGetInt(): array

Check failure on line 142 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetInt() return type has no value type specified in iterable type array.

Check failure on line 142 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetInt() return type has no value type specified in iterable type array.
{
return [
[['key' => 123456], 'key', null, 123456],
Expand Down Expand Up @@ -175,9 +173,9 @@ public function testGetIntError($data, string $key): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetIntError(): array
public static function providerGetIntError(): array

Check failure on line 178 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetIntError() return type has no value type specified in iterable type array.

Check failure on line 178 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetIntError() return type has no value type specified in iterable type array.
{
return [
[['key' => 123456], 'nope'],
Expand Down Expand Up @@ -208,9 +206,9 @@ public function testFindInt($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerFindInt(): array
public static function providerFindInt(): array

Check failure on line 211 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerFindInt() return type has no value type specified in iterable type array.

Check failure on line 211 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerFindInt() return type has no value type specified in iterable type array.
{
return [
[['key' => 123456], 'key', null, 123456],
Expand Down Expand Up @@ -244,9 +242,9 @@ public function testGetBool($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetBool(): array
public static function providerGetBool(): array

Check failure on line 247 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetBool() return type has no value type specified in iterable type array.

Check failure on line 247 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetBool() return type has no value type specified in iterable type array.
{
return [
[['key' => true], 'key', null, true],
Expand Down Expand Up @@ -280,9 +278,9 @@ public function testGetBoolError($data, string $key): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetBoolError(): array
public static function providerGetBoolError(): array

Check failure on line 283 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetBoolError() return type has no value type specified in iterable type array.

Check failure on line 283 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetBoolError() return type has no value type specified in iterable type array.
{
return [
[['key' => true], 'nope'],
Expand Down Expand Up @@ -313,9 +311,9 @@ public function testFindBool($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerFindBool(): array
public static function providerFindBool(): array

Check failure on line 316 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerFindBool() return type has no value type specified in iterable type array.

Check failure on line 316 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerFindBool() return type has no value type specified in iterable type array.
{
return [
[['key' => true], 'key', null, true],
Expand Down Expand Up @@ -349,9 +347,9 @@ public function testGetFloat($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetFloat(): array
public static function providerGetFloat(): array

Check failure on line 352 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetFloat() return type has no value type specified in iterable type array.

Check failure on line 352 in tests/ConfigurationTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test on ubuntu-latest

Method Selective\Config\Test\ConfigurationTest::providerGetFloat() return type has no value type specified in iterable type array.
{
return [
[['key' => 123.456], 'key', null, 123.456],
Expand Down Expand Up @@ -385,9 +383,9 @@ public function testGetFloatError($data, string $key): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetFloatError(): array
public static function providerGetFloatError(): array
{
return [
[['key' => 123.456], 'nope'],
Expand Down Expand Up @@ -418,9 +416,9 @@ public function testFindFloat($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerFindFloat(): array
public static function providerFindFloat(): array
{
return [
[['key' => 123.456], 'key', null, 123.456],
Expand Down Expand Up @@ -454,9 +452,9 @@ public function testGetArray($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetArray(): array
public static function providerGetArray(): array
{
return [
[['key' => ['key' => 'value']], 'key', null, ['key' => 'value']],
Expand Down Expand Up @@ -490,9 +488,9 @@ public function testGetArrayError($data, string $key): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetArrayError(): array
public static function providerGetArrayError(): array
{
return [
[['key' => ['key' => 'value']], 'nope'],
Expand Down Expand Up @@ -523,9 +521,9 @@ public function testFindArray($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerFindArray(): array
public static function providerFindArray(): array
{
return [
[['key' => ['key' => 'value']], 'key', null, ['key' => 'value']],
Expand Down Expand Up @@ -559,9 +557,9 @@ public function testGetChronos($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetChronos(): array
public static function providerGetChronos(): array
{
return [
[['key' => Chronos::now()], 'key', null, Chronos::now()],
Expand Down Expand Up @@ -596,9 +594,9 @@ public function testGetChronosError($data, string $key): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerGetChronosError(): array
public static function providerGetChronosError(): array
{
return [
[['key' => Chronos::now()], 'nope'],
Expand Down Expand Up @@ -629,9 +627,9 @@ public function testFindChronos($data, string $key, $default, $expected): void
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerFindChronos(): array
public static function providerFindChronos(): array
{
return [
[['key' => Chronos::now()], 'key', null, Chronos::now()],
Expand All @@ -647,9 +645,9 @@ public function providerFindChronos(): array
/**
* Provider.
*
* @return array<array<mixed>> The test data
* @return array The test data
*/
public function providerAll(): array
public static function providerAll(): array
{
return [
[['key' => Chronos::now()]],
Expand Down

0 comments on commit b1b9b34

Please sign in to comment.