-
Notifications
You must be signed in to change notification settings - Fork 10
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
Jonathan Oddy
committed
May 1, 2014
1 parent
b4ff9ef
commit 53ef9ba
Showing
8 changed files
with
194 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
namespace Weasel\JsonMarshaller\Config\Type; | ||
|
||
use Weasel\JsonMarshaller\Config\DoctrineAnnotations\JsonProperty; | ||
|
||
class ListType extends Type { | ||
|
||
/** | ||
* @var Type | ||
* @JsonProperty(type="\Weasel\JsonMarshaller\Config\Type\Type") | ||
*/ | ||
public $valueType; | ||
|
||
function __construct($valueType = null) | ||
{ | ||
$this->valueType = $valueType; | ||
} | ||
|
||
} |
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,20 @@ | ||
<?php | ||
namespace Weasel\JsonMarshaller\Config\Type; | ||
|
||
use Weasel\JsonMarshaller\Config\DoctrineAnnotations\JsonProperty; | ||
|
||
class MapType extends ListType { | ||
|
||
/** | ||
* @var Type | ||
* @JsonProperty(type="\Weasel\JsonMarshaller\Config\Type\Type") | ||
*/ | ||
public $keyType; | ||
|
||
function __construct($keyType = null, $valueType = null) | ||
{ | ||
$this->keyType = $keyType; | ||
parent::__construct($valueType); | ||
} | ||
|
||
} |
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 | ||
namespace Weasel\JsonMarshaller\Config\Type; | ||
|
||
use Weasel\JsonMarshaller\Config\DoctrineAnnotations\JsonProperty; | ||
|
||
class ObjectType extends Type { | ||
|
||
/** | ||
* @var string | ||
* @JsonProperty(type="string") | ||
*/ | ||
public $class; | ||
|
||
function __construct($class = null) | ||
{ | ||
$this->class = $class; | ||
} | ||
|
||
} |
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 | ||
namespace Weasel\JsonMarshaller\Config\Type; | ||
|
||
use Weasel\JsonMarshaller\Config\DoctrineAnnotations\JsonProperty; | ||
use Weasel\JsonMarshaller\Types\JsonType; | ||
|
||
class ScalarType extends Type { | ||
|
||
public function __construct($typeName = null) { | ||
$this->typeName = $typeName; | ||
} | ||
|
||
/** | ||
* @var string | ||
* @JsonProperty(type="string") | ||
*/ | ||
public $typeName; | ||
|
||
/** | ||
* This is a bit of a dirty hack... | ||
* @var JsonType | ||
*/ | ||
public $jsonType; | ||
|
||
} |
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,20 @@ | ||
<?php | ||
namespace Weasel\JsonMarshaller\Config\Type; | ||
|
||
use Weasel\JsonMarshaller\Config\DoctrineAnnotations\JsonSubTypes; | ||
use Weasel\JsonMarshaller\Config\DoctrineAnnotations\JsonTypeInfo; | ||
|
||
|
||
/** | ||
* Class Type | ||
* @package Weasel\JsonMarshaller\Config\Type | ||
* @JsonSubTypes({ | ||
* @JsonSubTypes\Type("\Weasel\JsonMarshaller\Config\Type\ListType"), | ||
* @JsonSubTypes\Type("\Weasel\JsonMarshaller\Config\Type\MapType"), | ||
* @JsonSubTypes\Type("\Weasel\JsonMarshaller\Config\Type\ScalarType"), | ||
* }) | ||
* @JsonTypeInfo(use=JsonTypeInfo::ID_NAME, include=JsonTypeInfo::AS_PROPERTY, property="type") | ||
*/ | ||
abstract class Type { | ||
|
||
} |
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
Oops, something went wrong.