Skip to content

Commit 00e83d0

Browse files
Added return types
1 parent 89e7563 commit 00e83d0

File tree

8 files changed

+8
-38
lines changed

8 files changed

+8
-38
lines changed

src/Binary/Loader/FileSystemLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
/**
3838
* {@inheritdoc}
3939
*/
40-
public function find($path)
40+
public function find($path): FileBinary
4141
{
4242
$path = $this->locator->locate($path);
4343
$mimeType = $this->mimeTypeGuesser->guessMimeType($path);

src/Binary/Loader/FlysystemLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
/**
3434
* {@inheritdoc}
3535
*/
36-
public function find($path)
36+
public function find($path): Binary
3737
{
3838
if (false === $this->filesystem->has($path)) {
3939
throw new NotLoadableException(sprintf('Source image "%s" not found.', $path));

src/Binary/Loader/FlysystemV2Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
public function find($path)
37+
public function find($path): Binary
3838
{
3939
try {
4040
$mimeType = $this->filesystem->mimeType($path);

src/Binary/Loader/StreamLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(string $wrapperPrefix, $context = null)
4646
/**
4747
* {@inheritdoc}
4848
*/
49-
public function find($path)
49+
public function find($path): string
5050
{
5151
$name = $this->wrapperPrefix.$path;
5252

src/Events/CacheResolveEvent.php

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,75 +15,45 @@
1515

1616
class CacheResolveEvent extends Event
1717
{
18-
/**
19-
* Resource path.
20-
*/
2118
protected string $path;
2219

23-
/**
24-
* Filter name.
25-
*/
2620
protected string $filter;
2721

28-
/**
29-
* Resource url.
30-
*/
3122
protected ?string $url;
3223

33-
/**
34-
* Init default event state.
35-
*/
3624
public function __construct(string $path, string $filter, ?string $url = null)
3725
{
3826
$this->path = $path;
3927
$this->filter = $filter;
4028
$this->url = $url;
4129
}
4230

43-
/**
44-
* Sets resource path.
45-
*/
4631
public function setPath(string $path): void
4732
{
4833
$this->path = $path;
4934
}
5035

51-
/**
52-
* Returns resource path.
53-
*/
5436
public function getPath(): string
5537
{
5638
return $this->path;
5739
}
5840

59-
/**
60-
* Sets filter name.
61-
*/
6241
public function setFilter(string $filter): void
6342
{
6443
$this->filter = $filter;
6544
}
6645

67-
/**
68-
* Returns filter name.
69-
*/
7046
public function getFilter(): string
7147
{
7248
return $this->filter;
7349
}
7450

75-
/**
76-
* Sets resource url.
77-
*/
7851
public function setUrl(?string $url): void
7952
{
8053
$this->url = $url;
8154
}
8255

83-
/**
84-
* Returns resource url.
85-
*/
86-
public function getUrl(): ?string
56+
public function getUrl(): string
8757
{
8858
return $this->url;
8959
}

src/Imagine/Cache/CacheManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function addResolver(string $filter, ResolverInterface $resolver): void
7777
*
7878
* @param string $path The path where the resolved file is expected
7979
*/
80-
public function getBrowserPath(string $path, string $filter, array $runtimeConfig = [], ?string $resolver = null, int $referenceType = UrlGeneratorInterface::ABSOLUTE_URL): string
80+
public function getBrowserPath(string $path, string $filter, array $runtimeConfig = [], ?string $resolver = null, int $referenceType = UrlGeneratorInterface::ABSOLUTE_URL): ?string
8181
{
8282
if (!empty($runtimeConfig)) {
8383
$rcPath = $this->getRuntimePath($path, $runtimeConfig);

src/Imagine/Cache/Resolver/ProxyResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function remove(array $paths, array $filters): void
5656
$this->resolver->remove($paths, $filters);
5757
}
5858

59-
protected function rewriteUrl(string $url): string
59+
protected function rewriteUrl(string $url): ?string
6060
{
6161
if (empty($this->hosts)) {
6262
return $url;

src/Imagine/Filter/FilterManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function apply(BinaryInterface $binary, array $config): BinaryInterface
7979
return $this->applyPostProcessors($this->applyFilters($binary, $config), $config);
8080
}
8181

82-
public function applyFilters(BinaryInterface $binary, array $config): BinaryInterface
82+
public function applyFilters(BinaryInterface $binary, array $config): Binary
8383
{
8484
if ($binary instanceof FileBinaryInterface) {
8585
$image = $this->imagine->open($binary->getPath());

0 commit comments

Comments
 (0)