Skip to content

Commit

Permalink
Added return types
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanvierkant committed Jan 4, 2022
1 parent 89e7563 commit db77179
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/Binary/Loader/FileSystemLoader.php
Expand Up @@ -37,7 +37,7 @@ public function __construct(
/**
* {@inheritdoc}
*/
public function find($path)
public function find($path): FileBinary
{
$path = $this->locator->locate($path);
$mimeType = $this->mimeTypeGuesser->guessMimeType($path);
Expand Down
2 changes: 1 addition & 1 deletion src/Binary/Loader/FlysystemLoader.php
Expand Up @@ -33,7 +33,7 @@ public function __construct(
/**
* {@inheritdoc}
*/
public function find($path)
public function find($path): Binary
{
if (false === $this->filesystem->has($path)) {
throw new NotLoadableException(sprintf('Source image "%s" not found.', $path));
Expand Down
2 changes: 1 addition & 1 deletion src/Binary/Loader/FlysystemV2Loader.php
Expand Up @@ -34,7 +34,7 @@ public function __construct(
/**
* {@inheritdoc}
*/
public function find($path)
public function find($path): Binary
{
try {
$mimeType = $this->filesystem->mimeType($path);
Expand Down
2 changes: 1 addition & 1 deletion src/Binary/Loader/StreamLoader.php
Expand Up @@ -46,7 +46,7 @@ public function __construct(string $wrapperPrefix, $context = null)
/**
* {@inheritdoc}
*/
public function find($path)
public function find($path): string
{
$name = $this->wrapperPrefix.$path;

Expand Down
32 changes: 1 addition & 31 deletions src/Events/CacheResolveEvent.php
Expand Up @@ -15,75 +15,45 @@

class CacheResolveEvent extends Event
{
/**
* Resource path.
*/
protected string $path;

/**
* Filter name.
*/
protected string $filter;

/**
* Resource url.
*/
protected ?string $url;

/**
* Init default event state.
*/
public function __construct(string $path, string $filter, ?string $url = null)
{
$this->path = $path;
$this->filter = $filter;
$this->url = $url;
}

/**
* Sets resource path.
*/
public function setPath(string $path): void
{
$this->path = $path;
}

/**
* Returns resource path.
*/
public function getPath(): string
{
return $this->path;
}

/**
* Sets filter name.
*/
public function setFilter(string $filter): void
{
$this->filter = $filter;
}

/**
* Returns filter name.
*/
public function getFilter(): string
{
return $this->filter;
}

/**
* Sets resource url.
*/
public function setUrl(?string $url): void
{
$this->url = $url;
}

/**
* Returns resource url.
*/
public function getUrl(): ?string
public function getUrl(): string
{
return $this->url;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Imagine/Cache/Resolver/ProxyResolver.php
Expand Up @@ -56,7 +56,7 @@ public function remove(array $paths, array $filters): void
$this->resolver->remove($paths, $filters);
}

protected function rewriteUrl(string $url): string
protected function rewriteUrl(string $url): ?string
{
if (empty($this->hosts)) {
return $url;
Expand Down

0 comments on commit db77179

Please sign in to comment.