Skip to content

Commit

Permalink
ci: fix php-cs-fixer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
carlalexander committed Jul 12, 2024
1 parent f7bf891 commit 678ba10
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/CloudProvider/Aws/AbstractClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected function parseResponseStatusCode(array $response): int
/**
* Makes a request to the AWS API for the given URI.
*/
protected function request(string $method, string $uri, string $body = null, array $headers = []): array
protected function request(string $method, string $uri, ?string $body = null, array $headers = []): array
{
$arguments = [
'headers' => $this->mergeHeaders($this->createBaseHeaders($body), $headers),
Expand Down
2 changes: 1 addition & 1 deletion src/CloudProvider/Aws/S3Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected function getService(): string
/**
* Makes a request to the AWS S3 API for the given object key.
*/
protected function request(string $method, string $key, string $body = null, array $headers = []): array
protected function request(string $method, string $key, ?string $body = null, array $headers = []): array
{
return parent::request($method, $this->createRequestUri($key), $body, $headers);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CloudStorage/AbstractCloudStorageStreamWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static function getProtocol(): string
/**
* Register the cloud storage stream wrapper.
*/
public static function register(CloudStorageClientInterface $client, \ArrayObject $cache = null)
public static function register(CloudStorageClientInterface $client, ?\ArrayObject $cache = null)
{
if (in_array(static::getProtocol(), stream_get_wrappers())) {
stream_wrapper_unregister(static::getProtocol());
Expand Down
2 changes: 1 addition & 1 deletion src/Console/RunAllCronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RunAllCronCommand extends AbstractCommand
/**
* Constructor.
*/
public function __construct(ConsoleClientInterface $consoleClient, EventManager $eventManager, WpCli $wpCli, \WP_Site_Query $siteQuery = null)
public function __construct(ConsoleClientInterface $consoleClient, EventManager $eventManager, WpCli $wpCli, ?\WP_Site_Query $siteQuery = null)
{
parent::__construct($wpCli);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ContentDeliveryNetworkImageProcessingSubscriber implements SubscriberInter
/**
* {@inheritdoc}
*/
public function __construct(array $baseImageSizes, bool $isMultisite, string $uploadsUrl, int $contentWidthGlobal = null)
public function __construct(array $baseImageSizes, bool $isMultisite, string $uploadsUrl, ?int $contentWidthGlobal = null)
{
$this->baseImageSizes = $baseImageSizes;
$this->contentWidthGlobal = $contentWidthGlobal;
Expand Down Expand Up @@ -128,10 +128,10 @@ public function generateScaledDownImage($image, $attachmentId, $size)
list($width, $height, $cropped) = $this->getImageAttachmentDimensions((int) $attachmentId, $size);

return [
$this->generateImageUrl($imageUrl, $height, $width, $cropped),
$width ?? false,
$height ?? false,
'full' !== $size,
$this->generateImageUrl($imageUrl, $height, $width, $cropped),
$width ?? false,
$height ?? false,
'full' !== $size,
];
}

Expand Down
6 changes: 3 additions & 3 deletions src/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function each(callable $callback)
/**
* Run a filter over each collection item.
*/
public function filter(callable $callback = null): self
public function filter(?callable $callback = null): self
{
$filtered = $callback ? array_filter($this->items, $callback, ARRAY_FILTER_USE_BOTH) : array_filter($this->items);

Expand Down Expand Up @@ -283,15 +283,15 @@ public function shift(int $count = 1)
/**
* Extract a slice of the collection.
*/
public function slice(int $offset, int $length = null): self
public function slice(int $offset, ?int $length = null): self
{
return new self(array_slice($this->items, $offset, $length, true));
}

/**
* Sort through each item with a callback.
*/
public function sort(callable $callback = null)
public function sort(?callable $callback = null)
{
$items = $this->items;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/CloudProvider/Aws/DynamoDbClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function testBatchGetItem()
'method' => 'POST',
'timeout' => 300,
'body' => '{"RequestItems":{"table":{"ConsistentRead":false,"Keys":[{"key":{"S":"forum"}}]}}}',
])
])
)
->willReturn([
'body' => '{"Responses": {"Forum": [{"Name":{"S":"Amazon DynamoDB"}, "Threads":{"N":"5"}, "Messages":{"N":"19"}, "Views":{"N":"35"}}]}}',
Expand Down
12 changes: 6 additions & 6 deletions tests/Unit/CloudProvider/Aws/S3ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ public function testObjectExists()
])
)
->willReturn([
'headers' => [
'content-type' => 'text/plain',
'content-length' => 42,
'last-modified' => '10 September 2000',
],
'response' => ['code' => 200],
'headers' => [
'content-type' => 'text/plain',
'content-length' => 42,
'last-modified' => '10 September 2000',
],
'response' => ['code' => 200],
]);

$gmdate = $this->getFunctionMock($this->getNamespace(S3Client::class), 'gmdate');
Expand Down

0 comments on commit 678ba10

Please sign in to comment.