From a9a5543b8a2d315cebb7749209418469d7788acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Andrieu?= Date: Mon, 11 Sep 2017 21:45:30 +0200 Subject: [PATCH 1/4] Fixed docs rendering --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b994e7e..4b5e41c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Build Status](https://travis-ci.org/Shudrum/ArrayFinder.svg?branch=master)](https://travis-ci.org/Shudrum/ArrayFinder) -#ArrayFinder Component +# ArrayFinder Component The ArrayFinder component allow you to manage large nested arrays with ease. @@ -28,11 +28,11 @@ To install this package, you can simply use composer: composer require shudrum/array-finder ``` -##Documentation +## Documentation -###Methods +### Methods -####get($path) +#### get($path) You can get a value following a path separated by a '.'. @@ -56,7 +56,7 @@ $myValue = $arrayFinder->get(0); // value3 If the path is `null`, all the content will be returned. -####set($path, $value) +#### set($path, $value) You can add a value to a specific path separated by a '.'. If the nested arrays does not exists, it will be created. @@ -69,7 +69,7 @@ $arrayFinder->set('a.b', 'value'); $arrayFinder->get(); // ['a' => ['b' => 'value]] ``` -####changeSeparator($separator) +#### changeSeparator($separator) If the default separator (.) does not fit to your needs, you can call this method to change it. @@ -82,11 +82,11 @@ $myValue = $arrayFinder->changeSeparator('/'); $myValue = $arrayFinder->get('a/b/c'); ``` -###Implementations +### Implementations The ArrayFinder component implements some usefull interfaces: -####ArrayAccess +#### ArrayAccess You can use this object like an array: @@ -100,7 +100,7 @@ $arrayFinder['a.b.c'] = 'value'; unset($arrayFinder['a.b']); ``` -####Countable +#### Countable You can use count on this object: @@ -113,7 +113,7 @@ count($arrayFinder); count($arrayFinder['a.b']); ``` -####Iterator +#### Iterator You can iterate on this object: @@ -127,7 +127,7 @@ foreach ($arrayFinder as $key => $value) { } ``` -####Serializable +#### Serializable You can easily serialize / unserialize this object. From 80f35eaa80ec2a74d5f513a725dff4affd8aaa88 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Thu, 5 Oct 2017 12:18:45 +0200 Subject: [PATCH 2/4] Fix PHPUnit backward compatibility --- .travis.yml | 4 ++-- Tests/ArrayFinderTest.php | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6fe035c..f21843e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,5 @@ php: - '5.5' - '5.6' - '7.0' - - hhvm - - nightly + - '7.1' + - '7.2' diff --git a/Tests/ArrayFinderTest.php b/Tests/ArrayFinderTest.php index db38cbb..7096455 100644 --- a/Tests/ArrayFinderTest.php +++ b/Tests/ArrayFinderTest.php @@ -2,9 +2,17 @@ namespace Shudrum\Component\ArrayFinder\Tests; +// PHPUnit backward compatibility +if ( + !class_exists('\PHPUnit\Framework\TestCase') + && class_exists('\PHPUnit_Framework_TestCase') +) { + class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase'); +} + use Shudrum\Component\ArrayFinder\ArrayFinder; -class ArrayFinderTest extends \PHPUnit_Framework_TestCase +class ArrayFinderTest extends \PHPUnit\Framework\TestCase { /** @var ArrayFinder */ private $arrayFinder; From dfeb524e2ab8e5654e17a3c5e52e735d06d117ed Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Wed, 1 Jan 2020 15:51:57 +0100 Subject: [PATCH 3/4] Add PHP 7.3 and 7.4 versions to Travis CI This will ensure that this project is forward compatible with them. --- .travis.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index f21843e..d57b253 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,22 @@ -install: - - composer install language: php -php: - - '5.4' - - '5.5' - - '5.6' - - '7.0' - - '7.1' - - '7.2' + +matrix: + include: + - php: 5.4 + dist: trusty + - php: 5.5 + dist: trusty + - php: 5.6 + dist: trusty + - php: 7.0 + dist: trusty + - php: 7.1 + dist: bionic + - php: 7.2 + dist: bionic + - php: 7.3 + dist: bionic + - php: 7.4 + dist: bionic + +install: travis_retry composer install From 3eca368af228ad12db780850d83ffa840e820b0b Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Wed, 1 Jan 2020 16:03:27 +0100 Subject: [PATCH 4/4] Use installed version of PHPUnit while running CI This fixes https://travis-ci.org/Shudrum/ArrayFinder/jobs/63157864. --- .travis.yml | 1 + composer.json | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index d57b253..7034573 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,3 +20,4 @@ matrix: dist: bionic install: travis_retry composer install +script: ./vendor/bin/phpunit diff --git a/composer.json b/composer.json index ec6ac78..ebbe2f5 100644 --- a/composer.json +++ b/composer.json @@ -19,5 +19,8 @@ "exclude-from-classmap": [ "/Tests/" ] + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^7.5" } }