diff --git a/src/Dimensions.php b/src/Dimensions.php index a161bd9..f0c4b24 100755 --- a/src/Dimensions.php +++ b/src/Dimensions.php @@ -1,15 +1,14 @@ width / $this->height; } - } diff --git a/src/Exceptions/CouldNotParseResizerParamsException.php b/src/Exceptions/CouldNotParseResizerParamsException.php index dad69b5..3f9cf5c 100755 --- a/src/Exceptions/CouldNotParseResizerParamsException.php +++ b/src/Exceptions/CouldNotParseResizerParamsException.php @@ -7,5 +7,4 @@ final class CouldNotParseResizerParamsException extends Exception { - } diff --git a/src/Exceptions/ImageNotFoundOrReadableException.php b/src/Exceptions/ImageNotFoundOrReadableException.php index e2acb09..8be7def 100755 --- a/src/Exceptions/ImageNotFoundOrReadableException.php +++ b/src/Exceptions/ImageNotFoundOrReadableException.php @@ -7,5 +7,4 @@ final class ImageNotFoundOrReadableException extends Exception { - } diff --git a/src/Exceptions/IncompatibleResizerParamsException.php b/src/Exceptions/IncompatibleResizerParamsException.php index a56aecc..cefd61e 100755 --- a/src/Exceptions/IncompatibleResizerParamsException.php +++ b/src/Exceptions/IncompatibleResizerParamsException.php @@ -7,5 +7,4 @@ final class IncompatibleResizerParamsException extends Exception { - } diff --git a/src/Exceptions/SecurityException.php b/src/Exceptions/SecurityException.php index d57238b..6dcda2a 100755 --- a/src/Exceptions/SecurityException.php +++ b/src/Exceptions/SecurityException.php @@ -7,5 +7,4 @@ final class SecurityException extends Exception { - } diff --git a/src/Geometry.php b/src/Geometry.php index 962bde4..2060fbc 100755 --- a/src/Geometry.php +++ b/src/Geometry.php @@ -5,14 +5,12 @@ use Imagine\Image\Point; use Nelson\Resizer\Exceptions\IncompatibleResizerParamsException; -use Nette\InvalidArgumentException; use Nette\SmartObject; final class Geometry { use SmartObject; - private ResizerParams $resizerParams; @@ -142,5 +140,4 @@ public function getCropPoint(Dimensions $source): Point return new Point((int) $x, (int) $y); } - } diff --git a/src/Latte/RlinkNode.php b/src/Latte/RlinkNode.php index c63591e..dcde0c5 100644 --- a/src/Latte/RlinkNode.php +++ b/src/Latte/RlinkNode.php @@ -45,7 +45,8 @@ public static function create(Tag $tag): ?static public function print(PrintContext $context): string { - return $context->format('' + return $context->format( + '' . '$lg = $this->global->uiPresenter ?? $this->global->uiControl;' . 'echo %modify(' . '$lg->link(Nelson\Resizer\Latte\RlinkNode::getLink($lg), %node)) %line;', @@ -53,7 +54,6 @@ public function print(PrintContext $context): string $this->args, $this->position, ); - } diff --git a/src/Presenters/ResizePresenter.php b/src/Presenters/ResizePresenter.php index 64e4a0b..298b306 100644 --- a/src/Presenters/ResizePresenter.php +++ b/src/Presenters/ResizePresenter.php @@ -11,7 +11,6 @@ use Nette\Http\Context; use Nette\Http\IRequest; use Nette\Http\IResponse; -use Nette\Http\Response; use Nette\Utils\DateTime; final class ResizePresenter extends Presenter diff --git a/src/Resizer.php b/src/Resizer.php index 365f2e4..8b5a966 100644 --- a/src/Resizer.php +++ b/src/Resizer.php @@ -3,7 +3,6 @@ namespace Nelson\Resizer; -use Exception; use Imagine\Exception\RuntimeException; use Imagine\Image\AbstractImagine; use Imagine\Image\Box; @@ -18,7 +17,6 @@ final class Resizer implements IResizer { use SmartObject; - /** @var string[] */ private const SUPPORTED_FORMATS = [ 'jpeg', 'jpg', diff --git a/src/ResizerParams.php b/src/ResizerParams.php index 424da75..47e92ea 100755 --- a/src/ResizerParams.php +++ b/src/ResizerParams.php @@ -1,10 +1,10 @@ width; + return $this->width !== null; } @@ -75,25 +74,25 @@ public function getHeight(): ?int public function hasHeight(): bool { - return null !== $this->height; + return $this->height !== null; } public function hasBothDimensions(): bool { - return ($this->width !== null && $this->height !== null); + return $this->width !== null && $this->height !== null; } public function hasOneDimension(): bool { - return ($this->width !== null || $this->height !== null); + return $this->width !== null || $this->height !== null; } public function hasNoDimensions(): bool { - return ($this->width === null && $this->height === null); + return $this->width === null && $this->height === null; } @@ -105,7 +104,4 @@ public function isCrop(): bool ($this->vertical !== null && strlen($this->vertical) === 1) ; } - - - } diff --git a/src/ResizerParamsParser.php b/src/ResizerParamsParser.php index 59fed68..fba89bf 100755 --- a/src/ResizerParamsParser.php +++ b/src/ResizerParamsParser.php @@ -3,7 +3,6 @@ namespace Nelson\Resizer; -use Exception; use Nelson\Resizer\Exceptions\CouldNotParseResizerParamsException; use Nette\SmartObject; @@ -72,6 +71,4 @@ private function parseNumericValueToIntOrNull(string $value): ?int return null; } - - } diff --git a/tests/GeometryTest.php b/tests/GeometryTest.php index d97d171..0ab6ab9 100644 --- a/tests/GeometryTest.php +++ b/tests/GeometryTest.php @@ -11,7 +11,6 @@ class GeometryTest extends TestCase { - private static Dimensions $sourceDimensions; diff --git a/tests/ResizerParamsParserTest.php b/tests/ResizerParamsParserTest.php index 758c2da..e729d0e 100644 --- a/tests/ResizerParamsParserTest.php +++ b/tests/ResizerParamsParserTest.php @@ -10,7 +10,6 @@ class ResizerParamsParserTest extends TestCase { - public function testEmpty(): void { $expected = new ResizerParams( diff --git a/tests/ResizerTest.php b/tests/ResizerTest.php index 486e654..63f2a0b 100644 --- a/tests/ResizerTest.php +++ b/tests/ResizerTest.php @@ -12,7 +12,6 @@ class ResizerTest extends TestCase { - private static Resizer $resizer; private static string $image; private static ResizerConfig $config; @@ -23,7 +22,7 @@ public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - static::$config = new ResizerConfig(); + static::$config = new ResizerConfig; static::$config->tempDir = __DIR__ . '/../temp'; static::$config->wwwDir = __DIR__ . '/../tests'; static::$config->qualityJpeg = 65; @@ -88,5 +87,4 @@ public static function tearDownAfterClass(): void parent::tearDownAfterClass(); FileSystem::delete(static::$config->tempDir . static::$config->cache); } - }