diff --git a/src/Client.php b/src/Client.php index 8b34243..4e77566 100644 --- a/src/Client.php +++ b/src/Client.php @@ -145,7 +145,7 @@ class Client /** * The constructor. */ - public function __construct(array $options = [], RepositoryRegistry $repositoryRegistry = null, ClientInterface $httpClient = null, HttpRequestFactory $httpRequestFactory = null, StreamFactoryInterface $streamFactory = null) + public function __construct(array $options = [], ?RepositoryRegistry $repositoryRegistry = null, ?ClientInterface $httpClient = null, ?HttpRequestFactory $httpRequestFactory = null, ?StreamFactoryInterface $streamFactory = null) { $this->setOptions($options); $this->classRegistry = $repositoryRegistry ?: new RepositoryRegistry(); @@ -383,7 +383,7 @@ public function setPatchType(string $patchType = "strategic"): void * @throws \Maclof\Kubernetes\Exceptions\BadRequestException */ #[\ReturnTypeWillChange] - public function sendRequest(string $method, string $uri, array $query = [], $body = null, bool $namespace = true, string $apiVersion = null, array $requestOptions = []) + public function sendRequest(string $method, string $uri, array $query = [], $body = null, bool $namespace = true, ?string $apiVersion = null, array $requestOptions = []) { $baseUri = $apiVersion ? ('apis/' . $apiVersion) : ('api/' . $this->apiVersion); if ($namespace) { diff --git a/src/Repositories/Repository.php b/src/Repositories/Repository.php index 64c5096..d6ab721 100644 --- a/src/Repositories/Repository.php +++ b/src/Repositories/Repository.php @@ -155,7 +155,7 @@ public function apply(Model $model): array /** * Delete a model. */ - public function delete(Model $model, DeleteOptions $options = null): array + public function delete(Model $model, ?DeleteOptions $options = null): array { return $this->deleteByName((string)$model->getMetadata('name'), $options); } @@ -163,7 +163,7 @@ public function delete(Model $model, DeleteOptions $options = null): array /** * Delete a model by name. */ - public function deleteByName(string $name, DeleteOptions $options = null): array + public function deleteByName(string $name, ?DeleteOptions $options = null): array { $body = $options ? $options->getSchema() : null;