Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ 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);
}

/**
* 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;

Expand Down