-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from meritoo/refactor/enumerations-instead-of-…
…the-type-classes Replace all the `*Type` classes by enumerations
- Loading branch information
Showing
62 changed files
with
389 additions
and
1,478 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 |
---|---|---|
@@ -1 +1 @@ | ||
1.3.1 | ||
1.3.2 |
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,21 @@ | ||
<?php | ||
|
||
/** | ||
* (c) Meritoo.pl, http://www.meritoo.pl | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Meritoo\Common\Enums\Date; | ||
|
||
enum DatePart: string | ||
{ | ||
case Day = 'day'; | ||
case Hour = 'hour'; | ||
case Minute = 'minute'; | ||
case Month = 'month'; | ||
case Second = 'second'; | ||
case Year = 'year'; | ||
} |
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,24 @@ | ||
<?php | ||
|
||
/** | ||
* (c) Meritoo.pl, http://www.meritoo.pl | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Meritoo\Common\Enums\Date; | ||
|
||
enum DatePeriod: int | ||
{ | ||
case LastMonth = 4; | ||
case LastWeek = 1; | ||
case LastYear = 7; | ||
case NextMonth = 6; | ||
case NextWeek = 3; | ||
case NextYear = 9; | ||
case ThisMonth = 5; | ||
case ThisWeek = 2; | ||
case ThisYear = 8; | ||
} |
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,18 @@ | ||
<?php | ||
|
||
/** | ||
* (c) Meritoo.pl, http://www.meritoo.pl | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Meritoo\Common\Enums; | ||
|
||
enum OopVisibility: int | ||
{ | ||
case Private = 3; | ||
case Protected = 2; | ||
case Public = 1; | ||
} |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
<?php | ||
|
||
/** | ||
* (c) Meritoo.pl, http://www.meritoo.pl | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Meritoo\Common\Exception\Date; | ||
|
||
use Meritoo\Common\Enums\Date\DatePart; | ||
|
||
final class InvalidDatePartException extends \Exception | ||
{ | ||
public function __construct(DatePart $datePart, string $value) | ||
{ | ||
$message = \sprintf( | ||
'Value of the \'%s\' date part is invalid: %s', | ||
$datePart->value, | ||
$value, | ||
); | ||
|
||
parent::__construct($message); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.