Skip to content

Commit ac371a7

Browse files
committed
updates per reviews from @dbu and @franmomu
1 parent 58902a8 commit ac371a7

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/Binary/Loader/ChainLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public function find($path)
3939
{
4040
$exceptions = [];
4141

42-
foreach ($this->loaders as $configName => $objectInst) {
42+
foreach ($this->loaders as $configName => $loader) {
4343
try {
44-
return $objectInst->find($path);
44+
return $loader->find($path);
4545
} catch (NotLoadableException $loaderException) {
46-
$exceptions[] = new ChainAttemptNotLoadableException($configName, $objectInst, $loaderException);
46+
$exceptions[] = new ChainAttemptNotLoadableException($configName, $loader, $loaderException);
4747
}
4848
}
4949

src/Exception/Binary/Loader/ChainAttemptNotLoadableException.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313

1414
use Liip\ImagineBundle\Binary\Loader\LoaderInterface;
1515

16-
class ChainAttemptNotLoadableException extends NotLoadableException
16+
final class ChainAttemptNotLoadableException extends NotLoadableException
1717
{
18-
private string $configName;
19-
private LoaderInterface $objectInst;
18+
private string $configName;
19+
private LoaderInterface $loaderInst;
2020

21-
public function __construct(string $configName, LoaderInterface $objectInst, NotLoadableException $loaderException)
21+
public function __construct(string $configName, LoaderInterface $loaderInst, NotLoadableException $loaderException)
2222
{
2323
$this->configName = $configName;
24-
$this->objectInst = $objectInst;
24+
$this->loaderInst = $loaderInst;
2525

2626
parent::__construct($this->compileFailureText(), 0, $loaderException);
2727
}
@@ -33,7 +33,7 @@ public function getLoaderConfigName(): string
3333

3434
public function getLoaderObjectInst(): LoaderInterface
3535
{
36-
return $this->objectInst;
36+
return $this->loaderInst;
3737
}
3838

3939
public function getLoaderObjectName(): string

src/Exception/Binary/Loader/ChainNotLoadableException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Liip\ImagineBundle\Exception\Binary\Loader;
1313

14-
class ChainNotLoadableException extends NotLoadableException
14+
final class ChainNotLoadableException extends NotLoadableException
1515
{
1616
public function __construct(string $path, ChainAttemptNotLoadableException ...$exceptions)
1717
{
@@ -39,8 +39,8 @@ private static function compileLoaderErrorsList(ChainAttemptNotLoadableException
3939
}, ...$exceptions);
4040
}
4141

42-
private static function implodeArrayMappedExceptions(\Closure $listMapper, ChainAttemptNotLoadableException ...$exceptions): string
42+
private static function implodeArrayMappedExceptions(\Closure $mapper, ChainAttemptNotLoadableException ...$exceptions): string
4343
{
44-
return implode(', ', array_map($listMapper, $exceptions));
44+
return implode(', ', array_map($mapper, $exceptions));
4545
}
4646
}

0 commit comments

Comments
 (0)