Skip to content

Commit

Permalink
Merge pull request hassankhan#149 from nbayramberdiyev/feat/drop-unsu…
Browse files Browse the repository at this point in the history
…pported-php-versions

Drop support for the end of life PHP versions
  • Loading branch information
DavidePastore authored Apr 24, 2022
2 parents 82421bb + 2db7c02 commit 1e7ce49
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 104 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration.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: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
php-versions: ['7.4', '8.0', '8.1']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v2
Expand All @@ -24,13 +24,13 @@ jobs:
run: composer install --no-interaction --no-progress --prefer-dist

- name: PHP Unit tests
if: ${{ matrix.php-versions != '7.3' }}
if: ${{ matrix.php-versions != '7.4' }}
run: vendor/bin/phpunit

- name: PHP Unit tests generating coverage data
if: ${{ matrix.php-versions == '7.3' }}
if: ${{ matrix.php-versions == '7.4' }}
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

- name: Upload code coverage data
if: ${{ matrix.php-versions == '7.3' }}
if: ${{ matrix.php-versions == '7.4' }}
run: php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ node_modules

# Ignore files from PHPStorm
.idea

# Ignore test & coverage files
.phpunit.result.cache
coverage.clover
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ YML, Properties and serialized files and strings.

## Requirements

Config requires PHP 5.5.9+.
Config requires PHP 7.4+.

> **IMPORTANT:** If you want to use YAML files or strings, require the [Symfony Yaml component](https://github.com/symfony/Yaml) in your `composer.json`.
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@
}
],
"require": {
"php": ">=5.5.9"
"php": ">=7.4"
},
"require-dev": {
"phpunit/phpunit": "~4.8.36 || ~5.7 || ~6.5 || ~7.5 || ~8.5",
"scrutinizer/ocular": "~1.1",
"squizlabs/php_codesniffer": "~2.2",
"symfony/yaml": "~3.4",
"yoast/phpunit-polyfills": "^1.0"
"phpunit/phpunit": "^9.5",
"scrutinizer/ocular": "^1.9",
"squizlabs/php_codesniffer": "^3.6",
"symfony/yaml": "^5.4"
},
"suggest": {
"symfony/yaml": "~3.4"
"symfony/yaml": "^5.4"
},
"autoload": {
"psr-4": {
Expand All @@ -34,5 +33,8 @@
"psr-4": {
"Noodlehaus\\Test\\": "tests"
}
},
"config": {
"sort-packages": true
}
}
29 changes: 16 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
Expand All @@ -15,19 +17,20 @@
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">src/</directory>
<exclude>
<directory suffix=".php">./src/Exception</directory>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory suffix=".php">./src/Exception</directory>
</exclude>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
15 changes: 13 additions & 2 deletions tests/AbstractConfigTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace Noodlehaus;

use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use Noodlehaus\Test\Fixture\SimpleConfig;
use PHPUnit\Framework\TestCase;

/**
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-04-21 at 22:37:22.
Expand All @@ -18,7 +19,8 @@ class AbstractConfigTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function set_up() {
protected function setUp(): void
{
$this->config = new SimpleConfig(
[
'host' => 'localhost',
Expand Down Expand Up @@ -454,6 +456,12 @@ public function testValid()
/**
* Tests to verify that Iterator is properly implemented by using a foreach
* loop on the test config
*
* @covers Noodlehaus\Config::current()
* @covers Noodlehaus\Config::next()
* @covers Noodlehaus\Config::key()
* @covers Noodlehaus\Config::valid()
* @covers Noodlehaus\Config::rewind()
*/
public function testIterator()
{
Expand All @@ -480,6 +488,9 @@ public function testIterator()
}
}

/**
* @covers Noodlehaus\Config::get()
*/
public function testGetShouldNotSet()
{
$this->config->get('invalid', 'default');
Expand Down
52 changes: 25 additions & 27 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@
use Noodlehaus\Parser\Json as JsonParser;
use Noodlehaus\Writer\Json as JsonWriter;
use PHPUnit\Framework\TestCase;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;

/**
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-04-21 at 22:37:22.
*/
class ConfigTest extends TestCase
{
use ExpectException;
/**
* @var Config
*/
protected $config;

/**
* @covers Noodlehaus\Config::load()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::load()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
*/
public function testLoadWithUnsupportedFormat()
{
Expand All @@ -31,9 +29,9 @@ public function testLoadWithUnsupportedFormat()
}

/**
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
*/
public function testConstructWithUnsupportedFormat()
{
Expand All @@ -43,11 +41,11 @@ public function testConstructWithUnsupportedFormat()
}

/**
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::getPathFromArray()
* @covers Noodlehaus\Config::getValidPath()
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::getPathFromArray()
* @covers Noodlehaus\Config::getValidPath()
*/
public function testConstructWithInvalidPath()
{
Expand All @@ -57,11 +55,11 @@ public function testConstructWithInvalidPath()
}

/**
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::getPathFromArray()
* @covers Noodlehaus\Config::getValidPath()
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::getPathFromArray()
* @covers Noodlehaus\Config::getValidPath()
*/
public function testConstructWithEmptyDirectory()
{
Expand All @@ -88,11 +86,11 @@ public function testConstructWithArray()
}

/**
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::getPathFromArray()
* @covers Noodlehaus\Config::getValidPath()
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::loadFromFile()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::getPathFromArray()
* @covers Noodlehaus\Config::getValidPath()
*/
public function testConstructWithArrayWithNonexistentFile()
{
Expand Down Expand Up @@ -218,7 +216,7 @@ public function testConstructWithEmptyYml()
*/
public function testConstructWithFileParser()
{
$config = new Config(__DIR__ . '/mocks/pass/json.config', new Parser\Json);
$config = new Config(__DIR__ . '/mocks/pass/json.config', new JsonParser());

$expected = 'localhost';
$actual = $config->get('host');
Expand Down Expand Up @@ -252,8 +250,8 @@ public function testGetReturnsArrayMergedArray($config)
}

/**
* @covers Noodlehaus\Config::toFile()
* @covers Noodlehaus\Config::getWriter()
* @covers Noodlehaus\Config::toFile()
* @covers Noodlehaus\Config::getWriter()
*/
public function testWritesToFile()
{
Expand All @@ -266,7 +264,7 @@ public function testWritesToFile()
}

/**
* @covers Noodlehaus\Config::toString()
* @covers Noodlehaus\Config::toString()
*/
public function testWritesToString()
{
Expand Down
7 changes: 3 additions & 4 deletions tests/Parser/IniTest.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?php

namespace Noodlehaus\Parser\Test;

use Noodlehaus\Parser\Ini;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use PHPUnit\Framework\TestCase;

/**
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-04-21 at 22:37:22.
*/
class IniTest extends TestCase
{
use ExpectException;
/**
* @var Ini
*/
Expand All @@ -20,7 +19,7 @@ class IniTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function set_up()
protected function setUp(): void
{
$this->ini = new Ini();
}
Expand Down
7 changes: 3 additions & 4 deletions tests/Parser/JsonTest.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?php

namespace Noodlehaus\Parser\Test;

use Noodlehaus\Parser\Json;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use PHPUnit\Framework\TestCase;

/**
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-04-21 at 22:37:22.
*/
class JsonTest extends TestCase
{
use ExpectException;
/**
* @var Json
*/
Expand All @@ -20,7 +19,7 @@ class JsonTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function set_up()
protected function setUp(): void
{
$this->json = new Json();
}
Expand Down
7 changes: 3 additions & 4 deletions tests/Parser/PhpTest.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?php

namespace Noodlehaus\Parser\Test;

use Noodlehaus\Parser\Php;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use PHPUnit\Framework\TestCase;

/**
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-04-21 at 22:37:22.
*/
class PhpTest extends TestCase
{
use ExpectException;
/**
* @var Php
*/
Expand All @@ -20,7 +19,7 @@ class PhpTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function set_up()
protected function setUp(): void
{
$this->php = new Php();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Parser/PropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Noodlehaus\Parser\Test;

use Noodlehaus\Parser\Properties;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use PHPUnit\Framework\TestCase;

class PropertiesTest extends TestCase
{
Expand All @@ -16,7 +16,7 @@ class PropertiesTest extends TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function set_up()
protected function setUp(): void
{
$this->properties = new Properties();
}
Expand Down
Loading

0 comments on commit 1e7ce49

Please sign in to comment.