-
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 #1 from Dropelikeit/bugfix/can_not_handle_array_it…
…erator_object Bugfix/can not handle array iterator object
- Loading branch information
Showing
7 changed files
with
151 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
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,11 +5,11 @@ | |
namespace Dropelikeit\LaravelJmsSerializer\Serializer; | ||
|
||
use Dropelikeit\LaravelJmsSerializer\Config\Config; | ||
use JMS\Serializer\Naming\IdenticalPropertyNamingStrategy; | ||
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy; | ||
use JMS\Serializer\SerializationContext; | ||
use JMS\Serializer\SerializerBuilder; | ||
use JMS\Serializer\SerializerInterface; | ||
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy; | ||
use JMS\Serializer\Naming\IdenticalPropertyNamingStrategy; | ||
|
||
/** | ||
* @author Marcel Strahl <[email protected]> | ||
|
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Dropelikeit\LaravelJmsSerializer\Tests\ResponseFactory; | ||
|
||
use ArrayIterator; | ||
use Dropelikeit\LaravelJmsSerializer\Tests\ResponseFactory\Response\Item; | ||
use Webmozart\Assert\Assert; | ||
|
||
/** | ||
* @author Marcel Strahl <[email protected]> | ||
*/ | ||
class Response extends ArrayIterator | ||
{ | ||
private function __construct(array $items) | ||
{ | ||
Assert::allIsInstanceOf($items, Item::class); | ||
Assert::isList($items); | ||
|
||
parent::__construct($items); | ||
} | ||
|
||
public static function create(array $items): self | ||
{ | ||
return new self($items); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Dropelikeit\LaravelJmsSerializer\Tests\ResponseFactory\Response; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
/** | ||
* @author Marcel Strahl <[email protected]> | ||
*/ | ||
class Item | ||
{ | ||
/** | ||
* @Serializer\Type("string") | ||
* @var string | ||
*/ | ||
private $key = 'magic_number'; | ||
|
||
/** | ||
* @Serializer\Type("integer") | ||
* @var int | ||
*/ | ||
private $value = 12; | ||
} |
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,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'some_objects' => [ | ||
'person' => [ | ||
'first_name' => 'Max', | ||
'last_name' => 'Mustermann', | ||
'birthdate' => '01.01.1976', | ||
'birth_place' => 'Berlin', | ||
'nationality' => 'german', | ||
], | ||
], | ||
]; |
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