-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Showing
10 changed files
with
205 additions
and
53 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 |
---|---|---|
@@ -1,52 +1,53 @@ | ||
{ | ||
"name": "jms/serializer", | ||
"type": "library", | ||
"description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", | ||
"keywords": ["serialization", "deserialization", "json", "jaxb", "xml"], | ||
"homepage": "http://jmsyst.com/libs/serializer", | ||
"license": "Apache2", | ||
"authors": [ | ||
{ | ||
"name": "Johannes M. Schmitt", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.5.0", | ||
"jms/metadata": "~1.1", | ||
"jms/parser-lib": "1.*", | ||
"phpoption/phpoption": "^1.1", | ||
"phpcollection/phpcollection": "~0.1", | ||
"doctrine/annotations": "^1.0", | ||
"doctrine/instantiator": "^1.0.3" | ||
}, | ||
"conflict": { | ||
"twig/twig": "<1.12" | ||
}, | ||
"suggest": { | ||
"symfony/yaml": "Required if you'd like to serialize data to YAML format." | ||
}, | ||
"require-dev": { | ||
"twig/twig": "~1.12|~2.0", | ||
"doctrine/orm": "~2.1", | ||
"jackalope/jackalope-doctrine-dbal": "^1.1.5", | ||
"doctrine/phpcr-odm": "^1.3|^2.0", | ||
"propel/propel1": "~1.7", | ||
"symfony/yaml": "^2.1", | ||
"symfony/translation": "^2.1", | ||
"symfony/validator": "^2.2", | ||
"symfony/form": "~2.1", | ||
"symfony/filesystem": "^2.1", | ||
"phpunit/phpunit": "^4.8|^5.0" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"JMS\\Serializer": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.3-dev" | ||
} | ||
} | ||
} | ||
{ | ||
"name": "jms/serializer", | ||
"type": "library", | ||
"description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", | ||
"keywords": ["serialization", "deserialization", "json", "jaxb", "xml"], | ||
"homepage": "http://jmsyst.com/libs/serializer", | ||
"license": "Apache2", | ||
"authors": [ | ||
{ | ||
"name": "Johannes M. Schmitt", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.5.0", | ||
"jms/metadata": "~1.1", | ||
"jms/parser-lib": "1.*", | ||
"phpoption/phpoption": "^1.1", | ||
"phpcollection/phpcollection": "~0.1", | ||
"doctrine/annotations": "^1.0", | ||
"doctrine/instantiator": "^1.0.3" | ||
}, | ||
"conflict": { | ||
"twig/twig": "<1.12" | ||
}, | ||
"suggest": { | ||
"symfony/yaml": "Required if you'd like to serialize data to YAML format." | ||
}, | ||
"require-dev": { | ||
"ext-pdo_sqlite": "*", | ||
"twig/twig": "~1.12|~2.0", | ||
"doctrine/orm": "~2.1", | ||
"jackalope/jackalope-doctrine-dbal": "^1.1.5", | ||
"doctrine/phpcr-odm": "^1.3|^2.0", | ||
"propel/propel1": "~1.7", | ||
"symfony/yaml": "^2.1", | ||
"symfony/translation": "^2.1", | ||
"symfony/validator": "^2.2", | ||
"symfony/form": "~2.1", | ||
"symfony/filesystem": "^2.1", | ||
"phpunit/phpunit": "^4.8|^5.0" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"JMS\\Serializer": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.3-dev" | ||
} | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
tests/JMS/Serializer/Tests/Fixtures/DiscriminatorMiddle/Base.php
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 | ||
|
||
/* | ||
* Copyright 2016 Johannes M. Schmitt <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\Serializer\Tests\Fixtures\DiscriminatorMiddle; | ||
|
||
|
||
abstract class Base | ||
{ | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
tests/JMS/Serializer/Tests/Fixtures/DiscriminatorMiddle/Chief.php
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,23 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2016 Johannes M. Schmitt <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\Serializer\Tests\Fixtures\DiscriminatorMiddle; | ||
|
||
class Chief extends User | ||
{ | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/JMS/Serializer/Tests/Fixtures/DiscriminatorMiddle/Employee.php
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,23 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2016 Johannes M. Schmitt <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\Serializer\Tests\Fixtures\DiscriminatorMiddle; | ||
|
||
class Employee extends User | ||
{ | ||
} |
38 changes: 38 additions & 0 deletions
38
tests/JMS/Serializer/Tests/Fixtures/DiscriminatorMiddle/User.php
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,38 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright 2016 Johannes M. Schmitt <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace JMS\Serializer\Tests\Fixtures\DiscriminatorMiddle; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
/** | ||
* @Serializer\Discriminator(field = "type", map = { | ||
* "chief": "JMS\Serializer\Tests\Fixtures\DiscriminatorMiddle\Chief", | ||
* "employee": "JMS\Serializer\Tests\Fixtures\DiscriminatorMiddle\Employee", | ||
* }) | ||
*/ | ||
abstract class User extends Base | ||
{ | ||
/** @Serializer\Type("integer") */ | ||
public $hours; | ||
|
||
public function __construct($hours) | ||
{ | ||
$this->hours = (integer) $hours; | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
tests/JMS/Serializer/Tests/Serializer/xml/user_hierarchy.xml
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<result> | ||
<entry> | ||
<hours>3</hours> | ||
<type><![CDATA[chief]]></type> | ||
</entry> | ||
<entry> | ||
<hours>1</hours> | ||
<type><![CDATA[employee]]></type> | ||
</entry> | ||
</result> |
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,6 @@ | ||
- | ||
hours: 3 | ||
type: chief | ||
- | ||
hours: 1 | ||
type: employee |