Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Commit

Permalink
- Yet another code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Mar 18, 2018
1 parent b4eaa32 commit f16b502
Show file tree
Hide file tree
Showing 26 changed files with 54 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/IPub/Images/Application/ImageResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Application
* @since 1.0.0
Expand Down
6 changes: 4 additions & 2 deletions src/IPub/Images/Application/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Application
* @since 1.0.0
Expand All @@ -22,7 +22,6 @@
use Nette\Utils;

use IPub\Images;
use IPub\Images\Exceptions;
use IPub\Images\Helpers;
use IPub\Images\Validators;

Expand Down Expand Up @@ -117,6 +116,7 @@ public function __construct(
* @return Application\IResponse
*
* @throws Application\BadRequestException
* @throws Utils\ImageException
*/
public function run(Application\Request $request) : Application\IResponse
{
Expand Down Expand Up @@ -156,6 +156,7 @@ public function run(Application\Request $request) : Application\IResponse
* @return void
*
* @throws Application\BadRequestException
* @throws Utils\ImageException
*/
private function generateImage(string $storage, ?string $namespace = NULL, string $filename, string $extension, ?string $size = NULL, ?string $algorithm = NULL) : void
{
Expand Down Expand Up @@ -216,6 +217,7 @@ private function generateImage(string $storage, ?string $namespace = NULL, strin
* @return void
*
* @throws Application\BadRequestException
* @throws Utils\ImageException
*/
private function createImage(string $imageContent, ?string $mimeType = NULL, ?int $width = NULL, ?int $height = NULL, int $algorithm) : void
{
Expand Down
4 changes: 1 addition & 3 deletions src/IPub/Images/Application/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Application
* @since 1.0.0
Expand All @@ -19,8 +19,6 @@
use Nette\Application;
use Nette\Utils;

use IPub\Images;

/**
* Micro-module router
*
Expand Down
10 changes: 7 additions & 3 deletions src/IPub/Images/DI/ImagesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage DI
* @since 1.0.0
Expand All @@ -19,7 +19,6 @@
use Nette;
use Nette\DI;
use Nette\Utils;
use Nette\PhpGenerator as Code;

use IPub\Images;
use IPub\Images\Application;
Expand All @@ -28,7 +27,6 @@
use IPub\Images\Validators;

use IPub\IPubModule;
use Tracy\Debugger;

/**
* Images extension container
Expand Down Expand Up @@ -57,6 +55,12 @@ class ImagesExtension extends DI\CompilerExtension
'wwwDir' => NULL,
];

/**
* @return void
*
* @throws Exceptions\InvalidArgumentException
* @throws Utils\AssertionException
*/
public function loadConfiguration() : void
{
// Get container builder
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Exceptions/FileNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Exceptions
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Exceptions/IException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Exceptions
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Exceptions/IOException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Exceptions
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Exceptions/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Exceptions
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Exceptions/InvalidStateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Exceptions
* @since 1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Exceptions
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Helpers/Converters.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Helpers
* @since 2.0.0
Expand Down
7 changes: 2 additions & 5 deletions src/IPub/Images/ImagesLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage common
* @since 1.0.0
Expand All @@ -17,11 +17,7 @@
namespace IPub\Images;

use Nette;
use Nette\Application;
use Nette\Utils;

use IPub;
use IPub\Images;
use IPub\Images\Exceptions;
use IPub\Images\Providers;
use IPub\Images\Templating;
Expand Down Expand Up @@ -68,6 +64,7 @@ public function __construct(
* @return string
*
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\InvalidStateException
*/
public function request(array $arguments) : string
{
Expand Down
7 changes: 1 addition & 6 deletions src/IPub/Images/Latte/Macros.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Latte
* @since 1.0.0
Expand All @@ -16,16 +16,11 @@

namespace IPub\Images\Latte;

use Nette;

use Latte;
use Latte\Compiler;
use Latte\MacroNode;
use Latte\PhpWriter;
use Latte\Macros\MacroSet;

use IPub;
use IPub\Images;
use IPub\Images\Helpers;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Providers/IProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Providers
* @since 2.0.0
Expand Down
3 changes: 1 addition & 2 deletions src/IPub/Images/Providers/PresenterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Providers
* @since 2.0.0
Expand All @@ -20,7 +20,6 @@
use Nette\Application;
use Nette\Utils;

use IPub\Images;
use IPub\Images\Exceptions;
use IPub\Images\Helpers;
use IPub\Images\Validators;
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/TImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage common
* @since 1.0.0
Expand Down
23 changes: 19 additions & 4 deletions src/IPub/Images/Templating/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Templating
* @since 1.0.0
Expand All @@ -19,8 +19,6 @@
use Nette;
use Nette\Utils;

use Latte\Engine;

use IPub\Images;
use IPub\Images\Exceptions;

Expand Down Expand Up @@ -59,6 +57,13 @@ public function __construct(
* @param string $file
*
* @return bool
*
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\InvalidStateException
*
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\InvalidStateException
* @throws Utils\ImageException
*/
public function isSquare(string $file) : bool
{
Expand All @@ -71,6 +76,10 @@ public function isSquare(string $file) : bool
* @param string $file
*
* @return bool
*
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\InvalidStateException
* @throws Utils\ImageException
*/
public function isHigher(string $file) : bool
{
Expand All @@ -83,6 +92,10 @@ public function isHigher(string $file) : bool
* @param string $file
*
* @return bool
*
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\InvalidStateException
* @throws Utils\ImageException
*/
public function isWider(string $file) : bool
{
Expand All @@ -95,8 +108,9 @@ public function isWider(string $file) : bool
* @param array $parameters
*
* @return string
*
*
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\InvalidStateException
*/
public function imageLink(array $parameters) : string
{
Expand All @@ -110,6 +124,7 @@ public function imageLink(array $parameters) : string
*
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\InvalidStateException
* @throws Utils\ImageException
*/
private function fromString($file) : Utils\Image
{
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Validators/IValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Validators
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/Images/Validators/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Validators
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/IPubTests/Images/ConvertersTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Tests
* @since 2.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/IPubTests/Images/ExtensionTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Tests
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/IPubTests/Images/PresenterProviderTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Tests
* @since 2.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/IPubTests/Images/PresenterTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Tests
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/IPubTests/Images/RouterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @copyright More in license.md
* @license https://www.ipublikuj.eu
* @author Adam Kadlec https://www.ipublikuj.eu
* @author Adam Kadlec <adam.kadlec@ipublikuj.eu>
* @package iPublikuj:Images!
* @subpackage Tests
* @since 2.0.0
Expand Down
Loading

0 comments on commit f16b502

Please sign in to comment.