diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 96128fc2..435369fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/bridges/ItakuBridge.php b/bridges/ItakuBridge.php index 22d7529f..0f60d486 100644 --- a/bridges/ItakuBridge.php +++ b/bridges/ItakuBridge.php @@ -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; diff --git a/caches/ArrayCache.php b/caches/ArrayCache.php index 55b18519..ddbd77d5 100644 --- a/caches/ArrayCache.php +++ b/caches/ArrayCache.php @@ -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, diff --git a/caches/FileCache.php b/caches/FileCache.php index 24a9872f..5b2f4b37 100644 --- a/caches/FileCache.php +++ b/caches/FileCache.php @@ -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, diff --git a/caches/NullCache.php b/caches/NullCache.php index 2549b117..9756b0aa 100644 --- a/caches/NullCache.php +++ b/caches/NullCache.php @@ -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 { } diff --git a/caches/SQLiteCache.php b/caches/SQLiteCache.php index d7cba554..a8d51c74 100644 --- a/caches/SQLiteCache.php +++ b/caches/SQLiteCache.php @@ -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); diff --git a/lib/CacheFactory.php b/lib/CacheFactory.php index 50d8cef9..96720458 100644 --- a/lib/CacheFactory.php +++ b/lib/CacheFactory.php @@ -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) { diff --git a/lib/CacheInterface.php b/lib/CacheInterface.php index 0009a55c..02f522e6 100644 --- a/lib/CacheInterface.php +++ b/lib/CacheInterface.php @@ -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; diff --git a/lib/http.php b/lib/http.php index 37a1f12e..b89e3c05 100644 --- a/lib/http.php +++ b/lib/http.php @@ -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; } diff --git a/lib/parsedown/Parsedown.php b/lib/parsedown/Parsedown.php index 1b9d6d5b..d9b5476a 100644 --- a/lib/parsedown/Parsedown.php +++ b/lib/parsedown/Parsedown.php @@ -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'])) {