Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Updated collections to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
italolelis committed Jun 27, 2016
1 parent 36cf73b commit 93c0e70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"php": ">=5.6",
"ramsey/uuid": "^3.0",
"easyframework/collections": "^5.0",
"easyframework/collections": "^6.0",
"beberlei/assert": "^2.5"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

namespace HelloFresh\Engine\Serializer\Type;

use Collections\Dictionary;
use Collections\Map;
use Collections\Iterable;
use JMS\Serializer\Context;
use JMS\Serializer\GraphNavigator;
use JMS\Serializer\Handler\SubscribingHandlerInterface;
use JMS\Serializer\VisitorInterface;

class DictionaryHandler implements SubscribingHandlerInterface
class MapHandler implements SubscribingHandlerInterface
{
public static function getSubscribingMethods()
{
return [
[
'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
'format' => 'json',
'type' => 'Dictionary',
'type' => 'Map',
'method' => 'serializeCollection'
],
[
'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
'format' => 'json',
'type' => 'Dictionary',
'type' => 'Map',
'method' => 'deserializeCollection'
]
];
Expand All @@ -43,6 +43,6 @@ public function deserializeCollection(VisitorInterface $visitor, $data, array $t
// See above.
$type['name'] = 'array';

return new Dictionary($data, $type, $context);
return new Map($data, $type, $context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

namespace HelloFresh\Engine\Serializer\Type;

use Collections\ArrayList;
use Collections\Vector;
use Collections\Iterable;
use JMS\Serializer\Context;
use JMS\Serializer\GraphNavigator;
use JMS\Serializer\Handler\SubscribingHandlerInterface;
use JMS\Serializer\VisitorInterface;

class ArrayListHandler implements SubscribingHandlerInterface
class VectorHandler implements SubscribingHandlerInterface
{
public static function getSubscribingMethods()
{
return [
[
'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
'format' => 'json',
'type' => 'ArrayList',
'type' => 'Vector',
'method' => 'serializeCollection'
],
[
'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
'format' => 'json',
'type' => 'ArrayList',
'type' => 'Vector',
'method' => 'deserializeCollection'
]
];
Expand All @@ -42,6 +42,6 @@ public function deserializeCollection(VisitorInterface $visitor, $data, array $t
// See above.
$type['name'] = 'array';

return new ArrayList($visitor->visitArray($data, $type, $context));
return new Vector($visitor->visitArray($data, $type, $context));
}
}

0 comments on commit 93c0e70

Please sign in to comment.