Skip to content

Commit 9b795d6

Browse files
committed
style: add void return type
1 parent 74bb6ee commit 9b795d6

93 files changed

Lines changed: 544 additions & 544 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Autoloader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Autoloader
2121
/**
2222
* Handles autoloading of Ymir plugin classes.
2323
*/
24-
public static function autoload(string $class)
24+
public static function autoload(string $class): void
2525
{
2626
if (!str_starts_with($class, __NAMESPACE__)) {
2727
return;
@@ -38,7 +38,7 @@ public static function autoload(string $class)
3838
/**
3939
* Registers the plugin autoloader as an SPL autoloader.
4040
*/
41-
public static function register(bool $prepend = false)
41+
public static function register(bool $prepend = false): void
4242
{
4343
spl_autoload_register([static::class, 'autoload'], true, $prepend);
4444
}

src/CloudProvider/Aws/CloudFrontClient.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public function __construct(ClientInterface $client, string $distributionId, str
5050
/**
5151
* {@inheritdoc}
5252
*/
53-
public function clearAll()
53+
public function clearAll(): void
5454
{
5555
$this->addPath('/*');
5656
}
5757

5858
/**
5959
* {@inheritdoc}
6060
*/
61-
public function clearUrl(string $url)
61+
public function clearUrl(string $url): void
6262
{
6363
$path = parse_url($url, PHP_URL_PATH);
6464

@@ -72,7 +72,7 @@ public function clearUrl(string $url)
7272
/**
7373
* {@inheritdoc}
7474
*/
75-
public function clearUrls($urls)
75+
public function clearUrls($urls): void
7676
{
7777
if (is_array($urls) || is_string($urls)) {
7878
$urls = new Collection($urls);
@@ -90,7 +90,7 @@ public function clearUrls($urls)
9090
/**
9191
* Invalidate the given paths.
9292
*/
93-
public function invalidatePaths(array $paths)
93+
public function invalidatePaths(array $paths): void
9494
{
9595
$concretePaths = array_filter($paths, function (string $path) {
9696
return !str_ends_with($path, '*');
@@ -110,7 +110,7 @@ public function invalidatePaths(array $paths)
110110
/**
111111
* {@inheritdoc}
112112
*/
113-
public function sendClearRequest(?callable $guard = null)
113+
public function sendClearRequest(?callable $guard = null): void
114114
{
115115
if (empty($this->invalidationPaths)) {
116116
return;
@@ -146,7 +146,7 @@ protected function getService(): string
146146
/**
147147
* Add the given path to the list.
148148
*/
149-
private function addPath(string $path)
149+
private function addPath(string $path): void
150150
{
151151
if (in_array($path, ['*', '/*'])) {
152152
$this->invalidationPaths = ['/*'];
@@ -242,7 +242,7 @@ private function generateInvalidationPayload(array $paths): string
242242
/**
243243
* Send an invalidation request.
244244
*/
245-
private function sendInvalidation(array $paths)
245+
private function sendInvalidation(array $paths): void
246246
{
247247
$attempts = 0;
248248
$maxAttempts = 3;

src/CloudProvider/Aws/DynamoDbClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function batchGetItem(array $arguments): array
4141
/**
4242
* Deletes a single item in a table by primary key.
4343
*/
44-
public function deleteItem(array $arguments)
44+
public function deleteItem(array $arguments): void
4545
{
4646
$response = $this->perform('DeleteItem', $arguments);
4747

@@ -73,7 +73,7 @@ public function getItem(array $arguments)
7373
/**
7474
* Creates a new item, or replaces an old item with a new item.
7575
*/
76-
public function putItem(array $arguments)
76+
public function putItem(array $arguments): void
7777
{
7878
$response = $this->perform('PutItem', $arguments);
7979

src/CloudProvider/Aws/LambdaClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(ClientInterface $client, string $functionName, strin
5050
/**
5151
* {@inheritdoc}
5252
*/
53-
public function createAttachmentMetadata($attachment, bool $async = false)
53+
public function createAttachmentMetadata($attachment, bool $async = false): void
5454
{
5555
$this->runWpCliCommand(sprintf('%s %s', Console\CreateAttachmentMetadataCommand::getName(), $this->getAttachmentId($attachment)), $async);
5656
}
@@ -90,7 +90,7 @@ public function createCroppedAttachmentImage($attachment, int $width, int $heigh
9090
/**
9191
* {@inheritdoc}
9292
*/
93-
public function editAttachmentImage($attachment, string $changes, string $apply = 'all')
93+
public function editAttachmentImage($attachment, string $changes, string $apply = 'all'): void
9494
{
9595
$this->runWpCliCommand(sprintf('%s %s \'%s\' %s', Console\EditAttachmentImageCommand::getName(), $this->getAttachmentId($attachment), $changes, $this->buildOptions([
9696
'apply' => $apply,
@@ -100,7 +100,7 @@ public function editAttachmentImage($attachment, string $changes, string $apply
100100
/**
101101
* {@inheritdoc}
102102
*/
103-
public function resizeAttachmentImage($attachment, int $width, int $height)
103+
public function resizeAttachmentImage($attachment, int $width, int $height): void
104104
{
105105
$this->runWpCliCommand(sprintf('%s %s %s', Console\ResizeAttachmentImageCommand::getName(), $this->getAttachmentId($attachment), $this->buildOptions([
106106
'width' => $width,

src/CloudProvider/Aws/S3Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(ClientInterface $client, string $bucket, string $key
4141
/**
4242
* {@inheritdoc}
4343
*/
44-
public function copyObject(string $sourceKey, string $targetKey, string $acl = 'public-read')
44+
public function copyObject(string $sourceKey, string $targetKey, string $acl = 'public-read'): void
4545
{
4646
$response = $this->request('put', $targetKey, null, [
4747
'x-amz-acl' => $acl,
@@ -66,7 +66,7 @@ public function createPutObjectRequest(string $key, string $acl = 'public-read')
6666
/**
6767
* {@inheritdoc}
6868
*/
69-
public function deleteObject(string $key)
69+
public function deleteObject(string $key): void
7070
{
7171
$response = $this->request('delete', $key);
7272

@@ -176,7 +176,7 @@ public function objectExists(string $key): bool
176176
/**
177177
* {@inheritdoc}
178178
*/
179-
public function putObject(string $key, string $object, string $acl = 'public-read', string $contentType = '')
179+
public function putObject(string $key, string $object, string $acl = 'public-read', string $contentType = ''): void
180180
{
181181
$headers = [
182182
'x-amz-acl' => $acl,

src/CloudProvider/Aws/SesClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function canSendEmails(): bool
4646
/**
4747
* {@inheritdoc}
4848
*/
49-
public function sendEmail(Email $email)
49+
public function sendEmail(Email $email): void
5050
{
5151
$response = $this->request('post', '/', http_build_query([
5252
'Action' => 'SendRawEmail',

src/CloudStorage/AbstractCloudStorageStreamWrapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static function getProtocol(): string
8787
/**
8888
* Register the cloud storage stream wrapper.
8989
*/
90-
public static function register(CloudStorageClientInterface $client, ?\ArrayObject $cache = null)
90+
public static function register(CloudStorageClientInterface $client, ?\ArrayObject $cache = null): void
9191
{
9292
if (in_array(static::getProtocol(), stream_get_wrappers())) {
9393
stream_wrapper_unregister(static::getProtocol());
@@ -279,7 +279,7 @@ public function stream_cast(): bool
279279
*
280280
* @see https://www.php.net/manual/en/streamwrapper.stream-close.php
281281
*/
282-
public function stream_close()
282+
public function stream_close(): void
283283
{
284284
$this->cache = null;
285285
fclose($this->openedStreamObjectResource);
@@ -804,7 +804,7 @@ private function parsePath(string $path): string
804804
/**
805805
* Remove the cache value for the given key.
806806
*/
807-
private function removeCacheValue(string $key)
807+
private function removeCacheValue(string $key): void
808808
{
809809
$cache = $this->getCache();
810810

@@ -818,7 +818,7 @@ private function removeCacheValue(string $key)
818818
/**
819819
* Set the given cache value for the given key.
820820
*/
821-
private function setCacheValue(string $key, $value)
821+
private function setCacheValue(string $key, $value): void
822822
{
823823
$this->getCache()->offsetSet($key, $value);
824824
}

src/Configuration/AssetsConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AssetsConfiguration implements ContainerConfigurationInterface
2525
/**
2626
* {@inheritdoc}
2727
*/
28-
public function modify(Container $container)
28+
public function modify(Container $container): void
2929
{
3030
$container['assets_path'] = $container->service(function () {
3131
return getenv('YMIR_ASSETS_PATH') ?: '';

src/Configuration/AttachmentConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AttachmentConfiguration implements ContainerConfigurationInterface
2525
/**
2626
* {@inheritdoc}
2727
*/
28-
public function modify(Container $container)
28+
public function modify(Container $container): void
2929
{
3030
$container['file_manager'] = $container->service(function (Container $container) {
3131
return new AttachmentFileManager($container['uploads_basedir']);

src/Configuration/CloudProviderConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CloudProviderConfiguration implements ContainerConfigurationInterface
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
public function modify(Container $container)
27+
public function modify(Container $container): void
2828
{
2929
$container['cloud_provider_function_name'] = $container->service(function () {
3030
$functionName = getenv('AWS_LAMBDA_FUNCTION_NAME');

0 commit comments

Comments
 (0)