-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring, stricter phpstan, moved from arrays to objects, better t…
…ests, more exceptions
- Loading branch information
Showing
14 changed files
with
875 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ parameters: | |
- ../src/ | ||
|
||
level: 7 | ||
|
||
checkMissingIterableValueType: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Nelson\Resizer; | ||
|
||
class Dimensions | ||
{ | ||
|
||
private int $width; | ||
private int $height; | ||
|
||
|
||
public function __construct( | ||
int $width, | ||
int $height | ||
) | ||
{ | ||
$this->width = $width; | ||
$this->height = $height; | ||
} | ||
|
||
|
||
public function getWidth(): int | ||
{ | ||
return $this->width; | ||
} | ||
|
||
|
||
public function getHeight(): int | ||
{ | ||
return $this->height; | ||
} | ||
|
||
|
||
public function getRatio(): float | ||
{ | ||
return $this->width / $this->height; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Nelson\Resizer\Exceptions; | ||
|
||
use Exception; | ||
|
||
final class CouldNotParseResizerParamsException extends Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Nelson\Resizer\Exceptions; | ||
|
||
use Exception; | ||
|
||
final class IncompatibleResizerParamsException extends Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.