diff --git a/lib/Api/AbstractV1Api.php b/lib/Api/AbstractV1Api.php index 12d115a..0189a29 100644 --- a/lib/Api/AbstractV1Api.php +++ b/lib/Api/AbstractV1Api.php @@ -41,11 +41,11 @@ abstract class AbstractV1Api protected ?LoggerInterface $logger; public function __construct( - ClientConfigInterface $clientConfig = null, - ClientInterface $client = null, - SerializerInterface $serializer = null, - RequestFactory $requestFactory = null, - LoggerInterface $logger = null + ?ClientConfigInterface $clientConfig = null, + ?ClientInterface $client = null, + ?SerializerInterface $serializer = null, + ?RequestFactory $requestFactory = null, + ?LoggerInterface $logger = null ) { $this->clientConfig = $clientConfig ?: new ClientConfig(); $this->client = $client ?: new Client(); @@ -104,7 +104,7 @@ protected function sendRequestAndHandleResponse( return $response; } - protected function createHttpPostRequest(string $path, array $headers = [], string $httpBody = null): Request + protected function createHttpPostRequest(string $path, array $headers = [], ?string $httpBody = null): Request { $uri = rtrim($this->clientConfig->getServiceUrl(), '/') . $path; if ($this->logger !== null) { diff --git a/src/Logger/MetricsLogHandler.php b/src/Logger/MetricsLogHandler.php index faf659c..4c4ae78 100644 --- a/src/Logger/MetricsLogHandler.php +++ b/src/Logger/MetricsLogHandler.php @@ -11,7 +11,7 @@ class MetricsLogHandler extends BaseLogger { private const LOG_FILENAME = '/var/log/rar_prometheus_metric.log'; - public function __construct(DriverInterface $filesystem, string $filePath = null) + public function __construct(DriverInterface $filesystem, ?string $filePath = null) { parent::__construct($filesystem, $filePath, self::LOG_FILENAME); }