mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 15:47:32 +02:00
Fix deprecations (#4636)
* Fix PHP 8.4 deprecation Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead * [github workflow] Add additional php versions
This commit is contained in:
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: shivammathur/setup-php@v2
|
||||
|
@@ -443,7 +443,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
return $data['owner'];
|
||||
}
|
||||
|
||||
private function getPost($id, array $metadata = null)
|
||||
private function getPost($id, ?array $metadata = null)
|
||||
{
|
||||
if (isset($metadata) && count($metadata['gallery_images']) < $metadata['num_images']) {
|
||||
$metadata = null; //force re-fetch of metadata
|
||||
@@ -515,7 +515,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
];
|
||||
}
|
||||
|
||||
private function getCommission($id, array $metadata = null)
|
||||
private function getCommission($id, ?array $metadata = null)
|
||||
{
|
||||
$url = self::URI . '/api/commissions/' . $id . '/?format=json';
|
||||
$uri = self::URI . '/commissions/' . $id;
|
||||
|
@@ -23,7 +23,7 @@ class ArrayCache implements CacheInterface
|
||||
return $default;
|
||||
}
|
||||
|
||||
public function set(string $key, $value, int $ttl = null): void
|
||||
public function set(string $key, $value, ?int $ttl = null): void
|
||||
{
|
||||
$this->data[$key] = [
|
||||
'key' => $key,
|
||||
|
@@ -45,7 +45,7 @@ class FileCache implements CacheInterface
|
||||
return $default;
|
||||
}
|
||||
|
||||
public function set($key, $value, int $ttl = null): void
|
||||
public function set($key, $value, ?int $ttl = null): void
|
||||
{
|
||||
$item = [
|
||||
'key' => $key,
|
||||
|
@@ -9,7 +9,7 @@ class NullCache implements CacheInterface
|
||||
return $default;
|
||||
}
|
||||
|
||||
public function set(string $key, $value, int $ttl = null): void
|
||||
public function set(string $key, $value, ?int $ttl = null): void
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -77,7 +77,7 @@ class SQLiteCache implements CacheInterface
|
||||
return $default;
|
||||
}
|
||||
|
||||
public function set(string $key, $value, int $ttl = null): void
|
||||
public function set(string $key, $value, ?int $ttl = null): void
|
||||
{
|
||||
$cacheKey = $this->createCacheKey($key);
|
||||
$blob = serialize($value);
|
||||
|
@@ -12,7 +12,7 @@ class CacheFactory
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function create(string $name = null): CacheInterface
|
||||
public function create(?string $name = null): CacheInterface
|
||||
{
|
||||
$cacheNames = [];
|
||||
foreach (scandir(PATH_LIB_CACHES) as $file) {
|
||||
|
@@ -4,7 +4,7 @@ interface CacheInterface
|
||||
{
|
||||
public function get(string $key, $default = null);
|
||||
|
||||
public function set(string $key, $value, int $ttl = null): void;
|
||||
public function set(string $key, $value, ?int $ttl = null): void;
|
||||
|
||||
public function delete(string $key): void;
|
||||
|
||||
|
@@ -227,7 +227,7 @@ final class Request
|
||||
return $this->get[$key] ?? $default;
|
||||
}
|
||||
|
||||
public function server(string $key, string $default = null): ?string
|
||||
public function server(string $key, ?string $default = null): ?string
|
||||
{
|
||||
return $this->server[$key] ?? $default;
|
||||
}
|
||||
|
@@ -712,7 +712,7 @@ class Parsedown
|
||||
#
|
||||
# Setext
|
||||
|
||||
protected function blockSetextHeader($Line, array $Block = null)
|
||||
protected function blockSetextHeader($Line, ?array $Block = null)
|
||||
{
|
||||
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
|
||||
{
|
||||
@@ -850,7 +850,7 @@ class Parsedown
|
||||
#
|
||||
# Table
|
||||
|
||||
protected function blockTable($Line, array $Block = null)
|
||||
protected function blockTable($Line, ?array $Block = null)
|
||||
{
|
||||
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
|
||||
{
|
||||
|
Reference in New Issue
Block a user