fix many PHP 8.4 compatibility issues

This commit is contained in:
Beu
2025-05-26 22:50:03 +02:00
parent 03a991cd50
commit 7a8d9f2b0b
59 changed files with 137 additions and 98 deletions

View File

@ -22,7 +22,7 @@ abstract class WebReader {
* @param callable $function
* @return Response
*/
public static function getUrl($url, callable $function = null) {
public static function getUrl($url, ?callable $function = null) {
$request = static::newRequest($url);
$response = $request->send();
if ($function) {
@ -73,7 +73,7 @@ abstract class WebReader {
* @param callable $function
* @return Response
*/
public static function postUrl($url, $content = null, callable $function = null) {
public static function postUrl($url, $content = null, ?callable $function = null) {
$request = static::newRequest($url);
$request->getOptions()->set(CURLOPT_POST, true); // post method
if ($content) {