Skip to content

Commit 65f58f1

Browse files
committed
Fix CS
1 parent abd6f97 commit 65f58f1

Some content is hidden

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

52 files changed

+89
-121
lines changed

src/AdapterCollection.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
2+
declare(strict_types=1);
33
/**
44
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
55
* Licensed under The MIT License
@@ -12,8 +12,6 @@
1212
* @license https://opensource.org/licenses/MIT MIT License
1313
*/
1414

15-
declare(strict_types=1);
16-
1715
namespace PhpCollective\Infrastructure\Storage;
1816

1917
use ArrayIterator;
@@ -113,7 +111,7 @@ public function empty(): void
113111
*/
114112
public function getNameToClassmap(): array
115113
{
116-
if (empty($this->adapters)) {
114+
if (!$this->adapters) {
117115
return [];
118116
}
119117

src/AdapterCollectionInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
2+
declare(strict_types=1);
33
/**
44
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
55
* Licensed under The MIT License
@@ -12,8 +12,6 @@
1212
* @license https://opensource.org/licenses/MIT MIT License
1313
*/
1414

15-
declare(strict_types=1);
16-
1715
namespace PhpCollective\Infrastructure\Storage;
1816

1917
use IteratorAggregate;

src/Exception/FileDoesNotExistException.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,19 +13,22 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage\Exception;
1817

1918
/**
2019
* Storage Exception
2120
*/
2221
class FileDoesNotExistException extends StorageException
2322
{
23+
/**
24+
* @param string $file
25+
*
26+
* @return self
27+
*/
2428
public static function filename(string $file): self
2529
{
2630
return new self(sprintf(
27-
'File %s does not exist',
31+
'File `%s` does not exist',
2832
$file,
2933
));
3034
}

src/Exception/FileNotReadableException.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,19 +13,22 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage\Exception;
1817

1918
/**
2019
* Storage Exception
2120
*/
2221
class FileNotReadableException extends StorageException
2322
{
23+
/**
24+
* @param string $file
25+
*
26+
* @return self
27+
*/
2428
public static function filename(string $file): self
2529
{
2630
return new self(sprintf(
27-
'File %s is not readable',
31+
'File `%s` is not readable',
2832
$file,
2933
));
3034
}

src/Exception/InvalidStreamResourceException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,15 +13,16 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage\Exception;
1817

1918
/**
2019
* Invalid Stream Resource
2120
*/
2221
class InvalidStreamResourceException extends StorageException
2322
{
23+
/**
24+
* @return self
25+
*/
2426
public static function create(): self
2527
{
2628
return new self(

src/File.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,8 +13,6 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage;
1817

1918
use PhpCollective\Infrastructure\Storage\Exception\InvalidStreamResourceException;
@@ -119,8 +118,8 @@ class File implements FileInterface
119118
* @param string|null $collection Collection name
120119
* @param string|null $model Model name
121120
* @param string|null $modelId Model id
122-
* @param array $variants Variants
123121
* @param array $metadata Meta data
122+
* @param array $variants Variants
124123
* @param resource|null $resource
125124
*
126125
* @return self
@@ -199,6 +198,8 @@ public function resource()
199198
*
200199
* @param string $file File
201200
*
201+
* @throws \RuntimeException
202+
*
202203
* @return self
203204
*/
204205
public function withFile(string $file): FileInterface
@@ -251,9 +252,9 @@ public function withResource($resource): FileInterface
251252
* @param string $model Model
252253
* @param string|int $modelId Model ID, UUID string or integer
253254
*
254-
* @return self
255+
* @return $this
255256
*/
256-
public function belongsToModel(string $model, $modelId): FileInterface
257+
public function belongsToModel(string $model, $modelId)
257258
{
258259
$this->model = $model;
259260
$this->modelId = (string)$modelId;
@@ -266,9 +267,9 @@ public function belongsToModel(string $model, $modelId): FileInterface
266267
*
267268
* @param string $collection Collection
268269
*
269-
* @return self
270+
* @return $this
270271
*/
271-
public function addToCollection(string $collection): FileInterface
272+
public function addToCollection(string $collection)
272273
{
273274
$this->collection = $collection;
274275

@@ -562,7 +563,9 @@ public function variantPaths(): array
562563

563564
/**
564565
* @param string $key
565-
* @param mixed $data;
566+
* @param mixed $data
567+
*
568+
* @return self
566569
*/
567570
public function withMetadataKey(string $key, $data): FileInterface
568571
{
@@ -605,7 +608,7 @@ public function withVariants(array $variants, bool $merge = true): FileInterface
605608
/**
606609
* @inheritDoc
607610
*/
608-
public function buildUrl(UrlBuilderInterface $urlBuilder): FileInterface
611+
public function buildUrl(UrlBuilderInterface $urlBuilder)
609612
{
610613
$this->url = $urlBuilder->url($this);
611614

src/FileFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,8 +13,6 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage;
1817

1918
use PhpCollective\Infrastructure\Storage\Exception\FileDoesNotExistException;
@@ -52,6 +51,8 @@ public static function fromUploadedFile(
5251

5352
/**
5453
* @inheritDoc
54+
*
55+
* @throws \RuntimeException
5556
*/
5657
public static function fromDisk(string $path, string $storage): FileInterface
5758
{

src/FileFactoryInterface.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,8 +13,6 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage;
1817

1918
use Psr\Http\Message\UploadedFileInterface;

src/FileInterface.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,8 +13,6 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage;
1817

1918
use JsonSerializable;
@@ -95,7 +94,7 @@ public function collection(): ?string;
9594
*
9695
* @return $this
9796
*/
98-
public function addToCollection(string $collection): self;
97+
public function addToCollection(string $collection);
9998

10099
/**
101100
* Get a variant
@@ -252,9 +251,9 @@ public function buildPath(PathBuilderInterface $pathBuilder): self;
252251
*
253252
* @param \PhpCollective\Infrastructure\Storage\UrlBuilder\UrlBuilderInterface $urlBuilder URL Builder
254253
*
255-
* @return self
254+
* @return $this
256255
*/
257-
public function buildUrl(UrlBuilderInterface $urlBuilder): self;
256+
public function buildUrl(UrlBuilderInterface $urlBuilder);
258257

259258
/**
260259
* Gets the URL for the file
@@ -313,7 +312,7 @@ public function withFilename(string $filename): self;
313312
* @param string $model Model
314313
* @param string|int $modelId Model ID, UUID string or integer
315314
*
316-
* @return self
315+
* @return $this
317316
*/
318-
public function belongsToModel(string $model, $modelId): self;
317+
public function belongsToModel(string $model, $modelId);
319318
}

src/FileStorage.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* Copyright (c) Florian Krämer (https://florian-kraemer.net)
@@ -12,8 +13,6 @@
1213
* @license https://opensource.org/licenses/MIT MIT License
1314
*/
1415

15-
declare(strict_types=1);
16-
1716
namespace PhpCollective\Infrastructure\Storage;
1817

1918
use InvalidArgumentException;

0 commit comments

Comments
 (0)