Update to feedio 4+ (#494)
- bumped dependencies to last supported version travis: - removed php 7.0 - move main target to nc 16 - drop support for nc 14 & 15 Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
parent
6c01164b9b
commit
ae99d52aad
11
.travis.yml
11
.travis.yml
|
@ -2,30 +2,31 @@ sudo: false
|
|||
dist: trusty
|
||||
language: php
|
||||
php:
|
||||
- 7.0.33
|
||||
- 7.1.26
|
||||
- 7.2
|
||||
- 7.3
|
||||
- 7.4snapshot
|
||||
- nightly
|
||||
|
||||
env:
|
||||
global:
|
||||
- CORE_BRANCH=stable15
|
||||
- CORE_BRANCH=stable16
|
||||
- MOZ_HEADLESS=1
|
||||
matrix:
|
||||
- DB=pgsql
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- env: DB=pgsql CORE_BRANCH=master
|
||||
- env: CORE_BRANCH=master
|
||||
- php: nightly
|
||||
- php: 7.4snapshot
|
||||
include:
|
||||
- php: 7.3
|
||||
env: DB=sqlite
|
||||
- php: 7.3
|
||||
env: DB=mysql
|
||||
- php: 7.3
|
||||
env: DB=pgsql CORE_BRANCH=master
|
||||
env: CORE_BRANCH=master
|
||||
fast_finish: true
|
||||
|
||||
before_install:
|
||||
|
@ -64,4 +65,4 @@ after_success:
|
|||
addons:
|
||||
firefox: "latest-beta"
|
||||
postgresql: "9.6"
|
||||
mariadb: "10.3"
|
||||
mariadb: "10.4"
|
||||
|
|
|
@ -28,7 +28,7 @@ Before you update to a new version, [check the changelog](https://github.com/nex
|
|||
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/news/master/screenshots/2-small.png">https://raw.githubusercontent.com/nextcloud/news/master/screenshots/2.png</screenshot>
|
||||
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/news/master/screenshots/3-small.png">https://raw.githubusercontent.com/nextcloud/news/master/screenshots/3.png</screenshot>
|
||||
<dependencies>
|
||||
<php min-version="7.0"/>
|
||||
<php min-version="7.1"/>
|
||||
<database min-version="9.4">pgsql</database>
|
||||
<database>sqlite</database>
|
||||
<database min-version="5.5">mysql</database>
|
||||
|
@ -37,7 +37,7 @@ Before you update to a new version, [check the changelog](https://github.com/nex
|
|||
<lib>SimpleXML</lib>
|
||||
<lib>iconv</lib>
|
||||
<owncloud max-version="0" min-version="0"/>
|
||||
<nextcloud min-version="14" max-version="16"/>
|
||||
<nextcloud min-version="16" max-version="17"/>
|
||||
</dependencies>
|
||||
|
||||
<background-jobs>
|
||||
|
|
|
@ -35,19 +35,19 @@
|
|||
"source": "https://github.com/nextcloud/news/"
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0",
|
||||
"php": "^7.1",
|
||||
"ezyang/htmlpurifier": "4.10.0",
|
||||
"pear/net_url2": "2.2.2",
|
||||
"riimu/kit-pathjoin": "1.2.0",
|
||||
"debril/feed-io": "^3.1",
|
||||
"debril/feed-io": "^4.3",
|
||||
"arthurhoaro/favicon": "^1.2",
|
||||
"ext-json": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-libxml": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.5",
|
||||
"squizlabs/php_codesniffer": "^3.3",
|
||||
"phpunit/phpunit": "^7.5",
|
||||
"squizlabs/php_codesniffer": "^3.4",
|
||||
"guzzlehttp/guzzle": "^6.3"
|
||||
},
|
||||
"replace": {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -11,6 +11,7 @@
|
|||
namespace OCA\News\Fetcher\Client;
|
||||
|
||||
use FeedIo\Adapter\ClientInterface;
|
||||
use FeedIo\Adapter\ResponseInterface;
|
||||
use FeedIo\Adapter\Guzzle\Response;
|
||||
use FeedIo\Adapter\NotFoundException;
|
||||
use FeedIo\Adapter\ServerErrorException;
|
||||
|
@ -41,7 +42,7 @@ class FeedIoClient implements ClientInterface
|
|||
* @throws \FeedIo\Adapter\ServerErrorException
|
||||
* @return \FeedIo\Adapter\ResponseInterface
|
||||
*/
|
||||
public function getResponse($url, \DateTime $modifiedSince)
|
||||
public function getResponse(string $url, \DateTime $modifiedSince) : ResponseInterface
|
||||
{
|
||||
try {
|
||||
$options = [
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
namespace OCA\News\Fetcher\Client;
|
||||
|
||||
use FeedIo\Adapter\ClientInterface as FeedIoClientInterface;
|
||||
use FeedIo\Adapter\ResponseInterface;
|
||||
use FeedIo\Adapter\NotFoundException;
|
||||
use FeedIo\Adapter\ServerErrorException;
|
||||
use Guzzle\Service\ClientInterface;
|
||||
|
@ -42,7 +43,7 @@ class LegacyGuzzleClient implements FeedIoClientInterface
|
|||
* @throws \FeedIo\Adapter\ServerErrorException
|
||||
* @return \FeedIo\Adapter\ResponseInterface
|
||||
*/
|
||||
public function getResponse($url, \DateTime $modifiedSince)
|
||||
public function getResponse(string $url, \DateTime $modifiedSince) : ResponseInterface
|
||||
{
|
||||
try {
|
||||
$options = [
|
||||
|
|
|
@ -37,7 +37,7 @@ class LegacyGuzzleResponse implements ResponseInterface
|
|||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isModified()
|
||||
public function isModified() : bool
|
||||
{
|
||||
return $this->response->getStatusCode() !== 304 && $this->response->getBody()->getSize() > 0;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class LegacyGuzzleResponse implements ResponseInterface
|
|||
/**
|
||||
* @return \Psr\Http\Message\StreamInterface
|
||||
*/
|
||||
public function getBody()
|
||||
public function getBody() : ? string
|
||||
{
|
||||
return $this->response->getBody();
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class LegacyGuzzleResponse implements ResponseInterface
|
|||
/**
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getLastModified()
|
||||
public function getLastModified() : ?\DateTime
|
||||
{
|
||||
if ($this->response->hasHeader(static::HTTP_LAST_MODIFIED)) {
|
||||
$lastModified = \DateTime::createFromFormat(
|
||||
|
@ -64,13 +64,13 @@ class LegacyGuzzleResponse implements ResponseInterface
|
|||
return false === $lastModified ? null : $lastModified;
|
||||
}
|
||||
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getHeaders()
|
||||
public function getHeaders() : iterable
|
||||
{
|
||||
return $this->response->getHeaders();
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class LegacyGuzzleResponse implements ResponseInterface
|
|||
* @param string $name
|
||||
* @return string[]
|
||||
*/
|
||||
public function getHeader($name)
|
||||
public function getHeader(string $name) : iterable
|
||||
{
|
||||
return current($this->response->getHeader($name));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue