-
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.
- Loading branch information
1 parent
f97c57a
commit 462a244
Showing
13 changed files
with
111 additions
and
78 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.2.0 | ||
2.0.0 |
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
20 changes: 0 additions & 20 deletions
20
...ption/DtoException/InitDtoException/DeclarationException/NullableDeclarationException.php
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
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Fixtures; | ||
|
||
use Dto\Dto; | ||
|
||
/** | ||
* @method string getName() | ||
* @method int getAge() | ||
* @psalm-suppress PossiblyUnusedProperty | ||
* @psalm-suppress PropertyNotSetInConstructor | ||
*/ | ||
class ErrorDto extends Dto | ||
{ | ||
protected string $message; | ||
protected int $code; | ||
} |
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Fixtures; | ||
|
||
use Dto\Dto; | ||
|
||
/** | ||
* @method ?sting getType() | ||
* @method ?ErrorDto getError() | ||
* @psalm-suppress PossiblyUnusedProperty | ||
* @psalm-suppress PropertyNotSetInConstructor | ||
*/ | ||
class NestedNullableDto extends Dto | ||
{ | ||
protected ?string $type; | ||
protected ?ErrorDto $error; | ||
} |
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,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Test; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Tests\Fixtures\NestedNullableDto; | ||
|
||
class NestedNullableDtoTest extends TestCase | ||
{ | ||
/** | ||
* @group ok | ||
* @dataProvider dp | ||
*/ | ||
public function testGetNullableValue(array $data): void | ||
{ | ||
$dto = new NestedNullableDto($data); | ||
$this->assertEquals($data, $dto->toArray()); | ||
} | ||
|
||
public static function dp(): array | ||
{ | ||
return [ | ||
[ | ||
[ | ||
'type' => null, | ||
'error' => null, | ||
], | ||
], | ||
[ | ||
[ | ||
'type' => 'type', | ||
'error' => null, | ||
], | ||
], | ||
[ | ||
[ | ||
'type' => null, | ||
'error' => [ | ||
'message' => 'Error message', | ||
'code' => 0, | ||
], | ||
], | ||
], | ||
]; | ||
} | ||
} |
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