From 5838af892f6c05d455ebe4672644cb6d75e17411 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Mon, 20 Jan 2020 10:40:05 -0500 Subject: [PATCH] Replace references to Zend with Laminas --- CHANGELOG | 6 ++++++ arsse.php | 2 +- lib/REST.php | 4 ++-- lib/REST/Fever/API.php | 6 +++--- lib/REST/NextcloudNews/V1_2.php | 4 ++-- lib/REST/NextcloudNews/Versions.php | 4 ++-- lib/REST/TinyTinyRSS/API.php | 4 ++-- lib/REST/TinyTinyRSS/Icon.php | 2 +- tests/cases/Misc/TestHTTP.php | 4 ++-- tests/cases/REST/Fever/TestAPI.php | 8 ++++---- tests/cases/REST/NextcloudNews/TestV1_2.php | 4 ++-- tests/cases/REST/NextcloudNews/TestVersions.php | 6 +++--- tests/cases/REST/TestREST.php | 10 +++++----- tests/cases/REST/TinyTinyRSS/TestAPI.php | 6 +++--- tests/cases/REST/TinyTinyRSS/TestIcon.php | 4 ++-- tests/lib/AbstractTest.php | 6 +++--- 16 files changed, 43 insertions(+), 37 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7aac0189..f5618ba8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +Version 0.8.3 (2020-??-??) +========================== + +Changes: +- Officially require PHP 7.1 (effectively required since version 0.8.0) + Version 0.8.2 (2019-12-07) ========================== diff --git a/arsse.php b/arsse.php index 0cfa0ae4..1fe1870a 100644 --- a/arsse.php +++ b/arsse.php @@ -25,7 +25,7 @@ if (\PHP_SAPI === "cli") { $conf = file_exists(BASE."config.php") ? new Conf(BASE."config.php") : new Conf; Arsse::load($conf); // handle Web requests - $emitter = new \Zend\HttpHandlerRunner\Emitter\SapiEmitter; + $emitter = new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter; $response = (new REST)->dispatch(); $emitter->emit($response); } diff --git a/lib/REST.php b/lib/REST.php index 07389baf..b375f3c9 100644 --- a/lib/REST.php +++ b/lib/REST.php @@ -11,8 +11,8 @@ use JKingWeb\Arsse\Misc\URL; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\ServerRequestFactory; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\ServerRequestFactory; +use Laminas\Diactoros\Response\EmptyResponse; class REST { const API_LIST = [ diff --git a/lib/REST/Fever/API.php b/lib/REST/Fever/API.php index 1569c928..21565985 100644 --- a/lib/REST/Fever/API.php +++ b/lib/REST/Fever/API.php @@ -14,9 +14,9 @@ use JKingWeb\Arsse\Db\ExceptionInput; use JKingWeb\Arsse\Misc\HTTP; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Response\JsonResponse; -use Zend\Diactoros\Response\XmlResponse; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\Response\JsonResponse; +use Laminas\Diactoros\Response\XmlResponse; +use Laminas\Diactoros\Response\EmptyResponse; class API extends \JKingWeb\Arsse\REST\AbstractHandler { const LEVEL = 3; diff --git a/lib/REST/NextcloudNews/V1_2.php b/lib/REST/NextcloudNews/V1_2.php index f0d2177a..90e7009e 100644 --- a/lib/REST/NextcloudNews/V1_2.php +++ b/lib/REST/NextcloudNews/V1_2.php @@ -19,8 +19,8 @@ use JKingWeb\Arsse\REST\Exception404; use JKingWeb\Arsse\REST\Exception405; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Response\JsonResponse as Response; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\Response\JsonResponse as Response; +use Laminas\Diactoros\Response\EmptyResponse; class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler { const REALM = "Nextcloud News API v1-2"; diff --git a/lib/REST/NextcloudNews/Versions.php b/lib/REST/NextcloudNews/Versions.php index 78d4ac7f..a8db7a71 100644 --- a/lib/REST/NextcloudNews/Versions.php +++ b/lib/REST/NextcloudNews/Versions.php @@ -8,8 +8,8 @@ namespace JKingWeb\Arsse\REST\NextcloudNews; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Response\JsonResponse as Response; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\Response\JsonResponse as Response; +use Laminas\Diactoros\Response\EmptyResponse; class Versions implements \JKingWeb\Arsse\REST\Handler { public function __construct() { diff --git a/lib/REST/TinyTinyRSS/API.php b/lib/REST/TinyTinyRSS/API.php index 56a24374..4049a2a0 100644 --- a/lib/REST/TinyTinyRSS/API.php +++ b/lib/REST/TinyTinyRSS/API.php @@ -20,8 +20,8 @@ use JKingWeb\Arsse\Db\ResultEmpty; use JKingWeb\Arsse\Feed\Exception as FeedException; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Response\JsonResponse as Response; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\Response\JsonResponse as Response; +use Laminas\Diactoros\Response\EmptyResponse; class API extends \JKingWeb\Arsse\REST\AbstractHandler { const LEVEL = 14; // emulated API level diff --git a/lib/REST/TinyTinyRSS/Icon.php b/lib/REST/TinyTinyRSS/Icon.php index 0415bf2c..c5c9030e 100644 --- a/lib/REST/TinyTinyRSS/Icon.php +++ b/lib/REST/TinyTinyRSS/Icon.php @@ -9,7 +9,7 @@ namespace JKingWeb\Arsse\REST\TinyTinyRSS; use JKingWeb\Arsse\Arsse; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Response\EmptyResponse as Response; +use Laminas\Diactoros\Response\EmptyResponse as Response; class Icon extends \JKingWeb\Arsse\REST\AbstractHandler { public function __construct() { diff --git a/tests/cases/Misc/TestHTTP.php b/tests/cases/Misc/TestHTTP.php index 70d1316b..8430ddaa 100644 --- a/tests/cases/Misc/TestHTTP.php +++ b/tests/cases/Misc/TestHTTP.php @@ -13,9 +13,9 @@ use Psr\Http\Message\ResponseInterface; class TestHTTP extends \JKingWeb\Arsse\Test\AbstractTest { /** @dataProvider provideMediaTypes */ public function testMatchMediaType(string $header, array $types, bool $exp) { - $msg = (new \Zend\Diactoros\Request)->withHeader("Content-Type", $header); + $msg = (new \Laminas\Diactoros\Request)->withHeader("Content-Type", $header); $this->assertSame($exp, HTTP::matchType($msg, ...$types)); - $msg = (new \Zend\Diactoros\Response)->withHeader("Content-Type", $header); + $msg = (new \Laminas\Diactoros\Response)->withHeader("Content-Type", $header); $this->assertSame($exp, HTTP::matchType($msg, ...$types)); } diff --git a/tests/cases/REST/Fever/TestAPI.php b/tests/cases/REST/Fever/TestAPI.php index ad54243c..f7cd3c53 100644 --- a/tests/cases/REST/Fever/TestAPI.php +++ b/tests/cases/REST/Fever/TestAPI.php @@ -15,10 +15,10 @@ use JKingWeb\Arsse\Db\ExceptionInput; use JKingWeb\Arsse\Db\Transaction; use JKingWeb\Arsse\REST\Fever\API; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Response\JsonResponse; -use Zend\Diactoros\Response\XmlResponse; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Response\JsonResponse; +use Laminas\Diactoros\Response\XmlResponse; +use Laminas\Diactoros\Response\EmptyResponse; /** @covers \JKingWeb\Arsse\REST\Fever\API */ class TestAPI extends \JKingWeb\Arsse\Test\AbstractTest { diff --git a/tests/cases/REST/NextcloudNews/TestV1_2.php b/tests/cases/REST/NextcloudNews/TestV1_2.php index af3d9d54..9aa3c8e9 100644 --- a/tests/cases/REST/NextcloudNews/TestV1_2.php +++ b/tests/cases/REST/NextcloudNews/TestV1_2.php @@ -16,8 +16,8 @@ use JKingWeb\Arsse\Db\ExceptionInput; use JKingWeb\Arsse\Db\Transaction; use JKingWeb\Arsse\REST\NextcloudNews\V1_2; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Response\JsonResponse as Response; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\Response\JsonResponse as Response; +use Laminas\Diactoros\Response\EmptyResponse; /** @covers \JKingWeb\Arsse\REST\NextcloudNews\V1_2 */ class TestV1_2 extends \JKingWeb\Arsse\Test\AbstractTest { diff --git a/tests/cases/REST/NextcloudNews/TestVersions.php b/tests/cases/REST/NextcloudNews/TestVersions.php index 2fc40b80..7c65ddbf 100644 --- a/tests/cases/REST/NextcloudNews/TestVersions.php +++ b/tests/cases/REST/NextcloudNews/TestVersions.php @@ -8,9 +8,9 @@ namespace JKingWeb\Arsse\TestCase\REST\NextcloudNews; use JKingWeb\Arsse\REST\NextcloudNews\Versions; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Response\JsonResponse as Response; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Response\JsonResponse as Response; +use Laminas\Diactoros\Response\EmptyResponse; /** @covers \JKingWeb\Arsse\REST\NextcloudNews\Versions */ class TestVersions extends \JKingWeb\Arsse\Test\AbstractTest { diff --git a/tests/cases/REST/TestREST.php b/tests/cases/REST/TestREST.php index 36c1753a..249e80c1 100644 --- a/tests/cases/REST/TestREST.php +++ b/tests/cases/REST/TestREST.php @@ -15,11 +15,11 @@ use JKingWeb\Arsse\REST\NextcloudNews\V1_2 as NCN; use JKingWeb\Arsse\REST\TinyTinyRSS\API as TTRSS; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Request; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Response\TextResponse; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\Request; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Response\TextResponse; +use Laminas\Diactoros\Response\EmptyResponse; /** @covers \JKingWeb\Arsse\REST */ class TestREST extends \JKingWeb\Arsse\Test\AbstractTest { diff --git a/tests/cases/REST/TinyTinyRSS/TestAPI.php b/tests/cases/REST/TinyTinyRSS/TestAPI.php index d3a275ac..f25c4ccb 100644 --- a/tests/cases/REST/TinyTinyRSS/TestAPI.php +++ b/tests/cases/REST/TinyTinyRSS/TestAPI.php @@ -16,9 +16,9 @@ use JKingWeb\Arsse\Db\ExceptionInput; use JKingWeb\Arsse\Db\Transaction; use JKingWeb\Arsse\REST\TinyTinyRSS\API; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Response\JsonResponse as Response; -use Zend\Diactoros\Response\EmptyResponse; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Response\JsonResponse as Response; +use Laminas\Diactoros\Response\EmptyResponse; /** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\API * @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Exception */ diff --git a/tests/cases/REST/TinyTinyRSS/TestIcon.php b/tests/cases/REST/TinyTinyRSS/TestIcon.php index d7f50626..fd330945 100644 --- a/tests/cases/REST/TinyTinyRSS/TestIcon.php +++ b/tests/cases/REST/TinyTinyRSS/TestIcon.php @@ -11,8 +11,8 @@ use JKingWeb\Arsse\User; use JKingWeb\Arsse\Database; use JKingWeb\Arsse\REST\TinyTinyRSS\Icon; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Response\EmptyResponse as Response; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Response\EmptyResponse as Response; /** @covers \JKingWeb\Arsse\REST\TinyTinyRSS\Icon */ class TestIcon extends \JKingWeb\Arsse\Test\AbstractTest { diff --git a/tests/lib/AbstractTest.php b/tests/lib/AbstractTest.php index 1581b0a6..bb0c688f 100644 --- a/tests/lib/AbstractTest.php +++ b/tests/lib/AbstractTest.php @@ -18,9 +18,9 @@ use Psr\Http\Message\MessageInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Response\JsonResponse; -use Zend\Diactoros\Response\XmlResponse; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Response\JsonResponse; +use Laminas\Diactoros\Response\XmlResponse; /** @coversNothing */ abstract class AbstractTest extends \PHPUnit\Framework\TestCase {