From be68c5a356dc31c1731faed3a40f853c792a05eb Mon Sep 17 00:00:00 2001 From: Rasmus Schultz Date: Thu, 25 Feb 2021 10:25:35 +0100 Subject: [PATCH 1/2] rename Match to MatchInfo: compatible with PHP 8 (match is a reserved word) --- composer.json | 13 +- composer.lock | 324 ++----------------------------- src/{Match.php => MatchInfo.php} | 2 +- src/Router.php | 4 +- test/test.php | 2 + 5 files changed, 34 insertions(+), 311 deletions(-) rename src/{Match.php => MatchInfo.php} (97%) diff --git a/composer.json b/composer.json index 750d560..b0f9b2e 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,17 @@ "email": "rasmus@mindplay.dk" } ], + "repositories": [ + { + "type": "vcs", + "url": "https://mindplaydk@bitbucket.org/mindplaydk/testies.git" + } + ], "require": { - "php": ">=5.4.0" + "php": "^5.4 || ^7.0 || ^8.0" }, "require-dev": { - "mindplay/testies": "^0.3", - "phpunit/php-code-coverage": "^2.2.4" + "mindplay/testies": "1.0.0.x-dev" }, "suggest": { "ext-intl": "provides better/faster support for slug-creation in URL helpers" @@ -31,4 +36,4 @@ "mindplay\\timber\\": "src/" } } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index 6059ed2..fd46a70 100644 --- a/composer.lock +++ b/composer.lock @@ -1,347 +1,63 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d0daba8570e1946a296c2be915e33d74", + "content-hash": "8f917dcbaa719346851cb411b4b3bd54", "packages": [], "packages-dev": [ { "name": "mindplay/testies", - "version": "0.3.0", + "version": "1.0.0.x-dev", "source": { "type": "git", - "url": "https://github.com/mindplay-dk/testies.git", - "reference": "272516fe2232929032e09002f380437a23aa3feb" + "url": "https://mindplaydk@bitbucket.org/mindplaydk/testies.git", + "reference": "dbc8bf7838a871eb3afa586d72044c40a0e029b1" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mindplay-dk/testies/zipball/272516fe2232929032e09002f380437a23aa3feb", - "reference": "272516fe2232929032e09002f380437a23aa3feb", - "shasum": "" + "require": { + "php": "^7.3 || ^8.0" }, "require-dev": { - "guzzlehttp/guzzle": "5.*", - "phpunit/php-code-coverage": "^3.0" + "guzzlehttp/guzzle": "^6.3.3", + "phpunit/php-code-coverage": "^9.2.5" }, "suggest": { - "phpunit/php-code-coverage": "^3.0" + "phpunit/php-code-coverage": "^9.2.5" }, + "default-branch": true, "type": "library", "autoload": { "files": [ - "header.php" + "src/test.func.php" ], "psr-4": { "mindplay\\testies\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL3.0+" + "MIT" ], "authors": [ { "name": "Rasmus Schultz", - "email": "rasc@fynskemedier.dk" + "email": "rasmus@mindplay.dk" } ], "description": "Yeah, testies: a lightweight library for quick, simple unit-testing", - "time": "2016-05-09T09:41:04+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06T15:47:00+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03T07:40:28+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.11", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-02-27T10:12:30+00:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-08-18T05:49:44+00:00" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2020-12-22T19:19:14+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "mindplay/testies": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=5.4.0" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.0.0" } diff --git a/src/Match.php b/src/MatchInfo.php similarity index 97% rename from src/Match.php rename to src/MatchInfo.php index da0c9db..f18544a 100644 --- a/src/Match.php +++ b/src/MatchInfo.php @@ -7,7 +7,7 @@ * * @see Router::match() */ -class Match +class MatchInfo { /** * @param Route $route the Route that matched the URL diff --git a/src/Router.php b/src/Router.php index d51244f..0a8696c 100644 --- a/src/Router.php +++ b/src/Router.php @@ -67,7 +67,7 @@ public function defineSymbol($name, $expression, $parse = null) /** * @param string $url * - * @return Match|null match information (or NULL, if no match was found) + * @return MatchInfo|null match information (or NULL, if no match was found) */ protected function match($url) { @@ -135,7 +135,7 @@ protected function match($url) if (!isset($current->handlers)) { return null; } else { - return new Match( + return new MatchInfo( $current, '/' . $url, $params diff --git a/test/test.php b/test/test.php index c5087e8..eeaf921 100644 --- a/test/test.php +++ b/test/test.php @@ -6,6 +6,8 @@ use mindplay\timber\Router; use mindplay\timber\UrlHelper; +use function mindplay\testies\{ test, ok, eq, expect, configure, run }; + require dirname(__DIR__) . '/vendor/autoload.php'; class SlugTester extends UrlHelper From 2f03a3b98ce11ab2c5d4abbd7440ec32487f38a6 Mon Sep 17 00:00:00 2001 From: Rasmus Schultz Date: Thu, 25 Feb 2021 11:14:35 +0100 Subject: [PATCH 2/2] fix deps, upgrade php minimum to 7.3+ --- .travis.yml | 8 +++----- README.md | 2 +- composer.json | 10 ++-------- composer.lock | 28 ++++++++++++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index a390e0e..5bb985a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,9 @@ language: php php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 + - 7.3 + - 7.4 + - 8.0 before_script: - 'composer install --dev --prefer-source' diff --git a/README.md b/README.md index c473b24..5872d8c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # mindplay/timber -[![PHP Version](https://img.shields.io/badge/php-5.4%2B-blue.svg)](https://packagist.org/packages/mindplay/timber) +[![PHP Version](https://img.shields.io/badge/php-7.3%2B-blue.svg)](https://packagist.org/packages/mindplay/timber) [![Build Status](https://travis-ci.org/mindplay-dk/timber.svg)](https://travis-ci.org/mindplay-dk/timber) Timber is a request router with regular expression support, high performance, and a diff --git a/composer.json b/composer.json index b0f9b2e..86c2123 100644 --- a/composer.json +++ b/composer.json @@ -16,17 +16,11 @@ "email": "rasmus@mindplay.dk" } ], - "repositories": [ - { - "type": "vcs", - "url": "https://mindplaydk@bitbucket.org/mindplaydk/testies.git" - } - ], "require": { - "php": "^5.4 || ^7.0 || ^8.0" + "php": "^7.3 || ^8.0" }, "require-dev": { - "mindplay/testies": "1.0.0.x-dev" + "mindplay/testies": "^1.0" }, "suggest": { "ext-intl": "provides better/faster support for slug-creation in URL helpers" diff --git a/composer.lock b/composer.lock index fd46a70..784c812 100644 --- a/composer.lock +++ b/composer.lock @@ -4,16 +4,22 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8f917dcbaa719346851cb411b4b3bd54", + "content-hash": "c0bf33f1736d31d395daa26832b357b2", "packages": [], "packages-dev": [ { "name": "mindplay/testies", - "version": "1.0.0.x-dev", + "version": "1.0.0", "source": { "type": "git", - "url": "https://mindplaydk@bitbucket.org/mindplaydk/testies.git", - "reference": "dbc8bf7838a871eb3afa586d72044c40a0e029b1" + "url": "https://github.com/mindplay-dk/testies.git", + "reference": "6501bc0ec4599948ee83284aa926538af839de50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mindplay-dk/testies/zipball/6501bc0ec4599948ee83284aa926538af839de50", + "reference": "6501bc0ec4599948ee83284aa926538af839de50", + "shasum": "" }, "require": { "php": "^7.3 || ^8.0" @@ -25,7 +31,6 @@ "suggest": { "phpunit/php-code-coverage": "^9.2.5" }, - "default-branch": true, "type": "library", "autoload": { "files": [ @@ -35,6 +40,7 @@ "mindplay\\testies\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -45,18 +51,20 @@ } ], "description": "Yeah, testies: a lightweight library for quick, simple unit-testing", - "time": "2020-12-22T19:19:14+00:00" + "support": { + "issues": "https://github.com/mindplay-dk/testies/issues", + "source": "https://github.com/mindplay-dk/testies/tree/1.0.0" + }, + "time": "2021-02-25T09:50:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "mindplay/testies": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.4.0" + "php": "^7.3 || ^8.0" }, "platform-dev": [], "plugin-api-version": "2.0.0"