-
Notifications
You must be signed in to change notification settings - Fork 2
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 #4 from sunrise-php/v1.2.0
v1.2.0
- Loading branch information
Showing
7 changed files
with
202 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* It's free open-source software released under the MIT License. | ||
* | ||
* @author Anatoly Fenric <anatoly@fenric.ru> | ||
* @copyright Copyright (c) 2021, Anatoly Fenric | ||
* @license https://github.com/sunrise-php/hydrator/blob/master/LICENSE | ||
* @link https://github.com/sunrise-php/hydrator | ||
*/ | ||
|
||
namespace Sunrise\Hydrator; | ||
|
||
/** | ||
* EnumerableObject | ||
*/ | ||
abstract class EnumerableObject implements EnumerableObjectInterface | ||
{ | ||
|
||
/** | ||
* The enum value | ||
* | ||
* @var mixed | ||
*/ | ||
protected $value; | ||
|
||
/** | ||
* Constructor of the class | ||
* | ||
* @param mixed $value | ||
*/ | ||
public function __construct($value) | ||
{ | ||
$this->value = $value; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
} |
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,26 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* It's free open-source software released under the MIT License. | ||
* | ||
* @author Anatoly Fenric <anatoly@fenric.ru> | ||
* @copyright Copyright (c) 2021, Anatoly Fenric | ||
* @license https://github.com/sunrise-php/hydrator/blob/master/LICENSE | ||
* @link https://github.com/sunrise-php/hydrator | ||
*/ | ||
|
||
namespace Sunrise\Hydrator; | ||
|
||
/** | ||
* EnumerableObjectInterface | ||
*/ | ||
interface EnumerableObjectInterface | ||
{ | ||
|
||
/** | ||
* Gets the enum value | ||
* | ||
* @return mixed | ||
*/ | ||
public function getValue(); | ||
} |
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,18 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Sunrise\Hydrator\Tests\Fixture; | ||
|
||
/** | ||
* Import classes | ||
*/ | ||
use Sunrise\Hydrator\EnumerableObject; | ||
|
||
/** | ||
* TestEnum | ||
*/ | ||
final class TestEnum extends EnumerableObject | ||
{ | ||
public const A = 'A:value'; | ||
public const B = 'B:value'; | ||
public const C = 'C:value'; | ||
} |
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,16 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Sunrise\Hydrator\Tests\Fixture; | ||
|
||
/** | ||
* Import classes | ||
*/ | ||
use Sunrise\Hydrator\HydrableObjectInterface; | ||
|
||
/** | ||
* TestEnumDto | ||
*/ | ||
final class TestEnumDto implements HydrableObjectInterface | ||
{ | ||
public TestEnum $foo; | ||
} |
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