+```
+
+More examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).
+
+### Security
+
+Parsedown is capable of escaping user-input within the HTML that it generates. Additionally Parsedown will apply sanitisation to additional scripting vectors (such as scripting link destinations) that are introduced by the markdown syntax itself.
+
+To tell Parsedown that it is processing untrusted user-input, use the following:
+```php
+$parsedown = new Parsedown;
+$parsedown->setSafeMode(true);
+```
+
+If instead, you wish to allow HTML within untrusted user-input, but still want output to be free from XSS it is recommended that you make use of a HTML sanitiser that allows HTML tags to be whitelisted, like [HTML Purifier](http://htmlpurifier.org/).
+
+In both cases you should strongly consider employing defence-in-depth measures, like [deploying a Content-Security-Policy](https://scotthelme.co.uk/content-security-policy-an-introduction/) (a browser security feature) so that your page is likely to be safe even if an attacker finds a vulnerability in one of the first lines of defence above.
+
+#### Security of Parsedown Extensions
+
+Safe mode does not necessarily yield safe results when using extensions to Parsedown. Extensions should be evaluated on their own to determine their specific safety against XSS.
+
+### Escaping HTML
+> ⚠️ **WARNING:** This method isn't safe from XSS!
+
+If you wish to escape HTML **in trusted input**, you can use the following:
+```php
+$parsedown = new Parsedown;
+$parsedown->setMarkupEscaped(true);
+```
+
+Beware that this still allows users to insert unsafe scripting vectors, such as links like `[xss](javascript:alert%281%29)`.
+
+### Questions
+
+**How does Parsedown work?**
+
+It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line starts with a `-` then perhaps it belongs to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).
+
+We call this approach "line based". We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages.
+
+**Is it compliant with CommonMark?**
+
+It passes most of the CommonMark tests. Most of the tests that don't pass deal with cases that are quite uncommon. Still, as CommonMark matures, compliance should improve.
+
+**Who uses it?**
+
+[Laravel Framework](https://laravel.com/), [Bolt CMS](http://bolt.cm/), [Grav CMS](http://getgrav.org/), [Herbie CMS](http://www.getherbie.org/), [Kirby CMS](http://getkirby.com/), [October CMS](http://octobercms.com/), [Pico CMS](http://picocms.org), [Statamic CMS](http://www.statamic.com/), [phpDocumentor](http://www.phpdoc.org/), [RaspberryPi.org](http://www.raspberrypi.org/), [Symfony demo](https://github.com/symfony/symfony-demo) and [more](https://packagist.org/packages/erusev/parsedown/dependents).
+
+**How can I help?**
+
+Use it, star it, share it and if you feel generous, [donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=528P3NZQMP8N2).
diff --git a/vendor/erusev/parsedown/composer.json b/vendor/erusev/parsedown/composer.json
new file mode 100644
index 0000000000..f8b40f8ce8
--- /dev/null
+++ b/vendor/erusev/parsedown/composer.json
@@ -0,0 +1,33 @@
+{
+ "name": "erusev/parsedown",
+ "description": "Parser for Markdown.",
+ "keywords": ["markdown", "parser"],
+ "homepage": "http://parsedown.org",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Emanuil Rusev",
+ "email": "hello@erusev.com",
+ "homepage": "http://erusev.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "ext-mbstring": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35"
+ },
+ "autoload": {
+ "psr-0": {"Parsedown": ""}
+ },
+ "autoload-dev": {
+ "psr-0": {
+ "TestParsedown": "test/",
+ "ParsedownTest": "test/",
+ "CommonMarkTest": "test/",
+ "CommonMarkTestWeak": "test/"
+ }
+ }
+}
diff --git a/vendor/evenement/evenement/.gitignore b/vendor/evenement/evenement/.gitignore
new file mode 100644
index 0000000000..987e2a253c
--- /dev/null
+++ b/vendor/evenement/evenement/.gitignore
@@ -0,0 +1,2 @@
+composer.lock
+vendor
diff --git a/vendor/evenement/evenement/.travis.yml b/vendor/evenement/evenement/.travis.yml
new file mode 100644
index 0000000000..65ba0ced9c
--- /dev/null
+++ b/vendor/evenement/evenement/.travis.yml
@@ -0,0 +1,24 @@
+language: php
+
+php:
+ - 7.0
+ - 7.1
+ - hhvm
+ - nightly
+
+matrix:
+ allow_failures:
+ - php: hhvm
+ - php: nightly
+
+before_script:
+ - wget http://getcomposer.org/composer.phar
+ - php composer.phar install
+
+script:
+ - ./vendor/bin/phpunit --coverage-text
+ - php -n examples/benchmark-emit-no-arguments.php
+ - php -n examples/benchmark-emit-one-argument.php
+ - php -n examples/benchmark-emit.php
+ - php -n examples/benchmark-emit-once.php
+ - php -n examples/benchmark-remove-listener-once.php
diff --git a/vendor/evenement/evenement/CHANGELOG.md b/vendor/evenement/evenement/CHANGELOG.md
new file mode 100644
index 0000000000..568f2295a5
--- /dev/null
+++ b/vendor/evenement/evenement/CHANGELOG.md
@@ -0,0 +1,35 @@
+CHANGELOG
+=========
+
+
+* v3.0.1 (2017-07-23)
+
+ * Resolved regression introduced in once listeners in v3.0.0 [#49](https://github.com/igorw/evenement/pull/49)
+
+* v3.0.0 (2017-07-23)
+
+ * Passing null as event name throw exception [#46](https://github.com/igorw/evenement/pull/46), and [#47](https://github.com/igorw/evenement/pull/47)
+ * Performance improvements [#39](https://github.com/igorw/evenement/pull/39), and [#45](https://github.com/igorw/evenement/pull/45)
+ * Remove once listeners [#44](https://github.com/igorw/evenement/pull/44), [#45](https://github.com/igorw/evenement/pull/45)
+
+* v2.1.0 (2017-07-17)
+
+ * Chaining for "on" method [#30](https://github.com/igorw/evenement/pull/30)
+ * Unit tests (on Travis) improvements [#33](https://github.com/igorw/evenement/pull/33), [#36](https://github.com/igorw/evenement/pull/36), and [#37](https://github.com/igorw/evenement/pull/37)
+ * Benchmarks added [#35](https://github.com/igorw/evenement/pull/35), and [#40](https://github.com/igorw/evenement/pull/40)
+ * Minor performance improvements [#42](https://github.com/igorw/evenement/pull/42), and [#38](https://github.com/igorw/evenement/pull/38)
+
+* v2.0.0 (2012-11-02)
+
+ * Require PHP >=5.4.0
+ * Added EventEmitterTrait
+ * Removed EventEmitter2
+
+* v1.1.0 (2017-07-17)
+
+ * Chaining for "on" method [#29](https://github.com/igorw/evenement/pull/29)
+ * Minor performance improvements [#43](https://github.com/igorw/evenement/pull/43)
+
+* v1.0.0 (2012-05-30)
+
+ * Inital stable release
diff --git a/vendor/evenement/evenement/LICENSE b/vendor/evenement/evenement/LICENSE
new file mode 100644
index 0000000000..d9a37d0a04
--- /dev/null
+++ b/vendor/evenement/evenement/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Igor Wiedler
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/evenement/evenement/README.md b/vendor/evenement/evenement/README.md
new file mode 100644
index 0000000000..94430119b1
--- /dev/null
+++ b/vendor/evenement/evenement/README.md
@@ -0,0 +1,83 @@
+# Événement
+
+Événement is a very simple event dispatching library for PHP.
+
+It has the same design goals as [Silex](http://silex-project.org) and
+[Pimple](http://pimple-project.org), to empower the user while staying concise
+and simple.
+
+It is very strongly inspired by the EventEmitter API found in
+[node.js](http://nodejs.org).
+
+[![Build Status](https://secure.travis-ci.org/igorw/evenement.png?branch=master)](http://travis-ci.org/igorw/evenement)
+
+## Fetch
+
+The recommended way to install Événement is [through composer](http://getcomposer.org).
+
+Just create a composer.json file for your project:
+
+```JSON
+{
+ "require": {
+ "evenement/evenement": "^3.0 || ^2.0"
+ }
+}
+```
+
+**Note:** The `3.x` version of Événement requires PHP 7 and the `2.x` version requires PHP 5.4. If you are
+using PHP 5.3, please use the `1.x` version:
+
+```JSON
+{
+ "require": {
+ "evenement/evenement": "^1.0"
+ }
+}
+```
+
+And run these two commands to install it:
+
+ $ curl -s http://getcomposer.org/installer | php
+ $ php composer.phar install
+
+Now you can add the autoloader, and you will have access to the library:
+
+```php
+on('user.created', function (User $user) use ($logger) {
+ $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
+});
+```
+
+### Emitting Events
+
+```php
+emit('user.created', [$user]);
+```
+
+Tests
+-----
+
+ $ ./vendor/bin/phpunit
+
+License
+-------
+MIT, see LICENSE.
diff --git a/vendor/evenement/evenement/composer.json b/vendor/evenement/evenement/composer.json
new file mode 100644
index 0000000000..cbb4827b69
--- /dev/null
+++ b/vendor/evenement/evenement/composer.json
@@ -0,0 +1,29 @@
+{
+ "name": "evenement/evenement",
+ "description": "Événement is a very simple event dispatching library for PHP",
+ "keywords": ["event-dispatcher", "event-emitter"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ }
+ ],
+ "require": {
+ "php": ">=7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6.0"
+ },
+ "autoload": {
+ "psr-0": {
+ "Evenement": "src"
+ }
+ },
+ "autoload-dev": {
+ "psr-0": {
+ "Evenement": "tests"
+ },
+ "files": ["tests/Evenement/Tests/functions.php"]
+ }
+}
diff --git a/vendor/evenement/evenement/doc/00-intro.md b/vendor/evenement/evenement/doc/00-intro.md
new file mode 100644
index 0000000000..6c28a2ab2c
--- /dev/null
+++ b/vendor/evenement/evenement/doc/00-intro.md
@@ -0,0 +1,28 @@
+# Introduction
+
+Événement is is French and means "event". The événement library aims to
+provide a simple way of subscribing to events and notifying those subscribers
+whenever an event occurs.
+
+The API that it exposes is almost a direct port of the EventEmitter API found
+in node.js. It also includes an "EventEmitter". There are some minor
+differences however.
+
+The EventEmitter is an implementation of the publish-subscribe pattern, which
+is a generalized version of the observer pattern. The observer pattern
+specifies an observable subject, which observers can register themselves to.
+Once something interesting happens, the subject notifies its observers.
+
+Pub/sub takes the same idea but encapsulates the observation logic inside a
+separate object which manages all of its subscribers or listeners. Subscribers
+are bound to an event name, and will only receive notifications of the events
+they subscribed to.
+
+**TLDR: What does evenement do, in short? It provides a mapping from event
+names to a list of listener functions and triggers each listener for a given
+event when it is emitted.**
+
+Why do we do this, you ask? To achieve decoupling.
+
+It allows you to design a system where the core will emit events, and modules
+are able to subscribe to these events. And respond to them.
diff --git a/vendor/evenement/evenement/doc/01-api.md b/vendor/evenement/evenement/doc/01-api.md
new file mode 100644
index 0000000000..17ba333ecc
--- /dev/null
+++ b/vendor/evenement/evenement/doc/01-api.md
@@ -0,0 +1,91 @@
+# API
+
+The API that événement exposes is defined by the
+`Evenement\EventEmitterInterface`. The interface is useful if you want to
+define an interface that extends the emitter and implicitly defines certain
+events to be emitted, or if you want to type hint an `EventEmitter` to be
+passed to a method without coupling to the specific implementation.
+
+## on($event, callable $listener)
+
+Allows you to subscribe to an event.
+
+Example:
+
+```php
+$emitter->on('user.created', function (User $user) use ($logger) {
+ $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
+});
+```
+
+Since the listener can be any callable, you could also use an instance method
+instead of the anonymous function:
+
+```php
+$loggerSubscriber = new LoggerSubscriber($logger);
+$emitter->on('user.created', array($loggerSubscriber, 'onUserCreated'));
+```
+
+This has the benefit that listener does not even need to know that the emitter
+exists.
+
+You can also accept more than one parameter for the listener:
+
+```php
+$emitter->on('numbers_added', function ($result, $a, $b) {});
+```
+
+## once($event, callable $listener)
+
+Convenience method that adds a listener which is guaranteed to only be called
+once.
+
+Example:
+
+```php
+$conn->once('connected', function () use ($conn, $data) {
+ $conn->send($data);
+});
+```
+
+## emit($event, array $arguments = [])
+
+Emit an event, which will call all listeners.
+
+Example:
+
+```php
+$conn->emit('data', [$data]);
+```
+
+The second argument to emit is an array of listener arguments. This is how you
+specify more args:
+
+```php
+$result = $a + $b;
+$emitter->emit('numbers_added', [$result, $a, $b]);
+```
+
+## listeners($event)
+
+Allows you to inspect the listeners attached to an event. Particularly useful
+to check if there are any listeners at all.
+
+Example:
+
+```php
+$e = new \RuntimeException('Everything is broken!');
+if (0 === count($emitter->listeners('error'))) {
+ throw $e;
+}
+```
+
+## removeListener($event, callable $listener)
+
+Remove a specific listener for a specific event.
+
+## removeAllListeners($event = null)
+
+Remove all listeners for a specific event or all listeners all together. This
+is useful for long-running processes, where you want to remove listeners in
+order to allow them to get garbage collected.
diff --git a/vendor/evenement/evenement/doc/02-plugin-system.md b/vendor/evenement/evenement/doc/02-plugin-system.md
new file mode 100644
index 0000000000..6a08371931
--- /dev/null
+++ b/vendor/evenement/evenement/doc/02-plugin-system.md
@@ -0,0 +1,155 @@
+# Example: Plugin system
+
+In this example I will show you how to create a generic plugin system with
+événement where plugins can alter the behaviour of the app. The app is a blog.
+Boring, I know. By using the EventEmitter it will be easy to extend this blog
+with additional functionality without modifying the core system.
+
+The blog is quite basic. Users are able to create blog posts when they log in.
+The users are stored in a static config file, so there is no sign up process.
+Once logged in they get a "new post" link which gives them a form where they
+can create a new blog post with plain HTML. That will store the post in a
+document database. The index lists all blog post titles by date descending.
+Clicking on the post title will take you to the full post.
+
+## Plugin structure
+
+The goal of the plugin system is to allow features to be added to the blog
+without modifying any core files of the blog.
+
+The plugins are managed through a config file, `plugins.json`. This JSON file
+contains a JSON-encoded list of class-names for plugin classes. This allows
+you to enable and disable plugins in a central location. The initial
+`plugins.json` is just an empty array:
+```json
+[]
+```
+
+A plugin class must implement the `PluginInterface`:
+```php
+interface PluginInterface
+{
+ function attachEvents(EventEmitterInterface $emitter);
+}
+```
+
+The `attachEvents` method allows the plugin to attach any events to the
+emitter. For example:
+```php
+class FooPlugin implements PluginInterface
+{
+ public function attachEvents(EventEmitterInterface $emitter)
+ {
+ $emitter->on('foo', function () {
+ echo 'bar!';
+ });
+ }
+}
+```
+
+The blog system creates an emitter instance and loads the plugins:
+```php
+$emitter = new EventEmitter();
+
+$pluginClasses = json_decode(file_get_contents('plugins.json'), true);
+foreach ($pluginClasses as $pluginClass) {
+ $plugin = new $pluginClass();
+ $pluginClass->attachEvents($emitter);
+}
+```
+
+This is the base system. There are no plugins yet, and there are no events yet
+either. That's because I don't know which extension points will be needed. I
+will add them on demand.
+
+## Feature: Markdown
+
+Writing blog posts in HTML sucks! Wouldn't it be great if I could write them
+in a nice format such as markdown, and have that be converted to HTML for me?
+
+This feature will need two extension points. I need to be able to mark posts
+as markdown, and I need to be able to hook into the rendering of the post body
+and convert it from markdown to HTML. So the blog needs two new events:
+`post.create` and `post.render`.
+
+In the code that creates the post, I'll insert the `post.create` event:
+```php
+class PostEvent
+{
+ public $post;
+
+ public function __construct(array $post)
+ {
+ $this->post = $post;
+ }
+}
+
+$post = createPostFromRequest($_POST);
+
+$event = new PostEvent($post);
+$emitter->emit('post.create', [$event]);
+$post = $event->post;
+
+$db->save('post', $post);
+```
+
+This shows that you can wrap a value in an event object to make it mutable,
+allowing listeners to change it.
+
+The same thing for the `post.render` event:
+```php
+public function renderPostBody(array $post)
+{
+ $emitter = $this->emitter;
+
+ $event = new PostEvent($post);
+ $emitter->emit('post.render', [$event]);
+ $post = $event->post;
+
+ return $post['body'];
+}
+
+
= $post['title'] %>
+
= renderPostBody($post) %>
+```
+
+Ok, the events are in place. It's time to create the first plugin, woohoo! I
+will call this the `MarkdownPlugin`, so here's `plugins.json`:
+```json
+[
+ "MarkdownPlugin"
+]
+```
+
+The `MarkdownPlugin` class will be autoloaded, so I don't have to worry about
+including any files. I just have to worry about implementing the plugin class.
+The `markdown` function represents a markdown to HTML converter.
+```php
+class MarkdownPlugin implements PluginInterface
+{
+ public function attachEvents(EventEmitterInterface $emitter)
+ {
+ $emitter->on('post.create', function (PostEvent $event) {
+ $event->post['format'] = 'markdown';
+ });
+
+ $emitter->on('post.render', function (PostEvent $event) {
+ if (isset($event->post['format']) && 'markdown' === $event->post['format']) {
+ $event->post['body'] = markdown($event->post['body']);
+ }
+ });
+ }
+}
+```
+
+There you go, the blog now renders posts as markdown. But all of the previous
+posts before the addition of the markdown plugin are still rendered correctly
+as raw HTML.
+
+## Feature: Comments
+
+TODO
+
+## Feature: Comment spam control
+
+TODO
diff --git a/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php b/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php
new file mode 100644
index 0000000000..53d7f4b225
--- /dev/null
+++ b/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+const ITERATIONS = 10000000;
+
+use Evenement\EventEmitter;
+
+require __DIR__.'/../vendor/autoload.php';
+
+$emitter = new EventEmitter();
+
+$emitter->on('event', function () {});
+
+$start = microtime(true);
+for ($i = 0; $i < ITERATIONS; $i++) {
+ $emitter->emit('event');
+}
+$time = microtime(true) - $start;
+
+echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL;
diff --git a/vendor/evenement/evenement/examples/benchmark-emit-once.php b/vendor/evenement/evenement/examples/benchmark-emit-once.php
new file mode 100644
index 0000000000..74f4d1755e
--- /dev/null
+++ b/vendor/evenement/evenement/examples/benchmark-emit-once.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+ini_set('memory_limit', '512M');
+
+const ITERATIONS = 100000;
+
+use Evenement\EventEmitter;
+
+require __DIR__.'/../vendor/autoload.php';
+
+$emitter = new EventEmitter();
+
+for ($i = 0; $i < ITERATIONS; $i++) {
+ $emitter->once('event', function ($a, $b, $c) {});
+}
+
+$start = microtime(true);
+$emitter->emit('event', [1, 2, 3]);
+$time = microtime(true) - $start;
+
+echo 'Emitting one event to ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL;
diff --git a/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php b/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php
new file mode 100644
index 0000000000..39fc4ba09e
--- /dev/null
+++ b/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+const ITERATIONS = 10000000;
+
+use Evenement\EventEmitter;
+
+require __DIR__.'/../vendor/autoload.php';
+
+$emitter = new EventEmitter();
+
+$emitter->on('event', function ($a) {});
+
+$start = microtime(true);
+for ($i = 0; $i < ITERATIONS; $i++) {
+ $emitter->emit('event', [1]);
+}
+$time = microtime(true) - $start;
+
+echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL;
diff --git a/vendor/evenement/evenement/examples/benchmark-emit.php b/vendor/evenement/evenement/examples/benchmark-emit.php
new file mode 100644
index 0000000000..3ab639e07a
--- /dev/null
+++ b/vendor/evenement/evenement/examples/benchmark-emit.php
@@ -0,0 +1,28 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+const ITERATIONS = 10000000;
+
+use Evenement\EventEmitter;
+
+require __DIR__.'/../vendor/autoload.php';
+
+$emitter = new EventEmitter();
+
+$emitter->on('event', function ($a, $b, $c) {});
+
+$start = microtime(true);
+for ($i = 0; $i < ITERATIONS; $i++) {
+ $emitter->emit('event', [1, 2, 3]);
+}
+$time = microtime(true) - $start;
+
+echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL;
diff --git a/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php b/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php
new file mode 100644
index 0000000000..414be3bd23
--- /dev/null
+++ b/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php
@@ -0,0 +1,39 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+ini_set('memory_limit', '512M');
+
+const ITERATIONS = 100000;
+
+use Evenement\EventEmitter;
+
+require __DIR__.'/../vendor/autoload.php';
+
+$emitter = new EventEmitter();
+
+$listeners = [];
+for ($i = 0; $i < ITERATIONS; $i++) {
+ $listeners[] = function ($a, $b, $c) {};
+}
+
+$start = microtime(true);
+foreach ($listeners as $listener) {
+ $emitter->once('event', $listener);
+}
+$time = microtime(true) - $start;
+echo 'Adding ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL;
+
+$start = microtime(true);
+foreach ($listeners as $listener) {
+ $emitter->removeListener('event', $listener);
+}
+$time = microtime(true) - $start;
+echo 'Removing ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL;
diff --git a/vendor/evenement/evenement/phpunit.xml.dist b/vendor/evenement/evenement/phpunit.xml.dist
new file mode 100644
index 0000000000..70bc693a56
--- /dev/null
+++ b/vendor/evenement/evenement/phpunit.xml.dist
@@ -0,0 +1,24 @@
+
+
+
+
+
+ ./tests/Evenement/
+
+
+
+
+
+ ./src/
+
+
+
diff --git a/vendor/evenement/evenement/src/Evenement/EventEmitter.php b/vendor/evenement/evenement/src/Evenement/EventEmitter.php
new file mode 100644
index 0000000000..db189b972b
--- /dev/null
+++ b/vendor/evenement/evenement/src/Evenement/EventEmitter.php
@@ -0,0 +1,17 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement;
+
+class EventEmitter implements EventEmitterInterface
+{
+ use EventEmitterTrait;
+}
diff --git a/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php b/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php
new file mode 100644
index 0000000000..310631a104
--- /dev/null
+++ b/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php
@@ -0,0 +1,22 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement;
+
+interface EventEmitterInterface
+{
+ public function on($event, callable $listener);
+ public function once($event, callable $listener);
+ public function removeListener($event, callable $listener);
+ public function removeAllListeners($event = null);
+ public function listeners($event = null);
+ public function emit($event, array $arguments = []);
+}
diff --git a/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php b/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php
new file mode 100644
index 0000000000..a78e65ca51
--- /dev/null
+++ b/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php
@@ -0,0 +1,135 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement;
+
+use InvalidArgumentException;
+
+trait EventEmitterTrait
+{
+ protected $listeners = [];
+ protected $onceListeners = [];
+
+ public function on($event, callable $listener)
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ if (!isset($this->listeners[$event])) {
+ $this->listeners[$event] = [];
+ }
+
+ $this->listeners[$event][] = $listener;
+
+ return $this;
+ }
+
+ public function once($event, callable $listener)
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ if (!isset($this->onceListeners[$event])) {
+ $this->onceListeners[$event] = [];
+ }
+
+ $this->onceListeners[$event][] = $listener;
+
+ return $this;
+ }
+
+ public function removeListener($event, callable $listener)
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ if (isset($this->listeners[$event])) {
+ $index = \array_search($listener, $this->listeners[$event], true);
+ if (false !== $index) {
+ unset($this->listeners[$event][$index]);
+ if (\count($this->listeners[$event]) === 0) {
+ unset($this->listeners[$event]);
+ }
+ }
+ }
+
+ if (isset($this->onceListeners[$event])) {
+ $index = \array_search($listener, $this->onceListeners[$event], true);
+ if (false !== $index) {
+ unset($this->onceListeners[$event][$index]);
+ if (\count($this->onceListeners[$event]) === 0) {
+ unset($this->onceListeners[$event]);
+ }
+ }
+ }
+ }
+
+ public function removeAllListeners($event = null)
+ {
+ if ($event !== null) {
+ unset($this->listeners[$event]);
+ } else {
+ $this->listeners = [];
+ }
+
+ if ($event !== null) {
+ unset($this->onceListeners[$event]);
+ } else {
+ $this->onceListeners = [];
+ }
+ }
+
+ public function listeners($event = null): array
+ {
+ if ($event === null) {
+ $events = [];
+ $eventNames = \array_unique(
+ \array_merge(\array_keys($this->listeners), \array_keys($this->onceListeners))
+ );
+ foreach ($eventNames as $eventName) {
+ $events[$eventName] = \array_merge(
+ isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [],
+ isset($this->onceListeners[$eventName]) ? $this->onceListeners[$eventName] : []
+ );
+ }
+ return $events;
+ }
+
+ return \array_merge(
+ isset($this->listeners[$event]) ? $this->listeners[$event] : [],
+ isset($this->onceListeners[$event]) ? $this->onceListeners[$event] : []
+ );
+ }
+
+ public function emit($event, array $arguments = [])
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ if (isset($this->listeners[$event])) {
+ foreach ($this->listeners[$event] as $listener) {
+ $listener(...$arguments);
+ }
+ }
+
+ if (isset($this->onceListeners[$event])) {
+ $listeners = $this->onceListeners[$event];
+ unset($this->onceListeners[$event]);
+ foreach ($listeners as $listener) {
+ $listener(...$arguments);
+ }
+ }
+ }
+}
diff --git a/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php b/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php
new file mode 100644
index 0000000000..28f3011d67
--- /dev/null
+++ b/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php
@@ -0,0 +1,438 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement\Tests;
+
+use Evenement\EventEmitter;
+use InvalidArgumentException;
+use PHPUnit\Framework\TestCase;
+
+class EventEmitterTest extends TestCase
+{
+ private $emitter;
+
+ public function setUp()
+ {
+ $this->emitter = new EventEmitter();
+ }
+
+ public function testAddListenerWithLambda()
+ {
+ $this->emitter->on('foo', function () {});
+ }
+
+ public function testAddListenerWithMethod()
+ {
+ $listener = new Listener();
+ $this->emitter->on('foo', [$listener, 'onFoo']);
+ }
+
+ public function testAddListenerWithStaticMethod()
+ {
+ $this->emitter->on('bar', ['Evenement\Tests\Listener', 'onBar']);
+ }
+
+ public function testAddListenerWithInvalidListener()
+ {
+ try {
+ $this->emitter->on('foo', 'not a callable');
+ $this->fail();
+ } catch (\Exception $e) {
+ } catch (\TypeError $e) {
+ }
+ }
+
+ public function testOnce()
+ {
+ $listenerCalled = 0;
+
+ $this->emitter->once('foo', function () use (&$listenerCalled) {
+ $listenerCalled++;
+ });
+
+ $this->assertSame(0, $listenerCalled);
+
+ $this->emitter->emit('foo');
+
+ $this->assertSame(1, $listenerCalled);
+
+ $this->emitter->emit('foo');
+
+ $this->assertSame(1, $listenerCalled);
+ }
+
+ public function testOnceWithArguments()
+ {
+ $capturedArgs = [];
+
+ $this->emitter->once('foo', function ($a, $b) use (&$capturedArgs) {
+ $capturedArgs = array($a, $b);
+ });
+
+ $this->emitter->emit('foo', array('a', 'b'));
+
+ $this->assertSame(array('a', 'b'), $capturedArgs);
+ }
+
+ public function testEmitWithoutArguments()
+ {
+ $listenerCalled = false;
+
+ $this->emitter->on('foo', function () use (&$listenerCalled) {
+ $listenerCalled = true;
+ });
+
+ $this->assertSame(false, $listenerCalled);
+ $this->emitter->emit('foo');
+ $this->assertSame(true, $listenerCalled);
+ }
+
+ public function testEmitWithOneArgument()
+ {
+ $test = $this;
+
+ $listenerCalled = false;
+
+ $this->emitter->on('foo', function ($value) use (&$listenerCalled, $test) {
+ $listenerCalled = true;
+
+ $test->assertSame('bar', $value);
+ });
+
+ $this->assertSame(false, $listenerCalled);
+ $this->emitter->emit('foo', ['bar']);
+ $this->assertSame(true, $listenerCalled);
+ }
+
+ public function testEmitWithTwoArguments()
+ {
+ $test = $this;
+
+ $listenerCalled = false;
+
+ $this->emitter->on('foo', function ($arg1, $arg2) use (&$listenerCalled, $test) {
+ $listenerCalled = true;
+
+ $test->assertSame('bar', $arg1);
+ $test->assertSame('baz', $arg2);
+ });
+
+ $this->assertSame(false, $listenerCalled);
+ $this->emitter->emit('foo', ['bar', 'baz']);
+ $this->assertSame(true, $listenerCalled);
+ }
+
+ public function testEmitWithNoListeners()
+ {
+ $this->emitter->emit('foo');
+ $this->emitter->emit('foo', ['bar']);
+ $this->emitter->emit('foo', ['bar', 'baz']);
+ }
+
+ public function testEmitWithTwoListeners()
+ {
+ $listenersCalled = 0;
+
+ $this->emitter->on('foo', function () use (&$listenersCalled) {
+ $listenersCalled++;
+ });
+
+ $this->emitter->on('foo', function () use (&$listenersCalled) {
+ $listenersCalled++;
+ });
+
+ $this->assertSame(0, $listenersCalled);
+ $this->emitter->emit('foo');
+ $this->assertSame(2, $listenersCalled);
+ }
+
+ public function testRemoveListenerMatching()
+ {
+ $listenersCalled = 0;
+
+ $listener = function () use (&$listenersCalled) {
+ $listenersCalled++;
+ };
+
+ $this->emitter->on('foo', $listener);
+ $this->emitter->removeListener('foo', $listener);
+
+ $this->assertSame(0, $listenersCalled);
+ $this->emitter->emit('foo');
+ $this->assertSame(0, $listenersCalled);
+ }
+
+ public function testRemoveListenerNotMatching()
+ {
+ $listenersCalled = 0;
+
+ $listener = function () use (&$listenersCalled) {
+ $listenersCalled++;
+ };
+
+ $this->emitter->on('foo', $listener);
+ $this->emitter->removeListener('bar', $listener);
+
+ $this->assertSame(0, $listenersCalled);
+ $this->emitter->emit('foo');
+ $this->assertSame(1, $listenersCalled);
+ }
+
+ public function testRemoveAllListenersMatching()
+ {
+ $listenersCalled = 0;
+
+ $this->emitter->on('foo', function () use (&$listenersCalled) {
+ $listenersCalled++;
+ });
+
+ $this->emitter->removeAllListeners('foo');
+
+ $this->assertSame(0, $listenersCalled);
+ $this->emitter->emit('foo');
+ $this->assertSame(0, $listenersCalled);
+ }
+
+ public function testRemoveAllListenersNotMatching()
+ {
+ $listenersCalled = 0;
+
+ $this->emitter->on('foo', function () use (&$listenersCalled) {
+ $listenersCalled++;
+ });
+
+ $this->emitter->removeAllListeners('bar');
+
+ $this->assertSame(0, $listenersCalled);
+ $this->emitter->emit('foo');
+ $this->assertSame(1, $listenersCalled);
+ }
+
+ public function testRemoveAllListenersWithoutArguments()
+ {
+ $listenersCalled = 0;
+
+ $this->emitter->on('foo', function () use (&$listenersCalled) {
+ $listenersCalled++;
+ });
+
+ $this->emitter->on('bar', function () use (&$listenersCalled) {
+ $listenersCalled++;
+ });
+
+ $this->emitter->removeAllListeners();
+
+ $this->assertSame(0, $listenersCalled);
+ $this->emitter->emit('foo');
+ $this->emitter->emit('bar');
+ $this->assertSame(0, $listenersCalled);
+ }
+
+ public function testCallablesClosure()
+ {
+ $calledWith = null;
+
+ $this->emitter->on('foo', function ($data) use (&$calledWith) {
+ $calledWith = $data;
+ });
+
+ $this->emitter->emit('foo', ['bar']);
+
+ self::assertSame('bar', $calledWith);
+ }
+
+ public function testCallablesClass()
+ {
+ $listener = new Listener();
+ $this->emitter->on('foo', [$listener, 'onFoo']);
+
+ $this->emitter->emit('foo', ['bar']);
+
+ self::assertSame(['bar'], $listener->getData());
+ }
+
+
+ public function testCallablesClassInvoke()
+ {
+ $listener = new Listener();
+ $this->emitter->on('foo', $listener);
+
+ $this->emitter->emit('foo', ['bar']);
+
+ self::assertSame(['bar'], $listener->getMagicData());
+ }
+
+ public function testCallablesStaticClass()
+ {
+ $this->emitter->on('foo', '\Evenement\Tests\Listener::onBar');
+
+ $this->emitter->emit('foo', ['bar']);
+
+ self::assertSame(['bar'], Listener::getStaticData());
+ }
+
+ public function testCallablesFunction()
+ {
+ $this->emitter->on('foo', '\Evenement\Tests\setGlobalTestData');
+
+ $this->emitter->emit('foo', ['bar']);
+
+ self::assertSame('bar', $GLOBALS['evenement-evenement-test-data']);
+
+ unset($GLOBALS['evenement-evenement-test-data']);
+ }
+
+ public function testListeners()
+ {
+ $onA = function () {};
+ $onB = function () {};
+ $onC = function () {};
+ $onceA = function () {};
+ $onceB = function () {};
+ $onceC = function () {};
+
+ self::assertCount(0, $this->emitter->listeners('event'));
+ $this->emitter->on('event', $onA);
+ self::assertCount(1, $this->emitter->listeners('event'));
+ self::assertSame([$onA], $this->emitter->listeners('event'));
+ $this->emitter->once('event', $onceA);
+ self::assertCount(2, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onceA], $this->emitter->listeners('event'));
+ $this->emitter->once('event', $onceB);
+ self::assertCount(3, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onceA, $onceB], $this->emitter->listeners('event'));
+ $this->emitter->on('event', $onB);
+ self::assertCount(4, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onB, $onceA, $onceB], $this->emitter->listeners('event'));
+ $this->emitter->removeListener('event', $onceA);
+ self::assertCount(3, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onB, $onceB], $this->emitter->listeners('event'));
+ $this->emitter->once('event', $onceC);
+ self::assertCount(4, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onB, $onceB, $onceC], $this->emitter->listeners('event'));
+ $this->emitter->on('event', $onC);
+ self::assertCount(5, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onB, $onC, $onceB, $onceC], $this->emitter->listeners('event'));
+ $this->emitter->once('event', $onceA);
+ self::assertCount(6, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onB, $onC, $onceB, $onceC, $onceA], $this->emitter->listeners('event'));
+ $this->emitter->removeListener('event', $onB);
+ self::assertCount(5, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onC, $onceB, $onceC, $onceA], $this->emitter->listeners('event'));
+ $this->emitter->emit('event');
+ self::assertCount(2, $this->emitter->listeners('event'));
+ self::assertSame([$onA, $onC], $this->emitter->listeners('event'));
+ }
+
+ public function testOnceCallIsNotRemovedWhenWorkingOverOnceListeners()
+ {
+ $aCalled = false;
+ $aCallable = function () use (&$aCalled) {
+ $aCalled = true;
+ };
+ $bCalled = false;
+ $bCallable = function () use (&$bCalled, $aCallable) {
+ $bCalled = true;
+ $this->emitter->once('event', $aCallable);
+ };
+ $this->emitter->once('event', $bCallable);
+
+ self::assertFalse($aCalled);
+ self::assertFalse($bCalled);
+ $this->emitter->emit('event');
+
+ self::assertFalse($aCalled);
+ self::assertTrue($bCalled);
+ $this->emitter->emit('event');
+
+ self::assertTrue($aCalled);
+ self::assertTrue($bCalled);
+ }
+
+ public function testEventNameMustBeStringOn()
+ {
+ self::expectException(InvalidArgumentException::class);
+ self::expectExceptionMessage('event name must not be null');
+
+ $this->emitter->on(null, function () {});
+ }
+
+ public function testEventNameMustBeStringOnce()
+ {
+ self::expectException(InvalidArgumentException::class);
+ self::expectExceptionMessage('event name must not be null');
+
+ $this->emitter->once(null, function () {});
+ }
+
+ public function testEventNameMustBeStringRemoveListener()
+ {
+ self::expectException(InvalidArgumentException::class);
+ self::expectExceptionMessage('event name must not be null');
+
+ $this->emitter->removeListener(null, function () {});
+ }
+
+ public function testEventNameMustBeStringEmit()
+ {
+ self::expectException(InvalidArgumentException::class);
+ self::expectExceptionMessage('event name must not be null');
+
+ $this->emitter->emit(null);
+ }
+
+ public function testListenersGetAll()
+ {
+ $a = function () {};
+ $b = function () {};
+ $c = function () {};
+ $d = function () {};
+
+ $this->emitter->once('event2', $c);
+ $this->emitter->on('event', $a);
+ $this->emitter->once('event', $b);
+ $this->emitter->on('event', $c);
+ $this->emitter->once('event', $d);
+
+ self::assertSame(
+ [
+ 'event' => [
+ $a,
+ $c,
+ $b,
+ $d,
+ ],
+ 'event2' => [
+ $c,
+ ],
+ ],
+ $this->emitter->listeners()
+ );
+ }
+
+ public function testOnceNestedCallRegression()
+ {
+ $first = 0;
+ $second = 0;
+
+ $this->emitter->once('event', function () use (&$first, &$second) {
+ $first++;
+ $this->emitter->once('event', function () use (&$second) {
+ $second++;
+ });
+ $this->emitter->emit('event');
+ });
+ $this->emitter->emit('event');
+
+ self::assertSame(1, $first);
+ self::assertSame(1, $second);
+ }
+}
diff --git a/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php b/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php
new file mode 100644
index 0000000000..df17424656
--- /dev/null
+++ b/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php
@@ -0,0 +1,51 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement\Tests;
+
+class Listener
+{
+ private $data = [];
+
+ private $magicData = [];
+
+ private static $staticData = [];
+
+ public function onFoo($data)
+ {
+ $this->data[] = $data;
+ }
+
+ public function __invoke($data)
+ {
+ $this->magicData[] = $data;
+ }
+
+ public static function onBar($data)
+ {
+ self::$staticData[] = $data;
+ }
+
+ public function getData()
+ {
+ return $this->data;
+ }
+
+ public function getMagicData()
+ {
+ return $this->magicData;
+ }
+
+ public static function getStaticData()
+ {
+ return self::$staticData;
+ }
+}
diff --git a/vendor/evenement/evenement/tests/Evenement/Tests/functions.php b/vendor/evenement/evenement/tests/Evenement/Tests/functions.php
new file mode 100644
index 0000000000..7f11f5ba92
--- /dev/null
+++ b/vendor/evenement/evenement/tests/Evenement/Tests/functions.php
@@ -0,0 +1,17 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement\Tests;
+
+function setGlobalTestData($data)
+{
+ $GLOBALS['evenement-evenement-test-data'] = $data;
+}
diff --git a/vendor/jakub-onderka/php-console-color/.gitignore b/vendor/jakub-onderka/php-console-color/.gitignore
new file mode 100644
index 0000000000..05ab16b84f
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/.gitignore
@@ -0,0 +1,3 @@
+build
+vendor
+composer.lock
diff --git a/vendor/jakub-onderka/php-console-color/.travis.yml b/vendor/jakub-onderka/php-console-color/.travis.yml
new file mode 100644
index 0000000000..49175a9969
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/.travis.yml
@@ -0,0 +1,24 @@
+language: php
+
+php:
+ - 5.4
+ - 5.5
+ - 5.6
+ - 7.0
+ - 7.1
+ - 7.2
+
+sudo: false
+
+cache:
+ directories:
+ - vendor
+ - $HOME/.composer/cache
+
+before_script:
+ - composer install --no-interaction --prefer-source
+
+script:
+ - ant phplint
+ - ant phpcs
+ - ant phpunit
diff --git a/vendor/jakub-onderka/php-console-color/LICENSE b/vendor/jakub-onderka/php-console-color/LICENSE
new file mode 100644
index 0000000000..0954fc941f
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2014-2018, Jakub Onderka
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/jakub-onderka/php-console-color/README.md b/vendor/jakub-onderka/php-console-color/README.md
new file mode 100644
index 0000000000..39e55d9255
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/README.md
@@ -0,0 +1,10 @@
+PHP Console Color
+=================
+
+[![Build Status](https://travis-ci.org/JakubOnderka/PHP-Console-Color.svg?branch=master)](https://travis-ci.org/JakubOnderka/PHP-Console-Color)
+
+Simple library for creating colored console ouput.
+
+See `example.php` how to use this library.
+
+![Example from Windows 10](https://user-images.githubusercontent.com/89590/40762008-687f909a-646c-11e8-88d6-e268a064be4c.png)
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-color/build.xml b/vendor/jakub-onderka/php-console-color/build.xml
new file mode 100644
index 0000000000..bb4ba66d8f
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/build.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-color/composer.json b/vendor/jakub-onderka/php-console-color/composer.json
new file mode 100644
index 0000000000..6481cb51d0
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "jakub-onderka/php-console-color",
+ "license": "BSD-2-Clause",
+ "authors": [
+ {
+ "name": "Jakub Onderka",
+ "email": "jakub.onderka@gmail.com"
+ }
+ ],
+ "autoload": {
+ "psr-4": {"JakubOnderka\\PhpConsoleColor\\": "src/"}
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.3",
+ "jakub-onderka/php-parallel-lint": "1.0",
+ "jakub-onderka/php-var-dump-check": "0.*",
+ "squizlabs/php_codesniffer": "1.*",
+ "jakub-onderka/php-code-style": "1.0"
+ }
+}
diff --git a/vendor/jakub-onderka/php-console-color/example.php b/vendor/jakub-onderka/php-console-color/example.php
new file mode 100644
index 0000000000..5e698a24ec
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/example.php
@@ -0,0 +1,38 @@
+isSupported() ? 'Yes' : 'No') . "\n";
+echo "256 colors are supported: " . ($consoleColor->are256ColorsSupported() ? 'Yes' : 'No') . "\n\n";
+
+if ($consoleColor->isSupported()) {
+ foreach ($consoleColor->getPossibleStyles() as $style) {
+ echo $consoleColor->apply($style, $style) . "\n";
+ }
+}
+
+echo "\n";
+
+if ($consoleColor->are256ColorsSupported()) {
+ echo "Foreground colors:\n";
+ for ($i = 1; $i <= 255; $i++) {
+ echo $consoleColor->apply("color_$i", str_pad($i, 6, ' ', STR_PAD_BOTH));
+
+ if ($i % 15 === 0) {
+ echo "\n";
+ }
+ }
+
+ echo "\nBackground colors:\n";
+
+ for ($i = 1; $i <= 255; $i++) {
+ echo $consoleColor->apply("bg_color_$i", str_pad($i, 6, ' ', STR_PAD_BOTH));
+
+ if ($i % 15 === 0) {
+ echo "\n";
+ }
+ }
+
+ echo "\n";
+}
diff --git a/vendor/jakub-onderka/php-console-color/phpunit.xml b/vendor/jakub-onderka/php-console-color/phpunit.xml
new file mode 100644
index 0000000000..f1105cc4e2
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/phpunit.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ tests
+
+
+
+
+
+
+ vendor
+
+
+
diff --git a/vendor/jakub-onderka/php-console-color/src/ConsoleColor.php b/vendor/jakub-onderka/php-console-color/src/ConsoleColor.php
new file mode 100644
index 0000000000..90fd125286
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/src/ConsoleColor.php
@@ -0,0 +1,287 @@
+ null,
+ 'bold' => '1',
+ 'dark' => '2',
+ 'italic' => '3',
+ 'underline' => '4',
+ 'blink' => '5',
+ 'reverse' => '7',
+ 'concealed' => '8',
+
+ 'default' => '39',
+ 'black' => '30',
+ 'red' => '31',
+ 'green' => '32',
+ 'yellow' => '33',
+ 'blue' => '34',
+ 'magenta' => '35',
+ 'cyan' => '36',
+ 'light_gray' => '37',
+
+ 'dark_gray' => '90',
+ 'light_red' => '91',
+ 'light_green' => '92',
+ 'light_yellow' => '93',
+ 'light_blue' => '94',
+ 'light_magenta' => '95',
+ 'light_cyan' => '96',
+ 'white' => '97',
+
+ 'bg_default' => '49',
+ 'bg_black' => '40',
+ 'bg_red' => '41',
+ 'bg_green' => '42',
+ 'bg_yellow' => '43',
+ 'bg_blue' => '44',
+ 'bg_magenta' => '45',
+ 'bg_cyan' => '46',
+ 'bg_light_gray' => '47',
+
+ 'bg_dark_gray' => '100',
+ 'bg_light_red' => '101',
+ 'bg_light_green' => '102',
+ 'bg_light_yellow' => '103',
+ 'bg_light_blue' => '104',
+ 'bg_light_magenta' => '105',
+ 'bg_light_cyan' => '106',
+ 'bg_white' => '107',
+ );
+
+ /** @var array */
+ private $themes = array();
+
+ public function __construct()
+ {
+ $this->isSupported = $this->isSupported();
+ }
+
+ /**
+ * @param string|array $style
+ * @param string $text
+ * @return string
+ * @throws InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function apply($style, $text)
+ {
+ if (!$this->isStyleForced() && !$this->isSupported()) {
+ return $text;
+ }
+
+ if (is_string($style)) {
+ $style = array($style);
+ }
+ if (!is_array($style)) {
+ throw new \InvalidArgumentException("Style must be string or array.");
+ }
+
+ $sequences = array();
+
+ foreach ($style as $s) {
+ if (isset($this->themes[$s])) {
+ $sequences = array_merge($sequences, $this->themeSequence($s));
+ } else if ($this->isValidStyle($s)) {
+ $sequences[] = $this->styleSequence($s);
+ } else {
+ throw new InvalidStyleException($s);
+ }
+ }
+
+ $sequences = array_filter($sequences, function ($val) {
+ return $val !== null;
+ });
+
+ if (empty($sequences)) {
+ return $text;
+ }
+
+ return $this->escSequence(implode(';', $sequences)) . $text . $this->escSequence(self::RESET_STYLE);
+ }
+
+ /**
+ * @param bool $forceStyle
+ */
+ public function setForceStyle($forceStyle)
+ {
+ $this->forceStyle = (bool) $forceStyle;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isStyleForced()
+ {
+ return $this->forceStyle;
+ }
+
+ /**
+ * @param array $themes
+ * @throws InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function setThemes(array $themes)
+ {
+ $this->themes = array();
+ foreach ($themes as $name => $styles) {
+ $this->addTheme($name, $styles);
+ }
+ }
+
+ /**
+ * @param string $name
+ * @param array|string $styles
+ * @throws \InvalidArgumentException
+ * @throws InvalidStyleException
+ */
+ public function addTheme($name, $styles)
+ {
+ if (is_string($styles)) {
+ $styles = array($styles);
+ }
+ if (!is_array($styles)) {
+ throw new \InvalidArgumentException("Style must be string or array.");
+ }
+
+ foreach ($styles as $style) {
+ if (!$this->isValidStyle($style)) {
+ throw new InvalidStyleException($style);
+ }
+ }
+
+ $this->themes[$name] = $styles;
+ }
+
+ /**
+ * @return array
+ */
+ public function getThemes()
+ {
+ return $this->themes;
+ }
+
+ /**
+ * @param string $name
+ * @return bool
+ */
+ public function hasTheme($name)
+ {
+ return isset($this->themes[$name]);
+ }
+
+ /**
+ * @param string $name
+ */
+ public function removeTheme($name)
+ {
+ unset($this->themes[$name]);
+ }
+
+ /**
+ * @return bool
+ */
+ public function isSupported()
+ {
+ if (DIRECTORY_SEPARATOR === '\\') {
+ if (function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support(STDOUT)) {
+ return true;
+ } elseif (getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON') {
+ return true;
+ }
+ return false;
+ } else {
+ return function_exists('posix_isatty') && @posix_isatty(STDOUT);
+ }
+ }
+
+ /**
+ * @return bool
+ */
+ public function are256ColorsSupported()
+ {
+ if (DIRECTORY_SEPARATOR === '\\') {
+ return function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support(STDOUT);
+ } else {
+ return strpos(getenv('TERM'), '256color') !== false;
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function getPossibleStyles()
+ {
+ return array_keys($this->styles);
+ }
+
+ /**
+ * @param string $name
+ * @return string[]
+ */
+ private function themeSequence($name)
+ {
+ $sequences = array();
+ foreach ($this->themes[$name] as $style) {
+ $sequences[] = $this->styleSequence($style);
+ }
+ return $sequences;
+ }
+
+ /**
+ * @param string $style
+ * @return string
+ */
+ private function styleSequence($style)
+ {
+ if (array_key_exists($style, $this->styles)) {
+ return $this->styles[$style];
+ }
+
+ if (!$this->are256ColorsSupported()) {
+ return null;
+ }
+
+ preg_match(self::COLOR256_REGEXP, $style, $matches);
+
+ $type = $matches[1] === 'bg_' ? self::BACKGROUND : self::FOREGROUND;
+ $value = $matches[2];
+
+ return "$type;5;$value";
+ }
+
+ /**
+ * @param string $style
+ * @return bool
+ */
+ private function isValidStyle($style)
+ {
+ return array_key_exists($style, $this->styles) || preg_match(self::COLOR256_REGEXP, $style);
+ }
+
+ /**
+ * @param string|int $value
+ * @return string
+ */
+ private function escSequence($value)
+ {
+ return "\033[{$value}m";
+ }
+}
diff --git a/vendor/jakub-onderka/php-console-color/src/InvalidStyleException.php b/vendor/jakub-onderka/php-console-color/src/InvalidStyleException.php
new file mode 100644
index 0000000000..6f1586f62e
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/src/InvalidStyleException.php
@@ -0,0 +1,10 @@
+isSupportedForce = $isSupported;
+ }
+
+ public function isSupported()
+ {
+ return $this->isSupportedForce;
+ }
+
+ public function setAre256ColorsSupported($are256ColorsSupported)
+ {
+ $this->are256ColorsSupportedForce = $are256ColorsSupported;
+ }
+
+ public function are256ColorsSupported()
+ {
+ return $this->are256ColorsSupportedForce;
+ }
+}
+
+class ConsoleColorTest extends \PHPUnit_Framework_TestCase
+{
+ /** @var ConsoleColorWithForceSupport */
+ private $uut;
+
+ protected function setUp()
+ {
+ $this->uut = new ConsoleColorWithForceSupport();
+ }
+
+ public function testNone()
+ {
+ $output = $this->uut->apply('none', 'text');
+ $this->assertEquals("text", $output);
+ }
+
+ public function testBold()
+ {
+ $output = $this->uut->apply('bold', 'text');
+ $this->assertEquals("\033[1mtext\033[0m", $output);
+ }
+
+ public function testBoldColorsAreNotSupported()
+ {
+ $this->uut->setIsSupported(false);
+
+ $output = $this->uut->apply('bold', 'text');
+ $this->assertEquals("text", $output);
+ }
+
+ public function testBoldColorsAreNotSupportedButAreForced()
+ {
+ $this->uut->setIsSupported(false);
+ $this->uut->setForceStyle(true);
+
+ $output = $this->uut->apply('bold', 'text');
+ $this->assertEquals("\033[1mtext\033[0m", $output);
+ }
+
+ public function testDark()
+ {
+ $output = $this->uut->apply('dark', 'text');
+ $this->assertEquals("\033[2mtext\033[0m", $output);
+ }
+
+ public function testBoldAndDark()
+ {
+ $output = $this->uut->apply(array('bold', 'dark'), 'text');
+ $this->assertEquals("\033[1;2mtext\033[0m", $output);
+ }
+
+ public function test256ColorForeground()
+ {
+ $output = $this->uut->apply('color_255', 'text');
+ $this->assertEquals("\033[38;5;255mtext\033[0m", $output);
+ }
+
+ public function test256ColorWithoutSupport()
+ {
+ $this->uut->setAre256ColorsSupported(false);
+
+ $output = $this->uut->apply('color_255', 'text');
+ $this->assertEquals("text", $output);
+ }
+
+ public function test256ColorBackground()
+ {
+ $output = $this->uut->apply('bg_color_255', 'text');
+ $this->assertEquals("\033[48;5;255mtext\033[0m", $output);
+ }
+
+ public function test256ColorForegroundAndBackground()
+ {
+ $output = $this->uut->apply(array('color_200', 'bg_color_255'), 'text');
+ $this->assertEquals("\033[38;5;200;48;5;255mtext\033[0m", $output);
+ }
+
+ public function testSetOwnTheme()
+ {
+ $this->uut->setThemes(array('bold_dark' => array('bold', 'dark')));
+ $output = $this->uut->apply(array('bold_dark'), 'text');
+ $this->assertEquals("\033[1;2mtext\033[0m", $output);
+ }
+
+ public function testAddOwnTheme()
+ {
+ $this->uut->addTheme('bold_own', 'bold');
+ $output = $this->uut->apply(array('bold_own'), 'text');
+ $this->assertEquals("\033[1mtext\033[0m", $output);
+ }
+
+ public function testAddOwnThemeArray()
+ {
+ $this->uut->addTheme('bold_dark', array('bold', 'dark'));
+ $output = $this->uut->apply(array('bold_dark'), 'text');
+ $this->assertEquals("\033[1;2mtext\033[0m", $output);
+ }
+
+ public function testOwnWithStyle()
+ {
+ $this->uut->addTheme('bold_dark', array('bold', 'dark'));
+ $output = $this->uut->apply(array('bold_dark', 'italic'), 'text');
+ $this->assertEquals("\033[1;2;3mtext\033[0m", $output);
+ }
+
+ public function testHasAndRemoveTheme()
+ {
+ $this->assertFalse($this->uut->hasTheme('bold_dark'));
+
+ $this->uut->addTheme('bold_dark', array('bold', 'dark'));
+ $this->assertTrue($this->uut->hasTheme('bold_dark'));
+
+ $this->uut->removeTheme('bold_dark');
+ $this->assertFalse($this->uut->hasTheme('bold_dark'));
+ }
+
+ public function testApplyInvalidArgument()
+ {
+ $this->setExpectedException('\InvalidArgumentException');
+ $this->uut->apply(new stdClass(), 'text');
+ }
+
+ public function testApplyInvalidStyleName()
+ {
+ $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
+ $this->uut->apply('invalid', 'text');
+ }
+
+ public function testApplyInvalid256Color()
+ {
+ $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
+ $this->uut->apply('color_2134', 'text');
+ }
+
+ public function testThemeInvalidStyle()
+ {
+ $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
+ $this->uut->addTheme('invalid', array('invalid'));
+ }
+
+ public function testForceStyle()
+ {
+ $this->assertFalse($this->uut->isStyleForced());
+ $this->uut->setForceStyle(true);
+ $this->assertTrue($this->uut->isStyleForced());
+ }
+
+ public function testGetPossibleStyles()
+ {
+ $this->assertInternalType('array', $this->uut->getPossibleStyles());
+ $this->assertNotEmpty($this->uut->getPossibleStyles());
+ }
+}
+
diff --git a/vendor/jakub-onderka/php-console-highlighter/.gitignore b/vendor/jakub-onderka/php-console-highlighter/.gitignore
new file mode 100644
index 0000000000..70f6ec0695
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/.gitignore
@@ -0,0 +1,4 @@
+/.idea/
+/build/
+/vendor/
+/composer.lock
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/.travis.yml b/vendor/jakub-onderka/php-console-highlighter/.travis.yml
new file mode 100644
index 0000000000..c88c4ec9d4
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/.travis.yml
@@ -0,0 +1,22 @@
+language: php
+
+php:
+ - 5.4
+ - 5.5
+ - 5.6
+ - 7.0
+ - 7.1
+ - 7.2
+
+sudo: false
+
+cache:
+ directories:
+ - vendor
+ - $HOME/.composer/cache
+
+before_script:
+ - composer install --no-interaction --prefer-source
+
+script:
+ - ant
diff --git a/vendor/jakub-onderka/php-console-highlighter/LICENSE b/vendor/jakub-onderka/php-console-highlighter/LICENSE
new file mode 100644
index 0000000000..1a8317fa15
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Jakub Onderka
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/README.md b/vendor/jakub-onderka/php-console-highlighter/README.md
new file mode 100644
index 0000000000..1ef3d1340d
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/README.md
@@ -0,0 +1,42 @@
+PHP Console Highlighter
+=======================
+
+Highlight PHP code in console (terminal).
+
+Example
+-------
+![Example](http://jakubonderka.github.io/php-console-highlight-example.png)
+
+Install
+-------
+
+Just create a `composer.json` file and run the `php composer.phar install` command to install it:
+
+```json
+{
+ "require": {
+ "jakub-onderka/php-console-highlighter": "0.*"
+ }
+}
+```
+
+Usage
+-------
+```php
+getWholeFile($fileContent);
+```
+
+------
+
+[![Downloads this Month](https://img.shields.io/packagist/dm/jakub-onderka/php-console-highlighter.svg)](https://packagist.org/packages/jakub-onderka/php-console-highlighter)
+[![Build Status](https://travis-ci.org/JakubOnderka/PHP-Console-Highlighter.svg?branch=master)](https://travis-ci.org/JakubOnderka/PHP-Console-Highlighter)
+[![License](https://poser.pugx.org/jakub-onderka/php-console-highlighter/license.svg)](https://packagist.org/packages/jakub-onderka/php-console-highlighter)
diff --git a/vendor/jakub-onderka/php-console-highlighter/build.xml b/vendor/jakub-onderka/php-console-highlighter/build.xml
new file mode 100644
index 0000000000..d656ea9d4b
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/build.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/composer.json b/vendor/jakub-onderka/php-console-highlighter/composer.json
new file mode 100644
index 0000000000..21c29f710a
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/composer.json
@@ -0,0 +1,28 @@
+{
+ "name": "jakub-onderka/php-console-highlighter",
+ "description": "Highlight PHP code in terminal",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Jakub Onderka",
+ "email": "acci@acci.cz",
+ "homepage": "http://www.acci.cz/"
+ }
+ ],
+ "autoload": {
+ "psr-4": {"JakubOnderka\\PhpConsoleHighlighter\\": "src/"}
+ },
+ "require": {
+ "php": ">=5.4.0",
+ "ext-tokenizer": "*",
+ "jakub-onderka/php-console-color": "~0.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0",
+ "jakub-onderka/php-parallel-lint": "~1.0",
+ "jakub-onderka/php-var-dump-check": "~0.1",
+ "squizlabs/php_codesniffer": "~1.5",
+ "jakub-onderka/php-code-style": "~1.0"
+ }
+}
diff --git a/vendor/jakub-onderka/php-console-highlighter/examples/snippet.php b/vendor/jakub-onderka/php-console-highlighter/examples/snippet.php
new file mode 100644
index 0000000000..1bf6ac3bd7
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/examples/snippet.php
@@ -0,0 +1,10 @@
+getCodeSnippet($fileContent, 3);
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/examples/whole_file.php b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file.php
new file mode 100644
index 0000000000..2a023d80ab
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file.php
@@ -0,0 +1,10 @@
+getWholeFile($fileContent);
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/examples/whole_file_line_numbers.php b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file_line_numbers.php
new file mode 100644
index 0000000000..f9178f2d13
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file_line_numbers.php
@@ -0,0 +1,10 @@
+getWholeFileWithLineNumbers($fileContent);
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/phpunit.xml b/vendor/jakub-onderka/php-console-highlighter/phpunit.xml
new file mode 100644
index 0000000000..9c653a680a
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/phpunit.xml
@@ -0,0 +1,15 @@
+
+
+
+
+ tests
+
+
+
+
+
+
+ vendor
+
+
+
diff --git a/vendor/jakub-onderka/php-console-highlighter/src/Highlighter.php b/vendor/jakub-onderka/php-console-highlighter/src/Highlighter.php
new file mode 100644
index 0000000000..47ce30d2c0
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/src/Highlighter.php
@@ -0,0 +1,263 @@
+ 'red',
+ self::TOKEN_COMMENT => 'yellow',
+ self::TOKEN_KEYWORD => 'green',
+ self::TOKEN_DEFAULT => 'default',
+ self::TOKEN_HTML => 'cyan',
+
+ self::ACTUAL_LINE_MARK => 'red',
+ self::LINE_NUMBER => 'dark_gray',
+ );
+
+ /**
+ * @param ConsoleColor $color
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ */
+ public function __construct(ConsoleColor $color)
+ {
+ $this->color = $color;
+
+ foreach ($this->defaultTheme as $name => $styles) {
+ if (!$this->color->hasTheme($name)) {
+ $this->color->addTheme($name, $styles);
+ }
+ }
+ }
+
+ /**
+ * @param string $source
+ * @param int $lineNumber
+ * @param int $linesBefore
+ * @param int $linesAfter
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function getCodeSnippet($source, $lineNumber, $linesBefore = 2, $linesAfter = 2)
+ {
+ $tokenLines = $this->getHighlightedLines($source);
+
+ $offset = $lineNumber - $linesBefore - 1;
+ $offset = max($offset, 0);
+ $length = $linesAfter + $linesBefore + 1;
+ $tokenLines = array_slice($tokenLines, $offset, $length, $preserveKeys = true);
+
+ $lines = $this->colorLines($tokenLines);
+
+ return $this->lineNumbers($lines, $lineNumber);
+ }
+
+ /**
+ * @param string $source
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function getWholeFile($source)
+ {
+ $tokenLines = $this->getHighlightedLines($source);
+ $lines = $this->colorLines($tokenLines);
+ return implode(PHP_EOL, $lines);
+ }
+
+ /**
+ * @param string $source
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function getWholeFileWithLineNumbers($source)
+ {
+ $tokenLines = $this->getHighlightedLines($source);
+ $lines = $this->colorLines($tokenLines);
+ return $this->lineNumbers($lines);
+ }
+
+ /**
+ * @param string $source
+ * @return array
+ */
+ private function getHighlightedLines($source)
+ {
+ $source = str_replace(array("\r\n", "\r"), "\n", $source);
+ $tokens = $this->tokenize($source);
+ return $this->splitToLines($tokens);
+ }
+
+ /**
+ * @param string $source
+ * @return array
+ */
+ private function tokenize($source)
+ {
+ $tokens = token_get_all($source);
+
+ $output = array();
+ $currentType = null;
+ $buffer = '';
+
+ foreach ($tokens as $token) {
+ if (is_array($token)) {
+ switch ($token[0]) {
+ case T_WHITESPACE:
+ break;
+
+ case T_OPEN_TAG:
+ case T_OPEN_TAG_WITH_ECHO:
+ case T_CLOSE_TAG:
+ case T_STRING:
+ case T_VARIABLE:
+
+ // Constants
+ case T_DIR:
+ case T_FILE:
+ case T_METHOD_C:
+ case T_DNUMBER:
+ case T_LNUMBER:
+ case T_NS_C:
+ case T_LINE:
+ case T_CLASS_C:
+ case T_FUNC_C:
+ case T_TRAIT_C:
+ $newType = self::TOKEN_DEFAULT;
+ break;
+
+ case T_COMMENT:
+ case T_DOC_COMMENT:
+ $newType = self::TOKEN_COMMENT;
+ break;
+
+ case T_ENCAPSED_AND_WHITESPACE:
+ case T_CONSTANT_ENCAPSED_STRING:
+ $newType = self::TOKEN_STRING;
+ break;
+
+ case T_INLINE_HTML:
+ $newType = self::TOKEN_HTML;
+ break;
+
+ default:
+ $newType = self::TOKEN_KEYWORD;
+ }
+ } else {
+ $newType = $token === '"' ? self::TOKEN_STRING : self::TOKEN_KEYWORD;
+ }
+
+ if ($currentType === null) {
+ $currentType = $newType;
+ }
+
+ if ($currentType !== $newType) {
+ $output[] = array($currentType, $buffer);
+ $buffer = '';
+ $currentType = $newType;
+ }
+
+ $buffer .= is_array($token) ? $token[1] : $token;
+ }
+
+ if (isset($newType)) {
+ $output[] = array($newType, $buffer);
+ }
+
+ return $output;
+ }
+
+ /**
+ * @param array $tokens
+ * @return array
+ */
+ private function splitToLines(array $tokens)
+ {
+ $lines = array();
+
+ $line = array();
+ foreach ($tokens as $token) {
+ foreach (explode("\n", $token[1]) as $count => $tokenLine) {
+ if ($count > 0) {
+ $lines[] = $line;
+ $line = array();
+ }
+
+ if ($tokenLine === '') {
+ continue;
+ }
+
+ $line[] = array($token[0], $tokenLine);
+ }
+ }
+
+ $lines[] = $line;
+
+ return $lines;
+ }
+
+ /**
+ * @param array $tokenLines
+ * @return array
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ private function colorLines(array $tokenLines)
+ {
+ $lines = array();
+ foreach ($tokenLines as $lineCount => $tokenLine) {
+ $line = '';
+ foreach ($tokenLine as $token) {
+ list($tokenType, $tokenValue) = $token;
+ if ($this->color->hasTheme($tokenType)) {
+ $line .= $this->color->apply($tokenType, $tokenValue);
+ } else {
+ $line .= $tokenValue;
+ }
+ }
+ $lines[$lineCount] = $line;
+ }
+
+ return $lines;
+ }
+
+ /**
+ * @param array $lines
+ * @param null|int $markLine
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ */
+ private function lineNumbers(array $lines, $markLine = null)
+ {
+ end($lines);
+ $lineStrlen = strlen(key($lines) + 1);
+
+ $snippet = '';
+ foreach ($lines as $i => $line) {
+ if ($markLine !== null) {
+ $snippet .= ($markLine === $i + 1 ? $this->color->apply(self::ACTUAL_LINE_MARK, ' > ') : ' ');
+ }
+
+ $snippet .= $this->color->apply(self::LINE_NUMBER, str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT) . '| ');
+ $snippet .= $line . PHP_EOL;
+ }
+
+ return $snippet;
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/tests/HigligterTest.php b/vendor/jakub-onderka/php-console-highlighter/tests/HigligterTest.php
new file mode 100644
index 0000000000..187beb67bb
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/tests/HigligterTest.php
@@ -0,0 +1,274 @@
+createMock('\JakubOnderka\PhpConsoleColor\ConsoleColor')
+ : $this->getMock('\JakubOnderka\PhpConsoleColor\ConsoleColor');
+
+ $mock->expects($this->any())
+ ->method('apply')
+ ->will($this->returnCallback(function ($style, $text) {
+ return "<$style>$text$style>";
+ }));
+
+ $mock->expects($this->any())
+ ->method('hasTheme')
+ ->will($this->returnValue(true));
+
+ return $mock;
+ }
+
+ protected function setUp()
+ {
+ $this->uut = new Highlighter($this->getConsoleColorMock());
+ }
+
+ protected function compare($original, $expected)
+ {
+ $output = $this->uut->getWholeFile($original);
+ $this->assertEquals($expected, $output);
+ }
+
+ public function testVariable()
+ {
+ $this->compare(
+ <<
+echo \$a;
+EOL
+ );
+ }
+
+ public function testInteger()
+ {
+ $this->compare(
+ <<
+echo 43;
+EOL
+ );
+ }
+
+ public function testFloat()
+ {
+ $this->compare(
+ <<
+echo 43.3;
+EOL
+ );
+ }
+
+ public function testHex()
+ {
+ $this->compare(
+ <<
+echo 0x43;
+EOL
+ );
+ }
+
+ public function testBasicFunction()
+ {
+ $this->compare(
+ <<
+function plus(\$a, \$b) {
+ return \$a + \$b;
+}
+EOL
+ );
+ }
+
+ public function testStringNormal()
+ {
+ $this->compare(
+ <<
+echo 'Ahoj světe';
+EOL
+ );
+ }
+
+ public function testStringDouble()
+ {
+ $this->compare(
+ <<
+echo "Ahoj světe";
+EOL
+ );
+ }
+
+ public function testInstanceof()
+ {
+ $this->compare(
+ <<
+\$a instanceof stdClass;
+EOL
+ );
+ }
+
+ /*
+ * Constants
+ */
+ public function testConstant()
+ {
+ $constants = array(
+ '__FILE__',
+ '__LINE__',
+ '__CLASS__',
+ '__FUNCTION__',
+ '__METHOD__',
+ '__TRAIT__',
+ '__DIR__',
+ '__NAMESPACE__'
+ );
+
+ foreach ($constants as $constant) {
+ $this->compare(
+ <<
+$constant;
+EOL
+ );
+ }
+ }
+
+ /*
+ * Comments
+ */
+ public function testComment()
+ {
+ $this->compare(
+ <<
+/* Ahoj */
+EOL
+ );
+ }
+
+ public function testDocComment()
+ {
+ $this->compare(
+ <<
+/** Ahoj */
+EOL
+ );
+ }
+
+ public function testInlineComment()
+ {
+ $this->compare(
+ <<
+// Ahoj
+EOL
+ );
+ }
+
+ public function testHashComment()
+ {
+ $this->compare(
+ <<
+# Ahoj
+EOL
+ );
+ }
+
+ public function testEmpty()
+ {
+ $this->compare(
+ ''
+ ,
+ ''
+ );
+ }
+
+ public function testWhitespace()
+ {
+ $this->compare(
+ ' '
+ ,
+ ''
+ );
+ }
+}
diff --git a/vendor/jms/metadata/.gitignore b/vendor/jms/metadata/.gitignore
new file mode 100644
index 0000000000..5657f6ea7d
--- /dev/null
+++ b/vendor/jms/metadata/.gitignore
@@ -0,0 +1 @@
+vendor
\ No newline at end of file
diff --git a/vendor/jms/metadata/.travis.yml b/vendor/jms/metadata/.travis.yml
new file mode 100644
index 0000000000..9b542925f9
--- /dev/null
+++ b/vendor/jms/metadata/.travis.yml
@@ -0,0 +1,22 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+ - hhvm
+
+matrix:
+ allow_failures:
+ - php: hhvm
+
+before_script:
+ - composer self-update
+ - composer install --dev --ignore-platform-reqs
+
+script: phpunit --coverage-clover clover
+
+after_success:
+ - wget https://scrutinizer-ci.com/ocular.phar
+ - php ocular.phar code-coverage:upload --format=php-clover clover
diff --git a/vendor/jms/metadata/CHANGELOG.md b/vendor/jms/metadata/CHANGELOG.md
new file mode 100644
index 0000000000..0704927651
--- /dev/null
+++ b/vendor/jms/metadata/CHANGELOG.md
@@ -0,0 +1,42 @@
+CHANGELOG
+=========
+
+This changelog references all relevant changes:
+
+* 1.7.0 (2018-10-26)
+ * allow to run the metadata on read-only file systems
+ * Change license to MIT
+ * Composer improvements
+
+* 1.6.0 (2016-12-05)
+ * PRS cache adapter
+ * other fixes
+
+* 1.5.0 (2013-11-06)
+ * adds ability to inject new drivers into the DriverChain after it has been constructed
+ * improves performance by removing some superfluous filesystem calls
+ * made MetadataFactory implementation non-final
+
+* 1.4.1 (2013-08-26)
+ * fixes a possible permission issue when using filesystem ACLs
+
+* 1.4.0 (2013-08-25)
+ * fixes a race condition when writing cache files
+
+* 1.3.0 (2013-01-22)
+ * added ability to retrieve all managed classes from the metadata factory
+
+* 1.2.0 (2012-08-21)
+ * added a Doctrine Cache Adapter
+ * better support for traits, and classes in the global namespace
+
+* 1.1.0 (2011-10-04)
+
+ * added support for metadata on interfaces
+ * added support for non annotation-based drivers
+ * added support for merging metadata
+
+This release is fully backwards compatible with the 1.0.0 release. Therefore,
+the 1.0.x branch has been discontinued.
+
+* 1.0.0 (2011-07-09)
diff --git a/vendor/jms/metadata/LICENSE b/vendor/jms/metadata/LICENSE
new file mode 100644
index 0000000000..9aaf79f1ae
--- /dev/null
+++ b/vendor/jms/metadata/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2018 Johannes M. Schmitt
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/jms/metadata/README.rst b/vendor/jms/metadata/README.rst
new file mode 100644
index 0000000000..51517ff80f
--- /dev/null
+++ b/vendor/jms/metadata/README.rst
@@ -0,0 +1,37 @@
+Metadata is a library for class/method/property metadata management in PHP
+==========================================================================
+
+Overview
+--------
+
+This library provides some commonly needed base classes for managing metadata
+for classes, methods and properties. The metadata can come from many different
+sources (annotations, YAML/XML/PHP configuration files).
+
+The metadata classes are used to abstract away that source and provide a common
+interface for all of them.
+
+Usage
+-----
+
+The library provides three classes that you can extend to add your application
+specific properties, and flags: ``ClassMetadata``, ``MethodMetadata``, and
+``PropertyMetadata``
+
+After you have added, your properties in sub-classes, you also need to add
+``DriverInterface`` implementations which know how to populate these classes
+from the different metadata sources.
+
+Finally, you can use the ``MetadataFactory`` to retrieve the metadata::
+
+ getMetadataForClass('MyNamespace\MyObject');
+
diff --git a/vendor/jms/metadata/composer.json b/vendor/jms/metadata/composer.json
new file mode 100644
index 0000000000..b6329d5c92
--- /dev/null
+++ b/vendor/jms/metadata/composer.json
@@ -0,0 +1,32 @@
+{
+ "name": "jms/metadata",
+ "description": "Class/method/property metadata management in PHP",
+ "keywords": ["annotations","metadata","yaml","xml"],
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com"
+ },
+ {
+ "name": "Asmir Mustafic",
+ "email": "goetas@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev" : {
+ "doctrine/cache" : "~1.0",
+ "symfony/cache" : "~3.1"
+ },
+ "autoload": {
+ "psr-0": { "Metadata\\": "src/" }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.5.x-dev"
+ }
+ }
+}
diff --git a/vendor/jms/metadata/composer.lock b/vendor/jms/metadata/composer.lock
new file mode 100644
index 0000000000..fe17ee6b46
--- /dev/null
+++ b/vendor/jms/metadata/composer.lock
@@ -0,0 +1,250 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "4cc1821f9af1271c77bb9a8bebc26138",
+ "content-hash": "ef7080989caee6eaf6daf11732a5bb86",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "doctrine/cache",
+ "version": "v1.6.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/cache.git",
+ "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3",
+ "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~5.5|~7.0"
+ },
+ "conflict": {
+ "doctrine/common": ">2.2,<2.4"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|~5.0",
+ "predis/predis": "~1.0",
+ "satooshi/php-coveralls": "~0.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Caching library offering an object-oriented API for many cache backends",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "cache",
+ "caching"
+ ],
+ "time": "2016-10-29 11:16:17"
+ },
+ {
+ "name": "psr/cache",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/cache.git",
+ "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
+ "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Cache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for caching libraries",
+ "keywords": [
+ "cache",
+ "psr",
+ "psr-6"
+ ],
+ "time": "2016-08-06 20:24:11"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10 12:19:37"
+ },
+ {
+ "name": "symfony/cache",
+ "version": "v3.1.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/cache.git",
+ "reference": "0f5881c9b8a03cef13fdee381f8ee623d0429cf4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/cache/zipball/0f5881c9b8a03cef13fdee381f8ee623d0429cf4",
+ "reference": "0f5881c9b8a03cef13fdee381f8ee623d0429cf4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "psr/cache": "~1.0",
+ "psr/log": "~1.0"
+ },
+ "provide": {
+ "psr/cache-implementation": "1.0"
+ },
+ "require-dev": {
+ "cache/integration-tests": "dev-master",
+ "doctrine/cache": "~1.6",
+ "predis/predis": "~1.0"
+ },
+ "suggest": {
+ "symfony/polyfill-apcu": "For using ApcuAdapter on HHVM"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Cache\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony implementation of PSR-6",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "caching",
+ "psr6"
+ ],
+ "time": "2016-11-09 14:09:05"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=5.3.0"
+ },
+ "platform-dev": []
+}
diff --git a/vendor/jms/metadata/phpunit.xml.dist b/vendor/jms/metadata/phpunit.xml.dist
new file mode 100644
index 0000000000..38db7c3f3c
--- /dev/null
+++ b/vendor/jms/metadata/phpunit.xml.dist
@@ -0,0 +1,25 @@
+
+
+
+
+
+ ./tests/Metadata/
+
+
+
+
+
+ performance
+
+
+
diff --git a/vendor/jms/metadata/src/Metadata/AdvancedMetadataFactoryInterface.php b/vendor/jms/metadata/src/Metadata/AdvancedMetadataFactoryInterface.php
new file mode 100644
index 0000000000..1c930eb1d2
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/AdvancedMetadataFactoryInterface.php
@@ -0,0 +1,20 @@
+
+ * @author Jordan Stout
+ */
+interface AdvancedMetadataFactoryInterface extends MetadataFactoryInterface
+{
+ /**
+ * Gets all the possible classes.
+ *
+ * @throws \RuntimeException if driver does not an advanced driver.
+ * @return array
+ */
+ public function getAllClassNames();
+}
diff --git a/vendor/jms/metadata/src/Metadata/Cache/CacheInterface.php b/vendor/jms/metadata/src/Metadata/Cache/CacheInterface.php
new file mode 100644
index 0000000000..dbf3ccbfab
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Cache/CacheInterface.php
@@ -0,0 +1,35 @@
+
+ */
+class DoctrineCacheAdapter implements CacheInterface
+{
+ /**
+ * @param string $prefix
+ */
+ private $prefix;
+
+ /**
+ * @var Cache $cache
+ */
+ private $cache;
+
+ /**
+ * @param string $prefix
+ * @param Cache $cache
+ */
+ public function __construct($prefix, Cache $cache)
+ {
+ $this->prefix = $prefix;
+ $this->cache = $cache;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function loadClassMetadataFromCache(\ReflectionClass $class)
+ {
+ $cache = $this->cache->fetch($this->prefix . $class->name);
+ return false === $cache ? null : $cache;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function putClassMetadataInCache(ClassMetadata $metadata)
+ {
+ $this->cache->save($this->prefix . $metadata->name, $metadata);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function evictClassMetadataFromCache(\ReflectionClass $class)
+ {
+ $this->cache->delete($this->prefix . $class->name);
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/Cache/FileCache.php b/vendor/jms/metadata/src/Metadata/Cache/FileCache.php
new file mode 100644
index 0000000000..d454ec19d9
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Cache/FileCache.php
@@ -0,0 +1,84 @@
+dir = rtrim($dir, '\\/');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function loadClassMetadataFromCache(\ReflectionClass $class)
+ {
+ $path = $this->dir.'/'.strtr($class->name, '\\', '-').'.cache.php';
+ if (!file_exists($path)) {
+ return null;
+ }
+
+ return include $path;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function putClassMetadataInCache(ClassMetadata $metadata)
+ {
+ if (!is_writable($this->dir)) {
+ throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable.', $this->dir));
+ }
+
+ $path = $this->dir.'/'.strtr($metadata->name, '\\', '-').'.cache.php';
+
+ $tmpFile = tempnam($this->dir, 'metadata-cache');
+ file_put_contents($tmpFile, 'renameFile($tmpFile, $path);
+ }
+
+ /**
+ * Renames a file with fallback for windows
+ *
+ * @param string $source
+ * @param string $target
+ */
+ private function renameFile($source, $target) {
+ if (false === @rename($source, $target)) {
+ if (defined('PHP_WINDOWS_VERSION_BUILD')) {
+ if (false === copy($source, $target)) {
+ throw new \RuntimeException(sprintf('(WIN) Could not write new cache file to %s.', $target));
+ }
+ if (false === unlink($source)) {
+ throw new \RuntimeException(sprintf('(WIN) Could not delete temp cache file to %s.', $source));
+ }
+ } else {
+ throw new \RuntimeException(sprintf('Could not write new cache file to %s.', $target));
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function evictClassMetadataFromCache(\ReflectionClass $class)
+ {
+ $path = $this->dir.'/'.strtr($class->name, '\\', '-').'.cache.php';
+ if (file_exists($path)) {
+ unlink($path);
+ }
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/Cache/PsrCacheAdapter.php b/vendor/jms/metadata/src/Metadata/Cache/PsrCacheAdapter.php
new file mode 100644
index 0000000000..9b9bb2f56c
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Cache/PsrCacheAdapter.php
@@ -0,0 +1,51 @@
+prefix = $prefix;
+ $this->pool = $pool;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function loadClassMetadataFromCache(\ReflectionClass $class)
+ {
+ $this->lastItem = $this->pool->getItem(strtr($this->prefix . $class->name, '\\', '.'));
+
+ return $this->lastItem->get();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function putClassMetadataInCache(ClassMetadata $metadata)
+ {
+ $key = strtr($this->prefix . $metadata->name, '\\', '.');
+
+ if (null === $this->lastItem || $this->lastItem->getKey() !== $key) {
+ $this->lastItem = $this->pool->getItem($key);
+ }
+
+ $this->pool->save($this->lastItem->set($metadata));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function evictClassMetadataFromCache(\ReflectionClass $class)
+ {
+ $this->pool->deleteItem(strtr($this->prefix . $class->name, '\\', '.'));
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/ClassHierarchyMetadata.php b/vendor/jms/metadata/src/Metadata/ClassHierarchyMetadata.php
new file mode 100644
index 0000000000..9817641abc
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/ClassHierarchyMetadata.php
@@ -0,0 +1,39 @@
+
+ */
+class ClassHierarchyMetadata
+{
+ public $classMetadata = array();
+
+ public function addClassMetadata(ClassMetadata $metadata)
+ {
+ $this->classMetadata[$metadata->name] = $metadata;
+ }
+
+ public function getRootClassMetadata()
+ {
+ return reset($this->classMetadata);
+ }
+
+ public function getOutsideClassMetadata()
+ {
+ return end($this->classMetadata);
+ }
+
+ public function isFresh($timestamp)
+ {
+ foreach ($this->classMetadata as $metadata) {
+ if (!$metadata->isFresh($timestamp)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/ClassMetadata.php b/vendor/jms/metadata/src/Metadata/ClassMetadata.php
new file mode 100644
index 0000000000..b29775d471
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/ClassMetadata.php
@@ -0,0 +1,82 @@
+
+ */
+class ClassMetadata implements \Serializable
+{
+ public $name;
+ public $reflection;
+ public $methodMetadata = array();
+ public $propertyMetadata = array();
+ public $fileResources = array();
+ public $createdAt;
+
+ public function __construct($name)
+ {
+ $this->name = $name;
+
+ $this->reflection = new \ReflectionClass($name);
+ $this->createdAt = time();
+ }
+
+ public function addMethodMetadata(MethodMetadata $metadata)
+ {
+ $this->methodMetadata[$metadata->name] = $metadata;
+ }
+
+ public function addPropertyMetadata(PropertyMetadata $metadata)
+ {
+ $this->propertyMetadata[$metadata->name] = $metadata;
+ }
+
+ public function isFresh($timestamp = null)
+ {
+ if (null === $timestamp) {
+ $timestamp = $this->createdAt;
+ }
+
+ foreach ($this->fileResources as $filepath) {
+ if (!file_exists($filepath)) {
+ return false;
+ }
+
+ if ($timestamp < filemtime($filepath)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public function serialize()
+ {
+ return serialize(array(
+ $this->name,
+ $this->methodMetadata,
+ $this->propertyMetadata,
+ $this->fileResources,
+ $this->createdAt,
+ ));
+ }
+
+ public function unserialize($str)
+ {
+ list(
+ $this->name,
+ $this->methodMetadata,
+ $this->propertyMetadata,
+ $this->fileResources,
+ $this->createdAt
+ ) = unserialize($str);
+
+ $this->reflection = new \ReflectionClass($this->name);
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php b/vendor/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php
new file mode 100644
index 0000000000..3392097210
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php
@@ -0,0 +1,59 @@
+
+ */
+abstract class AbstractFileDriver implements AdvancedDriverInterface
+{
+ /**
+ * @var FileLocatorInterface|FileLocator
+ */
+ private $locator;
+
+ public function __construct(FileLocatorInterface $locator)
+ {
+ $this->locator = $locator;
+ }
+
+ public function loadMetadataForClass(\ReflectionClass $class)
+ {
+ if (null === $path = $this->locator->findFileForClass($class, $this->getExtension())) {
+ return null;
+ }
+
+ return $this->loadMetadataFromFile($class, $path);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames()
+ {
+ if (!$this->locator instanceof AdvancedFileLocatorInterface) {
+ throw new \RuntimeException('Locator "%s" must be an instance of "AdvancedFileLocatorInterface".');
+ }
+
+ return $this->locator->findAllClasses($this->getExtension());
+ }
+
+ /**
+ * Parses the content of the file, and converts it to the desired metadata.
+ *
+ * @param \ReflectionClass $class
+ * @param string $file
+ *
+ * @return \Metadata\ClassMetadata|null
+ */
+ abstract protected function loadMetadataFromFile(\ReflectionClass $class, $file);
+
+ /**
+ * Returns the extension of the file.
+ *
+ * @return string
+ */
+ abstract protected function getExtension();
+}
diff --git a/vendor/jms/metadata/src/Metadata/Driver/AdvancedDriverInterface.php b/vendor/jms/metadata/src/Metadata/Driver/AdvancedDriverInterface.php
new file mode 100644
index 0000000000..1a904c7a44
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Driver/AdvancedDriverInterface.php
@@ -0,0 +1,18 @@
+
+ */
+interface AdvancedDriverInterface extends DriverInterface
+{
+ /**
+ * Gets all the metadata class names known to this driver.
+ *
+ * @return array
+ */
+ public function getAllClassNames();
+}
diff --git a/vendor/jms/metadata/src/Metadata/Driver/AdvancedFileLocatorInterface.php b/vendor/jms/metadata/src/Metadata/Driver/AdvancedFileLocatorInterface.php
new file mode 100644
index 0000000000..263c0bd7a5
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Driver/AdvancedFileLocatorInterface.php
@@ -0,0 +1,20 @@
+
+ */
+interface AdvancedFileLocatorInterface extends FileLocatorInterface
+{
+ /**
+ * Finds all possible metadata files.
+ *
+ * @param string $extension
+ *
+ * @return array
+ */
+ public function findAllClasses($extension);
+}
diff --git a/vendor/jms/metadata/src/Metadata/Driver/DriverChain.php b/vendor/jms/metadata/src/Metadata/Driver/DriverChain.php
new file mode 100644
index 0000000000..eab3871454
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Driver/DriverChain.php
@@ -0,0 +1,54 @@
+drivers = $drivers;
+ }
+
+ public function addDriver(DriverInterface $driver)
+ {
+ $this->drivers[] = $driver;
+ }
+
+ public function loadMetadataForClass(\ReflectionClass $class)
+ {
+ foreach ($this->drivers as $driver) {
+ if (null !== $metadata = $driver->loadMetadataForClass($class)) {
+ return $metadata;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames()
+ {
+ $classes = array();
+ foreach ($this->drivers as $driver) {
+ if (!$driver instanceof AdvancedDriverInterface) {
+ throw new \RuntimeException(
+ sprintf(
+ 'Driver "%s" must be an instance of "AdvancedDriverInterface" to use '.
+ '"DriverChain::getAllClassNames()".',
+ get_class($driver)
+ )
+ );
+ }
+ $driverClasses = $driver->getAllClassNames();
+ if (!empty($driverClasses)) {
+ $classes = array_merge($classes, $driverClasses);
+ }
+ }
+
+ return $classes;
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/Driver/DriverInterface.php b/vendor/jms/metadata/src/Metadata/Driver/DriverInterface.php
new file mode 100644
index 0000000000..e8a92127a1
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Driver/DriverInterface.php
@@ -0,0 +1,13 @@
+dirs = $dirs;
+ }
+
+ public function getDirs()
+ {
+ return $this->dirs;
+ }
+
+ /**
+ * @param \ReflectionClass $class
+ * @param string $extension
+ *
+ * @return string|null
+ */
+ public function findFileForClass(\ReflectionClass $class, $extension)
+ {
+ foreach ($this->dirs as $prefix => $dir) {
+ if ('' !== $prefix && 0 !== strpos($class->getNamespaceName(), $prefix)) {
+ continue;
+ }
+
+ $len = '' === $prefix ? 0 : strlen($prefix) + 1;
+ $path = $dir.'/'.str_replace('\\', '.', substr($class->name, $len)).'.'.$extension;
+ if (file_exists($path)) {
+ return $path;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function findAllClasses($extension)
+ {
+ $classes = array();
+ foreach ($this->dirs as $prefix => $dir) {
+ /** @var $iterator \RecursiveIteratorIterator|\SplFileInfo[] */
+ $iterator = new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($dir),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
+ $nsPrefix = $prefix !== '' ? $prefix.'\\' : '';
+ foreach ($iterator as $file) {
+ if (($fileName = $file->getBasename('.'.$extension)) == $file->getBasename()) {
+ continue;
+ }
+
+ $classes[] = $nsPrefix.str_replace('.', '\\', $fileName);
+ }
+ }
+
+ return $classes;
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php b/vendor/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php
new file mode 100644
index 0000000000..06c7a16cef
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php
@@ -0,0 +1,14 @@
+container = $container;
+ $this->realDriverId = $realDriverId;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function loadMetadataForClass(\ReflectionClass $class)
+ {
+ return $this->container->get($this->realDriverId)->loadMetadataForClass($class);
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/MergeableClassMetadata.php b/vendor/jms/metadata/src/Metadata/MergeableClassMetadata.php
new file mode 100644
index 0000000000..13ec1583ca
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/MergeableClassMetadata.php
@@ -0,0 +1,23 @@
+name = $object->name;
+ $this->reflection = $object->reflection;
+ $this->methodMetadata = array_merge($this->methodMetadata, $object->methodMetadata);
+ $this->propertyMetadata = array_merge($this->propertyMetadata, $object->propertyMetadata);
+ $this->fileResources = array_merge($this->fileResources, $object->fileResources);
+
+ if ($object->createdAt < $this->createdAt) {
+ $this->createdAt = $object->createdAt;
+ }
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/metadata/src/Metadata/MergeableInterface.php b/vendor/jms/metadata/src/Metadata/MergeableInterface.php
new file mode 100644
index 0000000000..59550742c5
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/MergeableInterface.php
@@ -0,0 +1,13 @@
+driver = $driver;
+ $this->hierarchyMetadataClass = $hierarchyMetadataClass;
+ $this->debug = (Boolean) $debug;
+ }
+
+ /**
+ * @param boolean $include
+ */
+ public function setIncludeInterfaces($include)
+ {
+ $this->includeInterfaces = (Boolean) $include;
+ }
+
+ public function setCache(CacheInterface $cache)
+ {
+ $this->cache = $cache;
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return ClassHierarchyMetadata|MergeableClassMetadata|null
+ */
+ public function getMetadataForClass($className)
+ {
+ if (isset($this->loadedMetadata[$className])) {
+ return $this->filterNullMetadata($this->loadedMetadata[$className]);
+ }
+
+ $metadata = null;
+ foreach ($this->getClassHierarchy($className) as $class) {
+ if (isset($this->loadedClassMetadata[$name = $class->getName()])) {
+ if (null !== $classMetadata = $this->filterNullMetadata($this->loadedClassMetadata[$name])) {
+ $this->addClassMetadata($metadata, $classMetadata);
+ }
+ continue;
+ }
+
+ // check the cache
+ if (null !== $this->cache) {
+ if (($classMetadata = $this->cache->loadClassMetadataFromCache($class)) instanceof NullMetadata) {
+ $this->loadedClassMetadata[$name] = $classMetadata;
+ continue;
+ }
+
+ if (null !== $classMetadata) {
+ if ( ! $classMetadata instanceof ClassMetadata) {
+ throw new \LogicException(sprintf('The cache must return instances of ClassMetadata, but got %s.', var_export($classMetadata, true)));
+ }
+
+ if ($this->debug && !$classMetadata->isFresh()) {
+ $this->cache->evictClassMetadataFromCache($classMetadata->reflection);
+ } else {
+ $this->loadedClassMetadata[$name] = $classMetadata;
+ $this->addClassMetadata($metadata, $classMetadata);
+ continue;
+ }
+ }
+ }
+
+ // load from source
+ if (null !== $classMetadata = $this->driver->loadMetadataForClass($class)) {
+ $this->loadedClassMetadata[$name] = $classMetadata;
+ $this->addClassMetadata($metadata, $classMetadata);
+
+ if (null !== $this->cache) {
+ $this->cache->putClassMetadataInCache($classMetadata);
+ }
+
+ continue;
+ }
+
+ if (null !== $this->cache && !$this->debug) {
+ $this->cache->putClassMetadataInCache(new NullMetadata($class->getName()));
+ }
+ }
+
+ if (null === $metadata) {
+ $metadata = new NullMetadata($className);
+ }
+
+ return $this->filterNullMetadata($this->loadedMetadata[$className] = $metadata);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames()
+ {
+ if (!$this->driver instanceof AdvancedDriverInterface) {
+ throw new \RuntimeException(
+ sprintf('Driver "%s" must be an instance of "AdvancedDriverInterface".', get_class($this->driver))
+ );
+ }
+
+ return $this->driver->getAllClassNames();
+ }
+
+ /**
+ * @param ClassMetadata|null $metadata
+ * @param ClassMetadata $toAdd
+ */
+ private function addClassMetadata(&$metadata, $toAdd)
+ {
+ if ($toAdd instanceof MergeableInterface) {
+ if (null === $metadata) {
+ $metadata = clone $toAdd;
+ } else {
+ $metadata->merge($toAdd);
+ }
+ } else {
+ if (null === $metadata) {
+ $metadata = new $this->hierarchyMetadataClass;
+ }
+
+ $metadata->addClassMetadata($toAdd);
+ }
+ }
+
+ /**
+ * @param string $class
+ */
+ private function getClassHierarchy($class)
+ {
+ $classes = array();
+ $refl = new \ReflectionClass($class);
+
+ do {
+ $classes[] = $refl;
+ $refl = $refl->getParentClass();
+ } while (false !== $refl);
+
+ $classes = array_reverse($classes, false);
+
+ if (!$this->includeInterfaces) {
+ return $classes;
+ }
+
+ $addedInterfaces = array();
+ $newHierarchy = array();
+
+ foreach ($classes as $class) {
+ foreach ($class->getInterfaces() as $interface) {
+ if (isset($addedInterfaces[$interface->getName()])) {
+ continue;
+ }
+ $addedInterfaces[$interface->getName()] = true;
+
+ $newHierarchy[] = $interface;
+ }
+
+ $newHierarchy[] = $class;
+ }
+
+ return $newHierarchy;
+ }
+
+ /**
+ * @param NullMetadata|null $metadata
+ *
+ * @return ClassMetadata|null
+ */
+ private function filterNullMetadata($metadata = null)
+ {
+ return !$metadata instanceof NullMetadata ? $metadata : null;
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/MetadataFactoryInterface.php b/vendor/jms/metadata/src/Metadata/MetadataFactoryInterface.php
new file mode 100644
index 0000000000..3b0c34ad7c
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/MetadataFactoryInterface.php
@@ -0,0 +1,26 @@
+
+ */
+interface MetadataFactoryInterface
+{
+ /**
+ * Returns the gathered metadata for the given class name.
+ *
+ * If the drivers return instances of MergeableClassMetadata, these will be
+ * merged prior to returning. Otherwise, all metadata for the inheritance
+ * hierarchy will be returned as ClassHierarchyMetadata unmerged.
+ *
+ * If no metadata is available, null is returned.
+ *
+ * @param string $className
+ *
+ * @return ClassHierarchyMetadata|MergeableClassMetadata|null
+ */
+ public function getMetadataForClass($className);
+}
diff --git a/vendor/jms/metadata/src/Metadata/MethodMetadata.php b/vendor/jms/metadata/src/Metadata/MethodMetadata.php
new file mode 100644
index 0000000000..aa2c892927
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/MethodMetadata.php
@@ -0,0 +1,51 @@
+
+ */
+class MethodMetadata implements \Serializable
+{
+ public $class;
+ public $name;
+ public $reflection;
+
+ public function __construct($class, $name)
+ {
+ $this->class = $class;
+ $this->name = $name;
+
+ $this->reflection = new \ReflectionMethod($class, $name);
+ $this->reflection->setAccessible(true);
+ }
+
+ /**
+ * @param object $obj
+ * @param array $args
+ *
+ * @return mixed
+ */
+ public function invoke($obj, array $args = array())
+ {
+ return $this->reflection->invokeArgs($obj, $args);
+ }
+
+ public function serialize()
+ {
+ return serialize(array($this->class, $this->name));
+ }
+
+ public function unserialize($str)
+ {
+ list($this->class, $this->name) = unserialize($str);
+
+ $this->reflection = new \ReflectionMethod($this->class, $this->name);
+ $this->reflection->setAccessible(true);
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/NullMetadata.php b/vendor/jms/metadata/src/Metadata/NullMetadata.php
new file mode 100644
index 0000000000..f06dfba68a
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/NullMetadata.php
@@ -0,0 +1,13 @@
+
+ */
+class NullMetadata extends ClassMetadata
+{
+
+}
diff --git a/vendor/jms/metadata/src/Metadata/PropertyMetadata.php b/vendor/jms/metadata/src/Metadata/PropertyMetadata.php
new file mode 100644
index 0000000000..78baad12d3
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/PropertyMetadata.php
@@ -0,0 +1,62 @@
+
+ */
+class PropertyMetadata implements \Serializable
+{
+ public $class;
+ public $name;
+ public $reflection;
+
+ public function __construct($class, $name)
+ {
+ $this->class = $class;
+ $this->name = $name;
+
+ $this->reflection = new \ReflectionProperty($class, $name);
+ $this->reflection->setAccessible(true);
+ }
+
+ /**
+ * @param object $obj
+ *
+ * @return mixed
+ */
+ public function getValue($obj)
+ {
+ return $this->reflection->getValue($obj);
+ }
+
+ /**
+ * @param object $obj
+ * @param string $value
+ */
+ public function setValue($obj, $value)
+ {
+ $this->reflection->setValue($obj, $value);
+ }
+
+ public function serialize()
+ {
+ return serialize(array(
+ $this->class,
+ $this->name,
+ ));
+ }
+
+ public function unserialize($str)
+ {
+ list($this->class, $this->name) = unserialize($str);
+
+ $this->reflection = new \ReflectionProperty($this->class, $this->name);
+ $this->reflection->setAccessible(true);
+ }
+}
diff --git a/vendor/jms/metadata/src/Metadata/Version.php b/vendor/jms/metadata/src/Metadata/Version.php
new file mode 100644
index 0000000000..65b1a40199
--- /dev/null
+++ b/vendor/jms/metadata/src/Metadata/Version.php
@@ -0,0 +1,8 @@
+markTestSkipped('Doctrine\Common is not installed.');
+ }
+ }
+
+ public function testLoadEvictPutClassMetadataFromInCache()
+ {
+ $cache = new DoctrineCacheAdapter('metadata-test', new ArrayCache());
+
+ $this->assertNull($cache->loadClassMetadataFromCache($refl = new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')));
+ $cache->putClassMetadataInCache($metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject'));
+
+ $this->assertEquals($metadata, $cache->loadClassMetadataFromCache($refl));
+
+ $cache->evictClassMetadataFromCache($refl);
+ $this->assertNull($cache->loadClassMetadataFromCache($refl));
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/Cache/FileCacheTest.php b/vendor/jms/metadata/tests/Metadata/Tests/Cache/FileCacheTest.php
new file mode 100644
index 0000000000..9325dd7232
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/Cache/FileCacheTest.php
@@ -0,0 +1,22 @@
+assertNull($cache->loadClassMetadataFromCache($refl = new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')));
+ $cache->putClassMetadataInCache($metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject'));
+
+ $this->assertEquals($metadata, $cache->loadClassMetadataFromCache($refl));
+
+ $cache->evictClassMetadataFromCache($refl);
+ $this->assertNull($cache->loadClassMetadataFromCache($refl));
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/Cache/PsrCacheAdapterTest.php b/vendor/jms/metadata/tests/Metadata/Tests/Cache/PsrCacheAdapterTest.php
new file mode 100644
index 0000000000..7470eb6999
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/Cache/PsrCacheAdapterTest.php
@@ -0,0 +1,33 @@
+markTestSkipped('symfony/cache is not installed.');
+ }
+ }
+
+ public function testLoadEvictPutClassMetadataFromInCache()
+ {
+ $cache = new PsrCacheAdapter('metadata-test', new ArrayAdapter());
+
+ $this->assertNull($cache->loadClassMetadataFromCache($refl = new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')));
+ $cache->putClassMetadataInCache($metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject'));
+
+ $this->assertEquals($metadata, $cache->loadClassMetadataFromCache($refl));
+
+ $cache->evictClassMetadataFromCache($refl);
+ $this->assertNull($cache->loadClassMetadataFromCache($refl));
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/ClassMetadataTest.php b/vendor/jms/metadata/tests/Metadata/Tests/ClassMetadataTest.php
new file mode 100644
index 0000000000..99cb9b3a72
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/ClassMetadataTest.php
@@ -0,0 +1,39 @@
+assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->name);
+ $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->reflection->name);
+ }
+
+ public function testSerializeUnserialize()
+ {
+ $metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject');
+
+ $this->assertEquals($metadata, unserialize(serialize($metadata)));
+ }
+
+ public function testIsFresh()
+ {
+ $ref = new \ReflectionClass('Metadata\Tests\Fixtures\TestObject');
+ touch($ref->getFilename());
+ sleep(2);
+
+ $metadata = new ClassMetadata($ref->name);
+ $metadata->fileResources[] = $ref->getFilename();
+ $this->assertTrue($metadata->isFresh());
+
+ sleep(2);
+ clearstatcache($ref->getFilename());
+ touch($ref->getFilename());
+ $this->assertFalse($metadata->isFresh());
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/Driver/AbstractFileDriverTest.php b/vendor/jms/metadata/tests/Metadata/Tests/Driver/AbstractFileDriverTest.php
new file mode 100644
index 0000000000..20b91fb288
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/Driver/AbstractFileDriverTest.php
@@ -0,0 +1,85 @@
+
+ */
+class AbstractFileDriverTest extends \PHPUnit_Framework_TestCase
+{
+ private static $extension = 'jms_metadata.yml';
+
+ /** @var \PHPUnit_Framework_MockObject_MockObject */
+ private $locator;
+
+ /** @var \PHPUnit_Framework_MockObject_MockObject */
+ private $driver;
+
+ public function setUp()
+ {
+ $this->locator = $this->getMock('Metadata\Driver\FileLocator', array(), array(), '', false);
+ $this->driver = $this->getMockBuilder('Metadata\Driver\AbstractFileDriver')
+ ->setConstructorArgs(array($this->locator))
+ ->getMockForAbstractClass();
+
+ $this->driver->expects($this->any())->method('getExtension')->will($this->returnValue(self::$extension));
+ }
+
+ public function testLoadMetadataForClass()
+ {
+ $class = new \ReflectionClass('\stdClass');
+ $this->locator
+ ->expects($this->once())
+ ->method('findFileForClass')
+ ->with($class, self::$extension)
+ ->will($this->returnValue('Some\Path'));
+
+ $this->driver
+ ->expects($this->once())
+ ->method('loadMetadataFromFile')
+ ->with($class, 'Some\Path')
+ ->will($this->returnValue($metadata = new ClassMetadata('\stdClass')));
+
+ $this->assertSame($metadata, $this->driver->loadMetadataForClass($class));
+ }
+
+ public function testLoadMetadataForClassWillReturnNull()
+ {
+ $class = new \ReflectionClass('\stdClass');
+ $this->locator
+ ->expects($this->once())
+ ->method('findFileForClass')
+ ->with($class, self::$extension)
+ ->will($this->returnValue(null));
+
+ $this->assertSame(null, $this->driver->loadMetadataForClass($class));
+ }
+
+ public function testGetAllClassNames()
+ {
+ $class = new \ReflectionClass('\stdClass');
+ $this->locator
+ ->expects($this->once())
+ ->method('findAllClasses')
+ ->with(self::$extension)
+ ->will($this->returnValue(array('\stdClass')));
+
+ $this->assertSame(array('\stdClass'), $this->driver->getAllClassNames($class));
+ }
+
+ public function testGetAllClassNamesThrowsRuntimeException()
+ {
+ $this->setExpectedException('RuntimeException');
+
+ $locator = $this->getMock('Metadata\Driver\FileLocatorInterface', array(), array(), '', false);
+ $driver = $this->getMockBuilder('Metadata\Driver\AbstractFileDriver')
+ ->setConstructorArgs(array($locator))
+ ->getMockForAbstractClass();
+ $class = new \ReflectionClass('\stdClass');
+ $locator->expects($this->never())->method('findAllClasses');
+
+ $driver->getAllClassNames($class);
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/Driver/DriverChainTest.php b/vendor/jms/metadata/tests/Metadata/Tests/Driver/DriverChainTest.php
new file mode 100644
index 0000000000..5e33643a42
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/Driver/DriverChainTest.php
@@ -0,0 +1,65 @@
+getMock('Metadata\\Driver\\DriverInterface');
+ $driver
+ ->expects($this->once())
+ ->method('loadMetadataForClass')
+ ->will($this->returnValue($metadata = new ClassMetadata('\stdClass')))
+ ;
+ $chain = new DriverChain(array($driver));
+
+ $this->assertSame($metadata, $chain->loadMetadataForClass(new \ReflectionClass('\stdClass')));
+ }
+
+ public function testGetAllClassNames()
+ {
+ $driver1 = $this->getMock('Metadata\\Driver\\AdvancedDriverInterface');
+ $driver1
+ ->expects($this->once())
+ ->method('getAllClassNames')
+ ->will($this->returnValue(array('Foo')));
+
+ $driver2 = $this->getMock('Metadata\\Driver\\AdvancedDriverInterface');
+ $driver2
+ ->expects($this->once())
+ ->method('getAllClassNames')
+ ->will($this->returnValue(array('Bar')));
+
+ $chain = new DriverChain(array($driver1, $driver2));
+
+ $this->assertSame(array('Foo', 'Bar'), $chain->getAllClassNames());
+ }
+
+ public function testLoadMetadataForClassReturnsNullWhenNoMetadataIsFound()
+ {
+ $driver = new DriverChain(array());
+ $this->assertNull($driver->loadMetadataForClass(new \ReflectionClass('\stdClass')));
+
+ $driver = $this->getMock('Metadata\\Driver\\DriverInterface');
+ $driver
+ ->expects($this->once())
+ ->method('loadMetadataForClass')
+ ->will($this->returnValue(null))
+ ;
+ $driverChain = new DriverChain(array($driver));
+ $this->assertNull($driver->loadMetadataForClass(new \ReflectionClass('\stdClass')));
+ }
+
+ public function testGetAllClassNamesThrowsException()
+ {
+ $this->setExpectedException('RuntimeException');
+ $driver = $this->getMock('Metadata\\Driver\\DriverInterface');
+ $driver->expects($this->never())->method('getAllClassNames');
+ $chain = new DriverChain(array($driver));
+ $chain->getAllClassNames();
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/Driver/FileLocatorTest.php b/vendor/jms/metadata/tests/Metadata/Tests/Driver/FileLocatorTest.php
new file mode 100644
index 0000000000..b92d8c9681
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/Driver/FileLocatorTest.php
@@ -0,0 +1,69 @@
+ __DIR__.'/Fixture/A',
+ 'Metadata\Tests\Driver\Fixture\B' => __DIR__.'/Fixture/B',
+ 'Metadata\Tests\Driver\Fixture\C' => __DIR__.'/Fixture/C',
+ ));
+
+ $ref = new \ReflectionClass('Metadata\Tests\Driver\Fixture\A\A');
+ $this->assertEquals(realpath(__DIR__.'/Fixture/A/A.xml'), realpath($locator->findFileForClass($ref, 'xml')));
+
+ $ref = new \ReflectionClass('Metadata\Tests\Driver\Fixture\B\B');
+ $this->assertNull($locator->findFileForClass($ref, 'xml'));
+
+ $ref = new \ReflectionClass('Metadata\Tests\Driver\Fixture\C\SubDir\C');
+ $this->assertEquals(realpath(__DIR__.'/Fixture/C/SubDir.C.yml'), realpath($locator->findFileForClass($ref, 'yml')));
+ }
+
+ public function testTraits()
+ {
+ if (version_compare(PHP_VERSION, '5.4.0', '<')) {
+ $this->markTestSkipped('No traits available');
+ }
+
+ $locator = new FileLocator(array(
+ 'Metadata\Tests\Driver\Fixture\T' => __DIR__.'/Fixture/T',
+ ));
+
+ $ref = new \ReflectionClass('Metadata\Tests\Driver\Fixture\T\T');
+ $this->assertEquals(realpath(__DIR__.'/Fixture/T/T.xml'), realpath($locator->findFileForClass($ref, 'xml')));
+ }
+
+ public function testFindFileForGlobalNamespacedClass()
+ {
+ $locator = new FileLocator(array(
+ '' => __DIR__.'/Fixture/D',
+ ));
+
+ require_once __DIR__.'/Fixture/D/D.php';
+ $ref = new \ReflectionClass('D');
+ $this->assertEquals(realpath(__DIR__.'/Fixture/D/D.yml'), realpath($locator->findFileForClass($ref, 'yml')));
+ }
+
+ public function testFindAllFiles()
+ {
+ $locator = new FileLocator(array(
+ 'Metadata\Tests\Driver\Fixture\A' => __DIR__.'/Fixture/A',
+ 'Metadata\Tests\Driver\Fixture\B' => __DIR__.'/Fixture/B',
+ 'Metadata\Tests\Driver\Fixture\C' => __DIR__.'/Fixture/C',
+ 'Metadata\Tests\Driver\Fixture\D' => __DIR__.'/Fixture/D'
+ ));
+
+ $this->assertCount(1, $xmlFiles = $locator->findAllClasses('xml'));
+ $this->assertSame('Metadata\Tests\Driver\Fixture\A\A', $xmlFiles[0]);
+
+ $this->assertCount(3, $ymlFiles = $locator->findAllClasses('yml'));
+ $this->assertSame('Metadata\Tests\Driver\Fixture\B\B', $ymlFiles[0]);
+ $this->assertSame('Metadata\Tests\Driver\Fixture\C\SubDir\C', $ymlFiles[1]);
+ $this->assertSame('Metadata\Tests\Driver\Fixture\D\D', $ymlFiles[2]);
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/Driver/Fixture/A/A.php b/vendor/jms/metadata/tests/Metadata/Tests/Driver/Fixture/A/A.php
new file mode 100644
index 0000000000..3ea6df1e2c
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/Driver/Fixture/A/A.php
@@ -0,0 +1,5 @@
+foo;
+ }
+
+ private function setFoo($foo)
+ {
+ $this->foo = $foo;
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/Fixtures/TestParent.php b/vendor/jms/metadata/tests/Metadata/Tests/Fixtures/TestParent.php
new file mode 100644
index 0000000000..940cb5b0f5
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/Fixtures/TestParent.php
@@ -0,0 +1,7 @@
+propertyMetadata['foo'] = 'bar';
+ $parentMetadata->propertyMetadata['baz'] = 'baz';
+ $parentMetadata->methodMetadata['foo'] = 'bar';
+ $parentMetadata->createdAt = 2;
+ $parentMetadata->fileResources[] = 'foo';
+
+ $childMetadata = new MergeableClassMetadata('Metadata\Tests\Fixtures\TestObject');
+ $childMetadata->propertyMetadata['foo'] = 'baz';
+ $childMetadata->methodMetadata['foo'] = 'baz';
+ $childMetadata->createdAt = 1;
+ $childMetadata->fileResources[] = 'bar';
+
+ $parentMetadata->merge($childMetadata);
+ $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $parentMetadata->name);
+ $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $parentMetadata->reflection->name);
+ $this->assertEquals(array('foo' => 'baz', 'baz' => 'baz',), $parentMetadata->propertyMetadata);
+ $this->assertEquals(array('foo' => 'baz',), $parentMetadata->methodMetadata);
+ $this->assertEquals(1, $parentMetadata->createdAt);
+ $this->assertEquals(array('foo', 'bar'), $parentMetadata->fileResources);
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/MetadataFactoryTest.php b/vendor/jms/metadata/tests/Metadata/Tests/MetadataFactoryTest.php
new file mode 100644
index 0000000000..7fb5df416f
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/MetadataFactoryTest.php
@@ -0,0 +1,279 @@
+getMock('Metadata\Driver\DriverInterface');
+
+ $driver
+ ->expects($this->at(0))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')))
+ ->will($this->returnCallback(function($class) {
+ return new ClassMetadata($class->getName());
+ }))
+ ;
+ $driver
+ ->expects($this->at(1))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestParent')))
+ ->will($this->returnCallback(function($class) {
+ return new ClassMetadata($class->getName());
+ }))
+ ;
+
+ $factory = new MetadataFactory($driver);
+ $metadata = $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestParent');
+
+ $this->assertInstanceOf('Metadata\ClassHierarchyMetadata', $metadata);
+ $this->assertEquals(2, count($metadata->classMetadata));
+ }
+
+ public function testGetMetadataForClassWhenMergeable()
+ {
+ $driver = $this->getMock('Metadata\Driver\DriverInterface');
+
+ $driver
+ ->expects($this->at(0))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')))
+ ->will($this->returnCallback(function($class) {
+ return new MergeableClassMetadata($class->getName());
+ }))
+ ;
+ $driver
+ ->expects($this->at(1))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestParent')))
+ ->will($this->returnCallback(function($class) {
+ return new MergeableClassMetadata($class->getName());
+ }))
+ ;
+
+ $factory = new MetadataFactory($driver);
+ $metadata = $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestParent');
+
+ $this->assertInstanceOf('Metadata\MergeableClassMetadata', $metadata);
+ $this->assertEquals('Metadata\Tests\Fixtures\TestParent', $metadata->name);
+ }
+
+ public function testGetMetadataWithComplexHierarchy()
+ {
+ $driver = $this->getMock('Metadata\Driver\DriverInterface');
+
+ $driver
+ ->expects($this->any())
+ ->method('loadMetadataForClass')
+ ->will($this->returnCallback(function($class) {
+ $metadata = new MergeableClassMetadata($class->name);
+
+ switch ($class->name) {
+ case 'Metadata\Tests\Fixtures\ComplexHierarchy\BaseClass':
+ $metadata->propertyMetadata['foo'] = new PropertyMetadata($class->name, 'foo');
+ break;
+
+ case 'Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA':
+ $metadata->propertyMetadata['bar'] = new PropertyMetadata($class->name, 'bar');
+ break;
+
+ case 'Metadata\Tests\Fixtures\ComplexHierarchy\SubClassB':
+ $metadata->propertyMetadata['baz'] = new PropertyMetadata($class->name, 'baz');
+ break;
+
+ default:
+ throw new \RuntimeException(sprintf('Unsupported class "%s".', $class->name));
+ }
+
+ return $metadata;
+ }))
+ ;
+
+ $factory = new MetadataFactory($driver);
+
+ $subClassA = $factory->getMetadataForClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA');
+ $this->assertInstanceOf('Metadata\MergeableClassMetadata', $subClassA);
+ $this->assertEquals(array('foo', 'bar'), array_keys($subClassA->propertyMetadata));
+
+ $subClassB = $factory->getMetadataForClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassB');
+ $this->assertInstanceOf('Metadata\MergeableClassMetadata', $subClassB);
+ $this->assertEquals(array('foo', 'baz'), array_keys($subClassB->propertyMetadata));
+ }
+
+ public function testGetMetadataWithCache()
+ {
+ $driver = $this->getMock('Metadata\Driver\DriverInterface');
+ $driver
+ ->expects($this->once())
+ ->method('loadMetadataForClass')
+ ->will($this->returnValue($metadata = new ClassMetadata('Metadata\Tests\Fixtures\TestObject')))
+ ;
+
+ $factory = new MetadataFactory($driver);
+
+ $cache = $this->getMock('Metadata\Cache\CacheInterface');
+ $cache
+ ->expects($this->once())
+ ->method('loadClassMetadataFromCache')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')))
+ ->will($this->returnValue(null))
+ ;
+ $cache
+ ->expects($this->once())
+ ->method('putClassMetadataInCache')
+ ->with($this->equalTo($metadata))
+ ;
+ $factory->setCache($cache);
+
+
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $this->assertSame($metadata, reset($factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject')->classMetadata));
+ }
+
+ public function testGetMetadataReturnsNullIfNoMetadataIsFound()
+ {
+ $driver = $this->getMock('Metadata\Driver\DriverInterface');
+ $driver
+ ->expects($this->once())
+ ->method('loadMetadataForClass')
+ ->will($this->returnValue(null))
+ ;
+
+ $factory = new MetadataFactory($driver);
+
+ $this->assertNull($factory->getMetadataForClass('stdClass'));
+ }
+
+ public function testGetMetadataWithInterfaces()
+ {
+ $driver = $this->getMock('Metadata\Driver\DriverInterface');
+
+ $driver
+ ->expects($this->at(3))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA')))
+ ;
+ $driver
+ ->expects($this->at(2))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\InterfaceB')))
+ ;
+ $driver
+ ->expects($this->at(1))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\BaseClass')))
+ ;
+ $driver
+ ->expects($this->at(0))
+ ->method('loadMetadataForClass')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\ComplexHierarchy\InterfaceA')))
+ ;
+
+ $factory = new MetadataFactory($driver);
+ $factory->setIncludeInterfaces(true);
+
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\ComplexHierarchy\SubClassA');
+ }
+
+ public function testGetAllClassNames()
+ {
+ $driver = $this->getMock('Metadata\Driver\AdvancedDriverInterface');
+ $driver
+ ->expects($this->once())
+ ->method('getAllClassNames')
+ ->will($this->returnValue(array()));
+
+ $factory = new MetadataFactory($driver);
+ $this->assertSame(array(), $factory->getAllClassNames());
+ }
+
+ public function testGetAllClassNamesThrowsException()
+ {
+ $this->setExpectedException('RuntimeException');
+ $factory = new MetadataFactory($this->getMock('Metadata\Driver\DriverInterface'));
+ $factory->getAllClassNames();
+ }
+
+ public function testNotFoundMetadataIsCached()
+ {
+ $driver = $this->getMock('Metadata\Driver\DriverInterface');
+ $driver
+ ->expects($this->once()) // This is the important part of this test
+ ->method('loadMetadataForClass')
+ ->will($this->returnValue(null))
+ ;
+
+ $cachedMetadata = null;
+ $cache = $this->getMock('Metadata\Cache\CacheInterface');
+ $cache
+ ->expects($this->any())
+ ->method('loadClassMetadataFromCache')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')))
+ ->will($this->returnCallback(function () use (&$cachedMetadata) {
+ return $cachedMetadata;
+ }))
+ ;
+ $cache
+ ->expects($this->once())
+ ->method('putClassMetadataInCache')
+ ->will($this->returnCallback(function ($metadata) use (&$cachedMetadata) {
+ $cachedMetadata = $metadata;
+ }))
+ ;
+
+ $factory = new MetadataFactory($driver);
+ $factory->setCache($cache);
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $this->assertNull($factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject'));
+
+ // We use another factory with the same cache, to simulate another request and skip the in memory
+ $factory = new MetadataFactory($driver);
+ $factory->setCache($cache);
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $this->assertNull($factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject'));
+ }
+
+ public function testNotFoundMetadataIsNotCachedInDebug()
+ {
+ $driver = $this->getMock('Metadata\Driver\DriverInterface');
+ $driver
+ ->expects($this->exactly(2))
+ ->method('loadMetadataForClass')
+ ->will($this->returnValue(null))
+ ;
+
+ $cachedMetadata = null;
+ $cache = $this->getMock('Metadata\Cache\CacheInterface');
+ $cache
+ ->expects($this->any())
+ ->method('loadClassMetadataFromCache')
+ ->with($this->equalTo(new \ReflectionClass('Metadata\Tests\Fixtures\TestObject')))
+ ->will($this->returnValue(null))
+ ;
+ $cache
+ ->expects($this->never())
+ ->method('putClassMetadataInCache')
+ ;
+
+ $factory = new MetadataFactory($driver, 'Metadata\ClassHierarchyMetadata', true);
+ $factory->setCache($cache);
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $this->assertNull($factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject'));
+
+ // We use another factory with the same cache, to simulate another request and skip the in memory
+ $factory = new MetadataFactory($driver, 'Metadata\ClassHierarchyMetadata', true);
+ $factory->setCache($cache);
+ $factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject');
+ $this->assertNull($factory->getMetadataForClass('Metadata\Tests\Fixtures\TestObject'));
+ }
+}
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/MethodMetadataTest.php b/vendor/jms/metadata/tests/Metadata/Tests/MethodMetadataTest.php
new file mode 100644
index 0000000000..2276ace066
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/MethodMetadataTest.php
@@ -0,0 +1,37 @@
+setAccessible(true);
+
+ $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->class);
+ $this->assertEquals('setFoo', $metadata->name);
+ $this->assertEquals($expectedReflector, $metadata->reflection);
+ }
+
+ public function testSerializeUnserialize()
+ {
+ $metadata = new MethodMetadata('Metadata\Tests\Fixtures\TestObject', 'setFoo');
+
+ $this->assertEquals($metadata, unserialize(serialize($metadata)));
+ }
+
+ public function testInvoke()
+ {
+ $obj = new TestObject();
+ $metadata = new MethodMetadata('Metadata\Tests\Fixtures\TestObject', 'setFoo');
+
+ $this->assertNull($obj->getFoo());
+ $metadata->invoke($obj, array('foo'));
+ $this->assertEquals('foo', $obj->getFoo());
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/metadata/tests/Metadata/Tests/PropertyMetadataTest.php b/vendor/jms/metadata/tests/Metadata/Tests/PropertyMetadataTest.php
new file mode 100644
index 0000000000..e30e546fbd
--- /dev/null
+++ b/vendor/jms/metadata/tests/Metadata/Tests/PropertyMetadataTest.php
@@ -0,0 +1,37 @@
+setAccessible(true);
+
+ $this->assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->class);
+ $this->assertEquals('foo', $metadata->name);
+ $this->assertEquals($expectedReflector, $metadata->reflection);
+ }
+
+ public function testSerializeUnserialize()
+ {
+ $metadata = new PropertyMetadata('Metadata\Tests\Fixtures\TestObject', 'foo');
+
+ $this->assertEquals($metadata, unserialize(serialize($metadata)));
+ }
+
+ public function testSetGetValue()
+ {
+ $obj = new TestObject();
+ $metadata = new PropertyMetadata('Metadata\Tests\Fixtures\TestObject', 'foo');
+
+ $this->assertNull($metadata->getValue($obj));
+ $metadata->setValue($obj, 'foo');
+ $this->assertEquals('foo', $metadata->getValue($obj));
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/metadata/tests/bootstrap.php b/vendor/jms/metadata/tests/bootstrap.php
new file mode 100644
index 0000000000..63333219b9
--- /dev/null
+++ b/vendor/jms/metadata/tests/bootstrap.php
@@ -0,0 +1,36 @@
+
+ *
+ */
+
+spl_autoload_register(function($class) {
+ if (0 === strpos($class, 'Metadata\Tests\\')) {
+ $path = __DIR__.'/../tests/'.strtr($class, '\\', '/').'.php';
+ if (file_exists($path) && is_readable($path)) {
+ require_once $path;
+
+ return true;
+ }
+ } elseif (0 === strpos($class, 'Metadata\\')) {
+ $path = __DIR__.'/../src/'.($class = strtr($class, '\\', '/')).'.php';
+ if (file_exists($path) && is_readable($path)) {
+ require_once $path;
+
+ return true;
+ }
+ } elseif (0 === strpos($class, 'Symfony\\')) {
+ $path = __DIR__.'/../../symfony/src/'.strtr($class, '\\', '/').'.php';
+
+ if (file_exists($path) && is_readable($path)) {
+ require_once $path;
+
+ return true;
+ }
+ }
+});
+
+@include __DIR__ . '/../vendor/autoload.php';
diff --git a/vendor/jms/parser-lib/.gitignore b/vendor/jms/parser-lib/.gitignore
new file mode 100644
index 0000000000..30f3ee22d1
--- /dev/null
+++ b/vendor/jms/parser-lib/.gitignore
@@ -0,0 +1,3 @@
+vendor/
+phpunit.xml
+
diff --git a/vendor/jms/parser-lib/.jms.yml b/vendor/jms/parser-lib/.jms.yml
new file mode 100644
index 0000000000..0d0f3156c5
--- /dev/null
+++ b/vendor/jms/parser-lib/.jms.yml
@@ -0,0 +1,19 @@
+filter:
+ paths: [src/*, tests/*]
+ excluded_paths: ["tests/*/Fixture/*"]
+
+default_config:
+ psr0_compliance: true
+ checkstyle: true
+ composer_config_check:
+ publish_checks: true
+ level: warning
+ reflection_fixes: true
+ use_statement_fixes: true
+
+path_configs:
+ tests:
+ paths: [tests/*]
+ psr0_compliance: false
+ checkstyle: false
+ phpunit_checks: true
diff --git a/vendor/jms/parser-lib/.travis.yml b/vendor/jms/parser-lib/.travis.yml
new file mode 100644
index 0000000000..c507441f07
--- /dev/null
+++ b/vendor/jms/parser-lib/.travis.yml
@@ -0,0 +1,15 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+
+before_script:
+ - curl -s http://getcomposer.org/installer | php
+ - php composer.phar install --dev
+
+script: phpunit --coverage-clover clover
+
+after_success:
+ - curl -sL https://bit.ly/artifact-uploader | php
+
diff --git a/vendor/jms/parser-lib/LICENSE b/vendor/jms/parser-lib/LICENSE
new file mode 100644
index 0000000000..f49a4e16e6
--- /dev/null
+++ b/vendor/jms/parser-lib/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
\ No newline at end of file
diff --git a/vendor/jms/parser-lib/README.md b/vendor/jms/parser-lib/README.md
new file mode 100644
index 0000000000..75e9cecd88
--- /dev/null
+++ b/vendor/jms/parser-lib/README.md
@@ -0,0 +1,4 @@
+Parser Library
+==============
+
+Learn more about it in its [documentation](http://jmsyst.com/libs/parser-lib).
diff --git a/vendor/jms/parser-lib/composer.json b/vendor/jms/parser-lib/composer.json
new file mode 100644
index 0000000000..417661d3e8
--- /dev/null
+++ b/vendor/jms/parser-lib/composer.json
@@ -0,0 +1,18 @@
+{
+ "name": "jms/parser-lib",
+ "description": "A library for easily creating recursive-descent parsers.",
+ "license": "Apache2",
+ "require": {
+ "phpoption/phpoption": ">=0.9,<2.0-dev"
+ },
+ "autoload": {
+ "psr-0": {
+ "JMS\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/parser-lib/composer.lock b/vendor/jms/parser-lib/composer.lock
new file mode 100644
index 0000000000..fe331e6ccf
--- /dev/null
+++ b/vendor/jms/parser-lib/composer.lock
@@ -0,0 +1,62 @@
+{
+ "hash": "804f267fbd2c33067f6cafd3576f70dd",
+ "packages": [
+ {
+ "name": "phpoption/phpoption",
+ "version": "0.9.0",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/schmittjoh/php-option",
+ "reference": "0.9.0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/schmittjoh/php-option/archive/0.9.0.zip",
+ "reference": "0.9.0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*"
+ },
+ "time": "2012-11-12 08:25:35",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "PhpOption\\": "src/"
+ }
+ },
+ "license": [
+ "Apache2"
+ ],
+ "authors": [
+ {
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com",
+ "homepage": "http://jmsyst.com",
+ "role": "Developer of wrapped JMSSerializerBundle"
+ }
+ ],
+ "description": "Option Type for PHP",
+ "keywords": [
+ "php",
+ "language",
+ "type",
+ "option"
+ ]
+ }
+ ],
+ "packages-dev": [
+
+ ],
+ "aliases": [
+
+ ],
+ "minimum-stability": "stable",
+ "stability-flags": [
+
+ ]
+}
diff --git a/vendor/jms/parser-lib/doc/LICENSE b/vendor/jms/parser-lib/doc/LICENSE
new file mode 100644
index 0000000000..a9aba5c6c9
--- /dev/null
+++ b/vendor/jms/parser-lib/doc/LICENSE
@@ -0,0 +1,55 @@
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+ "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+ "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+ "Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
+ "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+ "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+ "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+ "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+ "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+ "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+ to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
+ to Distribute and Publicly Perform the Work including as incorporated in Collections.
+
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+ You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
+ You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+ If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+
+ For the avoidance of doubt:
+ Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+ Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+ Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
+ Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
+
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+ This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+ Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+
+8. Miscellaneous
+
+ Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+ If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+ No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+ This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+ The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
diff --git a/vendor/jms/parser-lib/doc/index.rst b/vendor/jms/parser-lib/doc/index.rst
new file mode 100644
index 0000000000..da19058140
--- /dev/null
+++ b/vendor/jms/parser-lib/doc/index.rst
@@ -0,0 +1,108 @@
+Parser Library
+==============
+
+This library allows you to easily implement recursive-descent parsers.
+
+Installation
+------------
+You can install this library through composer:
+
+.. code-block :: bash
+
+ composer require jms/parser-lib
+
+or add it to your ``composer.json`` file directly.
+
+Example
+-------
+Let's assume that you would like to write a parser for a calculator. For simplicity
+sake, we will assume that the parser would already return the result of the
+calculation. Inputs could look like this ``1 + 1`` and we would expect ``2`` as
+a result.
+
+The first step, is to create a lexer which breaks the input string up into
+individual tokens which can then be consumed by the parser. This library provides
+a convenient class for simple problems which we will use::
+
+ $lexer = new \JMS\Parser\SimpleLexer(
+ '/
+ # Numbers
+ ([0-9]+)
+
+ # Do not surround with () because whitespace is not meaningful for
+ # our purposes.
+ |\s+
+
+ # Operators; we support only + and -
+ |(+)|(-)
+ /x', // The x modifier tells PCRE to ignore whitespace in the regex above.
+
+ // This maps token types to a human readable name.
+ array(0 => 'T_UNKNOWN', 1 => 'T_INT', 2 => 'T_PLUS', 3 => 'T_MINUS'),
+
+ // This function tells the lexer which type a token has. The first element is
+ // an integer from the map above, the second element the normalized value.
+ function($value) {
+ if ('+' === $value) {
+ return array(2, '+');
+ }
+ if ('-' === $value) {
+ return array(3, '-');
+ }
+ if (is_numeric($value)) {
+ return array(1, (integer) $value);
+ }
+
+ return array(0, $value);
+ }
+ );
+
+Now the second step, is to create the parser which can consume the tokens once
+the lexer has split them::
+
+ class MyParser extends \JMS\Parser\AbstractParser
+ {
+ const T_UNKNOWN = 0;
+ const T_INT = 1;
+ const T_PLUS = 2;
+ const T_MINUS = 3;
+
+ public function parseInternal()
+ {
+ $result = $this->match(self::T_INT);
+
+ while ($this->lexer->isNextAny(array(self::T_PLUS, self::T_MINUS))) {
+ if ($this->lexer->isNext(self::T_PLUS)) {
+ $this->lexer->moveNext();
+ $result += $this->match(self::T_INT);
+ } else if ($this->lexer->isNext(self::T_MINUS)) {
+ $this->lexer->moveNext();
+ $result -= $this->match(self::T_INT);
+ } else {
+ throw new \LogicException('Previous ifs were exhaustive.');
+ }
+ }
+
+ return $result;
+ }
+ }
+
+ $parser = new MyParser($lexer);
+ $parser->parse('1 + 1'); // int(2)
+ $parser->parse('5 + 10 - 4'); // int(11)
+
+That's it. Now you can perform basic operations already. If you like you can now
+also replace the hard-coded integers in the lexer with the class constants of the
+parser.
+
+License
+-------
+
+The code is released under the business-friendly `Apache2 license`_.
+
+Documentation is subject to the `Attribution-NonCommercial-NoDerivs 3.0 Unported
+license`_.
+
+.. _Apache2 license: http://www.apache.org/licenses/LICENSE-2.0.html
+.. _Attribution-NonCommercial-NoDerivs 3.0 Unported license: http://creativecommons.org/licenses/by-nc-nd/3.0/
+
diff --git a/vendor/jms/parser-lib/phpunit.xml.dist b/vendor/jms/parser-lib/phpunit.xml.dist
new file mode 100644
index 0000000000..225f970e65
--- /dev/null
+++ b/vendor/jms/parser-lib/phpunit.xml.dist
@@ -0,0 +1,25 @@
+
+
+
+
+
+ ./tests/JMS/
+
+
+
+
+
+ performance
+
+
+
diff --git a/vendor/jms/parser-lib/src/JMS/Parser/AbstractLexer.php b/vendor/jms/parser-lib/src/JMS/Parser/AbstractLexer.php
new file mode 100644
index 0000000000..420326010b
--- /dev/null
+++ b/vendor/jms/parser-lib/src/JMS/Parser/AbstractLexer.php
@@ -0,0 +1,163 @@
+
+ *
+ * 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\Parser;
+
+/**
+ * Abstract Lexer.
+ *
+ * @author Johannes M. Schmitt
+ */
+abstract class AbstractLexer
+{
+ public $token;
+ public $next;
+
+ private $i;
+ private $peek;
+ private $tokens;
+
+ /**
+ * Returns the name of the given token.
+ *
+ * @param integer $type
+ *
+ * @return string
+ */
+ public function getName($type)
+ {
+ $ref = new \ReflectionClass($this);
+ foreach ($ref->getConstants() as $name => $value) {
+ if ($value === $type) {
+ return $name;
+ }
+ }
+
+ throw new \InvalidArgumentException(sprintf('There is no token with value %s.', json_encode($type)));
+ }
+
+ public function setInput($str)
+ {
+ $tokens = preg_split($this->getRegex(), $str, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE);
+
+ $this->tokens = array();
+ foreach ($tokens as $token) {
+ list($token[2], $token[0]) = $this->determineTypeAndValue($token[0]);
+ $this->tokens[] = $token;
+ }
+
+ $this->reset();
+ }
+
+ public function reset()
+ {
+ $this->i = -1;
+ $this->peek = 0;
+ $this->token = $this->next = null;
+ $this->moveNext();
+ }
+
+ /**
+ * Moves the pointer one token forward.
+ *
+ * @return boolean if we have not yet reached the end of the input
+ */
+ public function moveNext()
+ {
+ $this->peek = 0;
+ $this->token = $this->next;
+ $this->next = isset($this->tokens[++$this->i]) ? $this->tokens[$this->i] : null;
+
+ return null !== $this->next;
+ }
+
+ /**
+ * Skips the token stream until a token of the given type.
+ *
+ * @param integer $type
+ *
+ * @return boolean true if a token of the passed type was found, false otherwise.
+ */
+ public function skipUntil($type)
+ {
+ while ( ! $this->isNext($type) && $this->moveNext());
+
+ if ( ! $this->isNext($type)) {
+ throw new \RuntimeException(sprintf('Could not find the token %s.', $this->getName($type)));
+ }
+ }
+
+ /**
+ * @param integer $type
+ *
+ * @return boolean
+ */
+ public function isNext($type)
+ {
+ return null !== $this->next && $type === $this->next[2];
+ }
+
+ /**
+ * @param array $types
+ *
+ * @return boolean
+ */
+ public function isNextAny(array $types)
+ {
+ if (null === $this->next) {
+ return false;
+ }
+
+ foreach ($types as $type) {
+ if ($type === $this->next[2]) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @return \PhpOption\Option<[string,integer,integer]>
+ */
+ public function peek()
+ {
+ if ( ! isset($this->tokens[$this->i + (++$this->peek)])) {
+ return \PhpOption\None::create();
+ }
+
+ return new \PhpOption\Some($this->tokens[$this->i + $this->peek]);
+ }
+
+ /**
+ * @return string
+ */
+ abstract protected function getRegex();
+
+ /**
+ * Determines the type of the given value.
+ *
+ * This method may also modify the passed value for example to cast them to
+ * a different PHP type where necessary.
+ *
+ * @param string $value
+ *
+ * @return array a tupel of type and normalized value
+ */
+ abstract protected function determineTypeAndValue($value);
+}
diff --git a/vendor/jms/parser-lib/src/JMS/Parser/AbstractParser.php b/vendor/jms/parser-lib/src/JMS/Parser/AbstractParser.php
new file mode 100644
index 0000000000..f276d0e757
--- /dev/null
+++ b/vendor/jms/parser-lib/src/JMS/Parser/AbstractParser.php
@@ -0,0 +1,128 @@
+
+ *
+ * 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\Parser;
+
+/**
+ * Base Parser which provides some useful parsing methods intended for sub-classing.
+ *
+ * @author Johannes M. Schmitt
+ */
+abstract class AbstractParser
+{
+ protected $lexer;
+ protected $context;
+
+ public function __construct(AbstractLexer $lexer)
+ {
+ $this->lexer = $lexer;
+ }
+
+ /**
+ * Parses the given input.
+ *
+ * @param string $str
+ * @param string $context parsing context (allows to produce better error messages)
+ *
+ * @return mixed
+ */
+ public function parse($str, $context = null)
+ {
+ $this->lexer->setInput($str);
+ $this->context = $context;
+
+ $rs = $this->parseInternal();
+
+ if (null !== $this->lexer->next) {
+ $this->syntaxError('end of input');
+ }
+
+ return $rs;
+ }
+
+ /**
+ * @return mixed
+ */
+ abstract protected function parseInternal();
+
+ /**
+ * Matches a token, and returns its value.
+ *
+ * @param integer $type
+ *
+ * @return mixed the value of the matched token
+ */
+ protected function match($type)
+ {
+ if ( ! $this->lexer->isNext($type)) {
+ $this->syntaxError($this->lexer->getName($type));
+ }
+
+ $this->lexer->moveNext();
+
+ return $this->lexer->token[0];
+ }
+
+ /**
+ * Matches any of the passed tokens, and returns the matched token's value.
+ *
+ * @param array $types
+ *
+ * @return mixed
+ */
+ protected function matchAny(array $types)
+ {
+ if ( ! $this->lexer->isNextAny($types)) {
+ $this->syntaxError('any of '.implode(' or ', array_map(array($this->lexer, 'getName'), $types)));
+ }
+
+ $this->lexer->moveNext();
+
+ return $this->lexer->token[0];
+ }
+
+ /**
+ * Raises a syntax error exception.
+ *
+ * @param string $expectedDesc A human understandable explanation what was expected
+ * @param array $actualToken The token that was found. If not given, next token will be assumed.
+ */
+ protected function syntaxError($expectedDesc, $actualToken = null)
+ {
+ if (null === $actualToken) {
+ $actualToken = $this->lexer->next;
+ }
+ if (null === $actualToken) {
+ $actualDesc = 'end of input';
+ } else if ($actualToken[1] === 0) {
+ $actualDesc = sprintf('"%s" of type %s at beginning of input', $actualToken[0], $this->lexer->getName($actualToken[2]));
+ } else {
+ $actualDesc = sprintf('"%s" of type %s at position %d (0-based)', $actualToken[0], $this->lexer->getName($actualToken[2]), $actualToken[1]);
+ }
+
+ $ex = new SyntaxErrorException(sprintf('Expected %s, but got %s%s.', $expectedDesc, $actualDesc, $this->context ? ' '.$this->context : ''));
+ if (null !== $actualToken) {
+ $ex->setActualToken($actualToken);
+ }
+ if (null !== $this->context) {
+ $ex->setContext($this->context);
+ }
+
+ throw $ex;
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/parser-lib/src/JMS/Parser/SimpleLexer.php b/vendor/jms/parser-lib/src/JMS/Parser/SimpleLexer.php
new file mode 100644
index 0000000000..8be10522bb
--- /dev/null
+++ b/vendor/jms/parser-lib/src/JMS/Parser/SimpleLexer.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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\Parser;
+
+/**
+ * The simple lexer is a fully usable lexer that does not require sub-classing.
+ *
+ * @author Johannes M. Schmitt
+ */
+class SimpleLexer extends AbstractLexer
+{
+ private $regex;
+ private $callable;
+ private $tokenNames;
+
+ public function __construct($regex, array $tokenNames, $typeCallable)
+ {
+ $this->regex = $regex;
+ $this->callable = $typeCallable;
+ $this->tokenNames = $tokenNames;
+ }
+
+ public function getName($type)
+ {
+ if ( ! isset($this->tokenNames[$type])) {
+ throw new \InvalidArgumentException(sprintf('There is no token with type %s.', json_encode($type)));
+ }
+
+ return $this->tokenNames[$type];
+ }
+
+ protected function getRegex()
+ {
+ return $this->regex;
+ }
+
+ protected function determineTypeAndValue($value)
+ {
+ return call_user_func($this->callable, $value);
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/parser-lib/src/JMS/Parser/SyntaxErrorException.php b/vendor/jms/parser-lib/src/JMS/Parser/SyntaxErrorException.php
new file mode 100644
index 0000000000..d05b8c9c0c
--- /dev/null
+++ b/vendor/jms/parser-lib/src/JMS/Parser/SyntaxErrorException.php
@@ -0,0 +1,45 @@
+
+ *
+ * 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\Parser;
+
+class SyntaxErrorException extends \RuntimeException
+{
+ private $actualToken;
+ private $context;
+
+ public function setActualToken(array $actualToken)
+ {
+ $this->actualToken = $actualToken;
+ }
+
+ public function setContext($context)
+ {
+ $this->context = $context;
+ }
+
+ public function getActualToken()
+ {
+ return $this->actualToken;
+ }
+
+ public function getContext()
+ {
+ return $this->context;
+ }
+}
diff --git a/vendor/jms/parser-lib/tests/JMS/Parser/Tests/AbstractLexerTest.php b/vendor/jms/parser-lib/tests/JMS/Parser/Tests/AbstractLexerTest.php
new file mode 100644
index 0000000000..83f8b3b527
--- /dev/null
+++ b/vendor/jms/parser-lib/tests/JMS/Parser/Tests/AbstractLexerTest.php
@@ -0,0 +1,121 @@
+lexer->setInput('"foo" 1234');
+
+ $this->assertNull($this->lexer->token);
+ $this->assertNotNull($this->lexer->next);
+
+ $this->assertAttributeEquals(array(
+ array('foo', 0, self::T_STRING),
+ array(1234, 7, self::T_INTEGER),
+ ), 'tokens', $this->lexer);
+ }
+
+ public function testMoveNext()
+ {
+ $this->lexer->setInput('1 2 3');
+ $this->assertNull($this->lexer->token);
+
+ $this->assertTrue($this->lexer->moveNext());
+ $this->assertValue(1, $this->lexer->token);
+
+ $this->assertTrue($this->lexer->moveNext());
+ $this->assertValue(2, $this->lexer->token);
+
+ $this->assertFalse($this->lexer->moveNext());
+ $this->assertValue(3, $this->lexer->token);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSkipUntilWithNonExistent()
+ {
+ $this->lexer->setInput('1 2 3');
+ $this->lexer->skipUntil(self::T_STRING);
+ }
+
+ public function testSkipUntil()
+ {
+ $this->lexer->setInput('1 "foo"');
+ $this->assertNull($this->lexer->skipUntil(self::T_STRING));
+ $this->assertValue(1, $this->lexer->token);
+ $this->assertValue('foo', $this->lexer->next);
+ }
+
+ public function testIsNext()
+ {
+ $this->lexer->setInput('1');
+ $this->assertTrue($this->lexer->isNext(self::T_INTEGER));
+ $this->assertFalse($this->lexer->isNext(self::T_COMMA));
+ }
+
+ public function testIsNextAny()
+ {
+ $this->lexer->setInput('1');
+ $this->assertTrue($this->lexer->isNextAny(array(self::T_COMMA, self::T_INTEGER)));
+ $this->assertFalse($this->lexer->isNextAny(array(self::T_COMMA, self::T_STRING)));
+ }
+
+ public function testPeek()
+ {
+ $this->lexer->setInput('1 2 3');
+
+ $this->assertValue(1, $this->lexer->next);
+ $this->assertValue(2, $this->lexer->peek()->get());
+
+ $this->assertValue(1, $this->lexer->next);
+ $this->assertValue(3, $this->lexer->peek()->get());
+
+ $this->assertValue(1, $this->lexer->next);
+ $this->assertTrue($this->lexer->moveNext());
+ $this->assertValue(2, $this->lexer->next);
+ $this->assertValue(3, $this->lexer->peek()->get());
+ $this->assertValue(2, $this->lexer->next);
+ }
+
+ private function assertValue($expected, $actualToken)
+ {
+ $this->assertNotNull($actualToken);
+ $this->assertSame($expected, $actualToken[0]);
+ }
+
+ protected function setUp()
+ {
+ $this->lexer = $this->getMockForAbstractClass('JMS\Parser\AbstractLexer');
+ $this->lexer->expects($this->any())
+ ->method('getRegex')
+ ->will($this->returnValue('/("(?:[^"]*|(?<=\\)"))*")|([0-9]+)|\s+|(.)/i'));
+ $this->lexer->expects($this->any())
+ ->method('determineTypeAndValue')
+ ->will($this->returnCallback(function($value) {
+ if (',' === $value) {
+ return array(AbstractLexerTest::T_COMMA, $value);
+ }
+
+ if ('"' === $value[0]) {
+ return array(AbstractLexerTest::T_STRING, substr($value, 1, -1));
+ }
+
+ if (preg_match('/^[0-9]+$/', $value)) {
+ return array(AbstractLexerTest::T_INTEGER, (integer) $value);
+ }
+
+ return array(AbstractLexerTest::T_UNKNOWN, $value);
+ }));
+ }
+}
diff --git a/vendor/jms/parser-lib/tests/JMS/Parser/Tests/AbstractParserTest.php b/vendor/jms/parser-lib/tests/JMS/Parser/Tests/AbstractParserTest.php
new file mode 100644
index 0000000000..ea5b48a613
--- /dev/null
+++ b/vendor/jms/parser-lib/tests/JMS/Parser/Tests/AbstractParserTest.php
@@ -0,0 +1,87 @@
+assertSame(2, $this->parser->parse('1 + 1'));
+ $this->assertSame(5, $this->parser->parse('1 + 1 + 4 - 1'));
+ }
+
+ /**
+ * @expectedException JMS\Parser\SyntaxErrorException
+ * @expectedExceptionMessage Expected T_INT, but got end of input.
+ */
+ public function testUnexpectedEnd()
+ {
+ $this->parser->parse('1 + ');
+ }
+
+ protected function setUp()
+ {
+ $this->lexer = $lexer = new \JMS\Parser\SimpleLexer(
+ '/([0-9]+)|\s+|(.)/',
+ array(0 => 'T_UNKNOWN', 1 => 'T_INT', 100 => 'T_PLUS', 101 => 'T_MINUS'),
+ function($value) {
+ if ('+' === $value) {
+ return array(AbstractParserTest::T_PLUS, $value);
+ }
+ if ('-' === $value) {
+ return array(AbstractParserTest::T_MINUS, $value);
+ }
+
+ // We would loose information on doubles here, but for this test it
+ // does not matter anyway.
+ if (is_numeric($value)) {
+ return array(AbstractParserTest::T_INT, (integer) $value);
+ }
+
+ return AbstractParserTest::T_UNKNOWN;
+ }
+ );
+
+ $this->parser = $parser = $this->getMockBuilder('JMS\Parser\AbstractParser')
+ ->setConstructorArgs(array($this->lexer))
+ ->getMockForAbstractClass();
+
+ $match = function($type) use ($parser) {
+ $ref = new \ReflectionMethod($parser, 'match');
+ $ref->setAccessible(true);
+
+ return $ref->invoke($parser, $type);
+ };
+
+ $this->parser->expects($this->any())
+ ->method('parseInternal')
+ ->will($this->returnCallback(function() use ($lexer, $match) {
+ // Result :== Number ( ("+"|"-") Number )*
+
+ $result = $match(AbstractParserTest::T_INT);
+ while ($lexer->isNextAny(array(AbstractParserTest::T_PLUS, AbstractParserTest::T_MINUS))) {
+ if ($lexer->isNext(AbstractParserTest::T_PLUS)) {
+ $lexer->moveNext();
+
+ $result += $match(AbstractParserTest::T_INT);
+ } else if ($lexer->isNext(AbstractParserTest::T_MINUS)) {
+ $lexer->moveNext();
+
+ $result -= $match(AbstractParserTest::T_INT);
+ } else {
+ throw new \LogicException('Previous ifs were exhaustive.');
+ }
+ }
+
+ return $result;
+ }));
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/parser-lib/tests/bootstrap.php b/vendor/jms/parser-lib/tests/bootstrap.php
new file mode 100644
index 0000000000..37d8f3fd73
--- /dev/null
+++ b/vendor/jms/parser-lib/tests/bootstrap.php
@@ -0,0 +1,8 @@
+xmlAttribute in XmlDriver.php [\#422](https://github.com/schmittjoh/serializer/issues/422)
+- Access level propose for Handler/DateHandler.php [\#386](https://github.com/schmittjoh/serializer/issues/386)
+- Type DateTime and Timestamp \(U format\) [\#343](https://github.com/schmittjoh/serializer/issues/343)
+
+**Merged pull requests:**
+
+- Update PHPDocs [\#736](https://github.com/schmittjoh/serializer/pull/736) ([gnat42](https://github.com/gnat42))
+
+## [1.6.0](https://github.com/schmittjoh/serializer/tree/1.6.0) (2017-03-24)
+**Implemented enhancements:**
+
+- Add DateTimeImmutable support to DateHandler [\#543](https://github.com/schmittjoh/serializer/issues/543)
+
+**Fixed bugs:**
+
+- Virtual property having type overriden by doctrine metadata [\#276](https://github.com/schmittjoh/serializer/issues/276)
+
+**Closed issues:**
+
+- Serialize a subclass [\#735](https://github.com/schmittjoh/serializer/issues/735)
+- How to handle Doctrine not found entity ? [\#731](https://github.com/schmittjoh/serializer/issues/731)
+- Regression with 1.5.0 =\> Undefined offset 15 [\#715](https://github.com/schmittjoh/serializer/issues/715)
+- detect serialisation without groups set [\#546](https://github.com/schmittjoh/serializer/issues/546)
+- Introducing the NormalizerInterface [\#537](https://github.com/schmittjoh/serializer/issues/537)
+- How to set JSON serialization options? [\#535](https://github.com/schmittjoh/serializer/issues/535)
+- @MaxDepth doesn't seem to be working [\#522](https://github.com/schmittjoh/serializer/issues/522)
+- max\_depth in YML config is ignored [\#498](https://github.com/schmittjoh/serializer/issues/498)
+- Dynamic property type annotation [\#436](https://github.com/schmittjoh/serializer/issues/436)
+- How to deserialize JSON if property might have a list of subobjects? [\#355](https://github.com/schmittjoh/serializer/issues/355)
+- Object to array normalization [\#354](https://github.com/schmittjoh/serializer/issues/354)
+- Serialize Doctrine object without references [\#353](https://github.com/schmittjoh/serializer/issues/353)
+- Post\_serialize doesn't serialize relation! [\#236](https://github.com/schmittjoh/serializer/issues/236)
+- parsing string to date [\#217](https://github.com/schmittjoh/serializer/issues/217)
+- Discriminator is not exposed when using a group exclusion strategy [\#157](https://github.com/schmittjoh/serializer/issues/157)
+
+## [1.6.0-RC1](https://github.com/schmittjoh/serializer/tree/1.6.0-RC1) (2017-03-14)
+**Implemented enhancements:**
+
+- Add symfony expression in exclusions/expositions [\#406](https://github.com/schmittjoh/serializer/issues/406)
+- check that cache directory was not created before throwing exception [\#729](https://github.com/schmittjoh/serializer/pull/729) ([mente](https://github.com/mente))
+- \#720 - Adding support for DateInterval deserialization [\#721](https://github.com/schmittjoh/serializer/pull/721) ([c0ntax](https://github.com/c0ntax))
+- Expression language based virtual properties [\#708](https://github.com/schmittjoh/serializer/pull/708) ([goetas](https://github.com/goetas))
+- Xml namespaces improvements [\#644](https://github.com/schmittjoh/serializer/pull/644) ([goetas](https://github.com/goetas))
+
+**Fixed bugs:**
+
+- Serialize correctly empty intervals according to ISO-8601 [\#722](https://github.com/schmittjoh/serializer/pull/722) ([goetas](https://github.com/goetas))
+
+**Closed issues:**
+
+- Is it possible to achieve something like - shouldSerializeEmpty [\#725](https://github.com/schmittjoh/serializer/issues/725)
+- How to handle DateTime serialization with fromArray method ? [\#723](https://github.com/schmittjoh/serializer/issues/723)
+- DateInterval supported for serialization but not deserialization [\#720](https://github.com/schmittjoh/serializer/issues/720)
+- Deserialization of collection when wraped by aditional xml tags [\#719](https://github.com/schmittjoh/serializer/issues/719)
+- SerializedName based on a property value [\#716](https://github.com/schmittjoh/serializer/issues/716)
+- Blank XML breaks XmlDeserializationVisitor error handling [\#701](https://github.com/schmittjoh/serializer/issues/701)
+- Problem with FOSUserBundle ROLE serialization [\#690](https://github.com/schmittjoh/serializer/issues/690)
+- Doctrine cache dependency when using setCacheDir [\#676](https://github.com/schmittjoh/serializer/issues/676)
+- OneToOne entities are not deserialized if passing a nested one-to-one property [\#652](https://github.com/schmittjoh/serializer/issues/652)
+- \[RFC\] Serialization refacotring [\#609](https://github.com/schmittjoh/serializer/issues/609)
+- Object handler callback returns array, but serialized object = null [\#594](https://github.com/schmittjoh/serializer/issues/594)
+- Cannot add @Discriminator field into specific @Group [\#557](https://github.com/schmittjoh/serializer/issues/557)
+- Object check on SerializationContext::isVisiting\(\) [\#502](https://github.com/schmittjoh/serializer/issues/502)
+- Define cdata and namespace for @XmlList elements [\#480](https://github.com/schmittjoh/serializer/issues/480)
+- Serializer working with parent class [\#376](https://github.com/schmittjoh/serializer/issues/376)
+- Add support for array format [\#374](https://github.com/schmittjoh/serializer/issues/374)
+- Obtain VirtualProperty value using a service [\#359](https://github.com/schmittjoh/serializer/issues/359)
+- make deserialisation of non existing id's configurable [\#333](https://github.com/schmittjoh/serializer/issues/333)
+- HHVM compatibility issue with undefined property JMS\Serializer\Metadata\ClassMetadata::$inline [\#312](https://github.com/schmittjoh/serializer/issues/312)
+- resources serialization [\#275](https://github.com/schmittjoh/serializer/issues/275)
+- I'm receiving "Class ArrayCollection does not exist" when serializing \(temporarily solved with a workaround\) [\#274](https://github.com/schmittjoh/serializer/issues/274)
+- Can't use handlers on strings \(and other simple types\) [\#194](https://github.com/schmittjoh/serializer/issues/194)
+- composer.json update for doctrine [\#178](https://github.com/schmittjoh/serializer/issues/178)
+- Use expression for virtual properties [\#171](https://github.com/schmittjoh/serializer/issues/171)
+- Handle classes that implement collections \(e.g. ArrayObject\) and properties [\#137](https://github.com/schmittjoh/serializer/issues/137)
+- Check CDATA is needed [\#136](https://github.com/schmittjoh/serializer/issues/136)
+- property path support [\#22](https://github.com/schmittjoh/serializer/issues/22)
+
+**Merged pull requests:**
+
+- Include reference to cache [\#727](https://github.com/schmittjoh/serializer/pull/727) ([hyperized](https://github.com/hyperized))
+
+## [1.5.0](https://github.com/schmittjoh/serializer/tree/1.5.0) (2017-02-14)
+**Closed issues:**
+
+- Serialized DateTime instances are not valid ISO-8601 [\#713](https://github.com/schmittjoh/serializer/issues/713)
+- Impossible to use discriminator field. Why we need StaticPropertyMetadata ? [\#705](https://github.com/schmittjoh/serializer/issues/705)
+- Deserializing XMLList with Namespaces not \(always\) working as intended [\#695](https://github.com/schmittjoh/serializer/issues/695)
+
+## [1.5.0-RC1](https://github.com/schmittjoh/serializer/tree/1.5.0-RC1) (2017-01-19)
+**Implemented enhancements:**
+
+- added support for xml-attributes as discriminators [\#692](https://github.com/schmittjoh/serializer/pull/692) ([twtinteractive](https://github.com/twtinteractive))
+- Added clearing previous libxml errors [\#688](https://github.com/schmittjoh/serializer/pull/688) ([zerkms](https://github.com/zerkms))
+- Prevent doctrine proxy loading for virtual types [\#684](https://github.com/schmittjoh/serializer/pull/684) ([goetas](https://github.com/goetas))
+- Implemented dynamic exclusion using symfony expression language [\#673](https://github.com/schmittjoh/serializer/pull/673) ([goetas](https://github.com/goetas))
+
+**Fixed bugs:**
+
+- Deserializing XMLList with Namespaces not \(always\) working as intended [\#697](https://github.com/schmittjoh/serializer/pull/697) ([goetas](https://github.com/goetas))
+
+**Closed issues:**
+
+- Groups logic [\#693](https://github.com/schmittjoh/serializer/issues/693)
+- BC from 1.1.\* to ^1.2 [\#643](https://github.com/schmittjoh/serializer/issues/643)
+- DoctrineProxySubscriber forces loading of the proxy even if custom handler exist [\#575](https://github.com/schmittjoh/serializer/issues/575)
+- ConditionalExpose/Exclude annotation [\#540](https://github.com/schmittjoh/serializer/issues/540)
+- Deprecated usage of ValidatorInterface [\#438](https://github.com/schmittjoh/serializer/issues/438)
+- Missing addData in XmlSerializerVisitor makes it impossible to add data in serializer.post\_serialize event [\#235](https://github.com/schmittjoh/serializer/issues/235)
+- Support JSON PATCH for updating object graph [\#231](https://github.com/schmittjoh/serializer/issues/231)
+- Dynamic expose, aka 'fields' query param [\#195](https://github.com/schmittjoh/serializer/issues/195)
+
+**Merged pull requests:**
+
+- Added doc reference for disabling discriminator [\#699](https://github.com/schmittjoh/serializer/pull/699) ([dragosprotung](https://github.com/dragosprotung))
+- Use GroupsExclusionStrategy::DEFAULT\_GROUP instead default group. [\#694](https://github.com/schmittjoh/serializer/pull/694) ([Aliance](https://github.com/Aliance))
+- A possible fix for the \#688 [\#689](https://github.com/schmittjoh/serializer/pull/689) ([zerkms](https://github.com/zerkms))
+- Improved Symfony 3.x compatibility [\#682](https://github.com/schmittjoh/serializer/pull/682) ([goetas](https://github.com/goetas))
+
+## [1.4.2](https://github.com/schmittjoh/serializer/tree/1.4.2) (2016-11-13)
+**Fixed bugs:**
+
+- Warning: JMS\Serializer\XmlDeserializationVisitor::visitArray\(\): Node no longer exists [\#674](https://github.com/schmittjoh/serializer/issues/674)
+- Fixed xml arrays with namespaced entry triggers error [\#675](https://github.com/schmittjoh/serializer/pull/675) ([goetas](https://github.com/goetas))
+
+**Closed issues:**
+
+- Max depth produces array of nulls [\#671](https://github.com/schmittjoh/serializer/issues/671)
+
+## [1.4.1](https://github.com/schmittjoh/serializer/tree/1.4.1) (2016-11-02)
+**Fixed bugs:**
+
+- Groups context might be not initialized [\#669](https://github.com/schmittjoh/serializer/pull/669) ([goetas](https://github.com/goetas))
+
+**Closed issues:**
+
+- Warning: Invalid argument supplied for foreach\(\) on getCurrentPath method [\#668](https://github.com/schmittjoh/serializer/issues/668)
+
+## [1.4.0](https://github.com/schmittjoh/serializer/tree/1.4.0) (2016-10-31)
+**Implemented enhancements:**
+
+- Document the implied 'Default' property group when no group is specified [\#661](https://github.com/schmittjoh/serializer/pull/661) ([akoebbe](https://github.com/akoebbe))
+- Allow discriminator map in the middle of the hierarchy when deserializing [\#659](https://github.com/schmittjoh/serializer/pull/659) ([goetas](https://github.com/goetas))
+- Handle both int and integer [\#657](https://github.com/schmittjoh/serializer/pull/657) ([Aliance](https://github.com/Aliance))
+
+**Fixed bugs:**
+
+- Deserialization fails when discriminator base class extends another class [\#182](https://github.com/schmittjoh/serializer/issues/182)
+- Xml setters ignored when deserializing [\#665](https://github.com/schmittjoh/serializer/pull/665) ([goetas](https://github.com/goetas))
+
+**Closed issues:**
+
+- Move `FormErrorHandler` to the bundle [\#664](https://github.com/schmittjoh/serializer/issues/664)
+- Not compatible with Symfony 3's Controller::json\(\) [\#663](https://github.com/schmittjoh/serializer/issues/663)
+- Class name not reflecting in serialized json [\#662](https://github.com/schmittjoh/serializer/issues/662)
+- YML virtual\_properties no group exlcusion [\#656](https://github.com/schmittjoh/serializer/issues/656)
+- \[RFC\] Introduce normalizer\denormalizer interface [\#646](https://github.com/schmittjoh/serializer/issues/646)
+- Plain arrays are serialized \(normalized\) as "objects", ignoring serializeNull [\#641](https://github.com/schmittjoh/serializer/issues/641)
+- serializer doesn't serialize traits [\#638](https://github.com/schmittjoh/serializer/issues/638)
+- Add metadata informations [\#637](https://github.com/schmittjoh/serializer/issues/637)
+- Unexpected results when serializing arrays containing null value elements [\#593](https://github.com/schmittjoh/serializer/issues/593)
+- Allow to set default serialization context when building serializer [\#528](https://github.com/schmittjoh/serializer/issues/528)
+- Enable Sourcegraph [\#455](https://github.com/schmittjoh/serializer/issues/455)
+- Use different accessor for each group [\#420](https://github.com/schmittjoh/serializer/issues/420)
+- GenericSerializationVisitor and shouldSerializeNull [\#360](https://github.com/schmittjoh/serializer/issues/360)
+- Specify group along with MaxDepth [\#150](https://github.com/schmittjoh/serializer/issues/150)
+- Allow Post Serialize Event to overwrite existing data [\#129](https://github.com/schmittjoh/serializer/issues/129)
+- Warning: array\_key\_exists\(\) expects parameter 2 to be array, string given [\#70](https://github.com/schmittjoh/serializer/issues/70)
+
+**Merged pull requests:**
+
+- Nullable array inconsistency [\#660](https://github.com/schmittjoh/serializer/pull/660) ([goetas](https://github.com/goetas))
+- Fixed PHP 7.0.11 BC break \(or bugfix\) [\#658](https://github.com/schmittjoh/serializer/pull/658) ([goetas](https://github.com/goetas))
+- Renamed replaceData to setData [\#653](https://github.com/schmittjoh/serializer/pull/653) ([goetas](https://github.com/goetas))
+- add required sqlite extension for developing [\#649](https://github.com/schmittjoh/serializer/pull/649) ([scasei](https://github.com/scasei))
+- Run serialization benchmarks in the build process [\#647](https://github.com/schmittjoh/serializer/pull/647) ([goetas](https://github.com/goetas))
+- Alcalyn feature default serializer context [\#645](https://github.com/schmittjoh/serializer/pull/645) ([goetas](https://github.com/goetas))
+- Add format output option [\#640](https://github.com/schmittjoh/serializer/pull/640) ([AyrtonRicardo](https://github.com/AyrtonRicardo))
+- Remove deprecated FileCacheReader for doctrine annotations [\#634](https://github.com/schmittjoh/serializer/pull/634) ([goetas](https://github.com/goetas))
+- Added tests to ensure SerializeNull policy [\#633](https://github.com/schmittjoh/serializer/pull/633) ([goetas](https://github.com/goetas))
+- Fix inheritance of discriminators on Doctrine entities [\#382](https://github.com/schmittjoh/serializer/pull/382) ([xoob](https://github.com/xoob))
+- Allow Post Serialize Event to overwrite existing data [\#273](https://github.com/schmittjoh/serializer/pull/273) ([jockri](https://github.com/jockri))
+
+## [1.3.1](https://github.com/schmittjoh/serializer/tree/1.3.1) (2016-08-23)
+**Closed issues:**
+
+- \[Idea\] Inline name [\#629](https://github.com/schmittjoh/serializer/issues/629)
+- indexBy property doesn't work since 1.2.0 [\#618](https://github.com/schmittjoh/serializer/issues/618)
+- Composer deps issue [\#494](https://github.com/schmittjoh/serializer/issues/494)
+- PHP 7 compatability issue [\#478](https://github.com/schmittjoh/serializer/issues/478)
+- Add new tag \(upgrade packagist\) [\#461](https://github.com/schmittjoh/serializer/issues/461)
+- Custom Type Handler for String Values [\#384](https://github.com/schmittjoh/serializer/issues/384)
+- serializer ignores properties added by traits [\#313](https://github.com/schmittjoh/serializer/issues/313)
+- Skip an element during Xml deserialization process [\#229](https://github.com/schmittjoh/serializer/issues/229)
+- Using serializer for JSON serialising [\#223](https://github.com/schmittjoh/serializer/issues/223)
+- No way to serialize binary data with a custom type [\#202](https://github.com/schmittjoh/serializer/issues/202)
+- Automatic mapping of properties [\#200](https://github.com/schmittjoh/serializer/issues/200)
+- Maybe the serializer should also allow the legal literals {1, 0} for booleans [\#198](https://github.com/schmittjoh/serializer/issues/198)
+- Customize how Booleans are serialized [\#180](https://github.com/schmittjoh/serializer/issues/180)
+- Problem with deserialize related entity [\#123](https://github.com/schmittjoh/serializer/issues/123)
+- serialized\_name does not work in yaml [\#118](https://github.com/schmittjoh/serializer/issues/118)
+
+**Merged pull requests:**
+
+- Revert "Default `$serializeNull` to false" [\#630](https://github.com/schmittjoh/serializer/pull/630) ([goetas](https://github.com/goetas))
+
+## [1.3.0](https://github.com/schmittjoh/serializer/tree/1.3.0) (2016-08-17)
+**Closed issues:**
+
+- problems with xml namespaces after update [\#621](https://github.com/schmittjoh/serializer/issues/621)
+- Trying to decorate a member to ArrayCollection but gets an error when deserilizing because composer didn't download the class from doctrine. [\#596](https://github.com/schmittjoh/serializer/issues/596)
+- Missing doctrine/common requirement ? [\#517](https://github.com/schmittjoh/serializer/issues/517)
+- PHP Fatal error: Using $this when not in object context in JMS/Serializer/Serializer.php on line 99 [\#441](https://github.com/schmittjoh/serializer/issues/441)
+- custom collection handler [\#415](https://github.com/schmittjoh/serializer/issues/415)
+- Exclude annotation not preventing attempt to find public methods when using AccessType [\#367](https://github.com/schmittjoh/serializer/issues/367)
+- serializer.pre\_serialize event only thrown on objects/classes [\#337](https://github.com/schmittjoh/serializer/issues/337)
+- Installing through composer gets "Segmentation fault" [\#308](https://github.com/schmittjoh/serializer/issues/308)
+- Erroneous data format for unserializing... [\#283](https://github.com/schmittjoh/serializer/issues/283)
+- DoctrineObjectConstructor should skip empty identifier field [\#193](https://github.com/schmittjoh/serializer/issues/193)
+
+**Merged pull requests:**
+
+- Added public `hasData` function to check if a data key already have been added. [\#625](https://github.com/schmittjoh/serializer/pull/625) ([goetas](https://github.com/goetas))
+- $context is not used [\#622](https://github.com/schmittjoh/serializer/pull/622) ([olvlvl](https://github.com/olvlvl))
+- Fix Doctrine PHPCR ODM 2.0 compatibility [\#605](https://github.com/schmittjoh/serializer/pull/605) ([wouterj](https://github.com/wouterj))
+- Introducing NormalizerInterface [\#592](https://github.com/schmittjoh/serializer/pull/592) ([alcalyn](https://github.com/alcalyn))
+- Fixed type-hinting [\#586](https://github.com/schmittjoh/serializer/pull/586) ([jgendera](https://github.com/jgendera))
+- Fix multiple handler callbacks in YamlDriver [\#515](https://github.com/schmittjoh/serializer/pull/515) ([mpajunen](https://github.com/mpajunen))
+- Fixed minor typos [\#364](https://github.com/schmittjoh/serializer/pull/364) ([sdaoudi](https://github.com/sdaoudi))
+- Default `$serializeNull` to false [\#317](https://github.com/schmittjoh/serializer/pull/317) ([steveYeah](https://github.com/steveYeah))
+- Missing attribute 'xml-value' in XML Reference [\#269](https://github.com/schmittjoh/serializer/pull/269) ([holtkamp](https://github.com/holtkamp))
+- Removed unnecessary use statement [\#262](https://github.com/schmittjoh/serializer/pull/262) ([dunglas](https://github.com/dunglas))
+
+## [1.2.0](https://github.com/schmittjoh/serializer/tree/1.2.0) (2016-08-03)
+**Implemented enhancements:**
+
+- Issue543 - Adding DateTimeImmutable support [\#635](https://github.com/schmittjoh/serializer/pull/635) ([toby-griffiths](https://github.com/toby-griffiths))
+
+**Fixed bugs:**
+
+- Fix xml-attribute-map for the xml driver [\#595](https://github.com/schmittjoh/serializer/pull/595) ([romantomchak](https://github.com/romantomchak))
+- Fix warning array\_key\_exists in deserialization. [\#398](https://github.com/schmittjoh/serializer/pull/398) ([leonnleite](https://github.com/leonnleite))
+- \#367 Exclude annotation not preventing attempt to find public methods when using AccessType [\#397](https://github.com/schmittjoh/serializer/pull/397) ([Strate](https://github.com/Strate))
+
+**Closed issues:**
+
+- XML serialisation performance vs. SimpleXML? [\#606](https://github.com/schmittjoh/serializer/issues/606)
+- Undefined Offset 21 - PropertyMetadata \(master\) [\#581](https://github.com/schmittjoh/serializer/issues/581)
+- Invalid null serialization in arrays [\#571](https://github.com/schmittjoh/serializer/issues/571)
+- List Polymorphic with XML Deserialization [\#568](https://github.com/schmittjoh/serializer/issues/568)
+- Serialize null values as empty string [\#566](https://github.com/schmittjoh/serializer/issues/566)
+- Type mismatch should throw an exception instead of coercing when deserializing JSON [\#561](https://github.com/schmittjoh/serializer/issues/561)
+- Serialize to array [\#518](https://github.com/schmittjoh/serializer/issues/518)
+- AnnotationDriver Exception on Missing Setter/Getter even on @Exclude'd Properties [\#516](https://github.com/schmittjoh/serializer/issues/516)
+- Arrays are serialized as objects like {"0":... } when data contains empty objects [\#488](https://github.com/schmittjoh/serializer/issues/488)
+- Tag new release [\#465](https://github.com/schmittjoh/serializer/issues/465)
+- Forcing no scientific notation for larg number, type double [\#405](https://github.com/schmittjoh/serializer/issues/405)
+- PHP \< 5.3.9 BC break [\#383](https://github.com/schmittjoh/serializer/issues/383)
+- Ignoring a tag when deserializing [\#352](https://github.com/schmittjoh/serializer/issues/352)
+
+**Merged pull requests:**
+
+- Allow to not skip empty not inline array root node [\#611](https://github.com/schmittjoh/serializer/pull/611) ([goetas](https://github.com/goetas))
+- Allow to use custom serializer with primitive type [\#610](https://github.com/schmittjoh/serializer/pull/610) ([goetas](https://github.com/goetas))
+- Composer is not able to resolve a dependency [\#608](https://github.com/schmittjoh/serializer/pull/608) ([goetas](https://github.com/goetas))
+- Test on Travis always high and low deps [\#584](https://github.com/schmittjoh/serializer/pull/584) ([goetas](https://github.com/goetas))
+- Update Symfony validator and allow PHPUnit 7 [\#583](https://github.com/schmittjoh/serializer/pull/583) ([goetas](https://github.com/goetas))
+- Fix serialize bug [\#582](https://github.com/schmittjoh/serializer/pull/582) ([goetas](https://github.com/goetas))
+- HHVM compatibility [\#580](https://github.com/schmittjoh/serializer/pull/580) ([goetas](https://github.com/goetas))
+- Discriminator Groups [\#579](https://github.com/schmittjoh/serializer/pull/579) ([maennchen](https://github.com/maennchen))
+- Fixed test suite on master [\#578](https://github.com/schmittjoh/serializer/pull/578) ([goetas](https://github.com/goetas))
+- Fix for a broken test: a missing \(incorrectly positioned\) argument [\#577](https://github.com/schmittjoh/serializer/pull/577) ([zerkms](https://github.com/zerkms))
+- Add extra test for handling child elements [\#569](https://github.com/schmittjoh/serializer/pull/569) ([tarjei](https://github.com/tarjei))
+- Fix bug \#343 return integer when the column is datetime [\#562](https://github.com/schmittjoh/serializer/pull/562) ([Bukashk0zzz](https://github.com/Bukashk0zzz))
+- \[doc\] fix AccessorOrder documentation [\#553](https://github.com/schmittjoh/serializer/pull/553) ([aledeg](https://github.com/aledeg))
+- Generic way to solve setValue on a property which respects its setter [\#550](https://github.com/schmittjoh/serializer/pull/550) ([maennchen](https://github.com/maennchen))
+- Added travis-ci label [\#399](https://github.com/schmittjoh/serializer/pull/399) ([spolischook](https://github.com/spolischook))
+- Generate namespaced element on XmlList entries [\#301](https://github.com/schmittjoh/serializer/pull/301) ([goetas](https://github.com/goetas))
+
+## [1.1.0](https://github.com/schmittjoh/serializer/tree/1.1.0) (2015-10-27)
+**Closed issues:**
+
+- Possible to set xsi:schemalocation? [\#505](https://github.com/schmittjoh/serializer/issues/505)
+- Travis needs a renewed token to be able to set the status [\#495](https://github.com/schmittjoh/serializer/issues/495)
+- Serialize a many-to-many relation [\#474](https://github.com/schmittjoh/serializer/issues/474)
+- The document type "..." is not allowed [\#427](https://github.com/schmittjoh/serializer/issues/427)
+- Yml serializer don't serialize empty arrays [\#183](https://github.com/schmittjoh/serializer/issues/183)
+
+**Merged pull requests:**
+
+- Manage empty array for serializer [\#510](https://github.com/schmittjoh/serializer/pull/510) ([Soullivaneuh](https://github.com/Soullivaneuh))
+- Fix the method name for the serialization context factory [\#490](https://github.com/schmittjoh/serializer/pull/490) ([stof](https://github.com/stof))
+- Switch the Twig integration to use non-deprecated APIs [\#482](https://github.com/schmittjoh/serializer/pull/482) ([stof](https://github.com/stof))
+- Add PHP 7 on Travis [\#477](https://github.com/schmittjoh/serializer/pull/477) ([Soullivaneuh](https://github.com/Soullivaneuh))
+- Change Proxy class used to Doctrine\Common\Persistence\Proxy [\#351](https://github.com/schmittjoh/serializer/pull/351) ([bburnichon](https://github.com/bburnichon))
+- Added PHP 5.6 [\#297](https://github.com/schmittjoh/serializer/pull/297) ([Nyholm](https://github.com/Nyholm))
+
+## [1.0.0](https://github.com/schmittjoh/serializer/tree/1.0.0) (2015-06-16)
+**Closed issues:**
+
+- Unrecognized 4 parts namespace [\#449](https://github.com/schmittjoh/serializer/issues/449)
+- Groups is ignored [\#440](https://github.com/schmittjoh/serializer/issues/440)
+- Property FelDev\CoreBundle\Entity\Persona::$apellido does not exist [\#432](https://github.com/schmittjoh/serializer/issues/432)
+- Erroneous data format for unserializing [\#430](https://github.com/schmittjoh/serializer/issues/430)
+- Deserialize JSON into existing Doctrine entities and empty strings are ignored [\#417](https://github.com/schmittjoh/serializer/issues/417)
+- Failing to deserealize JSON string [\#402](https://github.com/schmittjoh/serializer/issues/402)
+- Empty results serializing virtual\_properties [\#400](https://github.com/schmittjoh/serializer/issues/400)
+- API stable 1.0.0 release in sight? [\#395](https://github.com/schmittjoh/serializer/issues/395)
+- Is this project maintained still? [\#361](https://github.com/schmittjoh/serializer/issues/361)
+- PreSerialize [\#339](https://github.com/schmittjoh/serializer/issues/339)
+- Change default `access\_type` globally [\#336](https://github.com/schmittjoh/serializer/issues/336)
+- Deserialization of XmlList does not support namespaces [\#332](https://github.com/schmittjoh/serializer/issues/332)
+- Recursion groups, serializing properties in entities [\#329](https://github.com/schmittjoh/serializer/issues/329)
+- The testsuite is broken [\#326](https://github.com/schmittjoh/serializer/issues/326)
+- Namespaces and serialize/deserialize process [\#303](https://github.com/schmittjoh/serializer/issues/303)
+- Exclusion of parent properties failing [\#282](https://github.com/schmittjoh/serializer/issues/282)
+- How to deserialize correctly an array of arbitrary values ? [\#280](https://github.com/schmittjoh/serializer/issues/280)
+- Try to identify getter/setter from an excluded property [\#278](https://github.com/schmittjoh/serializer/issues/278)
+- Bug Entity constructor not called [\#270](https://github.com/schmittjoh/serializer/issues/270)
+- Make it possible to escape special characters on serialization [\#265](https://github.com/schmittjoh/serializer/issues/265)
+- doctrine annotations without namespace [\#264](https://github.com/schmittjoh/serializer/issues/264)
+- php-collection constraint [\#257](https://github.com/schmittjoh/serializer/issues/257)
+- \[Metadata\] PHP warning only when unittesting [\#255](https://github.com/schmittjoh/serializer/issues/255)
+- Discriminator [\#220](https://github.com/schmittjoh/serializer/issues/220)
+
+**Merged pull requests:**
+
+- fix json output \(from \[\] to {} if empty\) of form error [\#462](https://github.com/schmittjoh/serializer/pull/462) ([jhkchan](https://github.com/jhkchan))
+- Add toArray and fromArray methods to the serializer [\#435](https://github.com/schmittjoh/serializer/pull/435) ([tystr](https://github.com/tystr))
+- Erroneous data format for unserializing \#430 [\#431](https://github.com/schmittjoh/serializer/pull/431) ([tmilos](https://github.com/tmilos))
+- Scrutinizer Auto-Fixes [\#381](https://github.com/schmittjoh/serializer/pull/381) ([scrutinizer-auto-fixer](https://github.com/scrutinizer-auto-fixer))
+- Fixing tests for bugfixed PHP versions [\#375](https://github.com/schmittjoh/serializer/pull/375) ([urakozz](https://github.com/urakozz))
+- Making test running against phpunit 4.\* [\#369](https://github.com/schmittjoh/serializer/pull/369) ([joelwurtz](https://github.com/joelwurtz))
+- Fixes a typo in the annotations.rst [\#363](https://github.com/schmittjoh/serializer/pull/363) ([Potherca](https://github.com/Potherca))
+- \[doc\] Default group informations [\#345](https://github.com/schmittjoh/serializer/pull/345) ([emilien-puget](https://github.com/emilien-puget))
+- bump branch alias to 0.17 as 0.16 is already released [\#305](https://github.com/schmittjoh/serializer/pull/305) ([lsmith77](https://github.com/lsmith77))
+- Unserialization of XML booleans [\#302](https://github.com/schmittjoh/serializer/pull/302) ([goetas](https://github.com/goetas))
+- Added xml\_root\_namespace on YAML reference [\#299](https://github.com/schmittjoh/serializer/pull/299) ([goetas](https://github.com/goetas))
+- Fixed yml mapping file name [\#256](https://github.com/schmittjoh/serializer/pull/256) ([spolischook](https://github.com/spolischook))
+- Serialization of nested polymorphic objects [\#238](https://github.com/schmittjoh/serializer/pull/238) ([DavidMikeSimon](https://github.com/DavidMikeSimon))
+
+## [0.16.0](https://github.com/schmittjoh/serializer/tree/0.16.0) (2014-03-18)
+**Closed issues:**
+
+- best way to add root to json? [\#250](https://github.com/schmittjoh/serializer/issues/250)
+- Use Doctrine metadata [\#247](https://github.com/schmittjoh/serializer/issues/247)
+- Integration Points - run-time exclusion checking [\#239](https://github.com/schmittjoh/serializer/issues/239)
+- Using DoctrineTypeDriver to use Doctrine Anotations [\#232](https://github.com/schmittjoh/serializer/issues/232)
+
+**Merged pull requests:**
+
+- Changed some constraint to allow latest versions [\#251](https://github.com/schmittjoh/serializer/pull/251) ([stof](https://github.com/stof))
+- XML root element namespace support [\#246](https://github.com/schmittjoh/serializer/pull/246) ([andreasferber](https://github.com/andreasferber))
+- Added test for leading backslash in front of class name to TypeParserTest [\#245](https://github.com/schmittjoh/serializer/pull/245) ([deralex](https://github.com/deralex))
+- Allow to fetch data from has\*\(\) with public\_method [\#243](https://github.com/schmittjoh/serializer/pull/243) ([jaymecd](https://github.com/jaymecd))
+- Improve yaml documentacion Fix \#100 [\#221](https://github.com/schmittjoh/serializer/pull/221) ([BraisGabin](https://github.com/BraisGabin))
+
+## [0.15.0](https://github.com/schmittjoh/serializer/tree/0.15.0) (2014-02-10)
+**Closed issues:**
+
+- Add trait support [\#228](https://github.com/schmittjoh/serializer/issues/228)
+- "array" type: Not working for arrays of DateTime objects [\#199](https://github.com/schmittjoh/serializer/issues/199)
+- Discriminator field filtered by exclusion strategy [\#189](https://github.com/schmittjoh/serializer/issues/189)
+- DateTime within an array \(format get ignored\) [\#140](https://github.com/schmittjoh/serializer/issues/140)
+- EntityNotFoundException using softDeletable [\#101](https://github.com/schmittjoh/serializer/issues/101)
+- Virtual property documentation xml & yaml [\#100](https://github.com/schmittjoh/serializer/issues/100)
+
+**Merged pull requests:**
+
+- Read only class [\#227](https://github.com/schmittjoh/serializer/pull/227) ([goetas](https://github.com/goetas))
+- @Alex88's Serialize only form child of type Form \#117 [\#224](https://github.com/schmittjoh/serializer/pull/224) ([minayaserrano](https://github.com/minayaserrano))
+- @XmlElement notation consistency [\#219](https://github.com/schmittjoh/serializer/pull/219) ([ajgarlag](https://github.com/ajgarlag))
+- add $this-\>maxDepth to serialize / unserialize [\#218](https://github.com/schmittjoh/serializer/pull/218) ([rothfahl](https://github.com/rothfahl))
+- xml reference updated with virtual-property example [\#215](https://github.com/schmittjoh/serializer/pull/215) ([ribeiropaulor](https://github.com/ribeiropaulor))
+- Add XmlNamespace annotation documentation [\#213](https://github.com/schmittjoh/serializer/pull/213) ([jeserkin](https://github.com/jeserkin))
+- Scrutinizer Auto-Fixes [\#210](https://github.com/schmittjoh/serializer/pull/210) ([scrutinizer-auto-fixer](https://github.com/scrutinizer-auto-fixer))
+- Scrutinizer Auto-Fixes [\#206](https://github.com/schmittjoh/serializer/pull/206) ([scrutinizer-auto-fixer](https://github.com/scrutinizer-auto-fixer))
+- Add xmlAttributeMap to serialized values [\#204](https://github.com/schmittjoh/serializer/pull/204) ([colinfrei](https://github.com/colinfrei))
+- fix issue \#199: "array" type ignoring DateTime format [\#201](https://github.com/schmittjoh/serializer/pull/201) ([lukey78](https://github.com/lukey78))
+- Potential fix for "recursion detected" issue [\#104](https://github.com/schmittjoh/serializer/pull/104) ([tyler-sommer](https://github.com/tyler-sommer))
+
+## [0.14.0](https://github.com/schmittjoh/serializer/tree/0.14.0) (2013-12-04)
+**Implemented enhancements:**
+
+- Can now override groups on specific paths of the graph [\#170](https://github.com/schmittjoh/serializer/pull/170) ([adrienbrault](https://github.com/adrienbrault))
+
+**Closed issues:**
+
+- @HandlerCallback not inherited [\#181](https://github.com/schmittjoh/serializer/issues/181)
+- Conditional serialization [\#173](https://github.com/schmittjoh/serializer/issues/173)
+- Deserialize XML partially [\#167](https://github.com/schmittjoh/serializer/issues/167)
+- getter is not called when serializing Discriminator parent entity [\#156](https://github.com/schmittjoh/serializer/issues/156)
+- Deserialize DateTime from js Date.toJSON format fail [\#145](https://github.com/schmittjoh/serializer/issues/145)
+- Yaml driver for the parameter xml\_attribute\_map is broken [\#141](https://github.com/schmittjoh/serializer/issues/141)
+- XmlKeyValueStore annotation does not seem to deserialize properly [\#139](https://github.com/schmittjoh/serializer/issues/139)
+- Boolean conversion gone wrong [\#134](https://github.com/schmittjoh/serializer/issues/134)
+- Serialize to/from array? [\#133](https://github.com/schmittjoh/serializer/issues/133)
+- @XmlRoot annotation no longer working [\#131](https://github.com/schmittjoh/serializer/issues/131)
+- Skip an element based on a condition in a XmlList [\#121](https://github.com/schmittjoh/serializer/issues/121)
+
+**Merged pull requests:**
+
+- No CData [\#187](https://github.com/schmittjoh/serializer/pull/187) ([mvrhov](https://github.com/mvrhov))
+- composer is preinstalled on travis [\#185](https://github.com/schmittjoh/serializer/pull/185) ([lsmith77](https://github.com/lsmith77))
+- \[WIP\] added support for PHPCR [\#184](https://github.com/schmittjoh/serializer/pull/184) ([lsmith77](https://github.com/lsmith77))
+- Metadata filename convention added to yml/xml references [\#172](https://github.com/schmittjoh/serializer/pull/172) ([rodrigodiez](https://github.com/rodrigodiez))
+- Fix inline bug with empty child [\#165](https://github.com/schmittjoh/serializer/pull/165) ([adrienbrault](https://github.com/adrienbrault))
+- Add virtual properties yaml example [\#163](https://github.com/schmittjoh/serializer/pull/163) ([adrienbrault](https://github.com/adrienbrault))
+- Allow deserialization to constructed objects [\#160](https://github.com/schmittjoh/serializer/pull/160) ([eugene-dounar](https://github.com/eugene-dounar))
+- Fix DoctrineDriverTest random failures [\#155](https://github.com/schmittjoh/serializer/pull/155) ([eugene-dounar](https://github.com/eugene-dounar))
+- Fix XML null DateTime deserialization [\#154](https://github.com/schmittjoh/serializer/pull/154) ([eugene-dounar](https://github.com/eugene-dounar))
+- Update doctrine/orm dev dependency [\#153](https://github.com/schmittjoh/serializer/pull/153) ([eugene-dounar](https://github.com/eugene-dounar))
+- composer install --dev fails [\#152](https://github.com/schmittjoh/serializer/pull/152) ([eugene-dounar](https://github.com/eugene-dounar))
+- Update annotations.rst [\#146](https://github.com/schmittjoh/serializer/pull/146) ([chrisjohnson00](https://github.com/chrisjohnson00))
+- Add Doctrine\ODM\PHPCR\ChildrenCollection to ArrayCollectionHandler [\#143](https://github.com/schmittjoh/serializer/pull/143) ([hacfi](https://github.com/hacfi))
+- xml\_attribute\_map fix for the yaml driver [\#142](https://github.com/schmittjoh/serializer/pull/142) ([mvanmeerbeck](https://github.com/mvanmeerbeck))
+- Support PropelCollection serialization [\#81](https://github.com/schmittjoh/serializer/pull/81) ([zebraf1](https://github.com/zebraf1))
+- Adds XML namespaces support [\#58](https://github.com/schmittjoh/serializer/pull/58) ([ajgarlag](https://github.com/ajgarlag))
+
+## [0.13.0](https://github.com/schmittjoh/serializer/tree/0.13.0) (2013-07-29)
+**Closed issues:**
+
+- Documentation on Exclusion Strategies has an error [\#122](https://github.com/schmittjoh/serializer/issues/122)
+- How access to the current serializing group in a subscriber ? [\#99](https://github.com/schmittjoh/serializer/issues/99)
+- DoctrineProxySubscriber not found [\#93](https://github.com/schmittjoh/serializer/issues/93)
+- Namespaces at root level [\#86](https://github.com/schmittjoh/serializer/issues/86)
+- Issues when requesting JSON or XML using Doctrine MongoDB ODM [\#85](https://github.com/schmittjoh/serializer/issues/85)
+- addGlobalIgnoredName not working [\#78](https://github.com/schmittjoh/serializer/issues/78)
+- serialize\_null configuration [\#77](https://github.com/schmittjoh/serializer/issues/77)
+- Add json prefix to prevent script tag csrf attack [\#76](https://github.com/schmittjoh/serializer/issues/76)
+- Add support for replacing serialization object inside events [\#74](https://github.com/schmittjoh/serializer/issues/74)
+- Next stable version? [\#64](https://github.com/schmittjoh/serializer/issues/64)
+- Deserialize with object refs [\#62](https://github.com/schmittjoh/serializer/issues/62)
+
+**Merged pull requests:**
+
+- fix wrong quote in used in docs [\#130](https://github.com/schmittjoh/serializer/pull/130) ([jaapio](https://github.com/jaapio))
+- Document the handler $context argument [\#116](https://github.com/schmittjoh/serializer/pull/116) ([adrienbrault](https://github.com/adrienbrault))
+- Document the SubscribingHandlerInterface a bit [\#115](https://github.com/schmittjoh/serializer/pull/115) ([adrienbrault](https://github.com/adrienbrault))
+- Add getter for the xml serialization visitor defaultRootName property [\#114](https://github.com/schmittjoh/serializer/pull/114) ([adrienbrault](https://github.com/adrienbrault))
+- Add Serializer::getMetadataFactory [\#113](https://github.com/schmittjoh/serializer/pull/113) ([adrienbrault](https://github.com/adrienbrault))
+- Accessor order [\#108](https://github.com/schmittjoh/serializer/pull/108) ([jaapio](https://github.com/jaapio))
+- Added xmlns:xsi namespace and fixed tests [\#107](https://github.com/schmittjoh/serializer/pull/107) ([josser](https://github.com/josser))
+- \[Doc\] Fixed typo in event\_system [\#106](https://github.com/schmittjoh/serializer/pull/106) ([lyrixx](https://github.com/lyrixx))
+- Fix discriminator map search in ClassMetadata [\#97](https://github.com/schmittjoh/serializer/pull/97) ([xanido](https://github.com/xanido))
+- Use the AnnotationReader interface in the SerializerBuilder, instead of the implemented AnnotationReader itself [\#82](https://github.com/schmittjoh/serializer/pull/82) ([HarmenM](https://github.com/HarmenM))
+- Remove useless YamlSerializationVisitor::prepare method [\#75](https://github.com/schmittjoh/serializer/pull/75) ([adrienbrault](https://github.com/adrienbrault))
+- Add the PRE\_DESERIALIZE event to the Events class [\#73](https://github.com/schmittjoh/serializer/pull/73) ([adrienbrault](https://github.com/adrienbrault))
+- Improve serialization example [\#71](https://github.com/schmittjoh/serializer/pull/71) ([tvlooy](https://github.com/tvlooy))
+- Max depth strategy [\#4](https://github.com/schmittjoh/serializer/pull/4) ([adrienbrault](https://github.com/adrienbrault))
+
+## [0.12.0](https://github.com/schmittjoh/serializer/tree/0.12.0) (2013-03-28)
+**Closed issues:**
+
+- Serialization profile/definition builder [\#68](https://github.com/schmittjoh/serializer/issues/68)
+- I want to configure the default exclution policy [\#65](https://github.com/schmittjoh/serializer/issues/65)
+- Mulit type property mapping [\#56](https://github.com/schmittjoh/serializer/issues/56)
+- AccessType\("public\_method"\): Setters ignored when deserializing to non-standard XML properties [\#53](https://github.com/schmittjoh/serializer/issues/53)
+- Adding @Accessor with custom getter causes LogicException if Doctrine ManyToOneEntity [\#52](https://github.com/schmittjoh/serializer/issues/52)
+- Handler callback's does not get passed context [\#49](https://github.com/schmittjoh/serializer/issues/49)
+- PostSerialize callback causes data loss [\#46](https://github.com/schmittjoh/serializer/issues/46)
+- Empty Objects get serialized as "array\(\)" [\#43](https://github.com/schmittjoh/serializer/issues/43)
+- Exclusion Policies aren't properly applied when "serializeNull" is "true" [\#42](https://github.com/schmittjoh/serializer/issues/42)
+- Accessor annotation ignored [\#40](https://github.com/schmittjoh/serializer/issues/40)
+- Support for multiple exclusion strategies [\#39](https://github.com/schmittjoh/serializer/issues/39)
+- srholt123@yahoo.com [\#35](https://github.com/schmittjoh/serializer/issues/35)
+- Could you tag a stable version? [\#34](https://github.com/schmittjoh/serializer/issues/34)
+- Default conversion of camelCase to underscores is counterintuitive [\#33](https://github.com/schmittjoh/serializer/issues/33)
+- Define the xml root when deserializing [\#18](https://github.com/schmittjoh/serializer/issues/18)
+
+**Merged pull requests:**
+
+- \[Annotation\] Added the ability to set the type when using @VirtualProperty [\#69](https://github.com/schmittjoh/serializer/pull/69) ([pylebecq](https://github.com/pylebecq))
+- Added documentation for the @VirtualProperty annotation [\#67](https://github.com/schmittjoh/serializer/pull/67) ([pylebecq](https://github.com/pylebecq))
+- Metadata stack tests [\#57](https://github.com/schmittjoh/serializer/pull/57) ([adrienbrault](https://github.com/adrienbrault))
+- Adding context to twig extension [\#55](https://github.com/schmittjoh/serializer/pull/55) ([smurfy](https://github.com/smurfy))
+- Allow deserialization of polymorphic classes by class without specifying the type [\#48](https://github.com/schmittjoh/serializer/pull/48) ([gordalina](https://github.com/gordalina))
+- Moves all state to dedicated context class [\#47](https://github.com/schmittjoh/serializer/pull/47) ([schmittjoh](https://github.com/schmittjoh))
+- Add PropertyNamingStrategy [\#37](https://github.com/schmittjoh/serializer/pull/37) ([passkey1510](https://github.com/passkey1510))
+- The NavigatorContext now holds a metadata stack [\#28](https://github.com/schmittjoh/serializer/pull/28) ([adrienbrault](https://github.com/adrienbrault))
+
+## [0.11.0](https://github.com/schmittjoh/serializer/tree/0.11.0) (2013-01-29)
+**Closed issues:**
+
+- Hooking into metadata directly... [\#17](https://github.com/schmittjoh/serializer/issues/17)
+- Serializing null values [\#14](https://github.com/schmittjoh/serializer/issues/14)
+- Strange caching-error [\#13](https://github.com/schmittjoh/serializer/issues/13)
+- handling of plain array [\#10](https://github.com/schmittjoh/serializer/issues/10)
+- Unsupported format doesn't throw exception anymore [\#8](https://github.com/schmittjoh/serializer/issues/8)
+
+**Merged pull requests:**
+
+- Fix typo [\#32](https://github.com/schmittjoh/serializer/pull/32) ([inanimatt](https://github.com/inanimatt))
+- Fixed the serialization of pluralized form errors [\#31](https://github.com/schmittjoh/serializer/pull/31) ([stof](https://github.com/stof))
+- Extract json specific logic from GenericSerializationVisitor [\#29](https://github.com/schmittjoh/serializer/pull/29) ([adrienbrault](https://github.com/adrienbrault))
+- \[Serializer\] Misc cleanup [\#27](https://github.com/schmittjoh/serializer/pull/27) ([vicb](https://github.com/vicb))
+- \[Builder\] Add ability to include if metadata [\#25](https://github.com/schmittjoh/serializer/pull/25) ([vicb](https://github.com/vicb))
+- Fix DateTimeZone issue when using the DateTime type [\#23](https://github.com/schmittjoh/serializer/pull/23) ([colinmorelli](https://github.com/colinmorelli))
+- Wrong exception message for parsing datetime [\#21](https://github.com/schmittjoh/serializer/pull/21) ([nickelc](https://github.com/nickelc))
+- Fixed typo in doc/reference/annotations.rst [\#16](https://github.com/schmittjoh/serializer/pull/16) ([iambrosi](https://github.com/iambrosi))
+- Typecast when serializing primitive types [\#15](https://github.com/schmittjoh/serializer/pull/15) ([baldurrensch](https://github.com/baldurrensch))
+- add check and helpful exception message on inconsistent type situation [\#12](https://github.com/schmittjoh/serializer/pull/12) ([dbu](https://github.com/dbu))
+- Dispatch pre-serialization event before handling data to have ability change type in listener [\#7](https://github.com/schmittjoh/serializer/pull/7) ([megazoll](https://github.com/megazoll))
+- Fix tests running in different environments [\#6](https://github.com/schmittjoh/serializer/pull/6) ([megazoll](https://github.com/megazoll))
+- Add DateInterval serialization to DateHandler formerly DateTimeHandler [\#5](https://github.com/schmittjoh/serializer/pull/5) ([rpg600](https://github.com/rpg600))
+- WIP Navigator context [\#3](https://github.com/schmittjoh/serializer/pull/3) ([adrienbrault](https://github.com/adrienbrault))
+- Update src/JMS/Serializer/Construction/DoctrineObjectConstructor.php [\#2](https://github.com/schmittjoh/serializer/pull/2) ([robocoder](https://github.com/robocoder))
+- Filter out non-identifiers from $data before calling find\(\) [\#1](https://github.com/schmittjoh/serializer/pull/1) ([robocoder](https://github.com/robocoder))
+
+
+
+\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
diff --git a/vendor/jms/serializer/LICENSE b/vendor/jms/serializer/LICENSE
new file mode 100644
index 0000000000..f49a4e16e6
--- /dev/null
+++ b/vendor/jms/serializer/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
\ No newline at end of file
diff --git a/vendor/jms/serializer/META.md b/vendor/jms/serializer/META.md
new file mode 100644
index 0000000000..442ea6bfc6
--- /dev/null
+++ b/vendor/jms/serializer/META.md
@@ -0,0 +1,7 @@
+# Generating changelog
+
+Use: https://github.com/skywinder/Github-Changelog-Generator
+
+```bash
+github_changelog_generator --pull-requests --no-compare-link --no-unreleased -t GITHUB-TOKEN
+```
diff --git a/vendor/jms/serializer/README.md b/vendor/jms/serializer/README.md
new file mode 100644
index 0000000000..dd9f551a7b
--- /dev/null
+++ b/vendor/jms/serializer/README.md
@@ -0,0 +1,4 @@
+Serializer [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/schmittjoh/serializer/badges/quality-score.png?s=189df68e00c75d3fe155bc0da0b53b53709a9895)](https://scrutinizer-ci.com/g/schmittjoh/serializer/) [![Build Status](https://travis-ci.org/schmittjoh/serializer.svg?branch=master)](https://travis-ci.org/schmittjoh/serializer)
+==========
+
+Learn more about it in its [documentation](http://jmsyst.com/libs/serializer).
diff --git a/vendor/jms/serializer/UPGRADING.md b/vendor/jms/serializer/UPGRADING.md
new file mode 100644
index 0000000000..a4ada717b8
--- /dev/null
+++ b/vendor/jms/serializer/UPGRADING.md
@@ -0,0 +1,26 @@
+From 0.13 to ???
+================
+
+- If you have implemented your own ObjectConstructor, you need to add the DeserializationContext as an additional
+ parameter for the ``construct`` method.
+
+
+From 0.11 to 0.12
+=================
+
+- GraphNavigator::detachObject has been removed, you can directly use Context::stopVisiting instead.
+- VisitorInterface::getNavigator was deprecated, instead use Context::accept
+- Serializer::setGroups, Serializer::setExclusionStrategy and Serializer::setVersion were removed, these settings must
+ now be passed as part of a new Context object.
+
+ Before:
+
+ $serializer->setVersion(1);
+ $serializer->serialize($data, 'json');
+
+ After:
+
+ $serializer->serialize($data, 'json', SerializationContext::create()->setVersion(1));
+
+- All visit??? methods of the VisitorInterface, now require a third argument, the Context; the context is for example
+ passed as an additional argument to handlers, exclusion strategies, and also available in event listeners.
diff --git a/vendor/jms/serializer/composer.json b/vendor/jms/serializer/composer.json
new file mode 100644
index 0000000000..a801dfc8e4
--- /dev/null
+++ b/vendor/jms/serializer/composer.json
@@ -0,0 +1,57 @@
+{
+ "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": "Apache-2.0",
+ "authors": [
+ {
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "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": {
+ "jms/serializer-bundle": "<1.2.1",
+ "twig/twig": "<1.12"
+ },
+ "suggest": {
+ "symfony/yaml": "Required if you'd like to serialize data to YAML format.",
+ "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.",
+ "doctrine/cache": "Required if you like to use cache functionality."
+ },
+ "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|^3.0",
+ "symfony/translation": "^2.1|^3.0",
+ "symfony/validator": "^2.2|^3.0",
+ "symfony/form": "~2.1|^3.0",
+ "symfony/filesystem": "^2.1",
+ "symfony/expression-language": "^2.6|^3.0",
+ "phpunit/phpunit": "^4.8|^5.0"
+ },
+ "autoload": {
+ "psr-0": {
+ "JMS\\Serializer": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.8-dev"
+ }
+ }
+}
diff --git a/vendor/jms/serializer/doc/LICENSE b/vendor/jms/serializer/doc/LICENSE
new file mode 100644
index 0000000000..a9aba5c6c9
--- /dev/null
+++ b/vendor/jms/serializer/doc/LICENSE
@@ -0,0 +1,55 @@
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+ "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+ "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+ "Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
+ "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+ "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+ "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+ "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+ "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+ "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+ to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
+ to Distribute and Publicly Perform the Work including as incorporated in Collections.
+
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+ You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
+ You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+ If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+
+ For the avoidance of doubt:
+ Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+ Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+ Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
+ Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
+
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+ This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+ Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+
+8. Miscellaneous
+
+ Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+ If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+ No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+ This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+ The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
diff --git a/vendor/jms/serializer/doc/configuration.rst b/vendor/jms/serializer/doc/configuration.rst
new file mode 100644
index 0000000000..3e1106f827
--- /dev/null
+++ b/vendor/jms/serializer/doc/configuration.rst
@@ -0,0 +1,100 @@
+Configuration
+=============
+
+.. note ::
+
+ If you are using Symfony2, this section is mostly irrelevant for you as the entire integration is provided by
+ JMSSerializerBundle; please see `its documentation `_. If you are
+ using another framework, there also might be a module, or other special integration. Please check packagist, or
+ whatever registry usually holds such information for your framework.
+
+Constructing a Serializer
+-------------------------
+
+This library provides a special builder object which makes constructing serializer instances a breeze in any PHP
+project. In its shortest version, it's just a single line of code::
+
+ $serializer = JMS\Serializer\SerializerBuilder::create()->build();
+
+This serializer is fully functional, but you might want to tweak it a bit for example to configure a cache directory.
+
+Configuring a Cache Directory
+-----------------------------
+The serializer collects several metadata about your objects from various sources such as YML, XML, or annotations. In
+order to make this process as efficient as possible, it is encourage to let the serializer cache that information. For
+that, you can configure a cache directory::
+
+ $builder = new JMS\Serializer\SerializerBuilder();
+
+ $serializer =
+ JMS\Serializer\SerializerBuilder::create()
+ ->setCacheDir($someWritableDir)
+ ->setDebug($trueOrFalse)
+ ->build();
+
+As you can see, we also added a call to the ``setDebug`` method. In debug mode, the serializer will perform a bit more
+filesystem checks to see whether the data that it has cached is still valid. These checks are useful during development
+so that you do not need to manually clear cache folders, however in production they are just unnecessary overhead. The
+debug setting allows you to make the behavior environment specific.
+
+Adding Custom Handlers
+----------------------
+If you have created custom handlers, you can add them to the serializer easily::
+
+ $serializer =
+ JMS\Serializer\SerializerBuilder::create()
+ ->addDefaultHandlers()
+ ->configureHandlers(function(JMS\Serializer\Handler\HandlerRegistry $registry) {
+ $registry->registerHandler('serialization', 'MyObject', 'json',
+ function($visitor, MyObject $obj, array $type) {
+ return $obj->getName();
+ }
+ );
+ })
+ ->build();
+
+For more complex handlers, it is advisable to extract them to dedicated classes,
+see :doc:`handlers documentation `.
+
+Configuring Metadata Locations
+------------------------------
+This library supports several metadata sources. By default, it uses Doctrine annotations, but you may also store
+metadata in XML, or YML files. For the latter, it is necessary to configure a metadata directory where those files
+are located::
+
+ $serializer =
+ JMS\Serializer\SerializerBuilder::create()
+ ->addMetadataDir($someDir)
+ ->build();
+
+The serializer would expect the metadata files to be named like the fully qualified class names where all ``\`` are
+replaced with ``.``. So, if you class would be named ``Vendor\Package\Foo``, the metadata file would need to be located
+at ``$someDir/Vendor.Package.Foo.(xml|yml)``. For more information, see the :doc:`reference `.
+
+Setting a default SerializationContext factory
+--------------------------------------------
+To avoid to pass an instance of SerializationContext
+every time you call method ``serialize()`` (or ``toArray()``),
+you can set a ``SerializationContextFactory`` to the Serializer.
+
+Example using the SerializerBuilder::
+
+ use JMS\Serializer\SerializationContext;
+
+ $serializer = JMS\Serializer\SerializerBuilder::create()
+ ->setSerializationContextFactory(function () {
+ return SerializationContext::create()
+ ->setSerializeNull(true)
+ ;
+ })
+ ->build()
+ ;
+
+Then, calling ``$serializer->serialize($data, 'json');`` will generate
+a serialization context from your callable and use it.
+
+.. note ::
+
+ You can also set a default DeserializationContextFactory with
+ ``->setDeserializationContextFactory(function () { /* ... */ })``
+ to be used with methods ``deserialize()`` and ``fromArray()``.
diff --git a/vendor/jms/serializer/doc/cookbook.rst b/vendor/jms/serializer/doc/cookbook.rst
new file mode 100644
index 0000000000..985edd2d56
--- /dev/null
+++ b/vendor/jms/serializer/doc/cookbook.rst
@@ -0,0 +1,7 @@
+Cookbook
+========
+
+.. toctree ::
+ :glob:
+
+ cookbook/*
\ No newline at end of file
diff --git a/vendor/jms/serializer/doc/cookbook/arrays.rst b/vendor/jms/serializer/doc/cookbook/arrays.rst
new file mode 100644
index 0000000000..7cb2704a00
--- /dev/null
+++ b/vendor/jms/serializer/doc/cookbook/arrays.rst
@@ -0,0 +1,47 @@
+Serailizing arrays and hashes
+=============================
+
+Introduction
+------------
+Serializing arrays and hashes (a concept that in PHP has not explicit boundaries)
+can be challenging. The serializer offers via ``@Type`` annotation different options
+to configure its behavior, but if we try to serialize directly an array
+(not as a property of an object), we need to use context information to determine the
+array "type"
+
+Examples
+--------
+
+In case of a JSON serialization:
+
+.. code-block :: php
+
+ serialize([1, 2]); // [1, 2]
+ $serializer->serialize(['a', 'b']); // ['a', 'b']
+ $serializer->serialize(['c' => 'd']); // {"c" => "d"}
+
+ // same as default (let the PHP's json_encode function decide)
+ $serializer->serialize([1, 2], SerializationContext::create()->setInitialType('array')); // [1, 2]
+ $serializer->serialize([1 => 2], SerializationContext::create()->setInitialType('array')); // {"1": 2}
+ $serializer->serialize(['a', 'b'], SerializationContext::create()->setInitialType('array')); // ['a', 'b']
+ $serializer->serialize(['c' => 'd'], SerializationContext::create()->setInitialType('array')); // {"c" => "d"}
+
+ // typehint as strict array, keys will be always discarded
+ $serializer->serialize([], SerializationContext::create()->setInitialType('array')); // []
+ $serializer->serialize([1, 2], SerializationContext::create()->setInitialType('array')); // [1, 2]
+ $serializer->serialize(['a', 'b'], SerializationContext::create()->setInitialType('array')); // ['a', 'b']
+ $serializer->serialize(['c' => 'd'], SerializationContext::create()->setInitialType('array')); // ["d"]
+
+ // typehint as hash, keys will be always considered
+ $serializer->serialize([], SerializationContext::create()->setInitialType('array')); // {}
+ $serializer->serialize([1, 2], SerializationContext::create()->setInitialType('array')); // {"0" : 1, "1" : 2}
+ $serializer->serialize(['a', 'b'], SerializationContext::create()->setInitialType('array')); // {"0" : "a", "1" : "b"}
+ $serializer->serialize(['c' => 'd'], SerializationContext::create()->setInitialType('array')); // {"d" : "d"}
+
+
+.. note ::
+
+ This applies only for the JSON and YAML serialization.
diff --git a/vendor/jms/serializer/doc/cookbook/exclusion_strategies.rst b/vendor/jms/serializer/doc/cookbook/exclusion_strategies.rst
new file mode 100644
index 0000000000..9c3cd4e291
--- /dev/null
+++ b/vendor/jms/serializer/doc/cookbook/exclusion_strategies.rst
@@ -0,0 +1,311 @@
+Exclusion Strategies
+====================
+
+Introduction
+------------
+The serializer supports different exclusion strategies. Each strategy allows
+you to define which properties of your objects should be serialized.
+
+General Exclusion Strategies
+----------------------------
+If you would like to always expose, or exclude certain properties. Then, you can
+do this with the annotations ``@ExclusionPolicy``, ``@Exclude``, and ``@Expose``.
+
+The default exclusion policy is to exclude nothing. That is, all properties of the
+object will be serialized. If you only want to expose a few of the properties,
+then it is easier to change the exclusion policy, and only mark these few properties:
+
+.. code-block :: php
+
+ serialize(new VersionObject(), 'json', SerializationContext::create()->setVersion(1));
+
+
+Creating Different Views of Your Objects
+----------------------------------------
+Another default exclusion strategy is to create different views of your objects.
+Let's say you would like to serialize your object in a different view depending
+whether it is displayed in a list view or in a details view.
+
+You can achieve that by using the ``@Groups`` annotation on your properties. Any
+property without an explicit ``@Groups`` annotation will be included in a
+``Default`` group, which can be used when specifying groups in the serialization
+context.
+
+.. code-block :: php
+
+ use JMS\Serializer\Annotation\Groups;
+
+ class BlogPost
+ {
+ /** @Groups({"list", "details"}) */
+ private $id;
+
+ /** @Groups({"list", "details"}) */
+ private $title;
+
+ /** @Groups({"list"}) */
+ private $nbComments;
+
+ /** @Groups({"details"}) */
+ private $comments;
+
+ private $createdAt;
+ }
+
+You can then tell the serializer which groups to serialize in your controller::
+
+ use JMS\Serializer\SerializationContext;
+
+ $serializer->serialize(new BlogPost(), 'json', SerializationContext::create()->setGroups(array('list')));
+
+ //will output $id, $title and $nbComments.
+
+ $serializer->serialize(new BlogPost(), 'json', SerializationContext::create()->setGroups(array('Default', 'list')));
+
+ //will output $id, $title, $nbComments and $createdAt.
+
+Overriding Groups of Deeper Branches of the Graph
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In some cases you want to control more precisely what is serialized because you may have the same class at different
+depths of the object graph.
+
+For example if you have a User that has a manager and friends::
+
+ use JMS\Serializer\Annotation\Groups;
+
+ class User
+ {
+ private $name;
+
+ /** @Groups({"manager_group"}) */
+ private $manager;
+
+ /** @Groups({"friends_group"}) */
+ private $friends;
+
+ public function __construct($name, User $manager = null, array $friends = null)
+ {
+ $this->name = $name;
+ $this->manager = $manager;
+ $this->friends = $friends;
+ }
+ }
+
+And the following object graph::
+
+ $john = new User(
+ 'John',
+ new User(
+ 'John Manager',
+ new User('The boss'),
+ array(
+ new User('John Manager friend 1'),
+ )
+ ),
+ array(
+ new User(
+ 'John friend 1',
+ new User('John friend 1 manager')
+ ),
+ new User(
+ 'John friend 2',
+ new User('John friend 2 manager')
+ ),
+ )
+ );
+
+You can override groups on specific paths::
+
+ use JMS\Serializer\SerializationContext;
+
+ $context = SerializationContext::create()->setGroups(array(
+ 'Default', // Serialize John's name
+ 'manager_group', // Serialize John's manager
+ 'friends_group', // Serialize John's friends
+
+ 'manager' => array( // Override the groups for the manager of John
+ 'Default', // Serialize John manager's name
+ 'friends_group', // Serialize John manager's friends. If you do not override the groups for the friends, it will default to Default.
+ ),
+
+ 'friends' => array( // Override the groups for the friends of John
+ 'manager_group' // Serialize John friends' managers.
+
+ 'manager' => array( // Override the groups for the John friends' manager
+ 'Default', // This would be the default if you did not override the groups of the manager property.
+ ),
+ ),
+ ));
+ $serializer->serialize($john, 'json', $context);
+
+This would result in the following json::
+
+ {
+ "name": "John",
+ "manager": {
+ "name": "John Manager",
+ "friends": [
+ {
+ "name": "John Manager friend 1"
+ }
+ ]
+ },
+ "friends": [
+ {
+ "manager": {
+ "name": "John friend 1 manager"
+ },
+ },
+ {
+ "manager": {
+ "name": "John friend 2 manager"
+ },
+ },
+ ]
+ }
+
+Limiting serialization depth of some properties
+-----------------------------------------------
+You can limit the depth of what will be serialized in a property with the
+``@MaxDepth`` annotation.
+This exclusion strategy is a bit different from the others, because it will
+affect the serialized content of others classes than the one you apply the
+annotation to.
+
+.. code-block :: php
+
+ use JMS\Serializer\Annotation\MaxDepth;
+
+ class User
+ {
+ private $username;
+
+ /** @MaxDepth(1) */
+ private $friends;
+
+ /** @MaxDepth(2) */
+ private $posts;
+ }
+
+ class Post
+ {
+ private $title;
+
+ private $author;
+ }
+
+In this example, serializing a user, because the max depth of the ``$friends``
+property is 1, the user friends would be serialized, but not their friends;
+and because the the max depth of the ``$posts`` property is 2, the posts would
+be serialized, and their author would also be serialized.
+
+You need to tell the serializer to take into account MaxDepth checks::
+
+ use JMS\Serializer\SerializationContext;
+
+ $serializer->serialize($data, 'json', SerializationContext::create()->enableMaxDepthChecks());
+
+
+Dynamic exclusion strategy
+--------------------------
+
+If the previous exclusion strategies are not enough, is possible to use the ``ExpressionLanguageExclusionStrategy``
+that uses the `symfony expression language`_ to
+allow a more sophisticated exclusion strategies using ``@Exclude(if="expression")`` and ``@Expose(if="expression")`` methods.
+
+
+.. code-block :: php
+
+ setExpressionEvaluator(new ExpressionEvaluator(new ExpressionLanguage()))
+ ->build();
+
+.. _symfony expression language: https://github.com/symfony/expression-language
diff --git a/vendor/jms/serializer/doc/cookbook/stdclass.rst b/vendor/jms/serializer/doc/cookbook/stdclass.rst
new file mode 100644
index 0000000000..c70a21eafe
--- /dev/null
+++ b/vendor/jms/serializer/doc/cookbook/stdclass.rst
@@ -0,0 +1,16 @@
+stdClass
+========
+
+The serializer offers support for serializing ``stdClass`` objects, however the use of
+``stdClass`` objects is discouraged.
+
+The current implementation serializes all the properties of a ``stdClass`` object in
+the order they appear.
+
+There are may know limitations wen dealing with ``stdClass`` objects,
+more in detail, is not possible to:
+
+- change serialization order of properties
+- apply per-property exclusion policies
+- specify any extra serialization information for properties that are part of the ``stdClass`` object, as serialization name, type, xml structure and so on
+- deserialize data into ``stdClass`` objects
diff --git a/vendor/jms/serializer/doc/event_system.rst b/vendor/jms/serializer/doc/event_system.rst
new file mode 100644
index 0000000000..0b1c890184
--- /dev/null
+++ b/vendor/jms/serializer/doc/event_system.rst
@@ -0,0 +1,79 @@
+Event System
+============
+
+The serializer dispatches different events during the serialization, and
+deserialization process which you can use to hook in and alter the default
+behavior.
+
+Register an Event Listener, or Subscriber
+-----------------------------------------
+The difference between listeners, and subscribers is that listener do not know to which events they listen
+while subscribers contain that information. Thus, subscribers are easier to share, and re-use. Listeners
+on the other hand, can be simple callables and do not require a dedicated class.
+
+.. code-block :: php
+
+ class MyEventSubscriber implements JMS\Serializer\EventDispatcher\EventSubscriberInterface
+ {
+ public static function getSubscribedEvents()
+ {
+ return array(
+ array('event' => 'serializer.pre_serialize', 'method' => 'onPreSerialize'),
+ );
+ }
+
+ public function onPreSerialize(JMS\Serializer\EventDispatcher\PreSerializeEvent $event)
+ {
+ // do something
+ }
+ }
+
+ $builder
+ ->configureListeners(function(JMS\Serializer\EventDispatcher\EventDispatcher $dispatcher) {
+ $dispatcher->addListener('serializer.pre_serialize',
+ function(JMS\Serializer\EventDispatcher\PreSerializeEvent $event) {
+ // do something
+ }
+ );
+
+ $dispatcher->addSubscriber(new MyEventSubscriber());
+ })
+ ;
+
+Events
+------
+
+serializer.pre_serialize
+~~~~~~~~~~~~~~~~~~~~~~~~
+This is dispatched before a type is visited. You have access to the visitor,
+data, and type. Listeners may modify the type that is being used for
+serialization.
+
+**Event Object**: ``JMS\Serializer\EventDispatcher\PreSerializeEvent``
+
+serializer.post_serialize
+~~~~~~~~~~~~~~~~~~~~~~~~~
+This is dispatched right before a type is left. You can for example use this
+to add additional data for an object that you normally do not save inside
+objects such as links.
+
+**Event Object**: ``JMS\Serializer\EventDispatcher\ObjectEvent``
+
+serializer.pre_deserialize
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. versionadded : 0.12
+ Event was added
+
+This is dispatched before an object is deserialized. You can use this to
+modify submitted data, or modify the type that is being used for deserialization.
+
+**Event Object**: ``JMS\Serializer\EventDispatcher\PreDeserializeEvent``
+
+serializer.post_deserialize
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+This is dispatched after a type is processed. You can use it to normalize
+submitted data if you require external services for example, or also to
+perform validation of the submitted data.
+
+**Event Object**: ``JMS\Serializer\EventDispatcher\ObjectEvent``
diff --git a/vendor/jms/serializer/doc/handlers.rst b/vendor/jms/serializer/doc/handlers.rst
new file mode 100644
index 0000000000..e0e9cdfb76
--- /dev/null
+++ b/vendor/jms/serializer/doc/handlers.rst
@@ -0,0 +1,63 @@
+Handlers
+========
+
+Introduction
+------------
+Handlers allow you to change the serialization, or deserialization process
+for a single type/format combination.
+
+Handlers are simple callback which receive three arguments: the visitor,
+the data, and the type.
+
+Simple Callables
+----------------
+You can register simple callables on the builder object::
+
+ $builder
+ ->configureHandlers(function(JMS\Serializer\Handler\HandlerRegistry $registry) {
+ $registry->registerHandler('serialization', 'MyObject', 'json',
+ function($visitor, MyObject $obj, array $type) {
+ return $obj->getName();
+ }
+ );
+ })
+ ;
+
+Subscribing Handlers
+--------------------
+Subscribing handlers contain the configuration themselves which makes them easier to share with other users,
+and easier to set-up in general::
+
+ use JMS\Serializer\Handler\SubscribingHandlerInterface;
+ use JMS\Serializer\GraphNavigator;
+ use JMS\Serializer\JsonSerializationVisitor;
+ use JMS\Serializer\Context;
+
+ class MyHandler implements SubscribingHandlerInterface
+ {
+ public static function getSubscribingMethods()
+ {
+ return array(
+ array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'format' => 'json',
+ 'type' => 'DateTime',
+ 'method' => 'serializeDateTimeToJson',
+ ),
+ );
+ }
+
+ public function serializeDateTimeToJson(JsonSerializationVisitor $visitor, \DateTime $date, array $type, Context $context)
+ {
+ return $date->format($type['params'][0]);
+ }
+ }
+
+Also, this type of handler is registered via the builder object::
+
+ $builder
+ ->configureHandlers(function(JMS\Serializer\Handler\HandlerRegistry $registry) {
+ $registry->registerSubscribingHandler(new MyHandler());
+ })
+ ;
+
diff --git a/vendor/jms/serializer/doc/index.rst b/vendor/jms/serializer/doc/index.rst
new file mode 100644
index 0000000000..cd7b096117
--- /dev/null
+++ b/vendor/jms/serializer/doc/index.rst
@@ -0,0 +1,72 @@
+Serializer
+==========
+
+Introduction
+------------
+This library allows you to (de-)serialize data of any complexity. Currently, it supports XML, JSON, and YAML.
+
+It also provides you with a rich tool-set to adapt the output to your specific needs.
+
+Built-in features include:
+
+- (De-)serialize data of any complexity; circular references are handled gracefully.
+- Supports many built-in PHP types (such as dates)
+- Integrates with Doctrine ORM, et. al.
+- Supports versioning, e.g. for APIs
+- Configurable via PHP, XML, YAML, or Doctrine Annotations
+
+Installation
+------------
+This library can be easily installed via composer
+
+.. code-block :: bash
+
+ composer require jms/serializer
+
+or just add it to your ``composer.json`` file directly.
+
+Usage
+-----
+For standalone projects usage of the provided builder is encouraged::
+
+ $serializer = JMS\Serializer\SerializerBuilder::create()->build();
+ $jsonContent = $serializer->serialize($data, 'json');
+ echo $jsonContent; // or return it in a Response
+
+Documentation
+-------------
+
+.. toctree ::
+ :hidden:
+
+ configuration
+ usage
+ event_system
+ handlers
+ reference
+ cookbook
+
+- :doc:`Configuration `
+- :doc:`Usage `
+- :doc:`Events `
+- :doc:`Handlers `
+
+- Recipes
+ * :doc:`/cookbook/exclusion_strategies`
+
+- Reference
+ * :doc:`Annotations `
+ * :doc:`XML Reference `
+ * :doc:`YML Reference `
+
+License
+-------
+
+The code is released under the business-friendly `Apache2 license`_.
+
+Documentation is subject to the `Attribution-NonCommercial-NoDerivs 3.0 Unported
+license`_.
+
+.. _Apache2 license: http://www.apache.org/licenses/LICENSE-2.0.html
+.. _Attribution-NonCommercial-NoDerivs 3.0 Unported license: http://creativecommons.org/licenses/by-nc-nd/3.0/
+
diff --git a/vendor/jms/serializer/doc/reference.rst b/vendor/jms/serializer/doc/reference.rst
new file mode 100644
index 0000000000..123d6f6338
--- /dev/null
+++ b/vendor/jms/serializer/doc/reference.rst
@@ -0,0 +1,8 @@
+Reference
+=========
+
+.. toctree ::
+ :glob:
+ :maxdepth: 1
+
+ reference/*
\ No newline at end of file
diff --git a/vendor/jms/serializer/doc/reference/annotations.rst b/vendor/jms/serializer/doc/reference/annotations.rst
new file mode 100644
index 0000000000..45751e7233
--- /dev/null
+++ b/vendor/jms/serializer/doc/reference/annotations.rst
@@ -0,0 +1,746 @@
+Annotations
+-----------
+
+@ExclusionPolicy
+~~~~~~~~~~~~~~~~
+This annotation can be defined on a class to indicate the exclusion strategy
+that should be used for the class.
+
++----------+----------------------------------------------------------------+
+| Policy | Description |
++==========+================================================================+
+| all | all properties are excluded by default; only properties marked |
+| | with @Expose will be serialized/unserialized |
++----------+----------------------------------------------------------------+
+| none | no properties are excluded by default; all properties except |
+| | those marked with @Exclude will be serialized/unserialized |
++----------+----------------------------------------------------------------+
+
+@Exclude
+~~~~~~~~
+This annotation can be defined on a property to indicate that the property should
+not be serialized/unserialized. Works only in combination with NoneExclusionPolicy.
+
+If the ``ExpressionLanguageExclusionStrategy`` exclusion strategy is enabled, will
+be possible to use ``@Exclude(if="expression")`` to exclude dynamically a property.
+
+@Expose
+~~~~~~~
+This annotation can be defined on a property to indicate that the property should
+be serialized/unserialized. Works only in combination with AllExclusionPolicy.
+
+If the ``ExpressionLanguageExclusionStrategy`` exclusion strategy is enabled, will
+be possible to use ``@Expose(if="expression")`` to expose dynamically a property.
+
+@SkipWhenEmpty
+~~~~~~~~~~~~~~
+This annotation can be defined on a property to indicate that the property should
+not be serialized if the result will be "empty".
+
+Works option works only when serializing.
+
+@SerializedName
+~~~~~~~~~~~~~~~
+This annotation can be defined on a property to define the serialized name for a
+property. If this is not defined, the property will be translated from camel-case
+to a lower-cased underscored name, e.g. camelCase -> camel_case.
+
+@Since
+~~~~~~
+This annotation can be defined on a property to specify starting from which
+version this property is available. If an earlier version is serialized, then
+this property is excluded automatically. The version must be in a format that is
+understood by PHP's ``version_compare`` function.
+
+@Until
+~~~~~~
+This annotation can be defined on a property to specify until which version this
+property was available. If a later version is serialized, then this property is
+excluded automatically. The version must be in a format that is understood by
+PHP's ``version_compare`` function.
+
+@Groups
+~~~~~~~
+This annotation can be defined on a property to specify if the property
+should be serialized when only serializing specific groups (see
+:doc:`../cookbook/exclusion_strategies`).
+
+@MaxDepth
+~~~~~~~~~
+This annotation can be defined on a property to limit the depth to which the
+content will be serialized. It is very useful when a property will contain a
+large object graph.
+
+@AccessType
+~~~~~~~~~~~
+This annotation can be defined on a property, or a class to specify in which way
+the properties should be accessed. By default, the serializer will retrieve, or
+set the value via reflection, but you may change this to use a public method instead:
+
+.. code-block :: php
+
+ name;
+ }
+
+ public function setName($name)
+ {
+ $this->name = trim($name);
+ }
+ }
+
+@Accessor
+~~~~~~~~~
+This annotation can be defined on a property to specify which public method should
+be called to retrieve, or set the value of the given property:
+
+.. code-block :: php
+
+ name);
+ }
+
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+ }
+
+.. note ::
+
+ If you need only to serialize your data, you can avoid providing a setter by
+ setting the property as read-only using the ``@ReadOnly`` annotation.
+
+@AccessorOrder
+~~~~~~~~~~~~~~
+This annotation can be defined on a class to control the order of properties. By
+default the order is undefined, but you may change it to either "alphabetical", or
+"custom".
+
+.. code-block :: php
+
+ lastName;
+ }
+
+ public function getFirstName()
+ {
+ return $this->firstName;
+ }
+ }
+
+In this example:
+
+- ``id`` is exposed using the object reflection.
+- ``lastName`` is exposed using the ``getLastName`` getter method.
+- ``firstName`` is exposed using the ``object.getFirstName()`` expression (``exp`` can contain any valid symfony expression).
+
+
+.. note ::
+
+ This only works for serialization and is completely ignored during deserialization.
+
+@Inline
+~~~~~~~
+This annotation can be defined on a property to indicate that the data of the property
+should be inlined.
+
+**Note**: This only works for serialization, the serializer will not be able to deserialize
+objects with this annotation. Also, AccessorOrder will be using the name of the property
+to determine the order.
+
+@ReadOnly
+~~~~~~~~~
+This annotation can be defined on a property to indicate that the data of the property
+is read only and cannot be set during deserialization.
+
+A property can be marked as non read only with ``@ReadOnly(false)`` annotation (useful when a class is marked as read only).
+
+@PreSerialize
+~~~~~~~~~~~~~
+This annotation can be defined on a method which is supposed to be called before
+the serialization of the object starts.
+
+@PostSerialize
+~~~~~~~~~~~~~~
+This annotation can be defined on a method which is then called directly after the
+object has been serialized.
+
+@PostDeserialize
+~~~~~~~~~~~~~~~~
+This annotation can be defined on a method which is supposed to be called after
+the object has been deserialized.
+
+@HandlerCallback
+~~~~~~~~~~~~~~~~
+This annotation can be defined on a method if serialization/deserialization is handled
+by the object itself.
+
+.. code-block :: php
+
+ | A list of type T (T can be any available type). |
+| | Examples: |
+| | array, array, etc. |
++-------------------------------------+--------------------------------------------------+
+| array | A map of keys of type K to values of type V. |
+| | Examples: array, |
+| | array, etc. |
++-------------------------------------+--------------------------------------------------+
+| DateTime | PHP's DateTime object (default format/timezone) |
++-------------------------------------+--------------------------------------------------+
+| DateTime<'format'> | PHP's DateTime object (custom format/default |
+| | timezone) |
++-------------------------------------+--------------------------------------------------+
+| DateTime<'format', 'zone'> | PHP's DateTime object (custom format/timezone) |
++-------------------------------------+--------------------------------------------------+
+| DateTimeImmutable | PHP's DateTimeImmutable object (default format/ |
+| | timezone) |
++-------------------------------------+--------------------------------------------------+
+| DateTimeImmutable<'format'> | PHP's DateTimeImmutable object (custom format/ |
+| | default timezone) |
++-------------------------------------+--------------------------------------------------+
+| DateTimeImmutable<'format', 'zone'> | PHP's DateTimeImmutable object (custom format/ |
+| | timezone) |
++-------------------------------------+--------------------------------------------------+
+| DateInterval | PHP's DateInterval object using ISO 8601 format |
++-------------------------------------+--------------------------------------------------+
+| T | Where T is a fully qualified class name. |
++-------------------------------------+--------------------------------------------------+
+| ArrayCollection | Similar to array, but will be deserialized |
+| | into Doctrine's ArrayCollection class. |
++-------------------------------------+--------------------------------------------------+
+| ArrayCollection | Similar to array, but will be deserialized |
+| | into Doctrine's ArrayCollection class. |
++-------------------------------------+--------------------------------------------------+
+
+Examples:
+
+.. code-block :: php
+
+ ")
+ */
+ private $comments;
+
+ /**
+ * @Type("string")
+ */
+ private $title;
+
+ /**
+ * @Type("MyNamespace\Author")
+ */
+ private $author;
+
+ /**
+ * @Type("DateTime")
+ */
+ private $startAt;
+
+ /**
+ * @Type("DateTime<'Y-m-d'>")
+ */
+ private $endAt;
+
+ /**
+ * @Type("DateTimeImmutable")
+ */
+ private $createdAt;
+
+ /**
+ * @Type("DateTimeImmutable<'Y-m-d'>")
+ */
+ private $updatedAt;
+
+ /**
+ * @Type("boolean")
+ */
+ private $published;
+
+ /**
+ * @Type("array")
+ */
+ private $keyValueStore;
+ }
+
+@XmlRoot
+~~~~~~~~
+This allows you to specify the name of the top-level element.
+
+.. code-block :: php
+
+
+
+
+
+.. note ::
+
+ @XmlRoot only applies to the root element, but is for example not taken into
+ account for collections. You can define the entry name for collections using
+ @XmlList, or @XmlMap.
+
+@XmlAttribute
+~~~~~~~~~~~~~
+This allows you to mark properties which should be set as attributes,
+and not as child elements.
+
+.. code-block :: php
+
+
+
+
+
+
+@XmlDiscriminator
+~~~~~~~~~~~~~~~~~
+This annotation allows to modify the behaviour of @Discriminator regarding handling of XML.
+
+
+Available Options:
+
++-------------------------------------+--------------------------------------------------+
+| Type | Description |
++=====================================+==================================================+
+| attribute | use an attribute instead of a child node |
++-------------------------------------+--------------------------------------------------+
+| cdata | render child node content with or without cdata |
++-------------------------------------+--------------------------------------------------+
+| namespace | render child node using the specified namespace |
++-------------------------------------+--------------------------------------------------+
+
+Example for "attribute":
+.. code-block :: php
+
+
+
+
+Example for "cdata":
+
+.. code-block :: php
+ car
+
+
+@XmlValue
+~~~~~~~~~
+This allows you to mark properties which should be set as the value of the
+current element. Note that this has the limitation that any additional
+properties of that object must have the @XmlAttribute annotation.
+XMlValue also has property cdata. Which has the same meaning as the one in
+XMLElement.
+
+.. code-block :: php
+
+ 1.23
+
+@XmlList
+~~~~~~~~
+This allows you to define several properties of how arrays should be
+serialized. This is very similar to @XmlMap, and should be used if the
+keys of the array are not important.
+
+.. code-block :: php
+
+ text = $text;
+ }
+ }
+
+Resulting XML:
+
+.. code-block :: xml
+
+
+
+
+
+
+
+
+
+
+You can also specify the entry tag namespace using the ``namespace`` attribute (``@XmlList(inline = true, entry = "comment", namespace="http://www.example.com/ns")``).
+
+@XmlMap
+~~~~~~~
+Similar to @XmlList, but the keys of the array are meaningful.
+
+@XmlKeyValuePairs
+~~~~~~~~~~~~~~~~~
+This allows you to use the keys of an array as xml tags.
+
+.. note ::
+
+ When a key is an invalid xml tag name (e.g. 1_foo) the tag name *entry* will be used instead of the key.
+
+@XmlAttributeMap
+~~~~~~~~~~~~~~~~
+
+This is similar to the @XmlKeyValuePairs, but instead of creating child elements, it creates attributes.
+
+.. code-block :: php
+
+ 'firstname',
+ 'value' => 'Adrien',
+ );
+ }
+
+Resulting XML:
+
+.. code-block :: xml
+
+
+
+@XmlElement
+~~~~~~~~~~~
+This annotation can be defined on a property to add additional xml serialization/deserialization properties.
+
+.. code-block :: php
+
+ my_id
+
+@XmlNamespace
+~~~~~~~~~~~~~
+This annotation allows you to specify Xml namespace/s and prefix used.
+
+.. code-block :: php
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/doc/reference/xml_reference.rst b/vendor/jms/serializer/doc/reference/xml_reference.rst
new file mode 100644
index 0000000000..eb1df441e1
--- /dev/null
+++ b/vendor/jms/serializer/doc/reference/xml_reference.rst
@@ -0,0 +1,99 @@
+XML Reference
+-------------
+::
+
+
+
+
+
+
+
+ ClassName
+
+ foo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/doc/reference/yml_reference.rst b/vendor/jms/serializer/doc/reference/yml_reference.rst
new file mode 100644
index 0000000000..0128ad12a4
--- /dev/null
+++ b/vendor/jms/serializer/doc/reference/yml_reference.rst
@@ -0,0 +1,82 @@
+YAML Reference
+--------------
+::
+
+ # Vendor\MyBundle\Resources\config\serializer\Model.ClassName.yml
+ Vendor\MyBundle\Model\ClassName:
+ exclusion_policy: ALL
+ xml_root_name: foobar
+ xml_root_namespace: http://your.default.namespace
+ exclude: true
+ read_only: false
+ access_type: public_method # defaults to property
+ accessor_order: custom
+ custom_accessor_order: [propertyName1, propertyName2, ..., propertyNameN]
+ discriminator:
+ field_name: type
+ disabled: false
+ map:
+ some-value: ClassName
+ groups: [foo, bar]
+ xml_attribute: true
+ xml_element:
+ cdata: false
+ namespace: http://www.w3.org/2005/Atom
+ virtual_properties:
+ getSomeProperty:
+ serialized_name: foo
+ type: integer
+ expression_prop:
+ exp: object.getName()
+ serialized_name: foo
+ type: integer
+ xml_namespaces:
+ "": http://your.default.namespace
+ atom: http://www.w3.org/2005/Atom
+ properties:
+ some-property:
+ exclude: true
+ expose: true
+ exclude_if: expr
+ expose_if: expr
+ skip_when_empty: false
+ access_type: public_method # defaults to property
+ accessor: # access_type must be set to public_method
+ getter: getSomeOtherProperty
+ setter: setSomeOtherProperty
+ type: string
+ serialized_name: foo
+ since_version: 1.0
+ until_version: 1.1
+ groups: [foo, bar]
+ xml_attribute: true
+ xml_value: true
+ inline: true
+ read_only: true
+ xml_key_value_pairs: true
+ xml_list:
+ inline: true
+ entry_name: foo
+ namespace: http://www.w3.org/2005/Atom
+ xml_map:
+ inline: true
+ key_attribute_name: foo
+ entry_name: bar
+ namespace: http://www.w3.org/2005/Atom
+ xml_attribute_map: true
+ xml_element:
+ cdata: false
+ namespace: http://www.w3.org/2005/Atom
+ max_depth: 2
+
+ handler_callbacks:
+ serialization:
+ xml: serializeToXml
+ json: serializeToJson
+ deserialization:
+ xml: deserializeFromXml
+
+ callback_methods:
+ pre_serialize: [foo, bar]
+ post_serialize: [foo, bar]
+ post_deserialize: [foo, bar]
diff --git a/vendor/jms/serializer/doc/usage.rst b/vendor/jms/serializer/doc/usage.rst
new file mode 100644
index 0000000000..cd78c206ad
--- /dev/null
+++ b/vendor/jms/serializer/doc/usage.rst
@@ -0,0 +1,38 @@
+Usage
+=====
+
+Serializing Objects
+-------------------
+Most common usage is probably to serialize objects. This can be achieved
+very easily:
+
+.. configuration-block ::
+
+ .. code-block :: php
+
+ build();
+ $serializer->serialize($object, 'json');
+ $serializer->serialize($object, 'xml');
+ $serializer->serialize($object, 'yml');
+
+ .. code-block :: jinja
+
+ {{ object | serialize }} {# uses JSON #}
+ {{ object | serialize('json') }}
+ {{ object | serialize('xml') }}
+ {{ object | serialize('yml') }}
+
+Deserializing Objects
+---------------------
+You can also deserialize objects from their XML, or JSON representation. For
+example, when accepting data via an API.
+
+.. code-block :: php
+
+ build();
+ $object = $serializer->deserialize($jsonData, 'MyNamespace\MyObject', 'json');
+
diff --git a/vendor/jms/serializer/phpunit.xml.dist b/vendor/jms/serializer/phpunit.xml.dist
new file mode 100644
index 0000000000..cd62f11a77
--- /dev/null
+++ b/vendor/jms/serializer/phpunit.xml.dist
@@ -0,0 +1,31 @@
+
+
+
+
+
+ ./tests
+
+
+
+
+
+ performance
+
+
+
+
+ src
+
+
+
diff --git a/vendor/jms/serializer/src/JMS/Serializer/AbstractVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/AbstractVisitor.php
new file mode 100644
index 0000000000..8fdbe08591
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/AbstractVisitor.php
@@ -0,0 +1,66 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Accessor\AccessorStrategyInterface;
+use JMS\Serializer\Accessor\DefaultAccessorStrategy;
+use JMS\Serializer\Naming\PropertyNamingStrategyInterface;
+
+abstract class AbstractVisitor implements VisitorInterface
+{
+ protected $namingStrategy;
+
+ /**
+ * @var AccessorStrategyInterface
+ */
+ protected $accessor;
+
+ public function __construct(PropertyNamingStrategyInterface $namingStrategy, AccessorStrategyInterface $accessorStrategy = null)
+ {
+ $this->namingStrategy = $namingStrategy;
+ $this->accessor = $accessorStrategy ?: new DefaultAccessorStrategy();
+ }
+
+ public function getNamingStrategy()
+ {
+ return $this->namingStrategy;
+ }
+
+ public function prepare($data)
+ {
+ return $data;
+ }
+
+ /**
+ * @param array $typeArray
+ */
+ protected function getElementType($typeArray)
+ {
+ if (false === isset($typeArray['params'][0])) {
+ return null;
+ }
+
+ if (isset($typeArray['params'][1]) && is_array($typeArray['params'][1])) {
+ return $typeArray['params'][1];
+ } else {
+ return $typeArray['params'][0];
+ }
+ }
+
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Accessor/AccessorStrategyInterface.php b/vendor/jms/serializer/src/JMS/Serializer/Accessor/AccessorStrategyInterface.php
new file mode 100644
index 0000000000..6abcf8a234
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Accessor/AccessorStrategyInterface.php
@@ -0,0 +1,42 @@
+
+ *
+ * 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\Accessor;
+
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * @author Asmir Mustafic
+ */
+interface AccessorStrategyInterface
+{
+ /**
+ * @param object $object
+ * @param PropertyMetadata $metadata
+ * @return mixed
+ */
+ public function getValue($object, PropertyMetadata $metadata);
+
+ /**
+ * @param object $object
+ * @param mixed $value
+ * @param PropertyMetadata $metadata
+ * @return void
+ */
+ public function setValue($object, $value, PropertyMetadata $metadata);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Accessor/DefaultAccessorStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Accessor/DefaultAccessorStrategy.php
new file mode 100644
index 0000000000..57a4435668
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Accessor/DefaultAccessorStrategy.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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\Accessor;
+
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * @author Asmir Mustafic
+ */
+class DefaultAccessorStrategy implements AccessorStrategyInterface
+{
+
+ public function getValue($object, PropertyMetadata $metadata)
+ {
+ return $metadata->getValue($object);
+ }
+
+ public function setValue($object, $value, PropertyMetadata $metadata)
+ {
+ $metadata->setValue($object, $value);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Accessor/ExpressionAccessorStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Accessor/ExpressionAccessorStrategy.php
new file mode 100644
index 0000000000..4dc6054548
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Accessor/ExpressionAccessorStrategy.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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\Accessor;
+
+use JMS\Serializer\Expression\ExpressionEvaluatorInterface;
+use JMS\Serializer\Metadata\ExpressionPropertyMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * @author Asmir Mustafic
+ */
+class ExpressionAccessorStrategy implements AccessorStrategyInterface
+{
+ /**
+ * @var AccessorStrategyInterface
+ */
+ private $fallback;
+ /**
+ * @var ExpressionEvaluatorInterface
+ */
+ private $evaluator;
+
+ public function __construct(ExpressionEvaluatorInterface $evaluator, AccessorStrategyInterface $fallback)
+ {
+ $this->fallback = $fallback;
+ $this->evaluator = $evaluator;
+ }
+
+ public function getValue($object, PropertyMetadata $metadata)
+ {
+ if ($metadata instanceof ExpressionPropertyMetadata) {
+ return $this->evaluator->evaluate($metadata->expression, array('object' => $object));
+ }
+ return $this->fallback->getValue($object, $metadata);
+ }
+
+ public function setValue($object, $value, PropertyMetadata $metadata)
+ {
+ $this->fallback->setValue($object, $value, $metadata);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/AccessType.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/AccessType.php
new file mode 100644
index 0000000000..e4125e4e87
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/AccessType.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"CLASS", "PROPERTY"})
+ *
+ * @author Johannes M. Schmitt
+ */
+final class AccessType
+{
+ /**
+ * @Required
+ * @var string
+ */
+ public $type;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Accessor.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Accessor.php
new file mode 100644
index 0000000000..910fe7f54c
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Accessor.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target("PROPERTY")
+ *
+ * @author Johannes M. Schmitt
+ */
+final class Accessor
+{
+ /**
+ * @var string
+ */
+ public $getter;
+
+ /**
+ * @var string
+ */
+ public $setter;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/AccessorOrder.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/AccessorOrder.php
new file mode 100644
index 0000000000..15510daf75
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/AccessorOrder.php
@@ -0,0 +1,40 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * Controls the order of properties in a class.
+ *
+ * @Annotation
+ * @Target("CLASS")
+ * @author Johannes M. Schmitt
+ */
+final class AccessorOrder
+{
+ /**
+ * @Required
+ * @var string
+ */
+ public $order;
+
+ /**
+ * @var array
+ */
+ public $custom = array();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Discriminator.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Discriminator.php
new file mode 100644
index 0000000000..750e7eb7d9
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Discriminator.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target("CLASS")
+ */
+class Discriminator
+{
+ /** @var array */
+ public $map;
+
+ /** @var string */
+ public $field = 'type';
+
+ /** @var boolean */
+ public $disabled = false;
+
+ /** @var string[] */
+ public $groups = array();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Exclude.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Exclude.php
new file mode 100644
index 0000000000..27f3ec2b41
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Exclude.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "CLASS", "METHOD", "ANNOTATION"})
+ */
+final class Exclude
+{
+ public $if;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/ExclusionPolicy.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/ExclusionPolicy.php
new file mode 100644
index 0000000000..965af6c2d2
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/ExclusionPolicy.php
@@ -0,0 +1,46 @@
+
+ *
+ * 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\Annotation;
+
+use JMS\Serializer\Exception\RuntimeException;
+
+/**
+ * @Annotation
+ * @Target("CLASS")
+ */
+final class ExclusionPolicy
+{
+ const NONE = 'NONE';
+ const ALL = 'ALL';
+
+ public $policy;
+
+ public function __construct(array $values)
+ {
+ if ( ! is_string($values['value'])) {
+ throw new RuntimeException('"value" must be a string.');
+ }
+
+ $this->policy = strtoupper($values['value']);
+
+ if (self::NONE !== $this->policy && self::ALL !== $this->policy) {
+ throw new RuntimeException('Exclusion policy must either be "ALL", or "NONE".');
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Expose.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Expose.php
new file mode 100644
index 0000000000..53f7cd84df
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Expose.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "METHOD","ANNOTATION"})
+ */
+final class Expose
+{
+ public $if;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Groups.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Groups.php
new file mode 100644
index 0000000000..70f0ad7e38
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Groups.php
@@ -0,0 +1,29 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class Groups
+{
+ /** @var array @Required */
+ public $groups;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/HandlerCallback.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/HandlerCallback.php
new file mode 100644
index 0000000000..588b949ca8
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/HandlerCallback.php
@@ -0,0 +1,40 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target("METHOD")
+ *
+ * @author Johannes M. Schmitt
+ */
+final class HandlerCallback
+{
+ /**
+ * @Required
+ * @var string
+ */
+ public $format;
+
+ /**
+ * @Required
+ * @var string
+ */
+ public $direction;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Inline.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Inline.php
new file mode 100644
index 0000000000..ba82d5f863
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Inline.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class Inline
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/MaxDepth.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/MaxDepth.php
new file mode 100644
index 0000000000..7b05a3fcb6
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/MaxDepth.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class MaxDepth
+{
+ /**
+ * @Required
+ * @var integer
+ */
+ public $depth;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/PostDeserialize.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/PostDeserialize.php
new file mode 100644
index 0000000000..b7ff4b5f26
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/PostDeserialize.php
@@ -0,0 +1,33 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * This annotation can be defined on methods which are called after the
+ * deserialization of the object is complete.
+ *
+ * These methods do not necessarily have to be public.
+ *
+ * @Annotation
+ * @Target("METHOD")
+ * @author Johannes M. Schmitt
+ */
+final class PostDeserialize
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/PostSerialize.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/PostSerialize.php
new file mode 100644
index 0000000000..bb9cfd3f24
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/PostSerialize.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target("METHOD")
+ */
+final class PostSerialize
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/PreSerialize.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/PreSerialize.php
new file mode 100644
index 0000000000..c9ddbf1a63
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/PreSerialize.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * This annotation can be declared on methods which should be called
+ * before the Serialization process.
+ *
+ * These methods do not need to be public, and should do any clean-up, or
+ * preparation of the object that is necessary.
+ *
+ * @Annotation
+ * @Target("METHOD")
+ * @author Johannes M. Schmitt
+ */
+final class PreSerialize
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/ReadOnly.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/ReadOnly.php
new file mode 100644
index 0000000000..4712cb1041
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/ReadOnly.php
@@ -0,0 +1,31 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"CLASS","PROPERTY"})
+ */
+final class ReadOnly
+{
+ /**
+ * @var boolean
+ */
+ public $readOnly = true;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/SerializedName.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/SerializedName.php
new file mode 100644
index 0000000000..968705e2da
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/SerializedName.php
@@ -0,0 +1,39 @@
+
+ *
+ * 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\Annotation;
+
+use JMS\Serializer\Exception\RuntimeException;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD", "ANNOTATION"})
+ */
+final class SerializedName
+{
+ public $name;
+
+ public function __construct(array $values)
+ {
+ if (!isset($values['value']) || !is_string($values['value'])) {
+ throw new RuntimeException(sprintf('"value" must be a string.'));
+ }
+
+ $this->name = $values['value'];
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Since.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Since.php
new file mode 100644
index 0000000000..851d151100
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Since.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "METHOD"})
+ */
+final class Since extends Version
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/SkipWhenEmpty.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/SkipWhenEmpty.php
new file mode 100644
index 0000000000..d2a5433e00
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/SkipWhenEmpty.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class SkipWhenEmpty
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Type.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Type.php
new file mode 100644
index 0000000000..fb82886908
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Type.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "METHOD","ANNOTATION"})
+ */
+final class Type
+{
+ /**
+ * @Required
+ * @var string
+ */
+ public $name;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Until.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Until.php
new file mode 100644
index 0000000000..8eef0485a5
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Until.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "METHOD"})
+ */
+final class Until extends Version
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/Version.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Version.php
new file mode 100644
index 0000000000..62b663c07b
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/Version.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Annotation;
+
+abstract class Version
+{
+ /**
+ * @Required
+ * @var string
+ */
+ public $version;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/VirtualProperty.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/VirtualProperty.php
new file mode 100644
index 0000000000..ee168d91aa
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/VirtualProperty.php
@@ -0,0 +1,48 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"METHOD", "CLASS"})
+ *
+ * @author Alexander Klimenkov
+ */
+final class VirtualProperty
+{
+ public $exp;
+ public $name;
+ public $options = array();
+
+ public function __construct(array $data)
+ {
+ if (isset($data['value'])) {
+ $data['name'] = $data['value'];
+ unset($data['value']);
+ }
+
+ foreach ($data as $key => $value) {
+ if (!property_exists(__CLASS__, $key)) {
+ throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__));
+ }
+ $this->{$key} = $value;
+ }
+ }
+}
+
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlAttribute.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlAttribute.php
new file mode 100644
index 0000000000..9f7ef31b5f
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlAttribute.php
@@ -0,0 +1,31 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "METHOD","ANNOTATION"})
+ */
+final class XmlAttribute
+{
+ /**
+ * @var string
+ */
+ public $namespace;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlAttributeMap.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlAttributeMap.php
new file mode 100644
index 0000000000..2bdef0d425
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlAttributeMap.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "METHOD"})
+ */
+final class XmlAttributeMap
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlCollection.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlCollection.php
new file mode 100644
index 0000000000..699b59994b
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlCollection.php
@@ -0,0 +1,42 @@
+
+ *
+ * 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\Annotation;
+
+abstract class XmlCollection
+{
+ /**
+ * @var string
+ */
+ public $entry = 'entry';
+
+ /**
+ * @var boolean
+ */
+ public $inline = false;
+
+ /**
+ * @var string
+ */
+ public $namespace;
+
+ /**
+ * @var boolean
+ */
+ public $skipWhenEmpty = true;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlDiscriminator.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlDiscriminator.php
new file mode 100644
index 0000000000..caedd4c46c
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlDiscriminator.php
@@ -0,0 +1,42 @@
+
+ *
+ * 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\Annotation;
+
+
+/**
+ * @Annotation
+ * @Target("CLASS")
+ */
+class XmlDiscriminator
+{
+ /**
+ * @var boolean
+ */
+ public $attribute = false;
+
+ /**
+ * @var boolean
+ */
+ public $cdata = true;
+
+ /**
+ * @var string
+ */
+ public $namespace;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlElement.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlElement.php
new file mode 100644
index 0000000000..450fede8a7
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlElement.php
@@ -0,0 +1,36 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY", "METHOD","ANNOTATION"})
+ */
+final class XmlElement
+{
+ /**
+ * @var boolean
+ */
+ public $cdata = true;
+
+ /**
+ * @var string
+ */
+ public $namespace;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlKeyValuePairs.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlKeyValuePairs.php
new file mode 100644
index 0000000000..71fecab5d4
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlKeyValuePairs.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class XmlKeyValuePairs
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlList.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlList.php
new file mode 100644
index 0000000000..291daa90b5
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlList.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class XmlList extends XmlCollection
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlMap.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlMap.php
new file mode 100644
index 0000000000..813009df15
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlMap.php
@@ -0,0 +1,31 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class XmlMap extends XmlCollection
+{
+ /**
+ * @var string
+ */
+ public $keyAttribute = '_key';
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlNamespace.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlNamespace.php
new file mode 100644
index 0000000000..582e128ac7
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlNamespace.php
@@ -0,0 +1,37 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target("CLASS")
+ */
+final class XmlNamespace
+{
+ /**
+ * @Required
+ * @var string
+ */
+ public $uri;
+
+ /**
+ * @var string
+ */
+ public $prefix = '';
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlRoot.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlRoot.php
new file mode 100644
index 0000000000..46bcf479f4
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlRoot.php
@@ -0,0 +1,37 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target("CLASS")
+ */
+final class XmlRoot
+{
+ /**
+ * @Required
+ * @var string
+ */
+ public $name;
+
+ /**
+ * @var string
+ */
+ public $namespace;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlValue.php b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlValue.php
new file mode 100644
index 0000000000..2fbf8723f5
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Annotation/XmlValue.php
@@ -0,0 +1,31 @@
+
+ *
+ * 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\Annotation;
+
+/**
+ * @Annotation
+ * @Target({"PROPERTY","METHOD","ANNOTATION"})
+ */
+final class XmlValue
+{
+ /**
+ * @var boolean
+ */
+ public $cdata = true;
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ArrayTransformerInterface.php b/vendor/jms/serializer/src/JMS/Serializer/ArrayTransformerInterface.php
new file mode 100644
index 0000000000..fcd3fb1fa6
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ArrayTransformerInterface.php
@@ -0,0 +1,50 @@
+
+ *
+ * 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;
+
+/**
+ * Interface for array transformation.
+ *
+ * @author Daniel Bojdo
+ */
+interface ArrayTransformerInterface
+{
+ /**
+ * Converts objects to an array structure.
+ *
+ * This is useful when the data needs to be passed on to other methods which expect array data.
+ *
+ * @param mixed $data anything that converts to an array, typically an object or an array of objects
+ * @param SerializationContext|null $context
+ *
+ * @return array
+ */
+ public function toArray($data, SerializationContext $context = null);
+
+ /**
+ * Restores objects from an array structure.
+ *
+ * @param array $data
+ * @param string $type
+ * @param DeserializationContext|null $context
+ *
+ * @return mixed this returns whatever the passed type is, typically an object or an array of objects
+ */
+ public function fromArray(array $data, $type, DeserializationContext $context = null);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Builder/CallbackDriverFactory.php b/vendor/jms/serializer/src/JMS/Serializer/Builder/CallbackDriverFactory.php
new file mode 100644
index 0000000000..e9ad7a1f63
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Builder/CallbackDriverFactory.php
@@ -0,0 +1,29 @@
+callback = $callable;
+ }
+
+ public function createDriver(array $metadataDirs, Reader $reader)
+ {
+ $driver = call_user_func($this->callback, $metadataDirs, $reader);
+ if ( ! $driver instanceof DriverInterface) {
+ throw new \LogicException('The callback must return an instance of DriverInterface.');
+ }
+
+ return $driver;
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Builder/DefaultDriverFactory.php b/vendor/jms/serializer/src/JMS/Serializer/Builder/DefaultDriverFactory.php
new file mode 100644
index 0000000000..b85f90a4ef
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Builder/DefaultDriverFactory.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Construction;
+
+use Doctrine\Common\Persistence\ManagerRegistry;
+use JMS\Serializer\DeserializationContext;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Exception\ObjectConstructionException;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\VisitorInterface;
+
+/**
+ * Doctrine object constructor for new (or existing) objects during deserialization.
+ */
+class DoctrineObjectConstructor implements ObjectConstructorInterface
+{
+ const ON_MISSING_NULL = 'null';
+ const ON_MISSING_EXCEPTION = 'exception';
+ const ON_MISSING_FALLBACK = 'fallback';
+ /**
+ * @var string
+ */
+ private $fallbackStrategy;
+
+ private $managerRegistry;
+ private $fallbackConstructor;
+
+ /**
+ * Constructor.
+ *
+ * @param ManagerRegistry $managerRegistry Manager registry
+ * @param ObjectConstructorInterface $fallbackConstructor Fallback object constructor
+ * @param string $fallbackStrategy
+ */
+ public function __construct(ManagerRegistry $managerRegistry, ObjectConstructorInterface $fallbackConstructor, $fallbackStrategy = self::ON_MISSING_NULL)
+ {
+ $this->managerRegistry = $managerRegistry;
+ $this->fallbackConstructor = $fallbackConstructor;
+ $this->fallbackStrategy = $fallbackStrategy;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function construct(VisitorInterface $visitor, ClassMetadata $metadata, $data, array $type, DeserializationContext $context)
+ {
+ // Locate possible ObjectManager
+ $objectManager = $this->managerRegistry->getManagerForClass($metadata->name);
+
+ if ( ! $objectManager) {
+ // No ObjectManager found, proceed with normal deserialization
+ return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
+ }
+
+ // Locate possible ClassMetadata
+ $classMetadataFactory = $objectManager->getMetadataFactory();
+
+ if ($classMetadataFactory->isTransient($metadata->name)) {
+ // No ClassMetadata found, proceed with normal deserialization
+ return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
+ }
+
+ // Managed entity, check for proxy load
+ if ( ! is_array($data)) {
+ // Single identifier, load proxy
+ return $objectManager->getReference($metadata->name, $data);
+ }
+
+ // Fallback to default constructor if missing identifier(s)
+ $classMetadata = $objectManager->getClassMetadata($metadata->name);
+ $identifierList = array();
+
+ foreach ($classMetadata->getIdentifierFieldNames() as $name) {
+ if ( ! array_key_exists($name, $data)) {
+ return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
+ }
+
+ $identifierList[$name] = $data[$name];
+ }
+
+ // Entity update, load it from database
+ $object = $objectManager->find($metadata->name, $identifierList);
+
+ if (null === $object) {
+ switch ($this->fallbackStrategy) {
+ case self::ON_MISSING_NULL:
+ return null;
+ case self::ON_MISSING_EXCEPTION:
+ throw new ObjectConstructionException(sprintf("Entity %s can not be found", $metadata->name));
+ case self::ON_MISSING_FALLBACK:
+ return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
+ default:
+ throw new InvalidArgumentException("The provided fallback strategy for the object constructor is not valid");
+ }
+ }
+
+ $objectManager->initializeObject($object);
+
+ return $object;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Construction/ObjectConstructorInterface.php b/vendor/jms/serializer/src/JMS/Serializer/Construction/ObjectConstructorInterface.php
new file mode 100644
index 0000000000..e2c4be3f09
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Construction/ObjectConstructorInterface.php
@@ -0,0 +1,47 @@
+
+ *
+ * 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\Construction;
+
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\DeserializationContext;
+
+/**
+ * Implementations of this interface construct new objects during deserialization.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface ObjectConstructorInterface
+{
+ /**
+ * Constructs a new object.
+ *
+ * Implementations could for example create a new object calling "new", use
+ * "unserialize" techniques, reflection, or other means.
+ *
+ * @param VisitorInterface $visitor
+ * @param ClassMetadata $metadata
+ * @param mixed $data
+ * @param array $type ["name" => string, "params" => array]
+ * @param DeserializationContext $context
+ *
+ * @return object
+ */
+ public function construct(VisitorInterface $visitor, ClassMetadata $metadata, $data, array $type, DeserializationContext $context);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Construction/UnserializeObjectConstructor.php b/vendor/jms/serializer/src/JMS/Serializer/Construction/UnserializeObjectConstructor.php
new file mode 100644
index 0000000000..9614d75034
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Construction/UnserializeObjectConstructor.php
@@ -0,0 +1,47 @@
+
+ *
+ * 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\Construction;
+
+use Doctrine\Instantiator\Instantiator;
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\DeserializationContext;
+
+class UnserializeObjectConstructor implements ObjectConstructorInterface
+{
+ /** @var Instantiator */
+ private $instantiator;
+
+ public function construct(VisitorInterface $visitor, ClassMetadata $metadata, $data, array $type, DeserializationContext $context)
+ {
+ return $this->getInstantiator()->instantiate($metadata->name);
+ }
+
+ /**
+ * @return Instantiator
+ */
+ private function getInstantiator()
+ {
+ if (null == $this->instantiator) {
+ $this->instantiator = new Instantiator();
+ }
+
+ return $this->instantiator;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Context.php b/vendor/jms/serializer/src/JMS/Serializer/Context.php
new file mode 100644
index 0000000000..d5ad6ff5b2
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Context.php
@@ -0,0 +1,280 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Exclusion\DepthExclusionStrategy;
+use JMS\Serializer\Exclusion\DisjunctExclusionStrategy;
+use JMS\Serializer\Exclusion\ExclusionStrategyInterface;
+use JMS\Serializer\Exclusion\GroupsExclusionStrategy;
+use JMS\Serializer\Exclusion\VersionExclusionStrategy;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use Metadata\MetadataFactory;
+use Metadata\MetadataFactoryInterface;
+use PhpCollection\Map;
+
+abstract class Context
+{
+ /**
+ * @var \PhpCollection\Map
+ */
+ public $attributes;
+
+ private $format;
+
+ /** @var VisitorInterface */
+ private $visitor;
+
+ /** @var GraphNavigator */
+ private $navigator;
+
+ /** @var MetadataFactory */
+ private $metadataFactory;
+
+ /** @var ExclusionStrategyInterface */
+ private $exclusionStrategy;
+
+ /** @var boolean|null */
+ private $serializeNull;
+
+ private $initialized = false;
+
+ /** @var \SplStack */
+ private $metadataStack;
+
+ public function __construct()
+ {
+ $this->attributes = new Map();
+ }
+
+ /**
+ * @param string $format
+ */
+ public function initialize($format, VisitorInterface $visitor, GraphNavigator $navigator, MetadataFactoryInterface $factory)
+ {
+ if ($this->initialized) {
+ throw new \LogicException('This context was already initialized, and cannot be re-used.');
+ }
+
+ $this->initialized = true;
+ $this->format = $format;
+ $this->visitor = $visitor;
+ $this->navigator = $navigator;
+ $this->metadataFactory = $factory;
+ $this->metadataStack = new \SplStack();
+ }
+
+ public function accept($data, array $type = null)
+ {
+ return $this->navigator->accept($data, $type, $this);
+ }
+
+ public function getMetadataFactory()
+ {
+ return $this->metadataFactory;
+ }
+
+ public function getVisitor()
+ {
+ return $this->visitor;
+ }
+
+ public function getNavigator()
+ {
+ return $this->navigator;
+ }
+
+ public function getExclusionStrategy()
+ {
+ return $this->exclusionStrategy;
+ }
+
+ public function setAttribute($key, $value)
+ {
+ $this->assertMutable();
+ $this->attributes->set($key, $value);
+
+ return $this;
+ }
+
+ private function assertMutable()
+ {
+ if ( ! $this->initialized) {
+ return;
+ }
+
+ throw new \LogicException('This context was already initialized and is immutable; you cannot modify it anymore.');
+ }
+
+ public function addExclusionStrategy(ExclusionStrategyInterface $strategy)
+ {
+ $this->assertMutable();
+
+ if (null === $this->exclusionStrategy) {
+ $this->exclusionStrategy = $strategy;
+
+ return $this;
+ }
+
+ if ($this->exclusionStrategy instanceof DisjunctExclusionStrategy) {
+ $this->exclusionStrategy->addStrategy($strategy);
+
+ return $this;
+ }
+
+ $this->exclusionStrategy = new DisjunctExclusionStrategy(array(
+ $this->exclusionStrategy,
+ $strategy,
+ ));
+
+ return $this;
+ }
+
+ /**
+ * @param integer $version
+ */
+ public function setVersion($version)
+ {
+ if (null === $version) {
+ throw new \LogicException('The version must not be null.');
+ }
+
+ $this->attributes->set('version', $version);
+ $this->addExclusionStrategy(new VersionExclusionStrategy($version));
+
+ return $this;
+ }
+
+ /**
+ * @param array|string $groups
+ */
+ public function setGroups($groups)
+ {
+ if (empty($groups)) {
+ throw new \LogicException('The groups must not be empty.');
+ }
+
+ $this->attributes->set('groups', (array) $groups);
+ $this->addExclusionStrategy(new GroupsExclusionStrategy((array) $groups));
+
+ return $this;
+ }
+
+ public function enableMaxDepthChecks()
+ {
+ $this->addExclusionStrategy(new DepthExclusionStrategy());
+
+ return $this;
+ }
+
+ /**
+ * Set if NULLs should be serialized (TRUE) ot not (FALSE)
+ *
+ * @param bool $bool
+ * @return $this
+ */
+ public function setSerializeNull($bool)
+ {
+ $this->serializeNull = (boolean) $bool;
+
+ return $this;
+ }
+
+ /**
+ * Returns TRUE when NULLs should be serialized
+ * Returns FALSE when NULLs should not be serialized
+ * Returns NULL when NULLs should not be serialized,
+ * but the user has not explicitly decided to use this policy
+ *
+ * @return bool|null
+ */
+ public function shouldSerializeNull()
+ {
+ return $this->serializeNull;
+ }
+
+ /**
+ * @return string
+ */
+ public function getFormat()
+ {
+ return $this->format;
+ }
+
+ public function pushClassMetadata(ClassMetadata $metadata)
+ {
+ $this->metadataStack->push($metadata);
+ }
+
+ public function pushPropertyMetadata(PropertyMetadata $metadata)
+ {
+ $this->metadataStack->push($metadata);
+ }
+
+ public function popPropertyMetadata()
+ {
+ $metadata = $this->metadataStack->pop();
+
+ if ( ! $metadata instanceof PropertyMetadata) {
+ throw new RuntimeException('Context metadataStack not working well');
+ }
+ }
+
+ public function popClassMetadata()
+ {
+ $metadata = $this->metadataStack->pop();
+
+ if ( ! $metadata instanceof ClassMetadata) {
+ throw new RuntimeException('Context metadataStack not working well');
+ }
+ }
+
+ public function getMetadataStack()
+ {
+ return $this->metadataStack;
+ }
+
+ /**
+ * @return array
+ */
+ public function getCurrentPath()
+ {
+ if (!$this->metadataStack) {
+ return array();
+ }
+
+ $paths = array();
+ foreach ($this->metadataStack as $metadata) {
+ if ($metadata instanceof PropertyMetadata) {
+ array_unshift($paths, $metadata->name);
+ }
+ }
+
+ return $paths;
+ }
+
+
+ abstract public function getDepth();
+
+ /**
+ * @return integer
+ */
+ abstract public function getDirection();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableContextFactory.php b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableContextFactory.php
new file mode 100644
index 0000000000..84c26b05d2
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableContextFactory.php
@@ -0,0 +1,48 @@
+
+ *
+ * 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\ContextFactory;
+
+/**
+ * Context Factory using a callable.
+ */
+abstract class CallableContextFactory
+{
+ /**
+ * @var callable
+ */
+ private $callable;
+
+ /**
+ * @param callable $callable
+ */
+ public function __construct(callable $callable)
+ {
+ $this->callable = $callable;
+ }
+
+ /**
+ * @return mixed
+ */
+ protected function createContext()
+ {
+ $callable = $this->callable;
+
+ return $callable();
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableDeserializationContextFactory.php b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableDeserializationContextFactory.php
new file mode 100644
index 0000000000..20f9808557
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableDeserializationContextFactory.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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\ContextFactory;
+
+/**
+ * Deserialization Context Factory using a callable.
+ */
+class CallableDeserializationContextFactory extends CallableContextFactory implements
+ DeserializationContextFactoryInterface
+{
+ /**
+ * {@InheritDoc}
+ */
+ public function createDeserializationContext()
+ {
+ return $this->createContext();
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableSerializationContextFactory.php b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableSerializationContextFactory.php
new file mode 100644
index 0000000000..083666b357
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/CallableSerializationContextFactory.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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\ContextFactory;
+
+/**
+ * Serialization Context Factory using a callable.
+ */
+class CallableSerializationContextFactory extends CallableContextFactory implements
+ SerializationContextFactoryInterface
+{
+ /**
+ * {@InheritDoc}
+ */
+ public function createSerializationContext()
+ {
+ return $this->createContext();
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DefaultDeserializationContextFactory.php b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DefaultDeserializationContextFactory.php
new file mode 100644
index 0000000000..d2b1d5eed4
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DefaultDeserializationContextFactory.php
@@ -0,0 +1,35 @@
+
+ *
+ * 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\ContextFactory;
+
+use JMS\Serializer\DeserializationContext;
+
+/**
+ * Default Deserialization Context Factory.
+ */
+class DefaultDeserializationContextFactory implements DeserializationContextFactoryInterface
+{
+ /**
+ * {@InheritDoc}
+ */
+ public function createDeserializationContext()
+ {
+ return new DeserializationContext();
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DefaultSerializationContextFactory.php b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DefaultSerializationContextFactory.php
new file mode 100644
index 0000000000..a292d27167
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DefaultSerializationContextFactory.php
@@ -0,0 +1,35 @@
+
+ *
+ * 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\ContextFactory;
+
+use JMS\Serializer\SerializationContext;
+
+/**
+ * Default Serialization Context Factory.
+ */
+class DefaultSerializationContextFactory implements SerializationContextFactoryInterface
+{
+ /**
+ * {@InheritDoc}
+ */
+ public function createSerializationContext()
+ {
+ return new SerializationContext();
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DeserializationContextFactoryInterface.php b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DeserializationContextFactoryInterface.php
new file mode 100644
index 0000000000..3b6718b1de
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/DeserializationContextFactoryInterface.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\ContextFactory;
+
+use JMS\Serializer\DeserializationContext;
+
+/**
+ * Deserialization Context Factory Interface.
+ */
+interface DeserializationContextFactoryInterface
+{
+ /**
+ * @return DeserializationContext
+ */
+ public function createDeserializationContext();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/SerializationContextFactoryInterface.php b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/SerializationContextFactoryInterface.php
new file mode 100644
index 0000000000..725d83bb15
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/ContextFactory/SerializationContextFactoryInterface.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\ContextFactory;
+
+use JMS\Serializer\SerializationContext;
+
+/**
+ * Serialization Context Factory Interface.
+ */
+interface SerializationContextFactoryInterface
+{
+ /**
+ * @return SerializationContext
+ */
+ public function createSerializationContext();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/DeserializationContext.php b/vendor/jms/serializer/src/JMS/Serializer/DeserializationContext.php
new file mode 100644
index 0000000000..32aa8677e9
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/DeserializationContext.php
@@ -0,0 +1,53 @@
+
+ *
+ * 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;
+
+class DeserializationContext extends Context
+{
+ private $depth = 0;
+
+ public static function create()
+ {
+ return new self();
+ }
+
+ public function getDirection()
+ {
+ return GraphNavigator::DIRECTION_DESERIALIZATION;
+ }
+
+ public function getDepth()
+ {
+ return $this->depth;
+ }
+
+ public function increaseDepth()
+ {
+ $this->depth += 1;
+ }
+
+ public function decreaseDepth()
+ {
+ if ($this->depth <= 0) {
+ throw new \LogicException('Depth cannot be smaller than zero.');
+ }
+
+ $this->depth -= 1;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Event.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Event.php
new file mode 100644
index 0000000000..46fda85c07
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Event.php
@@ -0,0 +1,76 @@
+
+ *
+ * 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\EventDispatcher;
+
+use JMS\Serializer\Context;
+
+class Event
+{
+ /**
+ * @var bool Whether no further event listeners should be triggered
+ */
+ private $propagationStopped = false;
+
+ protected $type;
+ private $context;
+
+ public function __construct(Context $context, array $type)
+ {
+ $this->context = $context;
+ $this->type = $type;
+ }
+
+ public function getVisitor()
+ {
+ return $this->context->getVisitor();
+ }
+
+ public function getContext()
+ {
+ return $this->context;
+ }
+
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * Returns whether further event listeners should be triggered.
+ *
+ * @see Event::stopPropagation()
+ *
+ * @return bool Whether propagation was already stopped for this event
+ */
+ public function isPropagationStopped()
+ {
+ return $this->propagationStopped;
+ }
+ /**
+ * Stops the propagation of the event to further event listeners.
+ *
+ * If multiple event listeners are connected to the same event, no
+ * further event listener will be triggered once any trigger calls
+ * stopPropagation().
+ */
+ public function stopPropagation()
+ {
+ $this->propagationStopped = true;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventDispatcher.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventDispatcher.php
new file mode 100644
index 0000000000..8f4f075db8
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventDispatcher.php
@@ -0,0 +1,130 @@
+
+ *
+ * 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\EventDispatcher;
+use JMS\Serializer\Exception\InvalidArgumentException;
+
+/**
+ * Light-weight event dispatcher.
+ *
+ * This implementation focuses primarily on performance, and dispatching
+ * events for certain classes. It is not a general purpose event dispatcher.
+ *
+ * @author Johannes M. Schmitt
+ */
+class EventDispatcher implements EventDispatcherInterface
+{
+ private $listeners = array();
+ private $classListeners = array();
+
+ public static function getDefaultMethodName($eventName)
+ {
+ return 'on'.str_replace(array('_', '.'), '', $eventName);
+ }
+
+ /**
+ * Sets the listeners.
+ *
+ * @param array $listeners
+ */
+ public function setListeners(array $listeners)
+ {
+ $this->listeners = $listeners;
+ $this->classListeners = array();
+ }
+
+ public function addListener($eventName, $callable, $class = null, $format = null)
+ {
+ $this->listeners[$eventName][] = array($callable, null === $class ? null : strtolower($class), $format);
+ unset($this->classListeners[$eventName]);
+ }
+
+ public function addSubscriber(EventSubscriberInterface $subscriber)
+ {
+ foreach ($subscriber->getSubscribedEvents() as $eventData) {
+ if ( ! isset($eventData['event'])) {
+ throw new InvalidArgumentException(sprintf('Each event must have a "event" key.'));
+ }
+
+ $method = isset($eventData['method']) ? $eventData['method'] : self::getDefaultMethodName($eventData['event']);
+ $class = isset($eventData['class']) ? strtolower($eventData['class']) : null;
+ $format = isset($eventData['format']) ? $eventData['format'] : null;
+ $this->listeners[$eventData['event']][] = array(array($subscriber, $method), $class, $format);
+ unset($this->classListeners[$eventData['event']]);
+ }
+ }
+
+ public function hasListeners($eventName, $class, $format)
+ {
+ if ( ! isset($this->listeners[$eventName])) {
+ return false;
+ }
+
+ $loweredClass = strtolower($class);
+ if ( ! isset($this->classListeners[$eventName][$loweredClass][$format])) {
+ $this->classListeners[$eventName][$loweredClass][$format] = $this->initializeListeners($eventName, $loweredClass, $format);
+ }
+
+ return !!$this->classListeners[$eventName][$loweredClass][$format];
+ }
+
+ public function dispatch($eventName, $class, $format, Event $event)
+ {
+ if ( ! isset($this->listeners[$eventName])) {
+ return;
+ }
+
+ $loweredClass = strtolower($class);
+ if ( ! isset($this->classListeners[$eventName][$loweredClass][$format])) {
+ $this->classListeners[$eventName][$loweredClass][$format] = $this->initializeListeners($eventName, $loweredClass, $format);
+ }
+
+ foreach ($this->classListeners[$eventName][$loweredClass][$format] as $listener) {
+
+ if ($event->isPropagationStopped()) {
+ break;
+ }
+
+ call_user_func($listener, $event, $eventName, $loweredClass, $format, $this);
+ }
+ }
+
+ /**
+ * @param string $eventName
+ * @param string $loweredClass
+ * @param string $format
+ *
+ * @return array An array of listeners
+ */
+ protected function initializeListeners($eventName, $loweredClass, $format)
+ {
+ $listeners = array();
+ foreach ($this->listeners[$eventName] as $listener) {
+ if (null !== $listener[1] && $loweredClass !== $listener[1]) {
+ continue;
+ }
+ if (null !== $listener[2] && $format !== $listener[2]) {
+ continue;
+ }
+
+ $listeners[] = $listener[0];
+ }
+
+ return $listeners;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventDispatcherInterface.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventDispatcherInterface.php
new file mode 100644
index 0000000000..d757f99af2
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventDispatcherInterface.php
@@ -0,0 +1,66 @@
+
+ *
+ * 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\EventDispatcher;
+
+interface EventDispatcherInterface
+{
+ /**
+ * Returns whether there are listeners.
+ *
+ * @param string $eventName
+ * @param string $class
+ * @param string $format
+ *
+ * @return boolean
+ */
+ public function hasListeners($eventName, $class, $format);
+
+ /**
+ * Dispatches an event.
+ *
+ * The listeners/subscribers are called in the same order in which they
+ * were added to the dispatcher.
+ *
+ * @param string $eventName
+ * @param string $class
+ * @param string $format
+ * @param Event $event
+ * @return void
+ */
+ public function dispatch($eventName, $class, $format, Event $event);
+
+ /**
+ * Adds a listener.
+ *
+ * @param string $eventName
+ * @param callable $callable
+ * @param string|null $class
+ * @param string|null $format
+ * @return void
+ */
+ public function addListener($eventName, $callable, $class = null, $format = null);
+
+ /**
+ * Adds a subscribers.
+ *
+ * @param EventSubscriberInterface $subscriber
+ * @return void
+ */
+ public function addSubscriber(EventSubscriberInterface $subscriber);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventSubscriberInterface.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventSubscriberInterface.php
new file mode 100644
index 0000000000..a079ea5ffa
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventSubscriberInterface.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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\EventDispatcher;
+
+interface EventSubscriberInterface
+{
+ /**
+ * Returns the events to which this class has subscribed.
+ *
+ * Return format:
+ * array(
+ * array('event' => 'the-event-name', 'method' => 'onEventName', 'class' => 'some-class', 'format' => 'json'),
+ * array(...),
+ * )
+ *
+ * The class may be omitted if the class wants to subscribe to events of all classes.
+ * Same goes for the format key.
+ *
+ * @return array
+ */
+ public static function getSubscribedEvents();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Events.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Events.php
new file mode 100644
index 0000000000..b0211e36d7
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Events.php
@@ -0,0 +1,29 @@
+
+ *
+ * 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\EventDispatcher;
+
+abstract class Events
+{
+ const PRE_SERIALIZE = 'serializer.pre_serialize';
+ const POST_SERIALIZE = 'serializer.post_serialize';
+ const PRE_DESERIALIZE = 'serializer.pre_deserialize';
+ const POST_DESERIALIZE = 'serializer.post_deserialize';
+
+ final private function __construct() { }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/LazyEventDispatcher.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/LazyEventDispatcher.php
new file mode 100644
index 0000000000..fbc782fcd5
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/LazyEventDispatcher.php
@@ -0,0 +1,53 @@
+
+ *
+ * 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\EventDispatcher;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+class LazyEventDispatcher extends EventDispatcher
+{
+ private $container;
+
+ public function __construct(ContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function initializeListeners($eventName, $loweredClass, $format)
+ {
+ $listeners = parent::initializeListeners($eventName, $loweredClass, $format);
+
+ foreach ($listeners as &$listener) {
+ if ( ! is_array($listener) || ! is_string($listener[0])) {
+ continue;
+ }
+
+ if ( ! $this->container->has($listener[0])) {
+ continue;
+ }
+
+ $listener[0] = $this->container->get($listener[0]);
+ }
+
+ return $listeners;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/ObjectEvent.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/ObjectEvent.php
new file mode 100644
index 0000000000..c619d41a54
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/ObjectEvent.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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\EventDispatcher;
+
+use JMS\Serializer\Context;
+
+class ObjectEvent extends Event
+{
+ private $object;
+
+ public function __construct(Context $context, $object, array $type)
+ {
+ parent::__construct($context, $type);
+
+ $this->object = $object;
+ }
+
+ public function getObject()
+ {
+ return $this->object;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/PreDeserializeEvent.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/PreDeserializeEvent.php
new file mode 100644
index 0000000000..228eadeb0a
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/PreDeserializeEvent.php
@@ -0,0 +1,48 @@
+
+ *
+ * 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\EventDispatcher;
+
+use JMS\Serializer\DeserializationContext;
+
+class PreDeserializeEvent extends Event
+{
+ private $data;
+
+ public function __construct(DeserializationContext $context, $data, array $type)
+ {
+ parent::__construct($context, $type);
+
+ $this->data = $data;
+ }
+
+ public function setType($name, array $params = array())
+ {
+ $this->type = array('name' => $name, 'params' => $params);
+ }
+
+ public function getData()
+ {
+ return $this->data;
+ }
+
+ public function setData($data)
+ {
+ $this->data = $data;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/PreSerializeEvent.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/PreSerializeEvent.php
new file mode 100644
index 0000000000..ca3ed9cb19
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/PreSerializeEvent.php
@@ -0,0 +1,31 @@
+
+ *
+ * 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\EventDispatcher;
+
+class PreSerializeEvent extends ObjectEvent
+{
+ /**
+ * @param string $typeName
+ * @param array $params
+ */
+ public function setType($typeName, array $params = array())
+ {
+ $this->type = array('name' => $typeName, 'params' => $params);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriber.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriber.php
new file mode 100644
index 0000000000..1f91d7702f
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriber.php
@@ -0,0 +1,123 @@
+
+ *
+ * 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\EventDispatcher\Subscriber;
+
+use Doctrine\ORM\PersistentCollection;
+use Doctrine\ODM\MongoDB\PersistentCollection as MongoDBPersistentCollection;
+use Doctrine\ODM\PHPCR\PersistentCollection as PHPCRPersistentCollection;
+use Doctrine\Common\Persistence\Proxy;
+use Doctrine\ORM\Proxy\Proxy as ORMProxy;
+use JMS\Serializer\EventDispatcher\EventDispatcherInterface;
+use JMS\Serializer\EventDispatcher\PreSerializeEvent;
+use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
+
+class DoctrineProxySubscriber implements EventSubscriberInterface
+{
+ /**
+ * @var bool
+ */
+ private $skipVirtualTypeInit = false;
+
+ /**
+ * @var bool
+ */
+ private $initializeExcluded = true;
+
+ public function __construct($skipVirtualTypeInit = false, $initializeExcluded = true)
+ {
+ $this->skipVirtualTypeInit = (bool)$skipVirtualTypeInit;
+ $this->initializeExcluded = (bool)$initializeExcluded;
+ }
+
+ public function onPreSerialize(PreSerializeEvent $event)
+ {
+ $object = $event->getObject();
+ $type = $event->getType();
+
+ // If the set type name is not an actual class, but a faked type for which a custom handler exists, we do not
+ // modify it with this subscriber. Also, we forgo autoloading here as an instance of this type is already created,
+ // so it must be loaded if its a real class.
+ $virtualType = ! class_exists($type['name'], false);
+
+ if ($object instanceof PersistentCollection
+ || $object instanceof MongoDBPersistentCollection
+ || $object instanceof PHPCRPersistentCollection
+ ) {
+ if ( ! $virtualType) {
+ $event->setType('ArrayCollection');
+ }
+
+ return;
+ }
+
+ if (($this->skipVirtualTypeInit && $virtualType) ||
+ (!$object instanceof Proxy && !$object instanceof ORMProxy)
+ ) {
+ return;
+ }
+
+ // do not initialize the proxy if is going to be excluded by-class by some exclusion strategy
+ if ($this->initializeExcluded === false && !$virtualType) {
+ $context = $event->getContext();
+ $exclusionStrategy = $context->getExclusionStrategy();
+ if ($exclusionStrategy !== null && $exclusionStrategy->shouldSkipClass($context->getMetadataFactory()->getMetadataForClass(get_parent_class($object)), $context)) {
+ return;
+ }
+ }
+
+ $object->__load();
+
+ if ( ! $virtualType) {
+ $event->setType(get_parent_class($object));
+ }
+ }
+
+ public function onPreSerializeTypedProxy(PreSerializeEvent $event, $eventName, $class, $format, EventDispatcherInterface $dispatcher)
+ {
+ $type = $event->getType();
+ // is a virtual type? then there is no need to change the event name
+ if (!class_exists($type['name'], false)) {
+ return;
+ }
+
+ $object = $event->getObject();
+ if ($object instanceof Proxy) {
+ $parentClassName = get_parent_class($object);
+
+ // check if this is already a re-dispatch
+ if (strtolower($class) !== strtolower($parentClassName)) {
+ $event->stopPropagation();
+ $newEvent = new PreSerializeEvent($event->getContext(), $object, array('name' => $parentClassName, 'params' => $type['params']));
+ $dispatcher->dispatch($eventName, $parentClassName, $format, $newEvent);
+
+ // update the type in case some listener changed it
+ $newType = $newEvent->getType();
+ $event->setType($newType['name'], $newType['params']);
+ }
+ }
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ array('event' => 'serializer.pre_serialize', 'method' => 'onPreSerializeTypedProxy'),
+ array('event' => 'serializer.pre_serialize', 'method' => 'onPreSerialize'),
+ );
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriber.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriber.php
new file mode 100644
index 0000000000..b34a8bc947
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriber.php
@@ -0,0 +1,61 @@
+
+ *
+ * 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\EventDispatcher\Subscriber;
+
+use JMS\Serializer\EventDispatcher\Event;
+use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
+use JMS\Serializer\Exception\ValidationFailedException;
+use Symfony\Component\Validator\ValidatorInterface;
+
+class SymfonyValidatorSubscriber implements EventSubscriberInterface
+{
+ private $validator;
+
+ public function __construct(ValidatorInterface $validator)
+ {
+ $this->validator = $validator;
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ array('event' => 'serializer.post_deserialize', 'method' => 'onPostDeserialize'),
+ );
+ }
+
+ public function onPostDeserialize(Event $event)
+ {
+ $context = $event->getContext();
+
+ if ($context->getDepth() > 0) {
+ return;
+ }
+
+ $validator = $this->validator;
+ $context->attributes->get('validation_groups')->map(
+ function(array $groups) use ($event, $validator) {
+ $list = $validator->validate($event->getObject(), $groups);
+
+ if ($list->count() > 0) {
+ throw new ValidationFailedException($list);
+ }
+ }
+ );
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/SymfonyValidatorValidatorSubscriber.php b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/SymfonyValidatorValidatorSubscriber.php
new file mode 100644
index 0000000000..75ab85d5ed
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/Subscriber/SymfonyValidatorValidatorSubscriber.php
@@ -0,0 +1,73 @@
+
+ *
+ * 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\EventDispatcher\Subscriber;
+
+use JMS\Serializer\EventDispatcher\Event;
+use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
+use JMS\Serializer\Exception\ValidationFailedException;
+use PhpOption\None;
+use Symfony\Component\Validator\Validator\ValidatorInterface;
+
+class SymfonyValidatorValidatorSubscriber implements EventSubscriberInterface
+{
+ /**
+ * @var ValidatorInterface
+ */
+ private $validator;
+
+ public function __construct(ValidatorInterface $validator)
+ {
+ $this->validator = $validator;
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ array('event' => 'serializer.post_deserialize', 'method' => 'onPostDeserialize'),
+ );
+ }
+
+ public function onPostDeserialize(Event $event)
+ {
+ $context = $event->getContext();
+
+ if ($context->getDepth() > 0) {
+ return;
+ }
+
+ $validator = $this->validator;
+ $groups = $context->attributes->get('validation_groups') instanceof None
+ ? null
+ : $context->attributes->get('validation_groups')->get();
+
+ if (!$groups) {
+ return;
+ }
+
+ $constraints = $context->attributes->get('validation_constraints') instanceof None
+ ? null
+ : $context->attributes->get('validation_constraints')->get();
+
+ $list = $validator->validate($event->getObject(), $constraints, $groups);
+
+ if ($list->count() > 0) {
+ throw new ValidationFailedException($list);
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/Exception.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/Exception.php
new file mode 100644
index 0000000000..ae8fa65367
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/Exception.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Exception;
+
+/**
+ * Base exception for the Serializer.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface Exception
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/ExpressionLanguageRequiredException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/ExpressionLanguageRequiredException.php
new file mode 100644
index 0000000000..3df970fe47
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/ExpressionLanguageRequiredException.php
@@ -0,0 +1,26 @@
+
+ *
+ * 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\Exception;
+
+/**
+ * @author Asmir Mustafic
+ */
+class ExpressionLanguageRequiredException extends LogicException
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/InvalidArgumentException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/InvalidArgumentException.php
new file mode 100644
index 0000000000..fb5d344c21
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/InvalidArgumentException.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Exception;
+
+/**
+ * InvalidArgumentException for the Serializer.
+ *
+ * @author Johannes M. Schmitt
+ */
+class InvalidArgumentException extends \InvalidArgumentException implements Exception
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/LogicException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/LogicException.php
new file mode 100644
index 0000000000..f74b0153ea
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/LogicException.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Exception;
+
+/**
+ * LogicException for the Serializer.
+ *
+ * @author Johannes M. Schmitt
+ */
+class LogicException extends \LogicException implements Exception
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/ObjectConstructionException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/ObjectConstructionException.php
new file mode 100644
index 0000000000..9b8a845d04
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/ObjectConstructionException.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Exception;
+
+/**
+ * InvalidArgumentException for the Serializer.
+ *
+ * @author Asmir Mustafic
+ */
+class ObjectConstructionException extends RuntimeException implements Exception
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/RuntimeException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/RuntimeException.php
new file mode 100644
index 0000000000..cf15a7cd9d
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/RuntimeException.php
@@ -0,0 +1,28 @@
+
+ *
+ * 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\Exception;
+
+/**
+ * RuntimeException for the Serializer.
+ *
+ * @author Johannes M. Schmitt
+ */
+class RuntimeException extends \RuntimeException implements Exception
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/UnsupportedFormatException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/UnsupportedFormatException.php
new file mode 100644
index 0000000000..bf8e6d74f8
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/UnsupportedFormatException.php
@@ -0,0 +1,23 @@
+
+ *
+ * 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\Exception;
+
+class UnsupportedFormatException extends InvalidArgumentException
+{
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/ValidationFailedException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/ValidationFailedException.php
new file mode 100644
index 0000000000..2627b919ab
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/ValidationFailedException.php
@@ -0,0 +1,44 @@
+
+ *
+ * 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\Exception;
+
+use Symfony\Component\Validator\ConstraintViolationListInterface;
+
+class ValidationFailedException extends RuntimeException
+{
+ /**
+ * @var ConstraintViolationListInterface
+ */
+ private $list;
+
+ public function __construct(ConstraintViolationListInterface $list)
+ {
+ parent::__construct(sprintf('Validation failed with %d error(s).', count($list)));
+
+ $this->list = $list;
+ }
+
+ /**
+ * @return ConstraintViolationListInterface
+ */
+ public function getConstraintViolationList()
+ {
+ return $this->list;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exception/XmlErrorException.php b/vendor/jms/serializer/src/JMS/Serializer/Exception/XmlErrorException.php
new file mode 100644
index 0000000000..509a5947d8
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exception/XmlErrorException.php
@@ -0,0 +1,53 @@
+
+ *
+ * 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\Exception;
+
+class XmlErrorException extends RuntimeException
+{
+ private $xmlError;
+
+ public function __construct(\LibXMLError $error)
+ {
+ switch ($error->level) {
+ case LIBXML_ERR_WARNING:
+ $level = 'WARNING';
+ break;
+
+ case LIBXML_ERR_FATAL:
+ $level = 'FATAL';
+ break;
+
+ case LIBXML_ERR_ERROR:
+ $level = 'ERROR';
+ break;
+
+ default:
+ $level = 'UNKNOWN';
+ }
+
+ parent::__construct(sprintf('[%s] %s in %s (line: %d, column: %d)', $level, $error->message, $error->file, $error->line, $error->column));
+
+ $this->xmlError = $error;
+ }
+
+ public function getXmlError()
+ {
+ return $this->xmlError;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exclusion/DepthExclusionStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/DepthExclusionStrategy.php
new file mode 100644
index 0000000000..89295fcaa8
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/DepthExclusionStrategy.php
@@ -0,0 +1,67 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * @author Adrien Brault
+ */
+class DepthExclusionStrategy implements ExclusionStrategyInterface
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function shouldSkipClass(ClassMetadata $metadata, Context $context)
+ {
+ return $this->isTooDeep($context);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function shouldSkipProperty(PropertyMetadata $property, Context $context)
+ {
+ return $this->isTooDeep($context);
+ }
+
+ private function isTooDeep(Context $context)
+ {
+ $depth = $context->getDepth();
+ $metadataStack = $context->getMetadataStack();
+
+ $nthProperty = 0;
+ // iterate from the first added items to the lasts
+ for ($i = $metadataStack->count() - 1; $i > 0; $i--) {
+ $metadata = $metadataStack[$i];
+ if ($metadata instanceof PropertyMetadata) {
+ $nthProperty++;
+ $relativeDepth = $depth - $nthProperty;
+
+ if (null !== $metadata->maxDepth && $relativeDepth > $metadata->maxDepth) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exclusion/DisjunctExclusionStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/DisjunctExclusionStrategy.php
new file mode 100644
index 0000000000..fcede93f68
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/DisjunctExclusionStrategy.php
@@ -0,0 +1,93 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use PhpCollection\Sequence;
+use PhpCollection\SequenceInterface;
+
+/**
+ * Disjunct Exclusion Strategy.
+ *
+ * This strategy is short-circuiting and will skip a class, or property as soon as one of the delegates skips it.
+ *
+ * @author Johannes M. Schmitt
+ */
+class DisjunctExclusionStrategy implements ExclusionStrategyInterface
+{
+ /** @var \PhpCollection\SequenceInterface */
+ private $delegates;
+
+ /**
+ * @param ExclusionStrategyInterface[]|SequenceInterface $delegates
+ */
+ public function __construct($delegates)
+ {
+ if ( ! $delegates instanceof SequenceInterface) {
+ $delegates = new Sequence($delegates);
+ }
+
+ $this->delegates = $delegates;
+ }
+
+ public function addStrategy(ExclusionStrategyInterface $strategy)
+ {
+ $this->delegates->add($strategy);
+ }
+
+ /**
+ * Whether the class should be skipped.
+ *
+ * @param ClassMetadata $metadata
+ *
+ * @return boolean
+ */
+ public function shouldSkipClass(ClassMetadata $metadata, Context $context)
+ {
+ foreach ($this->delegates as $delegate) {
+ /** @var $delegate ExclusionStrategyInterface */
+ if ($delegate->shouldSkipClass($metadata, $context)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Whether the property should be skipped.
+ *
+ * @param PropertyMetadata $property
+ *
+ * @return boolean
+ */
+ public function shouldSkipProperty(PropertyMetadata $property, Context $context)
+ {
+ foreach ($this->delegates as $delegate) {
+ /** @var $delegate ExclusionStrategyInterface */
+ if ($delegate->shouldSkipProperty($property, $context)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exclusion/ExclusionStrategyInterface.php b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/ExclusionStrategyInterface.php
new file mode 100644
index 0000000000..a84e1df2d8
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/ExclusionStrategyInterface.php
@@ -0,0 +1,49 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Context;
+
+/**
+ * Interface for exclusion strategies.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface ExclusionStrategyInterface
+{
+ /**
+ * Whether the class should be skipped.
+ *
+ * @param ClassMetadata $metadata
+ *
+ * @return boolean
+ */
+ public function shouldSkipClass(ClassMetadata $metadata, Context $context);
+
+ /**
+ * Whether the property should be skipped.
+ *
+ * @param PropertyMetadata $property
+ *
+ * @return boolean
+ */
+ public function shouldSkipProperty(PropertyMetadata $property, Context $context);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exclusion/ExpressionLanguageExclusionStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/ExpressionLanguageExclusionStrategy.php
new file mode 100644
index 0000000000..e6dc309fcb
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/ExpressionLanguageExclusionStrategy.php
@@ -0,0 +1,64 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\SerializationContext;
+use JMS\Serializer\Expression\ExpressionEvaluatorInterface;
+
+/**
+ * Exposes an exclusion strategy based on the Symfony's expression language.
+ * This is not a standard exclusion strategy and can not be used in user applications.
+ *
+ * @internal
+ *
+ * @author Asmir Mustafic
+ */
+class ExpressionLanguageExclusionStrategy
+{
+ /**
+ * @var ExpressionEvaluatorInterface
+ */
+ private $expressionEvaluator;
+
+ public function __construct(ExpressionEvaluatorInterface $expressionEvaluator)
+ {
+ $this->expressionEvaluator = $expressionEvaluator;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function shouldSkipProperty(PropertyMetadata $property, Context $navigatorContext)
+ {
+ if (null === $property->excludeIf) {
+ return false;
+ }
+
+ $variables = [
+ 'context' => $navigatorContext,
+ ];
+ if ($navigatorContext instanceof SerializationContext) {
+ $variables['object'] = $navigatorContext->getObject();
+ }
+
+ return $this->expressionEvaluator->evaluate($property->excludeIf, $variables);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exclusion/GroupsExclusionStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/GroupsExclusionStrategy.php
new file mode 100644
index 0000000000..6d15663250
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/GroupsExclusionStrategy.php
@@ -0,0 +1,92 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Context;
+
+class GroupsExclusionStrategy implements ExclusionStrategyInterface
+{
+ const DEFAULT_GROUP = 'Default';
+
+ private $groups = array();
+
+ public function __construct(array $groups)
+ {
+ if (empty($groups)) {
+ $groups = array(self::DEFAULT_GROUP);
+ }
+
+ $this->groups = $groups;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function shouldSkipClass(ClassMetadata $metadata, Context $navigatorContext)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function shouldSkipProperty(PropertyMetadata $property, Context $navigatorContext)
+ {
+ $groups = $this->getGroupsFor($navigatorContext);
+
+ if ( ! $property->groups) {
+ return ! in_array(self::DEFAULT_GROUP, $groups);
+ }
+
+ return $this->shouldSkipUsingGroups($property, $groups);
+ }
+
+ private function shouldSkipUsingGroups(PropertyMetadata $property, $groups)
+ {
+ foreach ($property->groups as $group) {
+ if (in_array($group, $groups)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private function getGroupsFor(Context $navigatorContext)
+ {
+ $paths = $navigatorContext->getCurrentPath();
+
+ $groups = $this->groups;
+ foreach ($paths as $index => $path) {
+ if (!array_key_exists($path, $groups)) {
+ if ($index > 0) {
+ $groups = array(self::DEFAULT_GROUP);
+ }
+
+ break;
+ }
+
+ $groups = $groups[$path];
+ }
+
+ return $groups;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Exclusion/VersionExclusionStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/VersionExclusionStrategy.php
new file mode 100644
index 0000000000..04650dc674
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Exclusion/VersionExclusionStrategy.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Context;
+
+class VersionExclusionStrategy implements ExclusionStrategyInterface
+{
+ private $version;
+
+ public function __construct($version)
+ {
+ $this->version = $version;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function shouldSkipClass(ClassMetadata $metadata, Context $navigatorContext)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function shouldSkipProperty(PropertyMetadata $property, Context $navigatorContext)
+ {
+ if ((null !== $version = $property->sinceVersion) && version_compare($this->version, $version, '<')) {
+ return true;
+ }
+
+ if ((null !== $version = $property->untilVersion) && version_compare($this->version, $version, '>')) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Expression/ExpressionEvaluator.php b/vendor/jms/serializer/src/JMS/Serializer/Expression/ExpressionEvaluator.php
new file mode 100644
index 0000000000..223cd3d4cb
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Expression/ExpressionEvaluator.php
@@ -0,0 +1,79 @@
+
+ *
+ * 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\Expression;
+
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
+
+/**
+ * @author Asmir Mustafic
+ */
+class ExpressionEvaluator implements ExpressionEvaluatorInterface
+{
+
+ /**
+ * @var ExpressionLanguage
+ */
+ private $expressionLanguage;
+
+ /**
+ * @var array
+ */
+ private $context = array();
+
+ /**
+ * @var array
+ */
+ private $cache = array();
+
+ public function __construct(ExpressionLanguage $expressionLanguage, array $context = array(), array $cache = array())
+ {
+ $this->expressionLanguage = $expressionLanguage;
+ $this->context = $context;
+ $this->cache = $cache;
+ }
+
+ /**
+ * @param string $name
+ * @param mixed $value
+ */
+ public function setContextVariable($name, $value)
+ {
+ $this->context[$name] = $value;
+ }
+
+ /**
+ * @param string $expression
+ * @param array $data
+ * @return mixed
+ */
+ public function evaluate($expression, array $data = array())
+ {
+ if (!is_string($expression)) {
+ return $expression;
+ }
+
+ $context = $data + $this->context;
+
+ if (!array_key_exists($expression, $this->cache)) {
+ $this->cache[$expression] = $this->expressionLanguage->parse($expression, array_keys($context));
+ }
+
+ return $this->expressionLanguage->evaluate($this->cache[$expression], $context);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Expression/ExpressionEvaluatorInterface.php b/vendor/jms/serializer/src/JMS/Serializer/Expression/ExpressionEvaluatorInterface.php
new file mode 100644
index 0000000000..9d1be23a14
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Expression/ExpressionEvaluatorInterface.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\Expression;
+
+/**
+ * @author Asmir Mustafic
+ */
+interface ExpressionEvaluatorInterface
+{
+ /**
+ * @param string $expression
+ * @param array $data
+ * @return mixed
+ */
+ public function evaluate($expression, array $data = array());
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/GenericDeserializationVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/GenericDeserializationVisitor.php
new file mode 100644
index 0000000000..22b3d3c1fb
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/GenericDeserializationVisitor.php
@@ -0,0 +1,217 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\ClassMetadata;
+
+/**
+ * Generic Deserialization Visitor.
+ *
+ * @author Johannes M. Schmitt
+ */
+abstract class GenericDeserializationVisitor extends AbstractVisitor
+{
+ private $navigator;
+ private $result;
+ private $objectStack;
+ private $currentObject;
+
+ public function setNavigator(GraphNavigator $navigator)
+ {
+ $this->navigator = $navigator;
+ $this->result = null;
+ $this->objectStack = new \SplStack;
+ }
+
+ public function getNavigator()
+ {
+ return $this->navigator;
+ }
+
+ public function prepare($data)
+ {
+ return $this->decode($data);
+ }
+
+ public function visitNull($data, array $type, Context $context)
+ {
+ return null;
+ }
+
+ public function visitString($data, array $type, Context $context)
+ {
+ $data = (string) $data;
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitBoolean($data, array $type, Context $context)
+ {
+ $data = (Boolean) $data;
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitInteger($data, array $type, Context $context)
+ {
+ $data = (integer) $data;
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitDouble($data, array $type, Context $context)
+ {
+ $data = (double) $data;
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitArray($data, array $type, Context $context)
+ {
+ if ( ! is_array($data)) {
+ throw new RuntimeException(sprintf('Expected array, but got %s: %s', gettype($data), json_encode($data)));
+ }
+
+ // If no further parameters were given, keys/values are just passed as is.
+ if ( ! $type['params']) {
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ switch (count($type['params'])) {
+ case 1: // Array is a list.
+ $listType = $type['params'][0];
+
+ $result = array();
+ if (null === $this->result) {
+ $this->result = &$result;
+ }
+
+ foreach ($data as $v) {
+ $result[] = $this->navigator->accept($v, $listType, $context);
+ }
+
+ return $result;
+
+ case 2: // Array is a map.
+ list($keyType, $entryType) = $type['params'];
+
+ $result = array();
+ if (null === $this->result) {
+ $this->result = &$result;
+ }
+
+ foreach ($data as $k => $v) {
+ $result[$this->navigator->accept($k, $keyType, $context)] = $this->navigator->accept($v, $entryType, $context);
+ }
+
+ return $result;
+
+ default:
+ throw new RuntimeException(sprintf('Array type cannot have more than 2 parameters, but got %s.', json_encode($type['params'])));
+ }
+ }
+
+ public function startVisitingObject(ClassMetadata $metadata, $object, array $type, Context $context)
+ {
+ $this->setCurrentObject($object);
+
+ if (null === $this->result) {
+ $this->result = $this->currentObject;
+ }
+ }
+
+ public function visitProperty(PropertyMetadata $metadata, $data, Context $context)
+ {
+ $name = $this->namingStrategy->translateName($metadata);
+
+ if (null === $data) {
+ return;
+ }
+
+ if ( ! is_array($data)) {
+ throw new RuntimeException(sprintf('Invalid data "%s"(%s), expected "%s".', $data, $metadata->type['name'], $metadata->reflection->class));
+ }
+
+ if ( ! array_key_exists($name, $data)) {
+ return;
+ }
+
+ if ( ! $metadata->type) {
+ throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name));
+ }
+
+ $v = $data[$name] !== null ? $this->navigator->accept($data[$name], $metadata->type, $context) : null;
+
+ $this->accessor->setValue($this->currentObject, $v, $metadata);
+
+ }
+
+ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ $obj = $this->currentObject;
+ $this->revertCurrentObject();
+
+ return $obj;
+ }
+
+ public function getResult()
+ {
+ return $this->result;
+ }
+
+ public function setCurrentObject($object)
+ {
+ $this->objectStack->push($this->currentObject);
+ $this->currentObject = $object;
+ }
+
+ public function getCurrentObject()
+ {
+ return $this->currentObject;
+ }
+
+ public function revertCurrentObject()
+ {
+ return $this->currentObject = $this->objectStack->pop();
+ }
+
+ abstract protected function decode($str);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/GenericSerializationVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/GenericSerializationVisitor.php
new file mode 100644
index 0000000000..2d73908741
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/GenericSerializationVisitor.php
@@ -0,0 +1,222 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * @deprecated
+ */
+abstract class GenericSerializationVisitor extends AbstractVisitor
+{
+ private $navigator;
+ private $root;
+ private $dataStack;
+ private $data;
+
+ public function setNavigator(GraphNavigator $navigator)
+ {
+ $this->navigator = $navigator;
+ $this->root = null;
+ $this->dataStack = new \SplStack;
+ }
+
+ /**
+ * @return GraphNavigator
+ */
+ public function getNavigator()
+ {
+ return $this->navigator;
+ }
+
+ public function visitNull($data, array $type, Context $context)
+ {
+ return null;
+ }
+
+ public function visitString($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (string) $data;
+ }
+
+ public function visitBoolean($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (boolean) $data;
+ }
+
+ public function visitInteger($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (int) $data;
+ }
+
+ public function visitDouble($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (float) $data;
+ }
+
+ /**
+ * @param array $data
+ * @param array $type
+ */
+ public function visitArray($data, array $type, Context $context)
+ {
+ $this->dataStack->push($data);
+
+ $isHash = isset($type['params'][1]);
+
+ if (null === $this->root) {
+ $this->root = $isHash ? new \ArrayObject() : array();
+ $rs = &$this->root;
+ } else {
+ $rs = $isHash ? new \ArrayObject() : array();
+ }
+
+ $isList = isset($type['params'][0]) && ! isset($type['params'][1]);
+
+ foreach ($data as $k => $v) {
+ $v = $this->navigator->accept($v, $this->getElementType($type), $context);
+
+ if (null === $v && $context->shouldSerializeNull() !== true) {
+ continue;
+ }
+
+ if ($isList) {
+ $rs[] = $v;
+ } else {
+ $rs[$k] = $v;
+ }
+ }
+
+ $this->dataStack->pop();
+
+ return $rs;
+ }
+
+ public function startVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = new \stdClass;
+ }
+
+ $this->dataStack->push($this->data);
+ $this->data = array();
+ }
+
+ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ $rs = $this->data;
+ $this->data = $this->dataStack->pop();
+
+ if ($this->root instanceof \stdClass && 0 === $this->dataStack->count()) {
+ $this->root = $rs;
+ }
+
+ return $rs;
+ }
+
+ public function visitProperty(PropertyMetadata $metadata, $data, Context $context)
+ {
+ $v = $this->accessor->getValue($data, $metadata);
+
+ $v = $this->navigator->accept($v, $metadata->type, $context);
+ if (null === $v && $context->shouldSerializeNull() !== true) {
+ return;
+ }
+
+ $k = $this->namingStrategy->translateName($metadata);
+
+ if ($metadata->inline) {
+ if (is_array($v)) {
+ $this->data = array_merge($this->data, $v);
+ }
+ } else {
+ $this->data[$k] = $v;
+ }
+ }
+
+ /**
+ * Allows you to add additional data to the current object/root element.
+ * @deprecated use setData instead
+ * @param string $key
+ * @param integer|float|boolean|string|array|null $value This value must either be a regular scalar, or an array.
+ * It must not contain any objects anymore.
+ */
+ public function addData($key, $value)
+ {
+ if (isset($this->data[$key])) {
+ throw new InvalidArgumentException(sprintf('There is already data for "%s".', $key));
+ }
+
+ $this->data[$key] = $value;
+ }
+
+ /**
+ * Checks if some data key exists.
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function hasData($key)
+ {
+ return isset($this->data[$key]);
+ }
+
+ /**
+ * Allows you to replace existing data on the current object/root element.
+ *
+ * @param string $key
+ * @param integer|float|boolean|string|array|null $value This value must either be a regular scalar, or an array.
+ * It must not contain any objects anymore.
+ */
+ public function setData($key, $value)
+ {
+ $this->data[$key] = $value;
+ }
+
+ public function getRoot()
+ {
+ return $this->root;
+ }
+
+ /**
+ * @param array|\ArrayObject $data the passed data must be understood by whatever encoding function is applied later.
+ */
+ public function setRoot($data)
+ {
+ $this->root = $data;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php b/vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php
new file mode 100644
index 0000000000..bde1017a25
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php
@@ -0,0 +1,354 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\EventDispatcher\ObjectEvent;
+use JMS\Serializer\EventDispatcher\PreDeserializeEvent;
+use JMS\Serializer\EventDispatcher\PreSerializeEvent;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Construction\ObjectConstructorInterface;
+use JMS\Serializer\Handler\HandlerRegistryInterface;
+use JMS\Serializer\EventDispatcher\EventDispatcherInterface;
+use JMS\Serializer\Metadata\ClassMetadata;
+use Metadata\MetadataFactoryInterface;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Exception\ExpressionLanguageRequiredException;
+use JMS\Serializer\Exclusion\ExpressionLanguageExclusionStrategy;
+use JMS\Serializer\Expression\ExpressionEvaluatorInterface;
+
+/**
+ * Handles traversal along the object graph.
+ *
+ * This class handles traversal along the graph, and calls different methods
+ * on visitors, or custom handlers to process its nodes.
+ *
+ * @author Johannes M. Schmitt
+ */
+final class GraphNavigator
+{
+ const DIRECTION_SERIALIZATION = 1;
+ const DIRECTION_DESERIALIZATION = 2;
+
+ /**
+ * @var ExpressionLanguageExclusionStrategy
+ */
+ private $expressionExclusionStrategy;
+
+ private $dispatcher;
+ private $metadataFactory;
+ private $handlerRegistry;
+ private $objectConstructor;
+
+ /**
+ * Parses a direction string to one of the direction constants.
+ *
+ * @param string $dirStr
+ *
+ * @return integer
+ */
+ public static function parseDirection($dirStr)
+ {
+ switch (strtolower($dirStr)) {
+ case 'serialization':
+ return self::DIRECTION_SERIALIZATION;
+
+ case 'deserialization':
+ return self::DIRECTION_DESERIALIZATION;
+
+ default:
+ throw new InvalidArgumentException(sprintf('The direction "%s" does not exist.', $dirStr));
+ }
+ }
+
+ public function __construct(
+ MetadataFactoryInterface $metadataFactory,
+ HandlerRegistryInterface $handlerRegistry,
+ ObjectConstructorInterface $objectConstructor,
+ EventDispatcherInterface $dispatcher = null,
+ ExpressionEvaluatorInterface $expressionEvaluator = null
+ )
+ {
+ $this->dispatcher = $dispatcher;
+ $this->metadataFactory = $metadataFactory;
+ $this->handlerRegistry = $handlerRegistry;
+ $this->objectConstructor = $objectConstructor;
+ if ($expressionEvaluator) {
+ $this->expressionExclusionStrategy = new ExpressionLanguageExclusionStrategy($expressionEvaluator);
+ }
+ }
+
+ /**
+ * Called for each node of the graph that is being traversed.
+ *
+ * @param mixed $data the data depends on the direction, and type of visitor
+ * @param null|array $type array has the format ["name" => string, "params" => array]
+ * @param Context $context
+ * @return mixed the return value depends on the direction, and type of visitor
+ */
+ public function accept($data, array $type = null, Context $context)
+ {
+ $visitor = $context->getVisitor();
+
+ // If the type was not given, we infer the most specific type from the
+ // input data in serialization mode.
+ if (null === $type) {
+ if ($context instanceof DeserializationContext) {
+ throw new RuntimeException('The type must be given for all properties when deserializing.');
+ }
+
+ $typeName = gettype($data);
+ if ('object' === $typeName) {
+ $typeName = get_class($data);
+ }
+
+ $type = array('name' => $typeName, 'params' => array());
+ }
+ // If the data is null, we have to force the type to null regardless of the input in order to
+ // guarantee correct handling of null values, and not have any internal auto-casting behavior.
+ else if ($context instanceof SerializationContext && null === $data) {
+ $type = array('name' => 'NULL', 'params' => array());
+ }
+
+ switch ($type['name']) {
+ case 'NULL':
+ return $visitor->visitNull($data, $type, $context);
+
+ case 'string':
+ return $visitor->visitString($data, $type, $context);
+
+ case 'int':
+ case 'integer':
+ return $visitor->visitInteger($data, $type, $context);
+
+ case 'boolean':
+ return $visitor->visitBoolean($data, $type, $context);
+
+ case 'double':
+ case 'float':
+ return $visitor->visitDouble($data, $type, $context);
+
+ case 'array':
+ return $visitor->visitArray($data, $type, $context);
+
+ case 'resource':
+ $msg = 'Resources are not supported in serialized data.';
+ if ($context instanceof SerializationContext && null !== $path = $context->getPath()) {
+ $msg .= ' Path: '.$path;
+ }
+
+ throw new RuntimeException($msg);
+
+ default:
+ // TODO: The rest of this method needs some refactoring.
+ if ($context instanceof SerializationContext) {
+ if (null !== $data) {
+ if ($context->isVisiting($data)) {
+ return null;
+ }
+ $context->startVisiting($data);
+ }
+
+ // If we're serializing a polymorphic type, then we'll be interested in the
+ // metadata for the actual type of the object, not the base class.
+ if (class_exists($type['name'], false) || interface_exists($type['name'], false)) {
+ if (is_subclass_of($data, $type['name'], false)) {
+ $type = array('name' => get_class($data), 'params' => array());
+ }
+ }
+ } elseif ($context instanceof DeserializationContext) {
+ $context->increaseDepth();
+ }
+
+ // Trigger pre-serialization callbacks, and listeners if they exist.
+ // Dispatch pre-serialization event before handling data to have ability change type in listener
+ if ($context instanceof SerializationContext) {
+ if (null !== $this->dispatcher && $this->dispatcher->hasListeners('serializer.pre_serialize', $type['name'], $context->getFormat())) {
+ $this->dispatcher->dispatch('serializer.pre_serialize', $type['name'], $context->getFormat(), $event = new PreSerializeEvent($context, $data, $type));
+ $type = $event->getType();
+ }
+ } elseif ($context instanceof DeserializationContext) {
+ if (null !== $this->dispatcher && $this->dispatcher->hasListeners('serializer.pre_deserialize', $type['name'], $context->getFormat())) {
+ $this->dispatcher->dispatch('serializer.pre_deserialize', $type['name'], $context->getFormat(), $event = new PreDeserializeEvent($context, $data, $type));
+ $type = $event->getType();
+ $data = $event->getData();
+ }
+ }
+
+ // First, try whether a custom handler exists for the given type. This is done
+ // before loading metadata because the type name might not be a class, but
+ // could also simply be an artifical type.
+ if (null !== $handler = $this->handlerRegistry->getHandler($context->getDirection(), $type['name'], $context->getFormat())) {
+ $rs = call_user_func($handler, $visitor, $data, $type, $context);
+ $this->leaveScope($context, $data);
+
+ return $rs;
+ }
+
+ $exclusionStrategy = $context->getExclusionStrategy();
+
+ /** @var $metadata ClassMetadata */
+ $metadata = $this->metadataFactory->getMetadataForClass($type['name']);
+
+ if ($metadata->usingExpression && !$this->expressionExclusionStrategy) {
+ throw new ExpressionLanguageRequiredException("To use conditional exclude/expose in {$metadata->name} you must configure the expression language.");
+ }
+
+ if ($context instanceof DeserializationContext && ! empty($metadata->discriminatorMap) && $type['name'] === $metadata->discriminatorBaseClass) {
+ $metadata = $this->resolveMetadata($data, $metadata);
+ }
+
+ if (null !== $exclusionStrategy && $exclusionStrategy->shouldSkipClass($metadata, $context)) {
+ $this->leaveScope($context, $data);
+
+ return null;
+ }
+
+ $context->pushClassMetadata($metadata);
+
+ if ($context instanceof SerializationContext) {
+ foreach ($metadata->preSerializeMethods as $method) {
+ $method->invoke($data);
+ }
+ }
+
+ $object = $data;
+ if ($context instanceof DeserializationContext) {
+ $object = $this->objectConstructor->construct($visitor, $metadata, $data, $type, $context);
+ }
+
+ if (isset($metadata->handlerCallbacks[$context->getDirection()][$context->getFormat()])) {
+ $rs = $object->{$metadata->handlerCallbacks[$context->getDirection()][$context->getFormat()]}(
+ $visitor,
+ $context instanceof SerializationContext ? null : $data,
+ $context
+ );
+ $this->afterVisitingObject($metadata, $object, $type, $context);
+
+ return $context instanceof SerializationContext ? $rs : $object;
+ }
+
+ $visitor->startVisitingObject($metadata, $object, $type, $context);
+ foreach ($metadata->propertyMetadata as $propertyMetadata) {
+ if (null !== $exclusionStrategy && $exclusionStrategy->shouldSkipProperty($propertyMetadata, $context)) {
+ continue;
+ }
+
+ if (null !== $this->expressionExclusionStrategy && $this->expressionExclusionStrategy->shouldSkipProperty($propertyMetadata, $context)) {
+ continue;
+ }
+
+ if ($context instanceof DeserializationContext && $propertyMetadata->readOnly) {
+ continue;
+ }
+
+ $context->pushPropertyMetadata($propertyMetadata);
+ $visitor->visitProperty($propertyMetadata, $data, $context);
+ $context->popPropertyMetadata();
+ }
+
+ if ($context instanceof SerializationContext) {
+ $this->afterVisitingObject($metadata, $data, $type, $context);
+
+ return $visitor->endVisitingObject($metadata, $data, $type, $context);
+ }
+
+ $rs = $visitor->endVisitingObject($metadata, $data, $type, $context);
+ $this->afterVisitingObject($metadata, $rs, $type, $context);
+
+ return $rs;
+ }
+ }
+
+ private function resolveMetadata($data, ClassMetadata $metadata)
+ {
+ switch (true) {
+ case is_array($data) && isset($data[$metadata->discriminatorFieldName]):
+ $typeValue = (string) $data[$metadata->discriminatorFieldName];
+ break;
+
+ // Check XML attribute for discriminatorFieldName
+ case is_object($data) && $metadata->xmlDiscriminatorAttribute && isset($data[$metadata->discriminatorFieldName]):
+ $typeValue = (string) $data[$metadata->discriminatorFieldName];
+ break;
+
+ // Check XML element with namespace for discriminatorFieldName
+ case is_object($data) && !$metadata->xmlDiscriminatorAttribute && null !== $metadata->xmlDiscriminatorNamespace && isset($data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName}):
+ $typeValue = (string) $data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName};
+ break;
+
+ // Check XML element for discriminatorFieldName
+ case is_object($data) && isset($data->{$metadata->discriminatorFieldName}):
+ $typeValue = (string) $data->{$metadata->discriminatorFieldName};
+ break;
+
+ default:
+ throw new \LogicException(sprintf(
+ 'The discriminator field name "%s" for base-class "%s" was not found in input data.',
+ $metadata->discriminatorFieldName,
+ $metadata->name
+ ));
+ }
+
+ if ( ! isset($metadata->discriminatorMap[$typeValue])) {
+ throw new \LogicException(sprintf(
+ 'The type value "%s" does not exist in the discriminator map of class "%s". Available types: %s',
+ $typeValue,
+ $metadata->name,
+ implode(', ', array_keys($metadata->discriminatorMap))
+ ));
+ }
+
+ return $this->metadataFactory->getMetadataForClass($metadata->discriminatorMap[$typeValue]);
+ }
+
+ private function leaveScope(Context $context, $data)
+ {
+ if ($context instanceof SerializationContext) {
+ $context->stopVisiting($data);
+ } elseif ($context instanceof DeserializationContext) {
+ $context->decreaseDepth();
+ }
+ }
+
+ private function afterVisitingObject(ClassMetadata $metadata, $object, array $type, Context $context)
+ {
+ $this->leaveScope($context, $object);
+ $context->popClassMetadata();
+
+ if ($context instanceof SerializationContext) {
+ foreach ($metadata->postSerializeMethods as $method) {
+ $method->invoke($object);
+ }
+
+ if (null !== $this->dispatcher && $this->dispatcher->hasListeners('serializer.post_serialize', $metadata->name, $context->getFormat())) {
+ $this->dispatcher->dispatch('serializer.post_serialize', $metadata->name, $context->getFormat(), new ObjectEvent($context, $object, $type));
+ }
+
+ return;
+ }
+
+ foreach ($metadata->postDeserializeMethods as $method) {
+ $method->invoke($object);
+ }
+
+ if (null !== $this->dispatcher && $this->dispatcher->hasListeners('serializer.post_deserialize', $metadata->name, $context->getFormat())) {
+ $this->dispatcher->dispatch('serializer.post_deserialize', $metadata->name, $context->getFormat(), new ObjectEvent($context, $object, $type));
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/ArrayCollectionHandler.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/ArrayCollectionHandler.php
new file mode 100644
index 0000000000..bd224e7b2a
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/ArrayCollectionHandler.php
@@ -0,0 +1,94 @@
+
+ *
+ * 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\Handler;
+
+use Doctrine\Common\Collections\ArrayCollection;
+use JMS\Serializer\Context;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\VisitorInterface;
+use Doctrine\Common\Collections\Collection;
+
+class ArrayCollectionHandler implements SubscribingHandlerInterface
+{
+ /**
+ * @var bool
+ */
+ private $initializeExcluded = true;
+
+ public function __construct($initializeExcluded = true)
+ {
+ $this->initializeExcluded = $initializeExcluded;
+ }
+
+ public static function getSubscribingMethods()
+ {
+ $methods = array();
+ $formats = array('json', 'xml', 'yml');
+ $collectionTypes = array(
+ 'ArrayCollection',
+ 'Doctrine\Common\Collections\ArrayCollection',
+ 'Doctrine\ORM\PersistentCollection',
+ 'Doctrine\ODM\MongoDB\PersistentCollection',
+ 'Doctrine\ODM\PHPCR\PersistentCollection',
+ );
+
+ foreach ($collectionTypes as $type) {
+ foreach ($formats as $format) {
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'type' => $type,
+ 'format' => $format,
+ 'method' => 'serializeCollection',
+ );
+
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
+ 'type' => $type,
+ 'format' => $format,
+ 'method' => 'deserializeCollection',
+ );
+ }
+ }
+
+ return $methods;
+ }
+
+ public function serializeCollection(VisitorInterface $visitor, Collection $collection, array $type, Context $context)
+ {
+ // We change the base type, and pass through possible parameters.
+ $type['name'] = 'array';
+
+ if ($this->initializeExcluded === false) {
+ $exclusionStrategy = $context->getExclusionStrategy();
+ if ($exclusionStrategy !== null && $exclusionStrategy->shouldSkipClass($context->getMetadataFactory()->getMetadataForClass(get_class($collection)), $context)) {
+ return $visitor->visitArray([], $type, $context);
+ }
+ }
+
+ return $visitor->visitArray($collection->toArray(), $type, $context);
+ }
+
+ public function deserializeCollection(VisitorInterface $visitor, $data, array $type, Context $context)
+ {
+ // See above.
+ $type['name'] = 'array';
+
+ return new ArrayCollection($visitor->visitArray($data, $type, $context));
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/ConstraintViolationHandler.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/ConstraintViolationHandler.php
new file mode 100644
index 0000000000..1879ee1568
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/ConstraintViolationHandler.php
@@ -0,0 +1,111 @@
+
+ *
+ * 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\Handler;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\YamlSerializationVisitor;
+use JMS\Serializer\JsonSerializationVisitor;
+use JMS\Serializer\GraphNavigator;
+use Symfony\Component\Validator\ConstraintViolation;
+use Symfony\Component\Validator\ConstraintViolationList;
+use JMS\Serializer\XmlSerializationVisitor;
+
+class ConstraintViolationHandler implements SubscribingHandlerInterface
+{
+ public static function getSubscribingMethods()
+ {
+ $methods = array();
+ $formats = array('xml', 'json', 'yml');
+ $types = array('Symfony\Component\Validator\ConstraintViolationList' => 'serializeList', 'Symfony\Component\Validator\ConstraintViolation' => 'serializeViolation');
+
+ foreach ($types as $type => $method) {
+ foreach ($formats as $format) {
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'type' => $type,
+ 'format' => $format,
+ 'method' => $method.'To'.$format,
+ );
+ }
+ }
+
+ return $methods;
+ }
+
+ public function serializeListToXml(XmlSerializationVisitor $visitor, ConstraintViolationList $list, array $type)
+ {
+ if (null === $visitor->document) {
+ $visitor->document = $visitor->createDocument();
+ }
+
+ foreach ($list as $violation) {
+ $this->serializeViolationToXml($visitor, $violation);
+ }
+ }
+
+ public function serializeListToJson(JsonSerializationVisitor $visitor, ConstraintViolationList $list, array $type, Context $context)
+ {
+ return $visitor->visitArray(iterator_to_array($list), $type, $context);
+ }
+
+ public function serializeListToYml(YamlSerializationVisitor $visitor, ConstraintViolationList $list, array $type, Context $context)
+ {
+ return $visitor->visitArray(iterator_to_array($list), $type, $context);
+ }
+
+ public function serializeViolationToXml(XmlSerializationVisitor $visitor, ConstraintViolation $violation, array $type = null)
+ {
+ if (null === $visitor->document) {
+ $visitor->document = $visitor->createDocument(null, null, false);
+ $visitor->document->appendChild($violationNode = $visitor->document->createElement('violation'));
+ $visitor->setCurrentNode($violationNode);
+ } else {
+ $visitor->getCurrentNode()->appendChild(
+ $violationNode = $visitor->document->createElement('violation')
+ );
+ }
+
+ $violationNode->setAttribute('property_path', $violation->getPropertyPath());
+ $violationNode->appendChild($messageNode = $visitor->document->createElement('message'));
+
+ $messageNode->appendChild($visitor->document->createCDATASection($violation->getMessage()));
+ }
+
+ public function serializeViolationToJson(JsonSerializationVisitor $visitor, ConstraintViolation $violation, array $type = null)
+ {
+ $data = array(
+ 'property_path' => $violation->getPropertyPath(),
+ 'message' => $violation->getMessage()
+ );
+
+ if (null === $visitor->getRoot()) {
+ $visitor->setRoot($data);
+ }
+
+ return $data;
+ }
+
+ public function serializeViolationToYml(YamlSerializationVisitor $visitor, ConstraintViolation $violation, array $type = null)
+ {
+ return array(
+ 'property_path' => $violation->getPropertyPath(),
+ 'message' => $violation->getMessage(),
+ );
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/DateHandler.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/DateHandler.php
new file mode 100644
index 0000000000..bf7339fd59
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/DateHandler.php
@@ -0,0 +1,257 @@
+
+ *
+ * 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\Handler;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\JsonDeserializationVisitor;
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\XmlDeserializationVisitor;
+use JMS\Serializer\XmlSerializationVisitor;
+
+class DateHandler implements SubscribingHandlerInterface
+{
+ private $defaultFormat;
+ private $defaultTimezone;
+ private $xmlCData;
+
+ public static function getSubscribingMethods()
+ {
+ $methods = array();
+ $deserialisationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval');
+ $serialisationTypes = array('DateTime', 'DateTimeImmutable', 'DateInterval');
+
+ foreach (array('json', 'xml', 'yml') as $format) {
+
+ foreach ($deserialisationTypes as $type) {
+ $methods[] = [
+ 'type' => $type,
+ 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
+ 'format' => $format,
+ ];
+ }
+
+ foreach ($serialisationTypes as $type) {
+ $methods[] = array(
+ 'type' => $type,
+ 'format' => $format,
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'method' => 'serialize'.$type,
+ );
+ }
+ }
+
+ return $methods;
+ }
+
+ public function __construct($defaultFormat = \DateTime::ISO8601, $defaultTimezone = 'UTC', $xmlCData = true)
+ {
+ $this->defaultFormat = $defaultFormat;
+ $this->defaultTimezone = new \DateTimeZone($defaultTimezone);
+ $this->xmlCData = $xmlCData;
+ }
+
+ private function serializeDateTimeInterface(
+ VisitorInterface $visitor,
+ \DateTimeInterface $date,
+ array $type,
+ Context $context
+ )
+ {
+ if ($visitor instanceof XmlSerializationVisitor && false === $this->xmlCData) {
+ return $visitor->visitSimpleString($date->format($this->getFormat($type)), $type, $context);
+ }
+
+ $format = $this->getFormat($type);
+ if ('U' === $format) {
+ return $visitor->visitInteger($date->format($format), $type, $context);
+ }
+
+ return $visitor->visitString($date->format($this->getFormat($type)), $type, $context);
+ }
+
+ public function serializeDateTime(VisitorInterface $visitor, \DateTime $date, array $type, Context $context)
+ {
+ return $this->serializeDateTimeInterface($visitor, $date, $type, $context);
+ }
+
+ public function serializeDateTimeImmutable(
+ VisitorInterface $visitor,
+ \DateTimeImmutable $date,
+ array $type,
+ Context $context
+ )
+ {
+ return $this->serializeDateTimeInterface($visitor, $date, $type, $context);
+ }
+
+ public function serializeDateInterval(VisitorInterface $visitor, \DateInterval $date, array $type, Context $context)
+ {
+ $iso8601DateIntervalString = $this->format($date);
+
+ if ($visitor instanceof XmlSerializationVisitor && false === $this->xmlCData) {
+ return $visitor->visitSimpleString($iso8601DateIntervalString, $type, $context);
+ }
+
+ return $visitor->visitString($iso8601DateIntervalString, $type, $context);
+ }
+
+ private function isDataXmlNull($data)
+ {
+ $attributes = $data->attributes('xsi', true);
+ return isset($attributes['nil'][0]) && (string) $attributes['nil'][0] === 'true';
+ }
+
+ public function deserializeDateTimeFromXml(XmlDeserializationVisitor $visitor, $data, array $type)
+ {
+ if ($this->isDataXmlNull($data)) {
+ return null;
+ }
+
+ return $this->parseDateTime($data, $type);
+ }
+
+ public function deserializeDateTimeImmutableFromXml(XmlDeserializationVisitor $visitor, $data, array $type)
+ {
+ if ($this->isDataXmlNull($data)) {
+ return null;
+ }
+
+ return $this->parseDateTime($data, $type, true);
+ }
+
+ public function deserializeDateIntervalFromXml(XmlDeserializationVisitor $visitor, $data, array $type)
+ {
+ if ($this->isDataXmlNull($data)) {
+ return null;
+ }
+
+ return $this->parseDateInterval($data);
+ }
+
+ public function deserializeDateTimeFromJson(JsonDeserializationVisitor $visitor, $data, array $type)
+ {
+ if (null === $data) {
+ return null;
+ }
+
+ return $this->parseDateTime($data, $type);
+ }
+
+ public function deserializeDateTimeImmutableFromJson(JsonDeserializationVisitor $visitor, $data, array $type)
+ {
+ if (null === $data) {
+ return null;
+ }
+
+ return $this->parseDateTime($data, $type, true);
+ }
+
+ public function deserializeDateIntervalFromJson(JsonDeserializationVisitor $visitor, $data, array $type)
+ {
+ if (null === $data) {
+ return null;
+ }
+
+ return $this->parseDateInterval($data);
+ }
+
+ private function parseDateTime($data, array $type, $immutable = false)
+ {
+ $timezone = isset($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone;
+ $format = $this->getFormat($type);
+
+ if ($immutable) {
+ $datetime = \DateTimeImmutable::createFromFormat($format, (string) $data, $timezone);
+ } else {
+ $datetime = \DateTime::createFromFormat($format, (string) $data, $timezone);
+ }
+
+ if (false === $datetime) {
+ throw new RuntimeException(sprintf('Invalid datetime "%s", expected format %s.', $data, $format));
+ }
+
+ return $datetime;
+ }
+
+ private function parseDateInterval($data)
+ {
+ $dateInterval = null;
+ try {
+ $dateInterval = new \DateInterval($data);
+ } catch (\Exception $e) {
+ throw new RuntimeException(sprintf('Invalid dateinterval "%s", expected ISO 8601 format', $data), null, $e);
+ }
+
+ return $dateInterval;
+ }
+
+ /**
+ * @return string
+ * @param array $type
+ */
+ private function getFormat(array $type)
+ {
+ return isset($type['params'][0]) ? $type['params'][0] : $this->defaultFormat;
+ }
+
+ /**
+ * @param \DateInterval $dateInterval
+ * @return string
+ */
+ public function format(\DateInterval $dateInterval)
+ {
+ $format = 'P';
+
+ if (0 < $dateInterval->y) {
+ $format .= $dateInterval->y.'Y';
+ }
+
+ if (0 < $dateInterval->m) {
+ $format .= $dateInterval->m.'M';
+ }
+
+ if (0 < $dateInterval->d) {
+ $format .= $dateInterval->d.'D';
+ }
+
+ if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) {
+ $format .= 'T';
+ }
+
+ if (0 < $dateInterval->h) {
+ $format .= $dateInterval->h.'H';
+ }
+
+ if (0 < $dateInterval->i) {
+ $format .= $dateInterval->i.'M';
+ }
+
+ if (0 < $dateInterval->s) {
+ $format .= $dateInterval->s.'S';
+ }
+
+ if ($format === 'P') {
+ $format = 'P0DT0S';
+ }
+
+ return $format;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/FormErrorHandler.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/FormErrorHandler.php
new file mode 100644
index 0000000000..6847d503e3
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/FormErrorHandler.php
@@ -0,0 +1,159 @@
+
+ *
+ * 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\Handler;
+
+use JMS\Serializer\YamlSerializationVisitor;
+use JMS\Serializer\JsonSerializationVisitor;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\VisitorInterface;
+use Symfony\Component\Form\Form;
+use Symfony\Component\Form\FormError;
+use Symfony\Component\Translation\TranslatorInterface;
+use JMS\Serializer\XmlSerializationVisitor;
+
+class FormErrorHandler implements SubscribingHandlerInterface
+{
+ private $translator;
+
+ public static function getSubscribingMethods()
+ {
+ $methods = array();
+ foreach (array('xml', 'json', 'yml') as $format) {
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'type' => 'Symfony\Component\Form\Form',
+ 'format' => $format,
+ );
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'type' => 'Symfony\Component\Form\FormError',
+ 'format' => $format,
+ );
+ }
+
+ return $methods;
+ }
+
+ public function __construct(TranslatorInterface $translator)
+ {
+ $this->translator = $translator;
+ }
+
+ public function serializeFormToXml(XmlSerializationVisitor $visitor, Form $form, array $type)
+ {
+ if (null === $visitor->document) {
+ $visitor->document = $visitor->createDocument(null, null, false);
+ $visitor->document->appendChild($formNode = $visitor->document->createElement('form'));
+ $visitor->setCurrentNode($formNode);
+ } else {
+ $visitor->getCurrentNode()->appendChild(
+ $formNode = $visitor->document->createElement('form')
+ );
+ }
+
+ $formNode->setAttribute('name', $form->getName());
+
+ $formNode->appendChild($errorsNode = $visitor->document->createElement('errors'));
+ foreach ($form->getErrors() as $error) {
+ $errorNode = $visitor->document->createElement('entry');
+ $errorNode->appendChild($this->serializeFormErrorToXml($visitor, $error, array()));
+ $errorsNode->appendChild($errorNode);
+ }
+
+ foreach ($form->all() as $child) {
+ if ($child instanceof Form) {
+ if (null !== $node = $this->serializeFormToXml($visitor, $child, array())) {
+ $formNode->appendChild($node);
+ }
+ }
+ }
+
+ return $formNode;
+ }
+
+ public function serializeFormToJson(JsonSerializationVisitor $visitor, Form $form, array $type)
+ {
+ return $this->convertFormToArray($visitor, $form);
+ }
+
+ public function serializeFormToYml(YamlSerializationVisitor $visitor, Form $form, array $type)
+ {
+ return $this->convertFormToArray($visitor, $form);
+ }
+
+ public function serializeFormErrorToXml(XmlSerializationVisitor $visitor, FormError $formError, array $type)
+ {
+ if (null === $visitor->document) {
+ $visitor->document = $visitor->createDocument(null, null, true);
+ }
+
+ return $visitor->document->createCDATASection($this->getErrorMessage($formError));
+ }
+
+ public function serializeFormErrorToJson(JsonSerializationVisitor $visitor, FormError $formError, array $type)
+ {
+ return $this->getErrorMessage($formError);
+ }
+
+ public function serializeFormErrorToYml(YamlSerializationVisitor $visitor, FormError $formError, array $type)
+ {
+ return $this->getErrorMessage($formError);
+ }
+
+ private function getErrorMessage(FormError $error)
+ {
+ if (null !== $error->getMessagePluralization()) {
+ return $this->translator->transChoice($error->getMessageTemplate(), $error->getMessagePluralization(), $error->getMessageParameters(), 'validators');
+ }
+
+ return $this->translator->trans($error->getMessageTemplate(), $error->getMessageParameters(), 'validators');
+ }
+
+ private function convertFormToArray(VisitorInterface $visitor, Form $data)
+ {
+ $isRoot = null === $visitor->getRoot();
+
+ $form = new \ArrayObject();
+ $errors = array();
+ foreach ($data->getErrors() as $error) {
+ $errors[] = $this->getErrorMessage($error);
+ }
+
+ if ($errors) {
+ $form['errors'] = $errors;
+ }
+
+ $children = array();
+ foreach ($data->all() as $child) {
+ if ($child instanceof Form) {
+ $children[$child->getName()] = $this->convertFormToArray($visitor, $child);
+ }
+ }
+
+ if ($children) {
+ $form['children'] = $children;
+ }
+
+ if ($isRoot) {
+ $visitor->setRoot($form);
+ }
+
+ return $form;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/HandlerRegistry.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/HandlerRegistry.php
new file mode 100644
index 0000000000..ed7bfff772
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/HandlerRegistry.php
@@ -0,0 +1,88 @@
+
+ *
+ * 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\Handler;
+
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Exception\LogicException;
+
+class HandlerRegistry implements HandlerRegistryInterface
+{
+ protected $handlers;
+
+ public static function getDefaultMethod($direction, $type, $format)
+ {
+ if (false !== $pos = strrpos($type, '\\')) {
+ $type = substr($type, $pos + 1);
+ }
+
+ switch ($direction) {
+ case GraphNavigator::DIRECTION_DESERIALIZATION:
+ return 'deserialize'.$type.'From'.$format;
+
+ case GraphNavigator::DIRECTION_SERIALIZATION:
+ return 'serialize'.$type.'To'.$format;
+
+ default:
+ throw new LogicException(sprintf('The direction %s does not exist; see GraphNavigator::DIRECTION_??? constants.', json_encode($direction)));
+ }
+ }
+
+ public function __construct(array $handlers = array())
+ {
+ $this->handlers = $handlers;
+ }
+
+ public function registerSubscribingHandler(SubscribingHandlerInterface $handler)
+ {
+ foreach ($handler->getSubscribingMethods() as $methodData) {
+ if ( ! isset($methodData['type'], $methodData['format'])) {
+ throw new RuntimeException(sprintf('For each subscribing method a "type" and "format" attribute must be given, but only got "%s" for %s.', implode('" and "', array_keys($methodData)), get_class($handler)));
+ }
+
+ $directions = array(GraphNavigator::DIRECTION_DESERIALIZATION, GraphNavigator::DIRECTION_SERIALIZATION);
+ if (isset($methodData['direction'])) {
+ $directions = array($methodData['direction']);
+ }
+
+ foreach ($directions as $direction) {
+ $method = isset($methodData['method']) ? $methodData['method'] : self::getDefaultMethod($direction, $methodData['type'], $methodData['format']);
+ $this->registerHandler($direction, $methodData['type'], $methodData['format'], array($handler, $method));
+ }
+ }
+ }
+
+ public function registerHandler($direction, $typeName, $format, $handler)
+ {
+ if (is_string($direction)) {
+ $direction = GraphNavigator::parseDirection($direction);
+ }
+
+ $this->handlers[$direction][$typeName][$format] = $handler;
+ }
+
+ public function getHandler($direction, $typeName, $format)
+ {
+ if ( ! isset($this->handlers[$direction][$typeName][$format])) {
+ return null;
+ }
+
+ return $this->handlers[$direction][$typeName][$format];
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/HandlerRegistryInterface.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/HandlerRegistryInterface.php
new file mode 100644
index 0000000000..bd869f9785
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/HandlerRegistryInterface.php
@@ -0,0 +1,55 @@
+
+ *
+ * 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\Handler;
+
+/**
+ * Handler Registry Interface.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface HandlerRegistryInterface
+{
+ /**
+ * @param SubscribingHandlerInterface $handler
+ *
+ * @return void
+ */
+ public function registerSubscribingHandler(SubscribingHandlerInterface $handler);
+
+ /**
+ * Registers a handler in the registry.
+ *
+ * @param integer $direction one of the GraphNavigator::DIRECTION_??? constants
+ * @param string $typeName
+ * @param string $format
+ * @param callable $handler function(VisitorInterface, mixed $data, array $type): mixed
+ *
+ * @return void
+ */
+ public function registerHandler($direction, $typeName, $format, $handler);
+
+ /**
+ * @param integer $direction one of the GraphNavigator::DIRECTION_??? constants
+ * @param string $typeName
+ * @param string $format
+ *
+ * @return callable|null
+ */
+ public function getHandler($direction, $typeName, $format);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/LazyHandlerRegistry.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/LazyHandlerRegistry.php
new file mode 100644
index 0000000000..7df39201d2
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/LazyHandlerRegistry.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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\Handler;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+class LazyHandlerRegistry extends HandlerRegistry
+{
+ private $container;
+ private $initializedHandlers = array();
+
+ public function __construct(ContainerInterface $container, array $handlers = array())
+ {
+ parent::__construct($handlers);
+ $this->container = $container;
+ }
+
+ public function registerHandler($direction, $typeName, $format, $handler)
+ {
+ parent::registerHandler($direction, $typeName, $format, $handler);
+ unset($this->initializedHandlers[$direction][$typeName][$format]);
+ }
+
+ public function getHandler($direction, $typeName, $format)
+ {
+ if (isset($this->initializedHandlers[$direction][$typeName][$format])) {
+ return $this->initializedHandlers[$direction][$typeName][$format];
+ }
+
+ if ( ! isset($this->handlers[$direction][$typeName][$format])) {
+ return null;
+ }
+
+ $handler = $this->handlers[$direction][$typeName][$format];
+ if (is_array($handler) && is_string($handler[0]) && $this->container->has($handler[0])) {
+ $handler[0] = $this->container->get($handler[0]);
+ }
+
+ return $this->initializedHandlers[$direction][$typeName][$format] = $handler;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/PhpCollectionHandler.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/PhpCollectionHandler.php
new file mode 100644
index 0000000000..ddc51b8e07
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/PhpCollectionHandler.php
@@ -0,0 +1,88 @@
+
+ *
+ * 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\Handler;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\VisitorInterface;
+use PhpCollection\Map;
+use PhpCollection\Sequence;
+
+class PhpCollectionHandler implements SubscribingHandlerInterface
+{
+ public static function getSubscribingMethods()
+ {
+ $methods = array();
+ $formats = array('json', 'xml', 'yml');
+ $collectionTypes = array(
+ 'PhpCollection\Sequence' => 'Sequence',
+ 'PhpCollection\Map' => 'Map',
+ );
+
+ foreach ($collectionTypes as $type => $shortName) {
+ foreach ($formats as $format) {
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'type' => $type,
+ 'format' => $format,
+ 'method' => 'serialize'.$shortName,
+ );
+
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
+ 'type' => $type,
+ 'format' => $format,
+ 'method' => 'deserialize'.$shortName,
+ );
+ }
+ }
+
+ return $methods;
+ }
+
+ public function serializeMap(VisitorInterface $visitor, Map $map, array $type, Context $context)
+ {
+ $type['name'] = 'array';
+
+ return $visitor->visitArray(iterator_to_array($map), $type, $context);
+ }
+
+ public function deserializeMap(VisitorInterface $visitor, $data, array $type, Context $context)
+ {
+ $type['name'] = 'array';
+
+ return new Map($visitor->visitArray($data, $type, $context));
+ }
+
+ public function serializeSequence(VisitorInterface $visitor, Sequence $sequence, array $type, Context $context)
+ {
+ // We change the base type, and pass through possible parameters.
+ $type['name'] = 'array';
+
+ return $visitor->visitArray($sequence->all(), $type, $context);
+ }
+
+ public function deserializeSequence(VisitorInterface $visitor, $data, array $type, Context $context)
+ {
+ // See above.
+ $type['name'] = 'array';
+
+ return new Sequence($visitor->visitArray($data, $type, $context));
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/PropelCollectionHandler.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/PropelCollectionHandler.php
new file mode 100644
index 0000000000..defccc82f6
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/PropelCollectionHandler.php
@@ -0,0 +1,80 @@
+
+ *
+ * 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\Handler;
+
+use \PropelCollection;
+use JMS\Serializer\Context;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\Handler\SubscribingHandlerInterface;
+
+class PropelCollectionHandler implements SubscribingHandlerInterface
+{
+ public static function getSubscribingMethods()
+ {
+ $methods = array();
+ $formats = array('json', 'xml', 'yml');
+ //Note: issue when handling inheritance
+ $collectionTypes = array(
+ 'PropelCollection',
+ 'PropelObjectCollection',
+ 'PropelArrayCollection',
+ 'PropelOnDemandCollection'
+ );
+
+ foreach ($collectionTypes as $type) {
+ foreach ($formats as $format) {
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'type' => $type,
+ 'format' => $format,
+ 'method' => 'serializeCollection',
+ );
+
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
+ 'type' => $type,
+ 'format' => $format,
+ 'method' => 'deserializeCollection',
+ );
+ }
+ }
+
+ return $methods;
+ }
+
+ public function serializeCollection(VisitorInterface $visitor, PropelCollection $collection, array $type, Context $context)
+ {
+ // We change the base type, and pass through possible parameters.
+ $type['name'] = 'array';
+
+ return $visitor->visitArray($collection->getData(), $type, $context);
+ }
+
+ public function deserializeCollection(VisitorInterface $visitor, $data, array $type, Context $context)
+ {
+ // See above. Set parameter type to PropelCollection or PropelCollection
+ $type['name'] = 'array';
+
+ $collection = new PropelCollection();
+ $collection->setData($visitor->visitArray($data, $type, $context));
+
+ return $collection;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/StdClassHandler.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/StdClassHandler.php
new file mode 100644
index 0000000000..2e1ad5bab5
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/StdClassHandler.php
@@ -0,0 +1,60 @@
+
+ *
+ * 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\Handler;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Metadata\StaticPropertyMetadata;
+use JMS\Serializer\VisitorInterface;
+
+/**
+ * @author Asmir Mustafic
+ */
+class StdClassHandler implements SubscribingHandlerInterface
+{
+ public static function getSubscribingMethods()
+ {
+ $methods = array();
+ $formats = array('json', 'xml', 'yml');
+
+ foreach ($formats as $format) {
+ $methods[] = array(
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'type' => 'stdClass',
+ 'format' => $format,
+ 'method' => 'serializeStdClass',
+ );
+ }
+
+ return $methods;
+ }
+
+ public function serializeStdClass(VisitorInterface $visitor, \stdClass $stdClass, array $type, Context $context)
+ {
+ $classMetadata = $context->getMetadataFactory()->getMetadataForClass('stdClass');
+ $visitor->startVisitingObject($classMetadata, $stdClass, array('name' => 'stdClass'), $context);
+
+ foreach ((array)$stdClass as $name => $value) {
+ $metadata = new StaticPropertyMetadata('stdClass', $name, $value);
+ $visitor->visitProperty($metadata, $value, $context);
+ }
+
+ return $visitor->endVisitingObject($classMetadata, $stdClass, array('name' => 'stdClass'), $context);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Handler/SubscribingHandlerInterface.php b/vendor/jms/serializer/src/JMS/Serializer/Handler/SubscribingHandlerInterface.php
new file mode 100644
index 0000000000..5fd67e21c3
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Handler/SubscribingHandlerInterface.php
@@ -0,0 +1,40 @@
+
+ *
+ * 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\Handler;
+
+interface SubscribingHandlerInterface
+{
+ /**
+ * Return format:
+ *
+ * array(
+ * array(
+ * 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ * 'format' => 'json',
+ * 'type' => 'DateTime',
+ * 'method' => 'serializeDateTimeToJson',
+ * ),
+ * )
+ *
+ * The direction and method keys can be omitted.
+ *
+ * @return array
+ */
+ public static function getSubscribingMethods();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/JsonDeserializationVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/JsonDeserializationVisitor.php
new file mode 100644
index 0000000000..be763aeaa3
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/JsonDeserializationVisitor.php
@@ -0,0 +1,52 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Exception\RuntimeException;
+
+class JsonDeserializationVisitor extends GenericDeserializationVisitor
+{
+ protected function decode($str)
+ {
+ $decoded = json_decode($str, true);
+
+ switch (json_last_error()) {
+ case JSON_ERROR_NONE:
+ return $decoded;
+
+ case JSON_ERROR_DEPTH:
+ throw new RuntimeException('Could not decode JSON, maximum stack depth exceeded.');
+
+ case JSON_ERROR_STATE_MISMATCH:
+ throw new RuntimeException('Could not decode JSON, underflow or the nodes mismatch.');
+
+ case JSON_ERROR_CTRL_CHAR:
+ throw new RuntimeException('Could not decode JSON, unexpected control character found.');
+
+ case JSON_ERROR_SYNTAX:
+ throw new RuntimeException('Could not decode JSON, syntax error - malformed JSON.');
+
+ case JSON_ERROR_UTF8:
+ throw new RuntimeException('Could not decode JSON, malformed UTF-8 characters (incorrectly encoded?)');
+
+ default:
+ throw new RuntimeException('Could not decode JSON.');
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php
new file mode 100644
index 0000000000..3b4dd2d331
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php
@@ -0,0 +1,256 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+class JsonSerializationVisitor extends GenericSerializationVisitor
+{
+ private $options = 0;
+
+ private $navigator;
+ private $root;
+ private $dataStack;
+ private $data;
+
+ public function setNavigator(GraphNavigator $navigator)
+ {
+ $this->navigator = $navigator;
+ $this->root = null;
+ $this->dataStack = new \SplStack;
+ }
+
+ /**
+ * @return GraphNavigator
+ */
+ public function getNavigator()
+ {
+ return $this->navigator;
+ }
+
+ public function visitNull($data, array $type, Context $context)
+ {
+ return null;
+ }
+
+ public function visitString($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (string) $data;
+ }
+
+ public function visitBoolean($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (boolean) $data;
+ }
+
+ public function visitInteger($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (int) $data;
+ }
+
+ public function visitDouble($data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = $data;
+ }
+
+ return (float) $data;
+ }
+
+ /**
+ * @param array $data
+ * @param array $type
+ * @param Context $context
+ * @return mixed
+ */
+ public function visitArray($data, array $type, Context $context)
+ {
+ $this->dataStack->push($data);
+
+ $isHash = isset($type['params'][1]);
+
+ if (null === $this->root) {
+ $this->root = $isHash ? new \ArrayObject() : array();
+ $rs = &$this->root;
+ } else {
+ $rs = $isHash ? new \ArrayObject() : array();
+ }
+
+ $isList = isset($type['params'][0]) && ! isset($type['params'][1]);
+
+ foreach ($data as $k => $v) {
+ $v = $this->navigator->accept($v, $this->getElementType($type), $context);
+
+ if (null === $v && $context->shouldSerializeNull() !== true) {
+ continue;
+ }
+
+ if ($isList) {
+ $rs[] = $v;
+ } else {
+ $rs[$k] = $v;
+ }
+ }
+
+ $this->dataStack->pop();
+ return $rs;
+ }
+
+ public function startVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ if (null === $this->root) {
+ $this->root = new \stdClass;
+ }
+
+ $this->dataStack->push($this->data);
+ $this->data = array();
+ }
+
+ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ $rs = $this->data;
+ $this->data = $this->dataStack->pop();
+
+ // Force JSON output to "{}" instead of "[]" if it contains either no properties or all properties are null.
+ if (empty($rs)) {
+ $rs = new \ArrayObject();
+ }
+
+ if ($this->root instanceof \stdClass && 0 === $this->dataStack->count()) {
+ $this->root = $rs;
+ }
+
+ return $rs;
+ }
+
+ public function visitProperty(PropertyMetadata $metadata, $data, Context $context)
+ {
+ $v = $this->accessor->getValue($data, $metadata);
+
+ $v = $this->navigator->accept($v, $metadata->type, $context);
+ if ((null === $v && $context->shouldSerializeNull() !== true)
+ || (true === $metadata->skipWhenEmpty && ($v instanceof \ArrayObject || is_array($v)) && 0 === count($v))
+ ) {
+ return;
+ }
+
+ $k = $this->namingStrategy->translateName($metadata);
+
+ if ($metadata->inline) {
+ if (is_array($v)) {
+ $this->data = array_merge($this->data, $v);
+ }
+ } else {
+ $this->data[$k] = $v;
+ }
+ }
+
+ /**
+ * Allows you to add additional data to the current object/root element.
+ * @deprecated use setData instead
+ * @param string $key
+ * @param integer|float|boolean|string|array|null $value This value must either be a regular scalar, or an array.
+ * It must not contain any objects anymore.
+ */
+ public function addData($key, $value)
+ {
+ if (isset($this->data[$key])) {
+ throw new InvalidArgumentException(sprintf('There is already data for "%s".', $key));
+ }
+
+ $this->data[$key] = $value;
+ }
+
+ /**
+ * Checks if some data key exists.
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function hasData($key)
+ {
+ return isset($this->data[$key]);
+ }
+
+ /**
+ * Allows you to replace existing data on the current object/root element.
+ *
+ * @param string $key
+ * @param integer|float|boolean|string|array|null $value This value must either be a regular scalar, or an array.
+ * It must not contain any objects anymore.
+ */
+ public function setData($key, $value)
+ {
+ $this->data[$key] = $value;
+ }
+
+ public function getRoot()
+ {
+ return $this->root;
+ }
+
+ /**
+ * @param array|\ArrayObject $data the passed data must be understood by whatever encoding function is applied later.
+ */
+ public function setRoot($data)
+ {
+ $this->root = $data;
+ }
+
+
+ public function getResult()
+ {
+ $result = @json_encode($this->getRoot(), $this->options);
+
+ switch (json_last_error()) {
+ case JSON_ERROR_NONE:
+ return $result;
+
+ case JSON_ERROR_UTF8:
+ throw new \RuntimeException('Your data could not be encoded because it contains invalid UTF8 characters.');
+
+ default:
+ throw new \RuntimeException(sprintf('An error occurred while encoding your data (error code %d).', json_last_error()));
+ }
+ }
+
+ public function getOptions()
+ {
+ return $this->options;
+ }
+
+ public function setOptions($options)
+ {
+ $this->options = (integer) $options;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/ClassMetadata.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/ClassMetadata.php
new file mode 100644
index 0000000000..8fe096ff25
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/ClassMetadata.php
@@ -0,0 +1,346 @@
+
+ *
+ * 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\Metadata;
+
+use JMS\Serializer\Exception\InvalidArgumentException;
+use Metadata\MergeableInterface;
+use Metadata\MethodMetadata;
+use Metadata\MergeableClassMetadata;
+use Metadata\PropertyMetadata as BasePropertyMetadata;
+
+/**
+ * Class Metadata used to customize the serialization process.
+ *
+ * @author Johannes M. Schmitt
+ */
+class ClassMetadata extends MergeableClassMetadata
+{
+ const ACCESSOR_ORDER_UNDEFINED = 'undefined';
+ const ACCESSOR_ORDER_ALPHABETICAL = 'alphabetical';
+ const ACCESSOR_ORDER_CUSTOM = 'custom';
+
+ /** @var \ReflectionMethod[] */
+ public $preSerializeMethods = array();
+
+ /** @var \ReflectionMethod[] */
+ public $postSerializeMethods = array();
+
+ /** @var \ReflectionMethod[] */
+ public $postDeserializeMethods = array();
+
+ public $xmlRootName;
+ public $xmlRootNamespace;
+ public $xmlNamespaces = array();
+ public $accessorOrder;
+ public $customOrder;
+ public $usingExpression = false;
+ public $handlerCallbacks = array();
+
+ public $discriminatorDisabled = false;
+ public $discriminatorBaseClass;
+ public $discriminatorFieldName;
+ public $discriminatorValue;
+ public $discriminatorMap = array();
+ public $discriminatorGroups = array();
+
+ public $xmlDiscriminatorAttribute = false;
+ public $xmlDiscriminatorCData = true;
+ public $xmlDiscriminatorNamespace;
+
+ public function setDiscriminator($fieldName, array $map, array $groups = array())
+ {
+ if (empty($fieldName)) {
+ throw new \InvalidArgumentException('The $fieldName cannot be empty.');
+ }
+
+ if (empty($map)) {
+ throw new \InvalidArgumentException('The discriminator map cannot be empty.');
+ }
+
+ $this->discriminatorBaseClass = $this->name;
+ $this->discriminatorFieldName = $fieldName;
+ $this->discriminatorMap = $map;
+ $this->discriminatorGroups = $groups;
+ }
+
+ /**
+ * Sets the order of properties in the class.
+ *
+ * @param string $order
+ * @param array $customOrder
+ *
+ * @throws InvalidArgumentException When the accessor order is not valid
+ * @throws InvalidArgumentException When the custom order is not valid
+ */
+ public function setAccessorOrder($order, array $customOrder = array())
+ {
+ if ( ! in_array($order, array(self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM), true)) {
+ throw new InvalidArgumentException(sprintf('The accessor order "%s" is invalid.', $order));
+ }
+
+ foreach ($customOrder as $name) {
+ if ( ! is_string($name)) {
+ throw new InvalidArgumentException(sprintf('$customOrder is expected to be a list of strings, but got element of value %s.', json_encode($name)));
+ }
+ }
+
+ $this->accessorOrder = $order;
+ $this->customOrder = array_flip($customOrder);
+ $this->sortProperties();
+ }
+
+ public function addPropertyMetadata(BasePropertyMetadata $metadata)
+ {
+ parent::addPropertyMetadata($metadata);
+ $this->sortProperties();
+ if ($metadata instanceof PropertyMetadata && $metadata->excludeIf) {
+ $this->usingExpression = true;
+ }
+ }
+
+ public function addPreSerializeMethod(MethodMetadata $method)
+ {
+ $this->preSerializeMethods[] = $method;
+ }
+
+ public function addPostSerializeMethod(MethodMetadata $method)
+ {
+ $this->postSerializeMethods[] = $method;
+ }
+
+ public function addPostDeserializeMethod(MethodMetadata $method)
+ {
+ $this->postDeserializeMethods[] = $method;
+ }
+
+ /**
+ * @param integer $direction
+ * @param string|integer $format
+ * @param string $methodName
+ */
+ public function addHandlerCallback($direction, $format, $methodName)
+ {
+ $this->handlerCallbacks[$direction][$format] = $methodName;
+ }
+
+ public function merge(MergeableInterface $object)
+ {
+ if ( ! $object instanceof ClassMetadata) {
+ throw new InvalidArgumentException('$object must be an instance of ClassMetadata.');
+ }
+ parent::merge($object);
+
+ $this->preSerializeMethods = array_merge($this->preSerializeMethods, $object->preSerializeMethods);
+ $this->postSerializeMethods = array_merge($this->postSerializeMethods, $object->postSerializeMethods);
+ $this->postDeserializeMethods = array_merge($this->postDeserializeMethods, $object->postDeserializeMethods);
+ $this->xmlRootName = $object->xmlRootName;
+ $this->xmlRootNamespace = $object->xmlRootNamespace;
+ $this->xmlNamespaces = array_merge($this->xmlNamespaces, $object->xmlNamespaces);
+
+ // Handler methods are taken from the outer class completely.
+ $this->handlerCallbacks = $object->handlerCallbacks;
+
+ if ($object->accessorOrder) {
+ $this->accessorOrder = $object->accessorOrder;
+ $this->customOrder = $object->customOrder;
+ }
+
+ if ($object->discriminatorFieldName && $this->discriminatorFieldName) {
+ throw new \LogicException(sprintf(
+ 'The discriminator of class "%s" would overwrite the discriminator of the parent class "%s". Please define all possible sub-classes in the discriminator of %s.',
+ $object->name,
+ $this->discriminatorBaseClass,
+ $this->discriminatorBaseClass
+ ));
+ } elseif ( ! $this->discriminatorFieldName && $object->discriminatorFieldName) {
+ $this->discriminatorFieldName = $object->discriminatorFieldName;
+ $this->discriminatorMap = $object->discriminatorMap;
+ }
+
+ if ($object->discriminatorDisabled !== null) {
+ $this->discriminatorDisabled = $object->discriminatorDisabled;
+ }
+
+ if ($object->discriminatorMap) {
+ $this->discriminatorFieldName = $object->discriminatorFieldName;
+ $this->discriminatorMap = $object->discriminatorMap;
+ $this->discriminatorBaseClass = $object->discriminatorBaseClass;
+ }
+
+ if ($this->discriminatorMap && ! $this->reflection->isAbstract()) {
+ if (false === $typeValue = array_search($this->name, $this->discriminatorMap, true)) {
+ throw new \LogicException(sprintf(
+ 'The sub-class "%s" is not listed in the discriminator of the base class "%s".',
+ $this->name,
+ $this->discriminatorBaseClass
+ ));
+ }
+
+ $this->discriminatorValue = $typeValue;
+
+ if (isset($this->propertyMetadata[$this->discriminatorFieldName])
+ && ! $this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata) {
+ throw new \LogicException(sprintf(
+ 'The discriminator field name "%s" of the base-class "%s" conflicts with a regular property of the sub-class "%s".',
+ $this->discriminatorFieldName,
+ $this->discriminatorBaseClass,
+ $this->name
+ ));
+ }
+
+ $discriminatorProperty = new StaticPropertyMetadata(
+ $this->name,
+ $this->discriminatorFieldName,
+ $typeValue,
+ $this->discriminatorGroups
+ );
+ $discriminatorProperty->serializedName = $this->discriminatorFieldName;
+ $discriminatorProperty->xmlAttribute = $this->xmlDiscriminatorAttribute;
+ $discriminatorProperty->xmlElementCData = $this->xmlDiscriminatorCData;
+ $discriminatorProperty->xmlNamespace = $this->xmlDiscriminatorNamespace;
+ $this->propertyMetadata[$this->discriminatorFieldName] = $discriminatorProperty;
+ }
+
+ $this->sortProperties();
+ }
+
+ public function registerNamespace($uri, $prefix = null)
+ {
+ if ( ! is_string($uri)) {
+ throw new InvalidArgumentException(sprintf('$uri is expected to be a strings, but got value %s.', json_encode($uri)));
+ }
+
+ if ($prefix !== null) {
+ if ( ! is_string($prefix)) {
+ throw new InvalidArgumentException(sprintf('$prefix is expected to be a strings, but got value %s.', json_encode($prefix)));
+ }
+ } else {
+ $prefix = "";
+ }
+
+ $this->xmlNamespaces[$prefix] = $uri;
+
+ }
+
+ public function serialize()
+ {
+ $this->sortProperties();
+
+ return serialize(array(
+ $this->preSerializeMethods,
+ $this->postSerializeMethods,
+ $this->postDeserializeMethods,
+ $this->xmlRootName,
+ $this->xmlRootNamespace,
+ $this->xmlNamespaces,
+ $this->accessorOrder,
+ $this->customOrder,
+ $this->handlerCallbacks,
+ $this->discriminatorDisabled,
+ $this->discriminatorBaseClass,
+ $this->discriminatorFieldName,
+ $this->discriminatorValue,
+ $this->discriminatorMap,
+ $this->discriminatorGroups,
+ parent::serialize(),
+ 'discriminatorGroups' => $this->discriminatorGroups,
+ 'xmlDiscriminatorAttribute' => $this->xmlDiscriminatorAttribute,
+ 'xmlDiscriminatorCData' => $this->xmlDiscriminatorCData,
+ 'usingExpression' => $this->usingExpression,
+ 'xmlDiscriminatorNamespace' => $this->xmlDiscriminatorNamespace,
+ ));
+ }
+
+ public function unserialize($str)
+ {
+ $unserialized = unserialize($str);
+
+ list(
+ $this->preSerializeMethods,
+ $this->postSerializeMethods,
+ $this->postDeserializeMethods,
+ $this->xmlRootName,
+ $this->xmlRootNamespace,
+ $this->xmlNamespaces,
+ $this->accessorOrder,
+ $this->customOrder,
+ $this->handlerCallbacks,
+ $this->discriminatorDisabled,
+ $this->discriminatorBaseClass,
+ $this->discriminatorFieldName,
+ $this->discriminatorValue,
+ $this->discriminatorMap,
+ $this->discriminatorGroups,
+ $parentStr
+ ) = $unserialized;
+
+ if (isset($unserialized['discriminatorGroups'])) {
+ $this->discriminatorGroups = $unserialized['discriminatorGroups'];
+ }
+ if (isset($unserialized['usingExpression'])) {
+ $this->usingExpression = $unserialized['usingExpression'];
+ }
+
+ if (isset($deserializedData['xmlDiscriminatorAttribute'])) {
+ $this->xmlDiscriminatorAttribute = $deserializedData['xmlDiscriminatorAttribute'];
+ }
+
+ if (isset($deserializedData['xmlDiscriminatorNamespace'])) {
+ $this->xmlDiscriminatorNamespace = $deserializedData['xmlDiscriminatorNamespace'];
+ }
+
+ if (isset($deserializedData['xmlDiscriminatorCData'])) {
+ $this->xmlDiscriminatorCData = $deserializedData['xmlDiscriminatorCData'];
+ }
+
+ parent::unserialize($parentStr);
+ }
+
+ private function sortProperties()
+ {
+ switch ($this->accessorOrder) {
+ case self::ACCESSOR_ORDER_ALPHABETICAL:
+ ksort($this->propertyMetadata);
+ break;
+
+ case self::ACCESSOR_ORDER_CUSTOM:
+ $order = $this->customOrder;
+ $currentSorting = $this->propertyMetadata ? array_combine(array_keys($this->propertyMetadata), range(1, count($this->propertyMetadata))) : [];
+ uksort($this->propertyMetadata, function($a, $b) use ($order, $currentSorting) {
+ $existsA = isset($order[$a]);
+ $existsB = isset($order[$b]);
+
+ if ( ! $existsA && ! $existsB) {
+ return $currentSorting[$a] - $currentSorting[$b];
+ }
+
+ if ( ! $existsA) {
+ return 1;
+ }
+
+ if ( ! $existsB) {
+ return -1;
+ }
+
+ return $order[$a] < $order[$b] ? -1 : 1;
+ });
+ break;
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AbstractDoctrineTypeDriver.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AbstractDoctrineTypeDriver.php
new file mode 100644
index 0000000000..990003d6a0
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AbstractDoctrineTypeDriver.php
@@ -0,0 +1,173 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use Doctrine\Common\Persistence\ManagerRegistry;
+use JMS\Serializer\Metadata\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata as DoctrineClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\ExpressionPropertyMetadata;
+use JMS\Serializer\Metadata\StaticPropertyMetadata;
+use JMS\Serializer\Metadata\VirtualPropertyMetadata;
+use Metadata\Driver\DriverInterface;
+
+/**
+ * This class decorates any other driver. If the inner driver does not provide a
+ * a property type, the decorator will guess based on Doctrine 2 metadata.
+ */
+abstract class AbstractDoctrineTypeDriver implements DriverInterface
+{
+ /**
+ * Map of doctrine 2 field types to JMS\Serializer types
+ * @var array
+ */
+ protected $fieldMapping = array(
+ 'string' => 'string',
+ 'text' => 'string',
+ 'blob' => 'string',
+
+ 'integer' => 'integer',
+ 'smallint' => 'integer',
+ 'bigint' => 'integer',
+
+ 'datetime' => 'DateTime',
+ 'datetimetz' => 'DateTime',
+ 'time' => 'DateTime',
+ 'date' => 'DateTime',
+
+ 'float' => 'float',
+ 'decimal' => 'float',
+
+ 'boolean' => 'boolean',
+
+ 'array' => 'array',
+ 'json_array' => 'array',
+ 'simple_array' => 'array',
+ );
+
+ /**
+ * @var DriverInterface
+ */
+ protected $delegate;
+
+ /**
+ * @var ManagerRegistry
+ */
+ protected $registry;
+
+ public function __construct(DriverInterface $delegate, ManagerRegistry $registry)
+ {
+ $this->delegate = $delegate;
+ $this->registry = $registry;
+ }
+
+ public function loadMetadataForClass(\ReflectionClass $class)
+ {
+ /** @var $classMetadata ClassMetadata */
+ $classMetadata = $this->delegate->loadMetadataForClass($class);
+
+ // Abort if the given class is not a mapped entity
+ if ( ! $doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) {
+ return $classMetadata;
+ }
+
+ $this->setDiscriminator($doctrineMetadata, $classMetadata);
+
+ // We base our scan on the internal driver's property list so that we
+ // respect any internal white/blacklisting like in the AnnotationDriver
+ foreach ($classMetadata->propertyMetadata as $key => $propertyMetadata) {
+ /** @var $propertyMetadata PropertyMetadata */
+
+ // If the inner driver provides a type, don't guess anymore.
+ if ($propertyMetadata->type || $this->isVirtualProperty($propertyMetadata)) {
+ continue;
+ }
+
+ if ($this->hideProperty($doctrineMetadata, $propertyMetadata)) {
+ unset($classMetadata->propertyMetadata[$key]);
+ }
+
+ $this->setPropertyType($doctrineMetadata, $propertyMetadata);
+ }
+
+ return $classMetadata;
+ }
+
+ private function isVirtualProperty(PropertyMetadata $propertyMetadata)
+ {
+ return $propertyMetadata instanceof VirtualPropertyMetadata
+ || $propertyMetadata instanceof StaticPropertyMetadata
+ || $propertyMetadata instanceof ExpressionPropertyMetadata;
+ }
+
+ /**
+ * @param DoctrineClassMetadata $doctrineMetadata
+ * @param ClassMetadata $classMetadata
+ */
+ protected function setDiscriminator(DoctrineClassMetadata $doctrineMetadata, ClassMetadata $classMetadata)
+ {
+ }
+
+ /**
+ * @param DoctrineClassMetadata $doctrineMetadata
+ * @param PropertyMetadata $propertyMetadata
+ */
+ protected function hideProperty(DoctrineClassMetadata $doctrineMetadata, PropertyMetadata $propertyMetadata)
+ {
+ return false;
+ }
+
+ /**
+ * @param DoctrineClassMetadata $doctrineMetadata
+ * @param PropertyMetadata $propertyMetadata
+ */
+ protected function setPropertyType(DoctrineClassMetadata $doctrineMetadata, PropertyMetadata $propertyMetadata)
+ {
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return null|DoctrineClassMetadata
+ */
+ protected function tryLoadingDoctrineMetadata($className)
+ {
+ if ( ! $manager = $this->registry->getManagerForClass($className)) {
+ return null;
+ }
+
+ if ($manager->getMetadataFactory()->isTransient($className)) {
+ return null;
+ }
+
+ return $manager->getClassMetadata($className);
+ }
+
+ /**
+ * @param string $type
+ */
+ protected function normalizeFieldType($type)
+ {
+ if ( ! isset($this->fieldMapping[$type])) {
+ return;
+ }
+
+ return $this->fieldMapping[$type];
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php
new file mode 100644
index 0000000000..175bc81156
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php
@@ -0,0 +1,250 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\Annotation\Discriminator;
+use JMS\Serializer\Annotation\ExcludeIf;
+use JMS\Serializer\Annotation\SkipWhenEmpty;
+use JMS\Serializer\Annotation\XmlDiscriminator;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Annotation\HandlerCallback;
+use JMS\Serializer\Annotation\AccessorOrder;
+use JMS\Serializer\Annotation\Accessor;
+use JMS\Serializer\Annotation\AccessType;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlValue;
+use JMS\Serializer\Annotation\XmlKeyValuePairs;
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Annotation\PostSerialize;
+use JMS\Serializer\Annotation\PostDeserialize;
+use JMS\Serializer\Annotation\PreSerialize;
+use JMS\Serializer\Annotation\VirtualProperty;
+use JMS\Serializer\Metadata\ExpressionPropertyMetadata;
+use Metadata\MethodMetadata;
+use Doctrine\Common\Annotations\Reader;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\Exclude;
+use JMS\Serializer\Annotation\Groups;
+use JMS\Serializer\Annotation\Expose;
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Until;
+use JMS\Serializer\Annotation\Since;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+use JMS\Serializer\Annotation\Inline;
+use JMS\Serializer\Annotation\ReadOnly;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\VirtualPropertyMetadata;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Annotation\XmlAttributeMap;
+use Metadata\Driver\DriverInterface;
+use JMS\Serializer\Annotation\MaxDepth;
+
+class AnnotationDriver implements DriverInterface
+{
+ private $reader;
+
+ public function __construct(Reader $reader)
+ {
+ $this->reader = $reader;
+ }
+
+ public function loadMetadataForClass(\ReflectionClass $class)
+ {
+ $classMetadata = new ClassMetadata($name = $class->name);
+ $classMetadata->fileResources[] = $class->getFilename();
+
+ $propertiesMetadata = array();
+ $propertiesAnnotations = array();
+
+ $exclusionPolicy = 'NONE';
+ $excludeAll = false;
+ $classAccessType = PropertyMetadata::ACCESS_TYPE_PROPERTY;
+ $readOnlyClass = false;
+ foreach ($this->reader->getClassAnnotations($class) as $annot) {
+ if ($annot instanceof ExclusionPolicy) {
+ $exclusionPolicy = $annot->policy;
+ } elseif ($annot instanceof XmlRoot) {
+ $classMetadata->xmlRootName = $annot->name;
+ $classMetadata->xmlRootNamespace = $annot->namespace;
+ } elseif ($annot instanceof XmlNamespace) {
+ $classMetadata->registerNamespace($annot->uri, $annot->prefix);
+ } elseif ($annot instanceof Exclude) {
+ $excludeAll = true;
+ } elseif ($annot instanceof AccessType) {
+ $classAccessType = $annot->type;
+ } elseif ($annot instanceof ReadOnly) {
+ $readOnlyClass = true;
+ } elseif ($annot instanceof AccessorOrder) {
+ $classMetadata->setAccessorOrder($annot->order, $annot->custom);
+ } elseif ($annot instanceof Discriminator) {
+ if ($annot->disabled) {
+ $classMetadata->discriminatorDisabled = true;
+ } else {
+ $classMetadata->setDiscriminator($annot->field, $annot->map, $annot->groups);
+ }
+ } elseif ($annot instanceof XmlDiscriminator) {
+ $classMetadata->xmlDiscriminatorAttribute = (bool) $annot->attribute;
+ $classMetadata->xmlDiscriminatorCData = (bool) $annot->cdata;
+ $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string) $annot->namespace : null;
+ } elseif ($annot instanceof VirtualProperty) {
+ $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $annot->name, $annot->exp);
+ $propertiesMetadata[] = $virtualPropertyMetadata;
+ $propertiesAnnotations[] = $annot->options;
+ }
+ }
+
+ foreach ($class->getMethods() as $method) {
+ if ($method->class !== $name) {
+ continue;
+ }
+
+ $methodAnnotations = $this->reader->getMethodAnnotations($method);
+
+ foreach ($methodAnnotations as $annot) {
+ if ($annot instanceof PreSerialize) {
+ $classMetadata->addPreSerializeMethod(new MethodMetadata($name, $method->name));
+ continue 2;
+ } elseif ($annot instanceof PostDeserialize) {
+ $classMetadata->addPostDeserializeMethod(new MethodMetadata($name, $method->name));
+ continue 2;
+ } elseif ($annot instanceof PostSerialize) {
+ $classMetadata->addPostSerializeMethod(new MethodMetadata($name, $method->name));
+ continue 2;
+ } elseif ($annot instanceof VirtualProperty) {
+ $virtualPropertyMetadata = new VirtualPropertyMetadata($name, $method->name);
+ $propertiesMetadata[] = $virtualPropertyMetadata;
+ $propertiesAnnotations[] = $methodAnnotations;
+ continue 2;
+ } elseif ($annot instanceof HandlerCallback) {
+ $classMetadata->addHandlerCallback(GraphNavigator::parseDirection($annot->direction), $annot->format, $method->name);
+ continue 2;
+ }
+ }
+ }
+
+ if ( ! $excludeAll) {
+ foreach ($class->getProperties() as $property) {
+ if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
+ continue;
+ }
+ $propertiesMetadata[] = new PropertyMetadata($name, $property->getName());
+ $propertiesAnnotations[] = $this->reader->getPropertyAnnotations($property);
+ }
+
+ foreach ($propertiesMetadata as $propertyKey => $propertyMetadata) {
+ $isExclude = false;
+ $isExpose = $propertyMetadata instanceof VirtualPropertyMetadata
+ || $propertyMetadata instanceof ExpressionPropertyMetadata;
+ $propertyMetadata->readOnly = $propertyMetadata->readOnly || $readOnlyClass;
+ $accessType = $classAccessType;
+ $accessor = array(null, null);
+
+ $propertyAnnotations = $propertiesAnnotations[$propertyKey];
+
+ foreach ($propertyAnnotations as $annot) {
+ if ($annot instanceof Since) {
+ $propertyMetadata->sinceVersion = $annot->version;
+ } elseif ($annot instanceof Until) {
+ $propertyMetadata->untilVersion = $annot->version;
+ } elseif ($annot instanceof SerializedName) {
+ $propertyMetadata->serializedName = $annot->name;
+ } elseif ($annot instanceof SkipWhenEmpty) {
+ $propertyMetadata->skipWhenEmpty = true;
+ } elseif ($annot instanceof Expose) {
+ $isExpose = true;
+ if (null !== $annot->if) {
+ $propertyMetadata->excludeIf = "!(" . $annot->if . ")";
+ }
+ } elseif ($annot instanceof Exclude) {
+ if (null !== $annot->if) {
+ $propertyMetadata->excludeIf = $annot->if;
+ } else {
+ $isExclude = true;
+ }
+ } elseif ($annot instanceof Type) {
+ $propertyMetadata->setType($annot->name);
+ } elseif ($annot instanceof XmlElement) {
+ $propertyMetadata->xmlAttribute = false;
+ $propertyMetadata->xmlElementCData = $annot->cdata;
+ $propertyMetadata->xmlNamespace = $annot->namespace;
+ } elseif ($annot instanceof XmlList) {
+ $propertyMetadata->xmlCollection = true;
+ $propertyMetadata->xmlCollectionInline = $annot->inline;
+ $propertyMetadata->xmlEntryName = $annot->entry;
+ $propertyMetadata->xmlEntryNamespace = $annot->namespace;
+ $propertyMetadata->xmlCollectionSkipWhenEmpty = $annot->skipWhenEmpty;
+ } elseif ($annot instanceof XmlMap) {
+ $propertyMetadata->xmlCollection = true;
+ $propertyMetadata->xmlCollectionInline = $annot->inline;
+ $propertyMetadata->xmlEntryName = $annot->entry;
+ $propertyMetadata->xmlEntryNamespace = $annot->namespace;
+ $propertyMetadata->xmlKeyAttribute = $annot->keyAttribute;
+ } elseif ($annot instanceof XmlKeyValuePairs) {
+ $propertyMetadata->xmlKeyValuePairs = true;
+ } elseif ($annot instanceof XmlAttribute) {
+ $propertyMetadata->xmlAttribute = true;
+ $propertyMetadata->xmlNamespace = $annot->namespace;
+ } elseif ($annot instanceof XmlValue) {
+ $propertyMetadata->xmlValue = true;
+ $propertyMetadata->xmlElementCData = $annot->cdata;
+ } elseif ($annot instanceof XmlElement) {
+ $propertyMetadata->xmlElementCData = $annot->cdata;
+ } elseif ($annot instanceof AccessType) {
+ $accessType = $annot->type;
+ } elseif ($annot instanceof ReadOnly) {
+ $propertyMetadata->readOnly = $annot->readOnly;
+ } elseif ($annot instanceof Accessor) {
+ $accessor = array($annot->getter, $annot->setter);
+ } elseif ($annot instanceof Groups) {
+ $propertyMetadata->groups = $annot->groups;
+ foreach ((array) $propertyMetadata->groups as $groupName) {
+ if (false !== strpos($groupName, ',')) {
+ throw new InvalidArgumentException(sprintf(
+ 'Invalid group name "%s" on "%s", did you mean to create multiple groups?',
+ implode(', ', $propertyMetadata->groups),
+ $propertyMetadata->class.'->'.$propertyMetadata->name
+ ));
+ }
+ }
+ } elseif ($annot instanceof Inline) {
+ $propertyMetadata->inline = true;
+ } elseif ($annot instanceof XmlAttributeMap) {
+ $propertyMetadata->xmlAttributeMap = true;
+ } elseif ($annot instanceof MaxDepth) {
+ $propertyMetadata->maxDepth = $annot->depth;
+ }
+ }
+
+
+ if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude)
+ || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose)) {
+ $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]);
+ $classMetadata->addPropertyMetadata($propertyMetadata);
+ }
+ }
+ }
+
+ return $classMetadata;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/DoctrinePHPCRTypeDriver.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/DoctrinePHPCRTypeDriver.php
new file mode 100644
index 0000000000..d9353c47ad
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/DoctrinePHPCRTypeDriver.php
@@ -0,0 +1,69 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata as DoctrineClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * This class decorates any other driver. If the inner driver does not provide a
+ * a property type, the decorator will guess based on Doctrine 2 metadata.
+ */
+class DoctrinePHPCRTypeDriver extends AbstractDoctrineTypeDriver
+{
+ /**
+ * @param DoctrineClassMetadata $doctrineMetadata
+ * @param PropertyMetadata $propertyMetadata
+ */
+ protected function hideProperty(DoctrineClassMetadata $doctrineMetadata, PropertyMetadata $propertyMetadata)
+ {
+ return 'lazyPropertiesDefaults' === $propertyMetadata->name
+ || $doctrineMetadata->parentMapping === $propertyMetadata->name
+ || $doctrineMetadata->node === $propertyMetadata->name;
+ }
+
+ protected function setPropertyType(DoctrineClassMetadata $doctrineMetadata, PropertyMetadata $propertyMetadata)
+ {
+ $propertyName = $propertyMetadata->name;
+ if ($doctrineMetadata->hasField($propertyName) && $fieldType = $this->normalizeFieldType($doctrineMetadata->getTypeOfField($propertyName))) {
+ $field = $doctrineMetadata->getFieldMapping($propertyName);
+ if ( ! empty($field['multivalue'])) {
+ $fieldType = 'array';
+ }
+
+ $propertyMetadata->setType($fieldType);
+ } elseif ($doctrineMetadata->hasAssociation($propertyName)) {
+ try {
+ $targetEntity = $doctrineMetadata->getAssociationTargetClass($propertyName);
+ } catch (\Exception $e) {
+ return;
+ }
+
+ if (null === $this->tryLoadingDoctrineMetadata($targetEntity)) {
+ return;
+ }
+
+ if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) {
+ $targetEntity = "ArrayCollection<{$targetEntity}>";
+ }
+
+ $propertyMetadata->setType($targetEntity);
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/DoctrineTypeDriver.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/DoctrineTypeDriver.php
new file mode 100644
index 0000000000..9587c58e94
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/DoctrineTypeDriver.php
@@ -0,0 +1,69 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata as DoctrineClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * This class decorates any other driver. If the inner driver does not provide a
+ * a property type, the decorator will guess based on Doctrine 2 metadata.
+ */
+class DoctrineTypeDriver extends AbstractDoctrineTypeDriver
+{
+ protected function setDiscriminator(DoctrineClassMetadata $doctrineMetadata, ClassMetadata $classMetadata)
+ {
+ if (empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled
+ && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity()
+ ) {
+ $classMetadata->setDiscriminator(
+ $doctrineMetadata->discriminatorColumn['name'],
+ $doctrineMetadata->discriminatorMap
+ );
+ }
+ }
+
+ protected function setPropertyType(DoctrineClassMetadata $doctrineMetadata, PropertyMetadata $propertyMetadata)
+ {
+ $propertyName = $propertyMetadata->name;
+ if ($doctrineMetadata->hasField($propertyName) && $fieldType = $this->normalizeFieldType($doctrineMetadata->getTypeOfField($propertyName))) {
+ $propertyMetadata->setType($fieldType);
+ } elseif ($doctrineMetadata->hasAssociation($propertyName)) {
+ $targetEntity = $doctrineMetadata->getAssociationTargetClass($propertyName);
+
+ if (null === $targetMetadata = $this->tryLoadingDoctrineMetadata($targetEntity)) {
+ return;
+ }
+
+ // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy.
+ // On serialization, this would lead to only the supertype being serialized, and properties of subtypes
+ // being ignored.
+ if ($targetMetadata instanceof DoctrineClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) {
+ return;
+ }
+
+ if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) {
+ $targetEntity = "ArrayCollection<{$targetEntity}>";
+ }
+
+ $propertyMetadata->setType($targetEntity);
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/PhpDriver.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/PhpDriver.php
new file mode 100644
index 0000000000..05975896cf
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/PhpDriver.php
@@ -0,0 +1,45 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Metadata\ClassMetadata;
+use Metadata\Driver\AbstractFileDriver;
+
+class PhpDriver extends AbstractFileDriver
+{
+ protected function loadMetadataFromFile(\ReflectionClass $class, $file)
+ {
+ $metadata = require $file;
+
+ if ( ! $metadata instanceof ClassMetadata) {
+ throw new RuntimeException(sprintf('The file %s was expected to return an instance of ClassMetadata, but returned %s.', $file, json_encode($metadata)));
+ }
+ if ($metadata->name !== $class->name) {
+ throw new RuntimeException(sprintf('The file %s was expected to return metadata for class %s, but instead returned metadata for class %s.', $class->name, $metadata->name));
+ }
+
+ return $metadata;
+ }
+
+ protected function getExtension()
+ {
+ return 'php';
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/XmlDriver.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/XmlDriver.php
new file mode 100644
index 0000000000..47e5e8ed36
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/XmlDriver.php
@@ -0,0 +1,354 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Exception\XmlErrorException;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+use JMS\Serializer\Metadata\ExpressionPropertyMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\VirtualPropertyMetadata;
+use Metadata\MethodMetadata;
+use JMS\Serializer\Metadata\ClassMetadata;
+use Metadata\Driver\AbstractFileDriver;
+
+class XmlDriver extends AbstractFileDriver
+{
+ protected function loadMetadataFromFile(\ReflectionClass $class, $path)
+ {
+ $previous = libxml_use_internal_errors(true);
+ libxml_clear_errors();
+
+ $elem = simplexml_load_file($path);
+ libxml_use_internal_errors($previous);
+
+ if (false === $elem) {
+ throw new XmlErrorException(libxml_get_last_error());
+ }
+
+ $metadata = new ClassMetadata($name = $class->name);
+ if ( ! $elems = $elem->xpath("./class[@name = '".$name."']")) {
+ throw new RuntimeException(sprintf('Could not find class %s inside XML element.', $name));
+ }
+ $elem = reset($elems);
+
+ $metadata->fileResources[] = $path;
+ $metadata->fileResources[] = $class->getFileName();
+ $exclusionPolicy = strtoupper($elem->attributes()->{'exclusion-policy'}) ?: 'NONE';
+ $excludeAll = null !== ($exclude = $elem->attributes()->exclude) ? 'true' === strtolower($exclude) : false;
+ $classAccessType = (string) ($elem->attributes()->{'access-type'} ?: PropertyMetadata::ACCESS_TYPE_PROPERTY);
+
+ $propertiesMetadata = array();
+ $propertiesNodes = array();
+
+ if (null !== $accessorOrder = $elem->attributes()->{'accessor-order'}) {
+ $metadata->setAccessorOrder((string) $accessorOrder, preg_split('/\s*,\s*/', (string) $elem->attributes()->{'custom-accessor-order'}));
+ }
+
+ if (null !== $xmlRootName = $elem->attributes()->{'xml-root-name'}) {
+ $metadata->xmlRootName = (string) $xmlRootName;
+ }
+
+ if (null !== $xmlRootNamespace = $elem->attributes()->{'xml-root-namespace'}) {
+ $metadata->xmlRootNamespace = (string) $xmlRootNamespace;
+ }
+
+ $readOnlyClass = 'true' === strtolower($elem->attributes()->{'read-only'});
+
+ $discriminatorFieldName = (string) $elem->attributes()->{'discriminator-field-name'};
+ $discriminatorMap = array();
+ foreach ($elem->xpath('./discriminator-class') as $entry) {
+ if ( ! isset($entry->attributes()->value)) {
+ throw new RuntimeException('Each discriminator-class element must have a "value" attribute.');
+ }
+
+ $discriminatorMap[(string) $entry->attributes()->value] = (string) $entry;
+ }
+
+ if ('true' === (string) $elem->attributes()->{'discriminator-disabled'}) {
+ $metadata->discriminatorDisabled = true;
+ } elseif ( ! empty($discriminatorFieldName) || ! empty($discriminatorMap)) {
+
+ $discriminatorGroups = array();
+ foreach ($elem->xpath('./discriminator-groups/group') as $entry) {
+ $discriminatorGroups[] = (string) $entry;
+ }
+ $metadata->setDiscriminator($discriminatorFieldName, $discriminatorMap, $discriminatorGroups);
+ }
+
+ foreach ($elem->xpath('./xml-namespace') as $xmlNamespace) {
+ if ( ! isset($xmlNamespace->attributes()->uri)) {
+ throw new RuntimeException('The prefix attribute must be set for all xml-namespace elements.');
+ }
+
+ if (isset($xmlNamespace->attributes()->prefix)) {
+ $prefix = (string) $xmlNamespace->attributes()->prefix;
+ } else {
+ $prefix = null;
+ }
+
+ $metadata->registerNamespace((string) $xmlNamespace->attributes()->uri, $prefix);
+ }
+
+ foreach ($elem->xpath('./xml-discriminator') as $xmlDiscriminator) {
+ if (isset($xmlDiscriminator->attributes()->attribute)) {
+ $metadata->xmlDiscriminatorAttribute = (string) $xmlDiscriminator->attributes()->attribute === 'true';
+ }
+ if (isset($xmlDiscriminator->attributes()->cdata)) {
+ $metadata->xmlDiscriminatorCData = (string) $xmlDiscriminator->attributes()->cdata === 'true';
+ }
+ if (isset($xmlDiscriminator->attributes()->namespace)) {
+ $metadata->xmlDiscriminatorNamespace = (string) $xmlDiscriminator->attributes()->namespace;
+ }
+ }
+
+ foreach ($elem->xpath('./virtual-property') as $method) {
+
+ if (isset($method->attributes()->expression)) {
+ $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, (string)$method->attributes()->name, (string)$method->attributes()->expression);
+ } else {
+ if ( ! isset($method->attributes()->method)) {
+ throw new RuntimeException('The method attribute must be set for all virtual-property elements.');
+ }
+ $virtualPropertyMetadata = new VirtualPropertyMetadata($name, (string) $method->attributes()->method);
+ }
+
+ $propertiesMetadata[] = $virtualPropertyMetadata;
+ $propertiesNodes[] = $method;
+ }
+
+ if ( ! $excludeAll) {
+
+ foreach ($class->getProperties() as $property) {
+ if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
+ continue;
+ }
+
+ $propertiesMetadata[] = new PropertyMetadata($name, $pName = $property->getName());
+ $pElems = $elem->xpath("./property[@name = '".$pName."']");
+
+ $propertiesNodes[] = $pElems ? reset($pElems) : null;
+ }
+
+ foreach ($propertiesMetadata as $propertyKey => $pMetadata) {
+
+ $isExclude = false;
+ $isExpose = $pMetadata instanceof VirtualPropertyMetadata
+ || $pMetadata instanceof ExpressionPropertyMetadata;
+
+ $pElem = $propertiesNodes[$propertyKey];
+ if ( ! empty($pElem)) {
+
+ if (null !== $exclude = $pElem->attributes()->exclude) {
+ $isExclude = 'true' === strtolower($exclude);
+ }
+
+ if (null !== $expose = $pElem->attributes()->expose) {
+ $isExpose = 'true' === strtolower($expose);
+ }
+
+ if (null !== $excludeIf = $pElem->attributes()->{'exclude-if'}) {
+ $pMetadata->excludeIf =$excludeIf;
+ }
+
+ if (null !== $skip = $pElem->attributes()->{'skip-when-empty'}) {
+ $pMetadata->skipWhenEmpty = 'true' === strtolower($skip);
+ }
+
+ if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) {
+ $pMetadata->excludeIf = "!(" . $excludeIf .")";
+ $isExpose = true;
+ }
+
+ if (null !== $version = $pElem->attributes()->{'since-version'}) {
+ $pMetadata->sinceVersion = (string) $version;
+ }
+
+ if (null !== $version = $pElem->attributes()->{'until-version'}) {
+ $pMetadata->untilVersion = (string) $version;
+ }
+
+ if (null !== $serializedName = $pElem->attributes()->{'serialized-name'}) {
+ $pMetadata->serializedName = (string) $serializedName;
+ }
+
+ if (null !== $type = $pElem->attributes()->type) {
+ $pMetadata->setType((string) $type);
+ } elseif (isset($pElem->type)) {
+ $pMetadata->setType((string) $pElem->type);
+ }
+
+ if (null !== $groups = $pElem->attributes()->groups) {
+ $pMetadata->groups = preg_split('/\s*,\s*/', (string) $groups);
+ }
+
+ if (isset($pElem->{'xml-list'})) {
+
+ $pMetadata->xmlCollection = true;
+
+ $colConfig = $pElem->{'xml-list'};
+ if (isset($colConfig->attributes()->inline)) {
+ $pMetadata->xmlCollectionInline = 'true' === (string) $colConfig->attributes()->inline;
+ }
+
+ if (isset($colConfig->attributes()->{'entry-name'})) {
+ $pMetadata->xmlEntryName = (string) $colConfig->attributes()->{'entry-name'};
+ }
+
+ if (isset($colConfig->attributes()->{'skip-when-empty'})) {
+ $pMetadata->xmlCollectionSkipWhenEmpty = 'true' === (string) $colConfig->attributes()->{'skip-when-empty'};
+ } else {
+ $pMetadata->xmlCollectionSkipWhenEmpty = true;
+ }
+
+ if (isset($colConfig->attributes()->namespace)) {
+ $pMetadata->xmlEntryNamespace = (string) $colConfig->attributes()->namespace;
+ }
+ }
+
+ if (isset($pElem->{'xml-map'})) {
+ $pMetadata->xmlCollection = true;
+
+ $colConfig = $pElem->{'xml-map'};
+ if (isset($colConfig->attributes()->inline)) {
+ $pMetadata->xmlCollectionInline = 'true' === (string) $colConfig->attributes()->inline;
+ }
+
+ if (isset($colConfig->attributes()->{'entry-name'})) {
+ $pMetadata->xmlEntryName = (string) $colConfig->attributes()->{'entry-name'};
+ }
+
+ if (isset($colConfig->attributes()->namespace)) {
+ $pMetadata->xmlEntryNamespace = (string) $colConfig->attributes()->namespace;
+ }
+
+ if (isset($colConfig->attributes()->{'key-attribute-name'})) {
+ $pMetadata->xmlKeyAttribute = (string) $colConfig->attributes()->{'key-attribute-name'};
+ }
+ }
+
+ if (isset($pElem->{'xml-element'})) {
+ $colConfig = $pElem->{'xml-element'};
+ if (isset($colConfig->attributes()->cdata)) {
+ $pMetadata->xmlElementCData = 'true' === (string) $colConfig->attributes()->cdata;
+ }
+
+ if (isset($colConfig->attributes()->namespace)) {
+ $pMetadata->xmlNamespace = (string) $colConfig->attributes()->namespace;
+ }
+ }
+
+ if (isset($pElem->attributes()->{'xml-attribute'})) {
+ $pMetadata->xmlAttribute = 'true' === (string) $pElem->attributes()->{'xml-attribute'};
+ }
+
+ if (isset($pElem->attributes()->{'xml-attribute-map'})) {
+ $pMetadata->xmlAttributeMap = 'true' === (string) $pElem->attributes()->{'xml-attribute-map'};
+ }
+
+ if (isset($pElem->attributes()->{'xml-value'})) {
+ $pMetadata->xmlValue = 'true' === (string) $pElem->attributes()->{'xml-value'};
+ }
+
+ if (isset($pElem->attributes()->{'xml-key-value-pairs'})) {
+ $pMetadata->xmlKeyValuePairs = 'true' === (string) $pElem->attributes()->{'xml-key-value-pairs'};
+ }
+
+ if (isset($pElem->attributes()->{'max-depth'})) {
+ $pMetadata->maxDepth = (int) $pElem->attributes()->{'max-depth'};
+ }
+
+ //we need read-only before setter and getter set, because that method depends on flag being set
+ if (null !== $readOnly = $pElem->attributes()->{'read-only'}) {
+ $pMetadata->readOnly = 'true' === strtolower($readOnly);
+ } else {
+ $pMetadata->readOnly = $pMetadata->readOnly || $readOnlyClass;
+ }
+
+ $getter = $pElem->attributes()->{'accessor-getter'};
+ $setter = $pElem->attributes()->{'accessor-setter'};
+ $pMetadata->setAccessor(
+ (string) ($pElem->attributes()->{'access-type'} ?: $classAccessType),
+ $getter ? (string) $getter : null,
+ $setter ? (string) $setter : null
+ );
+
+ if (null !== $inline = $pElem->attributes()->inline) {
+ $pMetadata->inline = 'true' === strtolower($inline);
+ }
+
+ }
+
+ if ((ExclusionPolicy::NONE === (string) $exclusionPolicy && ! $isExclude)
+ || (ExclusionPolicy::ALL === (string) $exclusionPolicy && $isExpose)) {
+
+ $metadata->addPropertyMetadata($pMetadata);
+ }
+ }
+ }
+
+ foreach ($elem->xpath('./callback-method') as $method) {
+ if ( ! isset($method->attributes()->type)) {
+ throw new RuntimeException('The type attribute must be set for all callback-method elements.');
+ }
+ if ( ! isset($method->attributes()->name)) {
+ throw new RuntimeException('The name attribute must be set for all callback-method elements.');
+ }
+
+ switch ((string) $method->attributes()->type) {
+ case 'pre-serialize':
+ $metadata->addPreSerializeMethod(new MethodMetadata($name, (string) $method->attributes()->name));
+ break;
+
+ case 'post-serialize':
+ $metadata->addPostSerializeMethod(new MethodMetadata($name, (string) $method->attributes()->name));
+ break;
+
+ case 'post-deserialize':
+ $metadata->addPostDeserializeMethod(new MethodMetadata($name, (string) $method->attributes()->name));
+ break;
+
+ case 'handler':
+ if ( ! isset($method->attributes()->format)) {
+ throw new RuntimeException('The format attribute must be set for "handler" callback methods.');
+ }
+ if ( ! isset($method->attributes()->direction)) {
+ throw new RuntimeException('The direction attribute must be set for "handler" callback methods.');
+ }
+
+ $direction = GraphNavigator::parseDirection((string) $method->attributes()->direction);
+ $format = (string) $method->attributes()->format;
+ $metadata->addHandlerCallback($direction, $format, (string) $method->attributes()->name);
+
+ break;
+
+ default:
+ throw new RuntimeException(sprintf('The type "%s" is not supported.', $method->attributes()->name));
+ }
+ }
+
+ return $metadata;
+ }
+
+ protected function getExtension()
+ {
+ return 'xml';
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/YamlDriver.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/YamlDriver.php
new file mode 100644
index 0000000000..0c75cb96d4
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/YamlDriver.php
@@ -0,0 +1,336 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+use JMS\Serializer\Metadata\ExpressionPropertyMetadata;
+use Metadata\MethodMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\VirtualPropertyMetadata;
+use JMS\Serializer\Metadata\ClassMetadata;
+use Symfony\Component\Yaml\Yaml;
+use Metadata\Driver\AbstractFileDriver;
+
+class YamlDriver extends AbstractFileDriver
+{
+ protected function loadMetadataFromFile(\ReflectionClass $class, $file)
+ {
+ $config = Yaml::parse(file_get_contents($file));
+
+ if ( ! isset($config[$name = $class->name])) {
+ throw new RuntimeException(sprintf('Expected metadata for class %s to be defined in %s.', $class->name, $file));
+ }
+
+ $config = $config[$name];
+ $metadata = new ClassMetadata($name);
+ $metadata->fileResources[] = $file;
+ $metadata->fileResources[] = $class->getFileName();
+ $exclusionPolicy = isset($config['exclusion_policy']) ? strtoupper($config['exclusion_policy']) : 'NONE';
+ $excludeAll = isset($config['exclude']) ? (Boolean) $config['exclude'] : false;
+ $classAccessType = isset($config['access_type']) ? $config['access_type'] : PropertyMetadata::ACCESS_TYPE_PROPERTY;
+ $readOnlyClass = isset($config['read_only']) ? (Boolean) $config['read_only'] : false;
+ $this->addClassProperties($metadata, $config);
+
+ $propertiesMetadata = array();
+ if (array_key_exists('virtual_properties', $config)) {
+ foreach ($config['virtual_properties'] as $methodName => $propertySettings) {
+ if (isset($propertySettings['exp'])) {
+ $virtualPropertyMetadata = new ExpressionPropertyMetadata( $name, $methodName, $propertySettings['exp']);
+ unset($propertySettings['exp']);
+
+ } else {
+
+ if ( ! $class->hasMethod($methodName)) {
+ throw new RuntimeException('The method '.$methodName.' not found in class '.$class->name);
+ }
+ $virtualPropertyMetadata = new VirtualPropertyMetadata($name, $methodName);
+ }
+ $propertiesMetadata[$methodName] = $virtualPropertyMetadata;
+ $config['properties'][$methodName] = $propertySettings;
+ }
+ }
+
+ if ( ! $excludeAll) {
+ foreach ($class->getProperties() as $property) {
+ if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
+ continue;
+ }
+
+ $pName = $property->getName();
+ $propertiesMetadata[$pName] = new PropertyMetadata($name, $pName);
+ }
+
+ foreach ($propertiesMetadata as $pName => $pMetadata) {
+ $isExclude = false;
+ $isExpose = $pMetadata instanceof VirtualPropertyMetadata
+ || $pMetadata instanceof ExpressionPropertyMetadata
+ || (isset($config['properties']) && array_key_exists($pName, $config['properties']));
+
+ if (isset($config['properties'][$pName])) {
+ $pConfig = $config['properties'][$pName];
+
+ if (isset($pConfig['exclude'])) {
+ $isExclude = (Boolean) $pConfig['exclude'];
+ }
+
+ if (isset($pConfig['expose'])) {
+ $isExpose = (Boolean) $pConfig['expose'];
+ }
+
+ if (isset($pConfig['skip_when_empty'])) {
+ $pMetadata->skipWhenEmpty = (Boolean) $pConfig['skip_when_empty'];
+ }
+
+ if (isset($pConfig['since_version'])) {
+ $pMetadata->sinceVersion = (string) $pConfig['since_version'];
+ }
+
+ if (isset($pConfig['until_version'])) {
+ $pMetadata->untilVersion = (string) $pConfig['until_version'];
+ }
+
+ if (isset($pConfig['exclude_if'])) {
+ $pMetadata->excludeIf = (string) $pConfig['exclude_if'];
+ }
+
+ if (isset($pConfig['expose_if'])) {
+ $pMetadata->excludeIf = "!(" . $pConfig['expose_if'].")";
+ }
+
+ if (isset($pConfig['serialized_name'])) {
+ $pMetadata->serializedName = (string) $pConfig['serialized_name'];
+ }
+
+ if (isset($pConfig['type'])) {
+ $pMetadata->setType((string) $pConfig['type']);
+ }
+
+ if (isset($pConfig['groups'])) {
+ $pMetadata->groups = $pConfig['groups'];
+ }
+
+ if (isset($pConfig['xml_list'])) {
+ $pMetadata->xmlCollection = true;
+
+ $colConfig = $pConfig['xml_list'];
+ if (isset($colConfig['inline'])) {
+ $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline'];
+ }
+
+ if (isset($colConfig['entry_name'])) {
+ $pMetadata->xmlEntryName = (string)$colConfig['entry_name'];
+ }
+
+ if (isset($colConfig['skip_when_empty'])) {
+ $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty'];
+ } else {
+ $pMetadata->xmlCollectionSkipWhenEmpty = true;
+ }
+
+ if (isset($colConfig['namespace'])) {
+ $pMetadata->xmlEntryNamespace = (string) $colConfig['namespace'];
+ }
+ }
+
+ if (isset($pConfig['xml_map'])) {
+ $pMetadata->xmlCollection = true;
+
+ $colConfig = $pConfig['xml_map'];
+ if (isset($colConfig['inline'])) {
+ $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline'];
+ }
+
+ if (isset($colConfig['entry_name'])) {
+ $pMetadata->xmlEntryName = (string) $colConfig['entry_name'];
+ }
+
+ if (isset($colConfig['namespace'])) {
+ $pMetadata->xmlEntryNamespace = (string) $colConfig['namespace'];
+ }
+
+ if (isset($colConfig['key_attribute_name'])) {
+ $pMetadata->xmlKeyAttribute = $colConfig['key_attribute_name'];
+ }
+
+ }
+
+ if (isset($pConfig['xml_element'])) {
+ $colConfig = $pConfig['xml_element'];
+ if (isset($colConfig['cdata'])) {
+ $pMetadata->xmlElementCData = (Boolean) $colConfig['cdata'];
+ }
+
+ if (isset($colConfig['namespace'])) {
+ $pMetadata->xmlNamespace = (string) $colConfig['namespace'];
+ }
+ }
+
+ if (isset($pConfig['xml_attribute'])) {
+ $pMetadata->xmlAttribute = (Boolean) $pConfig['xml_attribute'];
+ }
+
+ if (isset($pConfig['xml_attribute_map'])) {
+ $pMetadata->xmlAttributeMap = (Boolean) $pConfig['xml_attribute_map'];
+ }
+
+ if (isset($pConfig['xml_value'])) {
+ $pMetadata->xmlValue = (Boolean) $pConfig['xml_value'];
+ }
+
+ if (isset($pConfig['xml_key_value_pairs'])) {
+ $pMetadata->xmlKeyValuePairs = (Boolean) $pConfig['xml_key_value_pairs'];
+ }
+
+ //we need read_only before setter and getter set, because that method depends on flag being set
+ if (isset($pConfig['read_only'])) {
+ $pMetadata->readOnly = (Boolean) $pConfig['read_only'];
+ } else {
+ $pMetadata->readOnly = $pMetadata->readOnly || $readOnlyClass;
+ }
+
+ $pMetadata->setAccessor(
+ isset($pConfig['access_type']) ? $pConfig['access_type'] : $classAccessType,
+ isset($pConfig['accessor']['getter']) ? $pConfig['accessor']['getter'] : null,
+ isset($pConfig['accessor']['setter']) ? $pConfig['accessor']['setter'] : null
+ );
+
+ if (isset($pConfig['inline'])) {
+ $pMetadata->inline = (Boolean) $pConfig['inline'];
+ }
+
+ if (isset($pConfig['max_depth'])) {
+ $pMetadata->maxDepth = (int) $pConfig['max_depth'];
+ }
+ }
+ if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude)
+ || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose)) {
+ $metadata->addPropertyMetadata($pMetadata);
+ }
+ }
+ }
+
+ if (isset($config['handler_callbacks'])) {
+ foreach ($config['handler_callbacks'] as $directionName => $formats) {
+ $direction = GraphNavigator::parseDirection($directionName);
+ foreach ($formats as $format => $methodName) {
+ $metadata->addHandlerCallback($direction, $format, $methodName);
+ }
+ }
+ }
+
+ if (isset($config['callback_methods'])) {
+ $cConfig = $config['callback_methods'];
+
+ if (isset($cConfig['pre_serialize'])) {
+ $metadata->preSerializeMethods = $this->getCallbackMetadata($class, $cConfig['pre_serialize']);
+ }
+ if (isset($cConfig['post_serialize'])) {
+ $metadata->postSerializeMethods = $this->getCallbackMetadata($class, $cConfig['post_serialize']);
+ }
+ if (isset($cConfig['post_deserialize'])) {
+ $metadata->postDeserializeMethods = $this->getCallbackMetadata($class, $cConfig['post_deserialize']);
+ }
+ }
+
+ return $metadata;
+ }
+
+ protected function getExtension()
+ {
+ return 'yml';
+ }
+
+ private function addClassProperties(ClassMetadata $metadata, array $config)
+ {
+ if (isset($config['custom_accessor_order']) && ! isset($config['accessor_order'])) {
+ $config['accessor_order'] = 'custom';
+ }
+
+ if (isset($config['accessor_order'])) {
+ $metadata->setAccessorOrder($config['accessor_order'], isset($config['custom_accessor_order']) ? $config['custom_accessor_order'] : array());
+ }
+
+ if (isset($config['xml_root_name'])) {
+ $metadata->xmlRootName = (string) $config['xml_root_name'];
+ }
+
+ if (isset($config['xml_root_namespace'])) {
+ $metadata->xmlRootNamespace = (string) $config['xml_root_namespace'];
+ }
+
+ if (array_key_exists('xml_namespaces', $config)) {
+
+ foreach ($config['xml_namespaces'] as $prefix => $uri) {
+ $metadata->registerNamespace($uri, $prefix);
+ }
+
+ }
+
+ if (isset($config['discriminator'])) {
+ if (isset($config['discriminator']['disabled']) && true === $config['discriminator']['disabled']) {
+ $metadata->discriminatorDisabled = true;
+ } else {
+ if ( ! isset($config['discriminator']['field_name'])) {
+ throw new RuntimeException('The "field_name" attribute must be set for discriminators.');
+ }
+
+ if ( ! isset($config['discriminator']['map']) || ! is_array($config['discriminator']['map'])) {
+ throw new RuntimeException('The "map" attribute must be set, and be an array for discriminators.');
+ }
+ $groups = isset($config['discriminator']['groups']) ? $config['discriminator']['groups'] : array();
+ $metadata->setDiscriminator($config['discriminator']['field_name'], $config['discriminator']['map'], $groups);
+
+ if (isset($config['discriminator']['xml_attribute'])) {
+ $metadata->xmlDiscriminatorAttribute = (bool) $config['discriminator']['xml_attribute'];
+ }
+ if (isset($config['discriminator']['xml_element'])) {
+ if (isset($config['discriminator']['xml_element']['cdata'])) {
+ $metadata->xmlDiscriminatorCData = (bool) $config['discriminator']['xml_element']['cdata'];
+ }
+ if (isset($config['discriminator']['xml_element']['namespace'])) {
+ $metadata->xmlDiscriminatorNamespace = (string) $config['discriminator']['xml_element']['namespace'];
+ }
+ }
+
+ }
+ }
+ }
+
+ private function getCallbackMetadata(\ReflectionClass $class, $config)
+ {
+ if (is_string($config)) {
+ $config = array($config);
+ } elseif ( ! is_array($config)) {
+ throw new RuntimeException(sprintf('callback methods expects a string, or an array of strings that represent method names, but got %s.', json_encode($config['pre_serialize'])));
+ }
+
+ $methods = array();
+ foreach ($config as $name) {
+ if ( ! $class->hasMethod($name)) {
+ throw new RuntimeException(sprintf('The method %s does not exist in class %s.', $name, $class->name));
+ }
+
+ $methods[] = new MethodMetadata($class->name, $name);
+ }
+
+ return $methods;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/ExpressionPropertyMetadata.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/ExpressionPropertyMetadata.php
new file mode 100644
index 0000000000..47eee7eef9
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/ExpressionPropertyMetadata.php
@@ -0,0 +1,127 @@
+
+ *
+ * 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\Metadata;
+
+use JMS\Serializer\Exception\ExpressionLanguageRequiredException;
+
+/**
+ * @Annotation
+ * @Target("METHOD")
+ *
+ * @author Asmir Mustafic
+ */
+class ExpressionPropertyMetadata extends PropertyMetadata
+{
+ /**
+ * @var string
+ */
+ public $expression;
+
+ public function __construct($class, $fieldName, $expression)
+ {
+ $this->class = $class;
+ $this->name = $fieldName;
+ $this->expression = $expression;
+ $this->readOnly = true;
+ }
+
+ public function setAccessor($type, $getter = null, $setter = null)
+ {
+ }
+
+ /**
+ * @param object $object
+ * @return mixed
+ */
+ public function getValue($object)
+ {
+ throw new ExpressionLanguageRequiredException(sprintf('The property %s on %s requires the expression accessor strategy to be enabled.', $this->name, $this->class));
+ }
+
+ public function setValue($obj, $value)
+ {
+ throw new \LogicException('ExpressionPropertyMetadata is immutable.');
+ }
+
+ public function serialize()
+ {
+ return serialize(array(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->xmlAttributeMap,
+ $this->maxDepth,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->class,
+ $this->name,
+ 'excludeIf' => $this->excludeIf,
+ 'expression' => $this->expression,
+ ));
+ }
+
+ public function unserialize($str)
+ {
+ $unserialized = unserialize($str);
+ list(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->xmlAttributeMap,
+ $this->maxDepth,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->class,
+ $this->name
+ ) = $unserialized;
+
+ if (isset($unserialized['excludeIf'])){
+ $this->excludeIf = $unserialized['excludeIf'];
+ }
+ if (isset($unserialized['expression'])){
+ $this->expression = $unserialized['expression'];
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/PropertyMetadata.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/PropertyMetadata.php
new file mode 100644
index 0000000000..e57b28bebb
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/PropertyMetadata.php
@@ -0,0 +1,188 @@
+
+ *
+ * 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\Metadata;
+
+use JMS\Serializer\TypeParser;
+use Metadata\PropertyMetadata as BasePropertyMetadata;
+use JMS\Serializer\Exception\RuntimeException;
+
+class PropertyMetadata extends BasePropertyMetadata
+{
+ const ACCESS_TYPE_PROPERTY = 'property';
+ const ACCESS_TYPE_PUBLIC_METHOD = 'public_method';
+
+ public $sinceVersion;
+ public $untilVersion;
+ public $groups;
+ public $serializedName;
+ public $type;
+ public $xmlCollection = false;
+ public $xmlCollectionInline = false;
+ public $xmlCollectionSkipWhenEmpty = true;
+ public $xmlEntryName;
+ public $xmlEntryNamespace;
+ public $xmlKeyAttribute;
+ public $xmlAttribute = false;
+ public $xmlValue = false;
+ public $xmlNamespace;
+ public $xmlKeyValuePairs = false;
+ public $xmlElementCData = true;
+ public $getter;
+ public $setter;
+ public $inline = false;
+ public $skipWhenEmpty = false;
+ public $readOnly = false;
+ public $xmlAttributeMap = false;
+ public $maxDepth = null;
+ public $excludeIf = null;
+
+ private static $typeParser;
+
+ public function setAccessor($type, $getter = null, $setter = null)
+ {
+ if (self::ACCESS_TYPE_PUBLIC_METHOD === $type) {
+ $class = $this->reflection->getDeclaringClass();
+
+ if (empty($getter)) {
+ if ($class->hasMethod('get'.$this->name) && $class->getMethod('get'.$this->name)->isPublic()) {
+ $getter = 'get'.$this->name;
+ } elseif ($class->hasMethod('is'.$this->name) && $class->getMethod('is'.$this->name)->isPublic()) {
+ $getter = 'is'.$this->name;
+ } elseif ($class->hasMethod('has'.$this->name) && $class->getMethod('has'.$this->name)->isPublic()) {
+ $getter = 'has'.$this->name;
+ } else {
+ throw new RuntimeException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get'.ucfirst($this->name), 'is'.ucfirst($this->name), 'has'.ucfirst($this->name), $this->class, $this->name));
+ }
+ }
+
+ if (empty($setter) && ! $this->readOnly) {
+ if ($class->hasMethod('set'.$this->name) && $class->getMethod('set'.$this->name)->isPublic()) {
+ $setter = 'set'.$this->name;
+ } else {
+ throw new RuntimeException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set'.ucfirst($this->name), $this->class, $this->name));
+ }
+ }
+ }
+
+ $this->getter = $getter;
+ $this->setter = $setter;
+ }
+
+ public function getValue($obj)
+ {
+ if (null === $this->getter) {
+ return parent::getValue($obj);
+ }
+
+ return $obj->{$this->getter}();
+ }
+
+ public function setValue($obj, $value)
+ {
+ if (null === $this->setter) {
+ parent::setValue($obj, $value);
+ return;
+ }
+
+ $obj->{$this->setter}($value);
+ }
+
+ public function setType($type)
+ {
+ if (null === self::$typeParser) {
+ self::$typeParser = new TypeParser();
+ }
+
+ $this->type = self::$typeParser->parse($type);
+ }
+
+ public function serialize()
+ {
+ return serialize(array(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->xmlAttributeMap,
+ $this->maxDepth,
+ parent::serialize(),
+ 'xmlEntryNamespace' => $this->xmlEntryNamespace,
+ 'xmlCollectionSkipWhenEmpty' => $this->xmlCollectionSkipWhenEmpty,
+ 'excludeIf' => $this->excludeIf,
+ 'skipWhenEmpty' => $this->skipWhenEmpty,
+ ));
+ }
+
+ public function unserialize($str)
+ {
+ $unserialized = unserialize($str);
+ list(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->xmlAttributeMap,
+ $this->maxDepth,
+ $parentStr
+ ) = $unserialized;
+
+ if (isset($unserialized['xmlEntryNamespace'])){
+ $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace'];
+ }
+ if (isset($unserialized['xmlCollectionSkipWhenEmpty'])){
+ $this->xmlCollectionSkipWhenEmpty = $unserialized['xmlCollectionSkipWhenEmpty'];
+ }
+ if (isset($unserialized['excludeIf'])){
+ $this->excludeIf = $unserialized['excludeIf'];
+ }
+ if (isset($unserialized['skipWhenEmpty'])){
+ $this->skipWhenEmpty = $unserialized['skipWhenEmpty'];
+ }
+
+ parent::unserialize($parentStr);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/StaticPropertyMetadata.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/StaticPropertyMetadata.php
new file mode 100644
index 0000000000..160e6c7367
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/StaticPropertyMetadata.php
@@ -0,0 +1,101 @@
+
+ *
+ * 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\Metadata;
+
+class StaticPropertyMetadata extends PropertyMetadata
+{
+ private $value;
+
+ public function __construct($className, $fieldName, $fieldValue, array $groups = array())
+ {
+ $this->class = $className;
+ $this->name = $fieldName;
+ $this->value = $fieldValue;
+ $this->readOnly = true;
+ $this->groups = $groups;
+ }
+
+ public function getValue($obj)
+ {
+ return $this->value;
+ }
+
+ public function setValue($obj, $value)
+ {
+ throw new \LogicException('StaticPropertyMetadata is immutable.');
+ }
+
+ public function setAccessor($type, $getter = null, $setter = null)
+ {
+ }
+
+ public function serialize()
+ {
+ return serialize(array(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->class,
+ $this->name,
+ $this->value
+ ));
+ }
+
+ public function unserialize($str)
+ {
+ list(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->class,
+ $this->name,
+ $this->value
+ ) = unserialize($str);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Metadata/VirtualPropertyMetadata.php b/vendor/jms/serializer/src/JMS/Serializer/Metadata/VirtualPropertyMetadata.php
new file mode 100644
index 0000000000..e0bec4060e
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Metadata/VirtualPropertyMetadata.php
@@ -0,0 +1,107 @@
+
+ *
+ * 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\Metadata;
+
+class VirtualPropertyMetadata extends PropertyMetadata
+{
+ public function __construct($class, $methodName)
+ {
+ if (0 === strpos($methodName, 'get')) {
+ $fieldName = lcfirst(substr($methodName, 3));
+ } else {
+ $fieldName = $methodName;
+ }
+
+ $this->class = $class;
+ $this->name = $fieldName;
+ $this->getter = $methodName;
+ $this->readOnly = true;
+ }
+
+ public function setValue($obj, $value)
+ {
+ throw new \LogicException('VirtualPropertyMetadata is immutable.');
+ }
+
+ public function setAccessor($type, $getter = null, $setter = null)
+ {
+ }
+
+ public function serialize()
+ {
+ return serialize(array(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->xmlAttributeMap,
+ $this->maxDepth,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->class,
+ $this->name,
+ 'excludeIf' => $this->excludeIf,
+ ));
+ }
+
+ public function unserialize($str)
+ {
+ $unserialized = unserialize($str);
+ list(
+ $this->sinceVersion,
+ $this->untilVersion,
+ $this->groups,
+ $this->serializedName,
+ $this->type,
+ $this->xmlCollection,
+ $this->xmlCollectionInline,
+ $this->xmlEntryName,
+ $this->xmlKeyAttribute,
+ $this->xmlAttribute,
+ $this->xmlValue,
+ $this->xmlNamespace,
+ $this->xmlKeyValuePairs,
+ $this->xmlElementCData,
+ $this->xmlAttributeMap,
+ $this->maxDepth,
+ $this->getter,
+ $this->setter,
+ $this->inline,
+ $this->readOnly,
+ $this->class,
+ $this->name
+ ) = $unserialized;
+
+ if (isset($unserialized['excludeIf'])){
+ $this->excludeIf = $unserialized['excludeIf'];
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Naming/CacheNamingStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Naming/CacheNamingStrategy.php
new file mode 100644
index 0000000000..cb3d31bded
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Naming/CacheNamingStrategy.php
@@ -0,0 +1,42 @@
+
+ *
+ * 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\Naming;
+
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+class CacheNamingStrategy implements PropertyNamingStrategyInterface
+{
+ private $delegate;
+ private $cache;
+
+ public function __construct(PropertyNamingStrategyInterface $delegate)
+ {
+ $this->delegate = $delegate;
+ $this->cache = new \SplObjectStorage();
+ }
+
+ public function translateName(PropertyMetadata $property)
+ {
+ if (isset($this->cache[$property])) {
+ return $this->cache[$property];
+ }
+
+ return $this->cache[$property] = $this->delegate->translateName($property);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Naming/CamelCaseNamingStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Naming/CamelCaseNamingStrategy.php
new file mode 100644
index 0000000000..7ad1c50dce
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Naming/CamelCaseNamingStrategy.php
@@ -0,0 +1,52 @@
+
+ *
+ * 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\Naming;
+
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * Generic naming strategy which translates a camel-cased property name.
+ *
+ * @author Johannes M. Schmitt
+ */
+class CamelCaseNamingStrategy implements PropertyNamingStrategyInterface
+{
+ private $separator;
+ private $lowerCase;
+
+ public function __construct($separator = '_', $lowerCase = true)
+ {
+ $this->separator = $separator;
+ $this->lowerCase = $lowerCase;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function translateName(PropertyMetadata $property)
+ {
+ $name = preg_replace('/[A-Z]/', $this->separator.'\\0', $property->name);
+
+ if ($this->lowerCase) {
+ return strtolower($name);
+ }
+
+ return ucfirst($name);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Naming/IdenticalPropertyNamingStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Naming/IdenticalPropertyNamingStrategy.php
new file mode 100644
index 0000000000..555ed36205
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Naming/IdenticalPropertyNamingStrategy.php
@@ -0,0 +1,30 @@
+
+ *
+ * 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\Naming;
+
+use JMS\Serializer\Naming\PropertyNamingStrategyInterface;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+class IdenticalPropertyNamingStrategy implements PropertyNamingStrategyInterface
+{
+ public function translateName(PropertyMetadata $property)
+ {
+ return $property->name;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Naming/PropertyNamingStrategyInterface.php b/vendor/jms/serializer/src/JMS/Serializer/Naming/PropertyNamingStrategyInterface.php
new file mode 100644
index 0000000000..6d764cb60a
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Naming/PropertyNamingStrategyInterface.php
@@ -0,0 +1,41 @@
+
+ *
+ * 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\Naming;
+
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * Interface for property naming strategies.
+ *
+ * Implementations translate the property name to a serialized name that is
+ * displayed.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface PropertyNamingStrategyInterface
+{
+ /**
+ * Translates the name of the property to the serialized version.
+ *
+ * @param PropertyMetadata $property
+ *
+ * @return string
+ */
+ public function translateName(PropertyMetadata $property);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Naming/SerializedNameAnnotationStrategy.php b/vendor/jms/serializer/src/JMS/Serializer/Naming/SerializedNameAnnotationStrategy.php
new file mode 100644
index 0000000000..e30060ce5b
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Naming/SerializedNameAnnotationStrategy.php
@@ -0,0 +1,48 @@
+
+ *
+ * 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\Naming;
+
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * Naming strategy which uses an annotation to translate the property name.
+ *
+ * @author Johannes M. Schmitt
+ */
+class SerializedNameAnnotationStrategy implements PropertyNamingStrategyInterface
+{
+ private $delegate;
+
+ public function __construct(PropertyNamingStrategyInterface $namingStrategy)
+ {
+ $this->delegate = $namingStrategy;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function translateName(PropertyMetadata $property)
+ {
+ if (null !== $name = $property->serializedName) {
+ return $name;
+ }
+
+ return $this->delegate->translateName($property);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/SerializationContext.php b/vendor/jms/serializer/src/JMS/Serializer/SerializationContext.php
new file mode 100644
index 0000000000..28823bceee
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/SerializationContext.php
@@ -0,0 +1,144 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Exception\LogicException;
+use JMS\Serializer\Exception\RuntimeException;
+use Metadata\MetadataFactoryInterface;
+
+class SerializationContext extends Context
+{
+ /** @var \SplObjectStorage */
+ private $visitingSet;
+
+ /** @var \SplStack */
+ private $visitingStack;
+
+ /**
+ * @var string
+ */
+ private $initialType;
+
+ public static function create()
+ {
+ return new self();
+ }
+
+ /**
+ * @param string $format
+ */
+ public function initialize($format, VisitorInterface $visitor, GraphNavigator $navigator, MetadataFactoryInterface $factory)
+ {
+ parent::initialize($format, $visitor, $navigator, $factory);
+
+ $this->visitingSet = new \SplObjectStorage();
+ $this->visitingStack = new \SplStack();
+ }
+
+ public function startVisiting($object)
+ {
+ if ( ! is_object($object)) {
+ return;
+ }
+ $this->visitingSet->attach($object);
+ $this->visitingStack->push($object);
+ }
+
+ public function stopVisiting($object)
+ {
+ if ( ! is_object($object)) {
+ return;
+ }
+ $this->visitingSet->detach($object);
+ $poppedObject = $this->visitingStack->pop();
+
+ if ($object !== $poppedObject) {
+ throw new RuntimeException('Context visitingStack not working well');
+ }
+ }
+
+ public function isVisiting($object)
+ {
+ if ( ! is_object($object)) {
+ return false;
+ }
+
+ return $this->visitingSet->contains($object);
+ }
+
+ public function getPath()
+ {
+ $path = array();
+ foreach ($this->visitingStack as $obj) {
+ $path[] = get_class($obj);
+ }
+
+ if ( ! $path) {
+ return null;
+ }
+
+ return implode(' -> ', $path);
+ }
+
+ public function getDirection()
+ {
+ return GraphNavigator::DIRECTION_SERIALIZATION;
+ }
+
+ public function getDepth()
+ {
+ return $this->visitingStack->count();
+ }
+
+ public function getObject()
+ {
+ return ! $this->visitingStack->isEmpty() ? $this->visitingStack->top() : null;
+ }
+
+ public function getVisitingStack()
+ {
+ return $this->visitingStack;
+ }
+
+ public function getVisitingSet()
+ {
+ return $this->visitingSet;
+ }
+
+ /**
+ * @param string $type
+ * @return $this
+ */
+ public function setInitialType($type)
+ {
+ $this->initialType = $type;
+ $this->attributes->set('initial_type', $type);
+ return $this;
+ }
+
+ /**
+ * @return string|null
+ */
+ public function getInitialType()
+ {
+ return $this->initialType
+ ? $this->initialType
+ : $this->attributes->containsKey('initial_type') ? $this->attributes->get('initial_type')->get() : null;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Serializer.php b/vendor/jms/serializer/src/JMS/Serializer/Serializer.php
new file mode 100644
index 0000000000..ae15510928
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Serializer.php
@@ -0,0 +1,255 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Construction\ObjectConstructorInterface;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Handler\HandlerRegistryInterface;
+use JMS\Serializer\EventDispatcher\EventDispatcherInterface;
+use JMS\Serializer\Exception\UnsupportedFormatException;
+use JMS\Serializer\ContextFactory\SerializationContextFactoryInterface;
+use JMS\Serializer\ContextFactory\DeserializationContextFactoryInterface;
+use JMS\Serializer\ContextFactory\DefaultSerializationContextFactory;
+use JMS\Serializer\ContextFactory\DefaultDeserializationContextFactory;
+use Metadata\MetadataFactoryInterface;
+use PhpCollection\MapInterface;
+use JMS\Serializer\Expression\ExpressionEvaluatorInterface;
+
+/**
+ * Serializer Implementation.
+ *
+ * @author Johannes M. Schmitt
+ */
+class Serializer implements SerializerInterface, ArrayTransformerInterface
+{
+ private $factory;
+ private $handlerRegistry;
+ private $objectConstructor;
+ private $dispatcher;
+ private $typeParser;
+
+ /** @var \PhpCollection\MapInterface */
+ private $serializationVisitors;
+
+ /** @var \PhpCollection\MapInterface */
+ private $deserializationVisitors;
+
+ private $navigator;
+
+ /**
+ * @var SerializationContextFactoryInterface
+ */
+ private $serializationContextFactory;
+
+ /**
+ * @var DeserializationContextFactoryInterface
+ */
+ private $deserializationContextFactory;
+
+ /**
+ * Constructor.
+ *
+ * @param \Metadata\MetadataFactoryInterface $factory
+ * @param Handler\HandlerRegistryInterface $handlerRegistry
+ * @param Construction\ObjectConstructorInterface $objectConstructor
+ * @param \PhpCollection\MapInterface $serializationVisitors of VisitorInterface
+ * @param \PhpCollection\MapInterface $deserializationVisitors of VisitorInterface
+ * @param EventDispatcher\EventDispatcherInterface $dispatcher
+ * @param TypeParser $typeParser
+ * @param ExpressionEvaluatorInterface|null $expressionEvaluator
+ */
+ public function __construct(
+ MetadataFactoryInterface $factory,
+ HandlerRegistryInterface $handlerRegistry,
+ ObjectConstructorInterface $objectConstructor,
+ MapInterface $serializationVisitors,
+ MapInterface $deserializationVisitors,
+ EventDispatcherInterface $dispatcher = null,
+ TypeParser $typeParser = null,
+ ExpressionEvaluatorInterface $expressionEvaluator = null
+ )
+ {
+ $this->factory = $factory;
+ $this->handlerRegistry = $handlerRegistry;
+ $this->objectConstructor = $objectConstructor;
+ $this->dispatcher = $dispatcher;
+ $this->typeParser = $typeParser ?: new TypeParser();
+ $this->serializationVisitors = $serializationVisitors;
+ $this->deserializationVisitors = $deserializationVisitors;
+
+ $this->navigator = new GraphNavigator($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->dispatcher, $expressionEvaluator);
+
+ $this->serializationContextFactory = new DefaultSerializationContextFactory();
+ $this->deserializationContextFactory = new DefaultDeserializationContextFactory();
+ }
+
+ public function serialize($data, $format, SerializationContext $context = null)
+ {
+ if (null === $context) {
+ $context = $this->serializationContextFactory->createSerializationContext();
+ }
+
+ return $this->serializationVisitors->get($format)
+ ->map(function(VisitorInterface $visitor) use ($context, $data, $format) {
+ $type = $context->getInitialType() !== null ? $this->typeParser->parse($context->getInitialType()) : null;
+
+ $this->visit($visitor, $context, $visitor->prepare($data), $format, $type);
+
+ return $visitor->getResult();
+ })
+ ->getOrThrow(new UnsupportedFormatException(sprintf('The format "%s" is not supported for serialization.', $format)))
+ ;
+ }
+
+ public function deserialize($data, $type, $format, DeserializationContext $context = null)
+ {
+ if (null === $context) {
+ $context = $this->deserializationContextFactory->createDeserializationContext();
+ }
+
+ return $this->deserializationVisitors->get($format)
+ ->map(function(VisitorInterface $visitor) use ($context, $data, $format, $type) {
+ $preparedData = $visitor->prepare($data);
+ $navigatorResult = $this->visit($visitor, $context, $preparedData, $format, $this->typeParser->parse($type));
+
+ return $this->handleDeserializeResult($visitor->getResult(), $navigatorResult);
+ })
+ ->getOrThrow(new UnsupportedFormatException(sprintf('The format "%s" is not supported for deserialization.', $format)))
+ ;
+ }
+
+ /**
+ * {@InheritDoc}
+ */
+ public function toArray($data, SerializationContext $context = null)
+ {
+ if (null === $context) {
+ $context = $this->serializationContextFactory->createSerializationContext();
+ }
+
+ return $this->serializationVisitors->get('json')
+ ->map(function(JsonSerializationVisitor $visitor) use ($context, $data) {
+ $type = $context->getInitialType() !== null ? $this->typeParser->parse($context->getInitialType()) : null;
+
+ $this->visit($visitor, $context, $data, 'json', $type);
+ $result = $this->convertArrayObjects($visitor->getRoot());
+
+ if ( ! is_array($result)) {
+ throw new RuntimeException(sprintf(
+ 'The input data of type "%s" did not convert to an array, but got a result of type "%s".',
+ is_object($data) ? get_class($data) : gettype($data),
+ is_object($result) ? get_class($result) : gettype($result)
+ ));
+ }
+
+ return $result;
+ })
+ ->get()
+ ;
+ }
+
+ /**
+ * {@InheritDoc}
+ */
+ public function fromArray(array $data, $type, DeserializationContext $context = null)
+ {
+ if (null === $context) {
+ $context = $this->deserializationContextFactory->createDeserializationContext();
+ }
+
+ return $this->deserializationVisitors->get('json')
+ ->map(function(JsonDeserializationVisitor $visitor) use ($data, $type, $context) {
+ $navigatorResult = $this->visit($visitor, $context, $data, 'json', $this->typeParser->parse($type));
+
+ return $this->handleDeserializeResult($visitor->getResult(), $navigatorResult);
+ })
+ ->get()
+ ;
+ }
+
+ private function visit(VisitorInterface $visitor, Context $context, $data, $format, array $type = null)
+ {
+ $context->initialize(
+ $format,
+ $visitor,
+ $this->navigator,
+ $this->factory
+ );
+
+ $visitor->setNavigator($this->navigator);
+
+ return $this->navigator->accept($data, $type, $context);
+ }
+
+ private function handleDeserializeResult($visitorResult, $navigatorResult)
+ {
+ // This is a special case if the root is handled by a callback on the object itself.
+ if (null === $visitorResult && null !== $navigatorResult) {
+ return $navigatorResult;
+ }
+
+ return $visitorResult;
+ }
+
+ private function convertArrayObjects($data)
+ {
+ if ($data instanceof \ArrayObject || $data instanceof \stdClass) {
+ $data = (array) $data;
+ }
+ if (is_array($data)) {
+ foreach ($data as $k => $v) {
+ $data[$k] = $this->convertArrayObjects($v);
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * @return MetadataFactoryInterface
+ */
+ public function getMetadataFactory()
+ {
+ return $this->factory;
+ }
+
+ /**
+ * @param SerializationContextFactoryInterface $serializationContextFactory
+ *
+ * @return self
+ */
+ public function setSerializationContextFactory(SerializationContextFactoryInterface $serializationContextFactory)
+ {
+ $this->serializationContextFactory = $serializationContextFactory;
+
+ return $this;
+ }
+
+ /**
+ * @param DeserializationContextFactoryInterface $deserializationContextFactory
+ *
+ * @return self
+ */
+ public function setDeserializationContextFactory(DeserializationContextFactoryInterface $deserializationContextFactory)
+ {
+ $this->deserializationContextFactory = $deserializationContextFactory;
+
+ return $this;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/SerializerBuilder.php b/vendor/jms/serializer/src/JMS/Serializer/SerializerBuilder.php
new file mode 100644
index 0000000000..2f4f301592
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/SerializerBuilder.php
@@ -0,0 +1,500 @@
+
+ *
+ * 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;
+
+use Doctrine\Common\Annotations\CachedReader;
+use Doctrine\Common\Cache\FilesystemCache;
+use JMS\Serializer\Accessor\AccessorStrategyInterface;
+use JMS\Serializer\Accessor\DefaultAccessorStrategy;
+use JMS\Serializer\Accessor\ExpressionAccessorStrategy;
+use JMS\Serializer\Builder\DefaultDriverFactory;
+use JMS\Serializer\Builder\DriverFactoryInterface;
+use JMS\Serializer\Handler\PhpCollectionHandler;
+use JMS\Serializer\Handler\PropelCollectionHandler;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Handler\StdClassHandler;
+use Metadata\Driver\DriverInterface;
+use Metadata\MetadataFactory;
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+use JMS\Serializer\Handler\HandlerRegistry;
+use JMS\Serializer\Construction\UnserializeObjectConstructor;
+use PhpCollection\Map;
+use JMS\Serializer\EventDispatcher\EventDispatcher;
+use Metadata\Driver\DriverChain;
+use JMS\Serializer\Metadata\Driver\YamlDriver;
+use JMS\Serializer\Metadata\Driver\XmlDriver;
+use Metadata\Driver\FileLocator;
+use JMS\Serializer\Handler\DateHandler;
+use JMS\Serializer\Handler\ArrayCollectionHandler;
+use JMS\Serializer\Construction\ObjectConstructorInterface;
+use JMS\Serializer\EventDispatcher\Subscriber\DoctrineProxySubscriber;
+use JMS\Serializer\Naming\CamelCaseNamingStrategy;
+use JMS\Serializer\Naming\PropertyNamingStrategyInterface;
+use JMS\Serializer\ContextFactory\SerializationContextFactoryInterface;
+use JMS\Serializer\ContextFactory\DeserializationContextFactoryInterface;
+use JMS\Serializer\ContextFactory\CallableSerializationContextFactory;
+use JMS\Serializer\ContextFactory\CallableDeserializationContextFactory;
+use Doctrine\Common\Annotations\Reader;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Metadata\Cache\FileCache;
+use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Expression\ExpressionEvaluatorInterface;
+
+/**
+ * Builder for serializer instances.
+ *
+ * This object makes serializer construction a breeze for projects that do not use
+ * any special dependency injection container.
+ *
+ * @author Johannes M. Schmitt
+ */
+class SerializerBuilder
+{
+ private $metadataDirs = array();
+ private $handlerRegistry;
+ private $handlersConfigured = false;
+ private $eventDispatcher;
+ private $listenersConfigured = false;
+ private $objectConstructor;
+ private $serializationVisitors;
+ private $deserializationVisitors;
+ private $visitorsAdded = false;
+ private $propertyNamingStrategy;
+ private $debug = false;
+ private $cacheDir;
+ private $annotationReader;
+ private $includeInterfaceMetadata = false;
+ private $driverFactory;
+ private $serializationContextFactory;
+ private $deserializationContextFactory;
+
+ /**
+ * @var ExpressionEvaluatorInterface
+ */
+ private $expressionEvaluator;
+
+ /**
+ * @var AccessorStrategyInterface
+ */
+ private $accessorStrategy;
+
+ public static function create()
+ {
+ return new static();
+ }
+
+ public function __construct()
+ {
+ $this->handlerRegistry = new HandlerRegistry();
+ $this->eventDispatcher = new EventDispatcher();
+ $this->driverFactory = new DefaultDriverFactory();
+ $this->serializationVisitors = new Map();
+ $this->deserializationVisitors = new Map();
+ }
+
+ public function setAccessorStrategy(AccessorStrategyInterface $accessorStrategy)
+ {
+ $this->accessorStrategy = $accessorStrategy;
+ }
+
+ protected function getAccessorStrategy()
+ {
+ if (!$this->accessorStrategy) {
+ $this->accessorStrategy = new DefaultAccessorStrategy();
+
+ if ($this->expressionEvaluator) {
+ $this->accessorStrategy = new ExpressionAccessorStrategy($this->expressionEvaluator, $this->accessorStrategy);
+ }
+ }
+ return $this->accessorStrategy;
+ }
+
+ public function setExpressionEvaluator(ExpressionEvaluatorInterface $expressionEvaluator)
+ {
+ $this->expressionEvaluator = $expressionEvaluator;
+
+ return $this;
+ }
+
+ public function setAnnotationReader(Reader $reader)
+ {
+ $this->annotationReader = $reader;
+
+ return $this;
+ }
+
+ public function setDebug($bool)
+ {
+ $this->debug = (boolean) $bool;
+
+ return $this;
+ }
+
+ public function setCacheDir($dir)
+ {
+ if ( ! is_dir($dir)) {
+ $this->createDir($dir);
+ }
+ if ( ! is_writable($dir)) {
+ throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
+ }
+
+ $this->cacheDir = $dir;
+
+ return $this;
+ }
+
+ public function addDefaultHandlers()
+ {
+ $this->handlersConfigured = true;
+ $this->handlerRegistry->registerSubscribingHandler(new DateHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new StdClassHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new PhpCollectionHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new ArrayCollectionHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new PropelCollectionHandler());
+
+ return $this;
+ }
+
+ public function configureHandlers(\Closure $closure)
+ {
+ $this->handlersConfigured = true;
+ $closure($this->handlerRegistry);
+
+ return $this;
+ }
+
+ public function addDefaultListeners()
+ {
+ $this->listenersConfigured = true;
+ $this->eventDispatcher->addSubscriber(new DoctrineProxySubscriber());
+
+ return $this;
+ }
+
+ public function configureListeners(\Closure $closure)
+ {
+ $this->listenersConfigured = true;
+ $closure($this->eventDispatcher);
+
+ return $this;
+ }
+
+ public function setObjectConstructor(ObjectConstructorInterface $constructor)
+ {
+ $this->objectConstructor = $constructor;
+
+ return $this;
+ }
+
+ public function setPropertyNamingStrategy(PropertyNamingStrategyInterface $propertyNamingStrategy)
+ {
+ $this->propertyNamingStrategy = $propertyNamingStrategy;
+
+ return $this;
+ }
+
+ public function setSerializationVisitor($format, VisitorInterface $visitor)
+ {
+ $this->visitorsAdded = true;
+ $this->serializationVisitors->set($format, $visitor);
+
+ return $this;
+ }
+
+ public function setDeserializationVisitor($format, VisitorInterface $visitor)
+ {
+ $this->visitorsAdded = true;
+ $this->deserializationVisitors->set($format, $visitor);
+
+ return $this;
+ }
+
+ public function addDefaultSerializationVisitors()
+ {
+ $this->initializePropertyNamingStrategy();
+
+ $this->visitorsAdded = true;
+ $this->serializationVisitors->setAll(array(
+ 'xml' => new XmlSerializationVisitor($this->propertyNamingStrategy, $this->getAccessorStrategy()),
+ 'yml' => new YamlSerializationVisitor($this->propertyNamingStrategy, $this->getAccessorStrategy()),
+ 'json' => new JsonSerializationVisitor($this->propertyNamingStrategy, $this->getAccessorStrategy()),
+ ));
+
+ return $this;
+ }
+
+ public function addDefaultDeserializationVisitors()
+ {
+ $this->initializePropertyNamingStrategy();
+
+ $this->visitorsAdded = true;
+ $this->deserializationVisitors->setAll(array(
+ 'xml' => new XmlDeserializationVisitor($this->propertyNamingStrategy),
+ 'json' => new JsonDeserializationVisitor($this->propertyNamingStrategy),
+ ));
+
+ return $this;
+ }
+
+ /**
+ * @param Boolean $include Whether to include the metadata from the interfaces
+ *
+ * @return SerializerBuilder
+ */
+ public function includeInterfaceMetadata($include)
+ {
+ $this->includeInterfaceMetadata = (Boolean) $include;
+
+ return $this;
+ }
+
+ /**
+ * Sets a map of namespace prefixes to directories.
+ *
+ * This method overrides any previously defined directories.
+ *
+ * @param array $namespacePrefixToDirMap
+ *
+ * @return SerializerBuilder
+ *
+ * @throws InvalidArgumentException When a directory does not exist
+ */
+ public function setMetadataDirs(array $namespacePrefixToDirMap)
+ {
+ foreach ($namespacePrefixToDirMap as $dir) {
+ if ( ! is_dir($dir)) {
+ throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
+ }
+ }
+
+ $this->metadataDirs = $namespacePrefixToDirMap;
+
+ return $this;
+ }
+
+ /**
+ * Adds a directory where the serializer will look for class metadata.
+ *
+ * The namespace prefix will make the names of the actual metadata files a bit shorter. For example, let's assume
+ * that you have a directory where you only store metadata files for the ``MyApplication\Entity`` namespace.
+ *
+ * If you use an empty prefix, your metadata files would need to look like:
+ *
+ * ``my-dir/MyApplication.Entity.SomeObject.yml``
+ * ``my-dir/MyApplication.Entity.OtherObject.xml``
+ *
+ * If you use ``MyApplication\Entity`` as prefix, your metadata files would need to look like:
+ *
+ * ``my-dir/SomeObject.yml``
+ * ``my-dir/OtherObject.yml``
+ *
+ * Please keep in mind that you currently may only have one directory per namespace prefix.
+ *
+ * @param string $dir The directory where metadata files are located.
+ * @param string $namespacePrefix An optional prefix if you only store metadata for specific namespaces in this directory.
+ *
+ * @return SerializerBuilder
+ *
+ * @throws InvalidArgumentException When a directory does not exist
+ * @throws InvalidArgumentException When a directory has already been registered
+ */
+ public function addMetadataDir($dir, $namespacePrefix = '')
+ {
+ if ( ! is_dir($dir)) {
+ throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
+ }
+
+ if (isset($this->metadataDirs[$namespacePrefix])) {
+ throw new InvalidArgumentException(sprintf('There is already a directory configured for the namespace prefix "%s". Please use replaceMetadataDir() to override directories.', $namespacePrefix));
+ }
+
+ $this->metadataDirs[$namespacePrefix] = $dir;
+
+ return $this;
+ }
+
+ /**
+ * Adds a map of namespace prefixes to directories.
+ *
+ * @param array $namespacePrefixToDirMap
+ *
+ * @return SerializerBuilder
+ */
+ public function addMetadataDirs(array $namespacePrefixToDirMap)
+ {
+ foreach ($namespacePrefixToDirMap as $prefix => $dir) {
+ $this->addMetadataDir($dir, $prefix);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Similar to addMetadataDir(), but overrides an existing entry.
+ *
+ * @param string $dir
+ * @param string $namespacePrefix
+ *
+ * @return SerializerBuilder
+ *
+ * @throws InvalidArgumentException When a directory does not exist
+ * @throws InvalidArgumentException When no directory is configured for the ns prefix
+ */
+ public function replaceMetadataDir($dir, $namespacePrefix = '')
+ {
+ if ( ! is_dir($dir)) {
+ throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
+ }
+
+ if ( ! isset($this->metadataDirs[$namespacePrefix])) {
+ throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix));
+ }
+
+ $this->metadataDirs[$namespacePrefix] = $dir;
+
+ return $this;
+ }
+
+ public function setMetadataDriverFactory(DriverFactoryInterface $driverFactory)
+ {
+ $this->driverFactory = $driverFactory;
+
+ return $this;
+ }
+
+ /**
+ * @param SerializationContextFactoryInterface|callable $serializationContextFactory
+ *
+ * @return self
+ */
+ public function setSerializationContextFactory($serializationContextFactory)
+ {
+ if ($serializationContextFactory instanceof SerializationContextFactoryInterface) {
+ $this->serializationContextFactory = $serializationContextFactory;
+ } elseif (is_callable($serializationContextFactory)) {
+ $this->serializationContextFactory = new CallableSerializationContextFactory(
+ $serializationContextFactory
+ );
+ } else {
+ throw new InvalidArgumentException('expected SerializationContextFactoryInterface or callable.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param DeserializationContextFactoryInterface|callable $deserializationContextFactory
+ *
+ * @return self
+ */
+ public function setDeserializationContextFactory($deserializationContextFactory)
+ {
+ if ($deserializationContextFactory instanceof DeserializationContextFactoryInterface) {
+ $this->deserializationContextFactory = $deserializationContextFactory;
+ } elseif (is_callable($deserializationContextFactory)) {
+ $this->deserializationContextFactory = new CallableDeserializationContextFactory(
+ $deserializationContextFactory
+ );
+ } else {
+ throw new InvalidArgumentException('expected DeserializationContextFactoryInterface or callable.');
+ }
+
+ return $this;
+ }
+
+ public function build()
+ {
+ $annotationReader = $this->annotationReader;
+ if (null === $annotationReader) {
+ $annotationReader = new AnnotationReader();
+
+ if (null !== $this->cacheDir) {
+ $this->createDir($this->cacheDir.'/annotations');
+ $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations');
+ $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug);
+ }
+ }
+
+ $metadataDriver = $this->driverFactory->createDriver($this->metadataDirs, $annotationReader);
+ $metadataFactory = new MetadataFactory($metadataDriver, null, $this->debug);
+
+ $metadataFactory->setIncludeInterfaces($this->includeInterfaceMetadata);
+
+ if (null !== $this->cacheDir) {
+ $this->createDir($this->cacheDir.'/metadata');
+ $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata'));
+ }
+
+ if ( ! $this->handlersConfigured) {
+ $this->addDefaultHandlers();
+ }
+
+ if ( ! $this->listenersConfigured) {
+ $this->addDefaultListeners();
+ }
+
+ if ( ! $this->visitorsAdded) {
+ $this->addDefaultSerializationVisitors();
+ $this->addDefaultDeserializationVisitors();
+ }
+
+ $serializer = new Serializer(
+ $metadataFactory,
+ $this->handlerRegistry,
+ $this->objectConstructor ?: new UnserializeObjectConstructor(),
+ $this->serializationVisitors,
+ $this->deserializationVisitors,
+ $this->eventDispatcher,
+ null,
+ $this->expressionEvaluator
+ );
+
+ if (null !== $this->serializationContextFactory) {
+ $serializer->setSerializationContextFactory($this->serializationContextFactory);
+ }
+
+ if (null !== $this->deserializationContextFactory) {
+ $serializer->setDeserializationContextFactory($this->deserializationContextFactory);
+ }
+
+ return $serializer;
+ }
+
+ private function initializePropertyNamingStrategy()
+ {
+ if (null !== $this->propertyNamingStrategy) {
+ return;
+ }
+
+ $this->propertyNamingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
+ }
+
+ private function createDir($dir)
+ {
+ if (is_dir($dir)) {
+ return;
+ }
+
+ if (false === @mkdir($dir, 0777, true) && false === is_dir($dir)) {
+ throw new RuntimeException(sprintf('Could not create directory "%s".', $dir));
+ }
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/SerializerInterface.php b/vendor/jms/serializer/src/JMS/Serializer/SerializerInterface.php
new file mode 100644
index 0000000000..2eb320d8fd
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/SerializerInterface.php
@@ -0,0 +1,50 @@
+
+ *
+ * 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;
+
+/**
+ * Serializer Interface.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface SerializerInterface
+{
+ /**
+ * Serializes the given data to the specified output format.
+ *
+ * @param object|array|scalar $data
+ * @param string $format
+ * @param Context $context
+ *
+ * @return string
+ */
+ public function serialize($data, $format, SerializationContext $context = null);
+
+ /**
+ * Deserializes the given data to the specified type.
+ *
+ * @param string $data
+ * @param string $type
+ * @param string $format
+ * @param Context $context
+ *
+ * @return object|array|scalar
+ */
+ public function deserialize($data, $type, $format, DeserializationContext $context = null);
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerExtension.php b/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerExtension.php
new file mode 100644
index 0000000000..fda6a51b85
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerExtension.php
@@ -0,0 +1,66 @@
+
+ *
+ * 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\Twig;
+
+use JMS\Serializer\SerializerInterface;
+use JMS\Serializer\SerializationContext;
+
+/**
+ * Serializer helper twig extension
+ *
+ * Basically provides access to JMSSerializer from Twig
+ */
+class SerializerExtension extends \Twig_Extension
+{
+ protected $serializer;
+
+ public function getName()
+ {
+ return 'jms_serializer';
+ }
+
+ public function __construct(SerializerInterface $serializer)
+ {
+ $this->serializer = $serializer;
+ }
+
+ public function getFilters()
+ {
+ return array(
+ new \Twig_SimpleFilter('serialize', array($this, 'serialize')),
+ );
+ }
+
+ public function getFunctions()
+ {
+ return array(
+ new \Twig_SimpleFunction('serialization_context', '\JMS\Serializer\SerializationContext::create'),
+ );
+ }
+
+ /**
+ * @param object $object
+ * @param string $type
+ * @param SerializationContext $context
+ */
+ public function serialize($object, $type = 'json', SerializationContext $context = null)
+ {
+ return $this->serializer->serialize($object, $type, $context);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerRuntimeExtension.php b/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerRuntimeExtension.php
new file mode 100644
index 0000000000..12a214aaaf
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerRuntimeExtension.php
@@ -0,0 +1,45 @@
+
+ *
+ * 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\Twig;
+
+/**
+ * @author Asmir Mustafic
+ */
+final class SerializerRuntimeExtension extends \Twig_Extension
+{
+
+ public function getName()
+ {
+ return 'jms_serializer';
+ }
+
+ public function getFilters()
+ {
+ return array(
+ new \Twig_SimpleFilter('serialize', array(SerializerRuntimeHelper::class, 'serialize')),
+ );
+ }
+
+ public function getFunctions()
+ {
+ return array(
+ new \Twig_SimpleFunction('serialization_context', '\JMS\Serializer\SerializationContext::create'),
+ );
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerRuntimeHelper.php b/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerRuntimeHelper.php
new file mode 100644
index 0000000000..39286b70d2
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Twig/SerializerRuntimeHelper.php
@@ -0,0 +1,46 @@
+
+ *
+ * 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\Twig;
+
+use JMS\Serializer\SerializationContext;
+use JMS\Serializer\SerializerInterface;
+
+/**
+ * @author Asmir Mustafic
+ */
+final class SerializerRuntimeHelper
+{
+ protected $serializer;
+
+ public function __construct(SerializerInterface $serializer)
+ {
+ $this->serializer = $serializer;
+ }
+
+ /**
+ * @param $object
+ * @param string $type
+ * @param SerializationContext|null $context
+ * @return string
+ */
+ public function serialize($object, $type = 'json', SerializationContext $context = null)
+ {
+ return $this->serializer->serialize($object, $type, $context);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/TypeParser.php b/vendor/jms/serializer/src/JMS/Serializer/TypeParser.php
new file mode 100644
index 0000000000..7a63ed77b1
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/TypeParser.php
@@ -0,0 +1,105 @@
+
+ *
+ * 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;
+
+/**
+ * Parses a serializer type.
+ *
+ * @author Johannes M. Schmitt
+ */
+final class TypeParser extends \JMS\Parser\AbstractParser
+{
+ const T_NAME = 1;
+ const T_STRING = 2;
+ const T_OPEN_BRACKET = 3;
+ const T_CLOSE_BRACKET = 4;
+ const T_COMMA = 5;
+ const T_NONE = 6;
+
+ public function __construct()
+ {
+ parent::__construct(new \JMS\Parser\SimpleLexer(
+ '/
+ # PHP Class Names
+ ((?:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\\\)*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)
+
+ # Strings
+ |("(?:[^"]|"")*"|\'(?:[^\']|\'\')*\')
+
+ # Ignore whitespace
+ |\s*
+
+ # Terminals
+ |(.)
+ /x',
+ array(self::T_NAME => 'T_NAME', self::T_STRING => 'T_STRING', self::T_OPEN_BRACKET => 'T_OPEN_BRACKET',
+ self::T_CLOSE_BRACKET => 'T_CLOSE_BRACKET', self::T_COMMA => 'T_COMMA', self::T_NONE => 'T_NONE'),
+ function($value) {
+ switch ($value[0]) {
+ case '"':
+ case "'":
+ return array(TypeParser::T_STRING, substr($value, 1, -1));
+
+ case '<':
+ return array(TypeParser::T_OPEN_BRACKET, '<');
+
+ case '>':
+ return array(TypeParser::T_CLOSE_BRACKET, '>');
+
+ case ',':
+ return array(TypeParser::T_COMMA, ',');
+
+ default:
+ if (preg_match('/^(?:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\\\)*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $value)) {
+ return array(TypeParser::T_NAME, $value);
+ }
+
+ return array(TypeParser::T_NONE, $value);
+ }
+ }
+ ));
+ }
+
+ /**
+ * @return array of the format ["name" => string, "params" => array]
+ */
+ protected function parseInternal()
+ {
+ $typeName = $this->match(self::T_NAME);
+ if ( ! $this->lexer->isNext(self::T_OPEN_BRACKET)) {
+ return array('name' => $typeName, 'params' => array());
+ }
+
+ $this->match(self::T_OPEN_BRACKET);
+ $params = array();
+ do {
+ if ($this->lexer->isNext(self::T_NAME)) {
+ $params[] = $this->parseInternal();
+ } else if ($this->lexer->isNext(self::T_STRING)) {
+ $params[] = $this->match(self::T_STRING);
+ } else {
+ $this->matchAny(array(self::T_NAME, self::T_STRING)); // Will throw an exception.
+ }
+ } while ($this->lexer->isNext(self::T_COMMA) && $this->lexer->moveNext());
+
+ $this->match(self::T_CLOSE_BRACKET);
+
+ return array('name' => $typeName, 'params' => $params);
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/Util/Writer.php b/vendor/jms/serializer/src/JMS/Serializer/Util/Writer.php
new file mode 100644
index 0000000000..d5de1eda5f
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/Util/Writer.php
@@ -0,0 +1,137 @@
+
+ *
+ * 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\Util;
+
+use JMS\Serializer\Exception\RuntimeException;
+
+/**
+ * A writer implementation.
+ *
+ * This may be used to simplify writing well-formatted code.
+ *
+ * @author Johannes M. Schmitt
+ */
+class Writer
+{
+ public $indentationSpaces = 4;
+ public $indentationLevel = 0;
+ public $content = '';
+ public $changeCount = 0;
+
+ private $changes = array();
+
+ public function indent()
+ {
+ $this->indentationLevel += 1;
+
+ return $this;
+ }
+
+ public function outdent()
+ {
+ $this->indentationLevel -= 1;
+
+ if ($this->indentationLevel < 0) {
+ throw new RuntimeException('The identation level cannot be less than zero.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param string $content
+ *
+ * @return Writer
+ */
+ public function writeln($content)
+ {
+ $this->write($content."\n");
+
+ return $this;
+ }
+
+ public function revert()
+ {
+ $change = array_pop($this->changes);
+ $this->changeCount -= 1;
+ $this->content = substr($this->content, 0, -1 * strlen($change));
+ }
+
+ /**
+ * @param string $content
+ *
+ * @return Writer
+ */
+ public function write($content)
+ {
+ $addition = '';
+
+ $lines = explode("\n", $content);
+ for ($i=0,$c=count($lines); $i<$c; $i++) {
+ if ($this->indentationLevel > 0
+ && !empty($lines[$i])
+ && ((empty($addition) && "\n" === substr($this->content, -1)) || "\n" === substr($addition, -1))) {
+ $addition .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces);
+ }
+
+ $addition .= $lines[$i];
+
+ if ($i+1 < $c) {
+ $addition .= "\n";
+ }
+ }
+
+ $this->content .= $addition;
+ $this->changes[] = $addition;
+ $this->changeCount += 1;
+
+ return $this;
+ }
+
+ public function rtrim($preserveNewLines = true)
+ {
+ if ( ! $preserveNewLines) {
+ $this->content = rtrim($this->content);
+
+ return $this;
+ }
+
+ $addNl = "\n" === substr($this->content, -1);
+ $this->content = rtrim($this->content);
+
+ if ($addNl) {
+ $this->content .= "\n";
+ }
+
+ return $this;
+ }
+
+ public function reset()
+ {
+ $this->content = '';
+ $this->indentationLevel = 0;
+
+ return $this;
+ }
+
+ public function getContent()
+ {
+ return $this->content;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/VisitorInterface.php b/vendor/jms/serializer/src/JMS/Serializer/VisitorInterface.php
new file mode 100644
index 0000000000..7b84800474
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/VisitorInterface.php
@@ -0,0 +1,141 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+
+/**
+ * Interface for visitors.
+ *
+ * This contains the minimal set of values that must be supported for any
+ * output format.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface VisitorInterface
+{
+ /**
+ * Allows visitors to convert the input data to a different representation
+ * before the actual serialization/deserialization process starts.
+ *
+ * @param mixed $data
+ *
+ * @return mixed
+ */
+ public function prepare($data);
+
+ /**
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return mixed
+ */
+ public function visitNull($data, array $type, Context $context);
+
+ /**
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return mixed
+ */
+ public function visitString($data, array $type, Context $context);
+
+ /**
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return mixed
+ */
+ public function visitBoolean($data, array $type, Context $context);
+
+ /**
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return mixed
+ */
+ public function visitDouble($data, array $type, Context $context);
+
+ /**
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return mixed
+ */
+ public function visitInteger($data, array $type, Context $context);
+
+ /**
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return mixed
+ */
+ public function visitArray($data, array $type, Context $context);
+
+ /**
+ * Called before the properties of the object are being visited.
+ *
+ * @param ClassMetadata $metadata
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return void
+ */
+ public function startVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context);
+
+ /**
+ * @param PropertyMetadata $metadata
+ * @param mixed $data
+ *
+ * @return void
+ */
+ public function visitProperty(PropertyMetadata $metadata, $data, Context $context);
+
+ /**
+ * Called after all properties of the object have been visited.
+ *
+ * @param ClassMetadata $metadata
+ * @param mixed $data
+ * @param array $type
+ *
+ * @return mixed
+ */
+ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context);
+
+ /**
+ * Called before serialization/deserialization starts.
+ *
+ * @param GraphNavigator $navigator
+ *
+ * @return void
+ */
+ public function setNavigator(GraphNavigator $navigator);
+
+ /**
+ * @deprecated use Context::getNavigator/Context::accept instead
+ * @return GraphNavigator
+ */
+ public function getNavigator();
+
+ /**
+ * @return object|array|scalar
+ */
+ public function getResult();
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/XmlDeserializationVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/XmlDeserializationVisitor.php
new file mode 100644
index 0000000000..daab5905b2
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/XmlDeserializationVisitor.php
@@ -0,0 +1,390 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Exception\XmlErrorException;
+use JMS\Serializer\Exception\LogicException;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\ClassMetadata;
+
+class XmlDeserializationVisitor extends AbstractVisitor
+{
+ private $objectStack;
+ private $metadataStack;
+ private $objectMetadataStack;
+ private $currentObject;
+ private $currentMetadata;
+ private $result;
+ private $navigator;
+ private $disableExternalEntities = true;
+ private $doctypeWhitelist = array();
+
+ public function enableExternalEntities()
+ {
+ $this->disableExternalEntities = false;
+ }
+
+ public function setNavigator(GraphNavigator $navigator)
+ {
+ $this->navigator = $navigator;
+ $this->objectStack = new \SplStack;
+ $this->metadataStack = new \SplStack;
+ $this->objectMetadataStack = new \SplStack;
+ $this->result = null;
+ }
+
+ public function getNavigator()
+ {
+ return $this->navigator;
+ }
+
+ public function prepare($data)
+ {
+ $data = $this->emptyStringToSpaceCharacter($data);
+
+ $previous = libxml_use_internal_errors(true);
+ libxml_clear_errors();
+
+ $previousEntityLoaderState = libxml_disable_entity_loader($this->disableExternalEntities);
+
+ if (false !== stripos($data, 'getDomDocumentTypeEntitySubset($data);
+ if (!in_array($internalSubset, $this->doctypeWhitelist, true)) {
+ throw new InvalidArgumentException(sprintf(
+ 'The document type "%s" is not allowed. If it is safe, you may add it to the whitelist configuration.',
+ $internalSubset
+ ));
+ }
+ }
+
+ $doc = simplexml_load_string($data);
+
+ libxml_use_internal_errors($previous);
+ libxml_disable_entity_loader($previousEntityLoaderState);
+
+ if (false === $doc) {
+ throw new XmlErrorException(libxml_get_last_error());
+ }
+
+ return $doc;
+ }
+
+ private function emptyStringToSpaceCharacter($data)
+ {
+ return $data === '' ? ' ' : (string) $data;
+ }
+
+ public function visitNull($data, array $type, Context $context)
+ {
+ return null;
+ }
+
+ public function visitString($data, array $type, Context $context)
+ {
+ $data = (string) $data;
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitBoolean($data, array $type, Context $context)
+ {
+ $data = (string) $data;
+
+ if ('true' === $data || '1' === $data) {
+ $data = true;
+ } elseif ('false' === $data || '0' === $data) {
+ $data = false;
+ } else {
+ throw new RuntimeException(sprintf('Could not convert data to boolean. Expected "true", "false", "1" or "0", but got %s.', json_encode($data)));
+ }
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitInteger($data, array $type, Context $context)
+ {
+ $data = (integer) $data;
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitDouble($data, array $type, Context $context)
+ {
+ $data = (double) $data;
+
+ if (null === $this->result) {
+ $this->result = $data;
+ }
+
+ return $data;
+ }
+
+ public function visitArray($data, array $type, Context $context)
+ {
+ $entryName = null !== $this->currentMetadata && $this->currentMetadata->xmlEntryName ? $this->currentMetadata->xmlEntryName : 'entry';
+ $namespace = null !== $this->currentMetadata && $this->currentMetadata->xmlEntryNamespace ? $this->currentMetadata->xmlEntryNamespace : null;
+
+ if ($namespace === null && $this->objectMetadataStack->count()) {
+ $classMetadata = $this->objectMetadataStack->top();
+ $namespace = isset($classMetadata->xmlNamespaces[''])?$classMetadata->xmlNamespaces['']:$namespace;
+ }
+
+ if (null !== $namespace) {
+ $prefix = uniqid('ns-');
+ $data->registerXPathNamespace($prefix, $namespace);
+ $nodes = $data->xpath("$prefix:$entryName");
+ } else {
+ $nodes = $data->xpath($entryName);
+ }
+
+ if (!count($nodes)) {
+ if (null === $this->result) {
+ return $this->result = array();
+ }
+
+ return array();
+ }
+
+ switch (count($type['params'])) {
+ case 0:
+ throw new RuntimeException(sprintf('The array type must be specified either as "array", or "array".'));
+
+ case 1:
+ $result = array();
+
+ if (null === $this->result) {
+ $this->result = &$result;
+ }
+
+ foreach ($nodes as $v) {
+ $result[] = $this->navigator->accept($v, $type['params'][0], $context);
+ }
+
+ return $result;
+
+ case 2:
+ if (null === $this->currentMetadata) {
+ throw new RuntimeException('Maps are not supported on top-level without metadata.');
+ }
+
+ list($keyType, $entryType) = $type['params'];
+ $result = array();
+ if (null === $this->result) {
+ $this->result = &$result;
+ }
+
+ $nodes = $data->children($namespace)->$entryName;
+ foreach ($nodes as $v) {
+ $attrs = $v->attributes();
+ if ( ! isset($attrs[$this->currentMetadata->xmlKeyAttribute])) {
+ throw new RuntimeException(sprintf('The key attribute "%s" must be set for each entry of the map.', $this->currentMetadata->xmlKeyAttribute));
+ }
+
+ $k = $this->navigator->accept($attrs[$this->currentMetadata->xmlKeyAttribute], $keyType, $context);
+ $result[$k] = $this->navigator->accept($v, $entryType, $context);
+ }
+
+ return $result;
+
+ default:
+ throw new LogicException(sprintf('The array type does not support more than 2 parameters, but got %s.', json_encode($type['params'])));
+ }
+ }
+
+ public function startVisitingObject(ClassMetadata $metadata, $object, array $type, Context $context)
+ {
+ $this->setCurrentObject($object);
+ $this->objectMetadataStack->push($metadata);
+ if (null === $this->result) {
+ $this->result = $this->currentObject;
+ }
+ }
+
+ public function visitProperty(PropertyMetadata $metadata, $data, Context $context)
+ {
+ $name = $this->namingStrategy->translateName($metadata);
+
+ if ( ! $metadata->type) {
+ throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name));
+ }
+
+ if ($metadata->xmlAttribute) {
+
+ $attributes = $data->attributes($metadata->xmlNamespace);
+ if (isset($attributes[$name])) {
+ $v = $this->navigator->accept($attributes[$name], $metadata->type, $context);
+ $this->accessor->setValue($this->currentObject, $v, $metadata);
+ }
+
+ return;
+ }
+
+ if ($metadata->xmlValue) {
+ $v = $this->navigator->accept($data, $metadata->type, $context);
+ $this->accessor->setValue($this->currentObject, $v, $metadata);
+
+ return;
+ }
+
+ if ($metadata->xmlCollection) {
+ $enclosingElem = $data;
+ if (!$metadata->xmlCollectionInline) {
+ $enclosingElem = $data->children($metadata->xmlNamespace)->$name;
+ }
+
+ $this->setCurrentMetadata($metadata);
+ $v = $this->navigator->accept($enclosingElem, $metadata->type, $context);
+ $this->revertCurrentMetadata();
+ $this->accessor->setValue($this->currentObject, $v, $metadata);
+
+ return;
+ }
+
+ if ($metadata->xmlNamespace) {
+ $node = $data->children($metadata->xmlNamespace)->$name;
+ if (!$node->count()) {
+ return;
+ }
+ } else {
+
+ $namespaces = $data->getDocNamespaces();
+
+ if (isset($namespaces[''])) {
+ $prefix = uniqid('ns-');
+ $data->registerXPathNamespace($prefix, $namespaces['']);
+ $nodes = $data->xpath('./'.$prefix. ':'.$name );
+ } else {
+ $nodes = $data->xpath('./'. $name );
+ }
+ if (empty($nodes)) {
+ return;
+ }
+ $node = reset($nodes);
+ }
+
+ $v = $this->navigator->accept($node, $metadata->type, $context);
+
+ $this->accessor->setValue($this->currentObject, $v, $metadata);
+ }
+
+ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ $rs = $this->currentObject;
+ $this->objectMetadataStack->pop();
+ $this->revertCurrentObject();
+
+ return $rs;
+ }
+
+ public function setCurrentObject($object)
+ {
+ $this->objectStack->push($this->currentObject);
+ $this->currentObject = $object;
+ }
+
+ public function getCurrentObject()
+ {
+ return $this->currentObject;
+ }
+
+ public function revertCurrentObject()
+ {
+ return $this->currentObject = $this->objectStack->pop();
+ }
+
+ public function setCurrentMetadata(PropertyMetadata $metadata)
+ {
+ $this->metadataStack->push($this->currentMetadata);
+ $this->currentMetadata = $metadata;
+ }
+
+ public function getCurrentMetadata()
+ {
+ return $this->currentMetadata;
+ }
+
+ public function revertCurrentMetadata()
+ {
+ return $this->currentMetadata = $this->metadataStack->pop();
+ }
+
+ public function getResult()
+ {
+ return $this->result;
+ }
+
+ /**
+ * @param array $doctypeWhitelist
+ */
+ public function setDoctypeWhitelist(array $doctypeWhitelist)
+ {
+ $this->doctypeWhitelist = $doctypeWhitelist;
+ }
+
+ /**
+ * @return array
+ */
+ public function getDoctypeWhitelist()
+ {
+ return $this->doctypeWhitelist;
+ }
+
+ /**
+ * Retrieves internalSubset even in bugfixed php versions
+ *
+ * @param \DOMDocumentType $child
+ * @param string $data
+ * @return string
+ */
+ private function getDomDocumentTypeEntitySubset($data)
+ {
+ $startPos = $endPos = stripos($data, '') {
+ --$braces;
+ }
+ } while ($braces > 0);
+
+ $internalSubset = substr($data, $startPos, $endPos - $startPos);
+ $internalSubset = str_replace(array("\n", "\r"), '', $internalSubset);
+ $internalSubset = preg_replace('/\s{2,}/', ' ', $internalSubset);
+ $internalSubset = str_replace(array("[ ]>"), array('[]>'), $internalSubset);
+
+ return $internalSubset;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/XmlSerializationVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/XmlSerializationVisitor.php
new file mode 100644
index 0000000000..5cbf93eaa4
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/XmlSerializationVisitor.php
@@ -0,0 +1,523 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Accessor\AccessorStrategyInterface;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Naming\PropertyNamingStrategyInterface;
+
+/**
+ * XmlSerializationVisitor.
+ *
+ * @author Johannes M. Schmitt
+ */
+class XmlSerializationVisitor extends AbstractVisitor
+{
+ public $document;
+
+ private $navigator;
+ private $defaultRootName = 'result';
+ private $defaultRootNamespace;
+ private $defaultVersion = '1.0';
+ private $defaultEncoding = 'UTF-8';
+ private $stack;
+ private $metadataStack;
+ private $currentNode;
+ private $currentMetadata;
+ private $hasValue;
+ private $nullWasVisited;
+ private $objectMetadataStack;
+
+ /** @var boolean */
+ private $formatOutput;
+
+ public function __construct(PropertyNamingStrategyInterface $namingStrategy, AccessorStrategyInterface $accessorStrategy = null)
+ {
+ parent::__construct($namingStrategy, $accessorStrategy);
+ $this->objectMetadataStack = new \SplStack;
+ $this->formatOutput = true;
+ }
+
+ public function setDefaultRootName($name, $namespace = null)
+ {
+ $this->defaultRootName = $name;
+ $this->defaultRootNamespace = $namespace;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function hasDefaultRootName()
+ {
+ return 'result' === $this->defaultRootName;
+ }
+
+ public function setDefaultVersion($version)
+ {
+ $this->defaultVersion = $version;
+ }
+
+ public function setDefaultEncoding($encoding)
+ {
+ $this->defaultEncoding = $encoding;
+ }
+
+ public function setNavigator(GraphNavigator $navigator)
+ {
+ $this->navigator = $navigator;
+ $this->document = null;
+ $this->stack = new \SplStack;
+ $this->metadataStack = new \SplStack;
+ }
+
+ public function getNavigator()
+ {
+ return $this->navigator;
+ }
+
+ public function visitNull($data, array $type, Context $context)
+ {
+ if (null === $this->document) {
+ $this->document = $this->createDocument(null, null, true);
+ $node = $this->document->createAttribute('xsi:nil');
+ $node->value = 'true';
+ $this->currentNode->appendChild($node);
+
+ $this->attachNullNamespace();
+
+ return;
+ }
+
+ $node = $this->document->createAttribute('xsi:nil');
+ $node->value = 'true';
+ $this->attachNullNamespace();
+
+ return $node;
+ }
+
+ public function visitString($data, array $type, Context $context)
+ {
+
+ if (null !== $this->currentMetadata) {
+ $doCData = $this->currentMetadata->xmlElementCData;
+ } else {
+ $doCData = true;
+ }
+
+ if (null === $this->document) {
+ $this->document = $this->createDocument(null, null, true);
+ $this->currentNode->appendChild($doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data));
+
+ return;
+ }
+
+ return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data);
+ }
+
+ public function visitSimpleString($data, array $type, Context $context)
+ {
+ if (null === $this->document) {
+ $this->document = $this->createDocument(null, null, true);
+ $this->currentNode->appendChild($this->document->createTextNode((string) $data));
+
+ return;
+ }
+
+ return $this->document->createTextNode((string) $data);
+ }
+
+ public function visitBoolean($data, array $type, Context $context)
+ {
+ if (null === $this->document) {
+ $this->document = $this->createDocument(null, null, true);
+ $this->currentNode->appendChild($this->document->createTextNode($data ? 'true' : 'false'));
+
+ return;
+ }
+
+ return $this->document->createTextNode($data ? 'true' : 'false');
+ }
+
+ public function visitInteger($data, array $type, Context $context)
+ {
+ return $this->visitNumeric($data, $type);
+ }
+
+ public function visitDouble($data, array $type, Context $context)
+ {
+ return $this->visitNumeric($data, $type);
+ }
+
+ public function visitArray($data, array $type, Context $context)
+ {
+ if (null === $this->document) {
+ $this->document = $this->createDocument(null, null, true);
+ }
+
+ $entryName = (null !== $this->currentMetadata && null !== $this->currentMetadata->xmlEntryName) ? $this->currentMetadata->xmlEntryName : 'entry';
+ $keyAttributeName = (null !== $this->currentMetadata && null !== $this->currentMetadata->xmlKeyAttribute) ? $this->currentMetadata->xmlKeyAttribute : null;
+ $namespace = (null !== $this->currentMetadata && null !== $this->currentMetadata->xmlEntryNamespace) ? $this->currentMetadata->xmlEntryNamespace : null;
+
+ foreach ($data as $k => $v) {
+
+ if (null === $v && $context->shouldSerializeNull() !== true) {
+ continue;
+ }
+
+ $tagName = (null !== $this->currentMetadata && $this->currentMetadata->xmlKeyValuePairs && $this->isElementNameValid($k)) ? $k : $entryName;
+
+ $entryNode = $this->createElement($tagName, $namespace);
+ $this->currentNode->appendChild($entryNode);
+ $this->setCurrentNode($entryNode);
+
+ if (null !== $keyAttributeName) {
+ $entryNode->setAttribute($keyAttributeName, (string) $k);
+ }
+
+ if (null !== $node = $this->navigator->accept($v, $this->getElementType($type), $context)) {
+ $this->currentNode->appendChild($node);
+ }
+
+ $this->revertCurrentNode();
+ }
+ }
+
+ public function startVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ $this->objectMetadataStack->push($metadata);
+
+ if (null === $this->document) {
+ $this->document = $this->createDocument(null, null, false);
+ if ($metadata->xmlRootName) {
+ $rootName = $metadata->xmlRootName;
+ $rootNamespace = $metadata->xmlRootNamespace?:$this->getClassDefaultNamespace($metadata);
+ } else {
+ $rootName = $this->defaultRootName;
+ $rootNamespace = $this->defaultRootNamespace;
+ }
+
+ if ($rootNamespace) {
+ $this->currentNode = $this->document->createElementNS($rootNamespace, $rootName);
+ } else {
+ $this->currentNode = $this->document->createElement($rootName);
+ }
+
+ $this->document->appendChild($this->currentNode);
+ }
+
+ $this->addNamespaceAttributes($metadata, $this->currentNode);
+
+ $this->hasValue = false;
+ }
+
+ public function visitProperty(PropertyMetadata $metadata, $object, Context $context)
+ {
+ $v = $this->accessor->getValue($object, $metadata);
+
+ if (null === $v && $context->shouldSerializeNull() !== true) {
+ return;
+ }
+
+ if ($metadata->xmlAttribute) {
+ $this->setCurrentMetadata($metadata);
+ $node = $this->navigator->accept($v, $metadata->type, $context);
+ $this->revertCurrentMetadata();
+
+ if ( ! $node instanceof \DOMCharacterData) {
+ throw new RuntimeException(sprintf('Unsupported value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encode($v)));
+ }
+ $attributeName = $this->namingStrategy->translateName($metadata);
+ $this->setAttributeOnNode($this->currentNode, $attributeName, $node->nodeValue, $metadata->xmlNamespace);
+
+ return;
+ }
+
+ if (($metadata->xmlValue && $this->currentNode->childNodes->length > 0)
+ || ( ! $metadata->xmlValue && $this->hasValue)) {
+ throw new RuntimeException(sprintf('If you make use of @XmlValue, all other properties in the class must have the @XmlAttribute annotation. Invalid usage detected in class %s.', $metadata->class));
+ }
+
+ if ($metadata->xmlValue) {
+ $this->hasValue = true;
+
+ $this->setCurrentMetadata($metadata);
+ $node = $this->navigator->accept($v, $metadata->type, $context);
+ $this->revertCurrentMetadata();
+
+ if ( ! $node instanceof \DOMCharacterData) {
+ throw new RuntimeException(sprintf('Unsupported value for property %s::$%s. Expected character data, but got %s.', $metadata->reflection->class, $metadata->reflection->name, is_object($node) ? get_class($node) : gettype($node)));
+ }
+
+ $this->currentNode->appendChild($node);
+
+ return;
+ }
+
+ if ($metadata->xmlAttributeMap) {
+ if ( ! is_array($v)) {
+ throw new RuntimeException(sprintf('Unsupported value type for XML attribute map. Expected array but got %s.', gettype($v)));
+ }
+
+ foreach ($v as $key => $value) {
+ $this->setCurrentMetadata($metadata);
+ $node = $this->navigator->accept($value, null, $context);
+ $this->revertCurrentMetadata();
+
+ if ( ! $node instanceof \DOMCharacterData) {
+ throw new RuntimeException(sprintf('Unsupported value for a XML attribute map value. Expected character data, but got %s.', json_encode($v)));
+ }
+
+ $this->setAttributeOnNode($this->currentNode, $key, $node->nodeValue, $metadata->xmlNamespace);
+ }
+
+ return;
+ }
+
+ if ($addEnclosingElement = !$this->isInLineCollection($metadata) && ! $metadata->inline) {
+ $elementName = $this->namingStrategy->translateName($metadata);
+
+ $namespace = null !== $metadata->xmlNamespace
+ ? $metadata->xmlNamespace
+ : $this->getClassDefaultNamespace($this->objectMetadataStack->top());
+
+ $element = $this->createElement($elementName, $namespace);
+ $this->currentNode->appendChild($element);
+ $this->setCurrentNode($element);
+ }
+
+ $this->setCurrentMetadata($metadata);
+
+ if (null !== $node = $this->navigator->accept($v, $metadata->type, $context)) {
+ $this->currentNode->appendChild($node);
+ }
+
+ $this->revertCurrentMetadata();
+
+ if ($addEnclosingElement) {
+ $this->revertCurrentNode();
+
+ if ($this->isElementEmpty($element) && ($v === null || $this->isSkippableCollection($metadata) || $this->isSkippableEmptyObject($node, $metadata) || $this->isCircularRef($context, $v))) {
+ $this->currentNode->removeChild($element);
+ }
+ }
+
+ $this->hasValue = false;
+ }
+
+ private function isInLineCollection(PropertyMetadata $metadata)
+ {
+ return $metadata->xmlCollection && $metadata->xmlCollectionInline;
+ }
+
+ private function isCircularRef(SerializationContext $context, $v)
+ {
+ return $context->isVisiting($v);
+ }
+
+ private function isSkippableEmptyObject($node, PropertyMetadata $metadata)
+ {
+ return $node === null && !$metadata->xmlCollection && $metadata->skipWhenEmpty;
+ }
+
+ private function isSkippableCollection(PropertyMetadata $metadata)
+ {
+ return $metadata->xmlCollection && $metadata->xmlCollectionSkipWhenEmpty;
+ }
+
+ private function isElementEmpty(\DOMElement $element)
+ {
+ return !$element->hasChildNodes() && !$element->hasAttributes();
+ }
+
+ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ $this->objectMetadataStack->pop();
+ }
+
+ public function getResult()
+ {
+ return $this->document->saveXML();
+ }
+
+ public function getCurrentNode()
+ {
+ return $this->currentNode;
+ }
+
+ public function getCurrentMetadata()
+ {
+ return $this->currentMetadata;
+ }
+
+ public function getDocument()
+ {
+ return $this->document;
+ }
+
+ public function setCurrentMetadata(PropertyMetadata $metadata)
+ {
+ $this->metadataStack->push($this->currentMetadata);
+ $this->currentMetadata = $metadata;
+ }
+
+ public function setCurrentNode(\DOMNode $node)
+ {
+ $this->stack->push($this->currentNode);
+ $this->currentNode = $node;
+ }
+
+ public function revertCurrentNode()
+ {
+ return $this->currentNode = $this->stack->pop();
+ }
+
+ public function revertCurrentMetadata()
+ {
+ return $this->currentMetadata = $this->metadataStack->pop();
+ }
+
+ public function createDocument($version = null, $encoding = null, $addRoot = true)
+ {
+ $doc = new \DOMDocument($version ?: $this->defaultVersion, $encoding ?: $this->defaultEncoding);
+ $doc->formatOutput = $this->isFormatOutput();
+
+ if ($addRoot) {
+ if ($this->defaultRootNamespace) {
+ $rootNode = $doc->createElementNS($this->defaultRootNamespace, $this->defaultRootName);
+ } else {
+ $rootNode = $doc->createElement($this->defaultRootName);
+ }
+ $this->setCurrentNode($rootNode);
+ $doc->appendChild($rootNode);
+ }
+
+ return $doc;
+ }
+
+ public function prepare($data)
+ {
+ $this->nullWasVisited = false;
+
+ return $data;
+ }
+
+ private function visitNumeric($data, array $type)
+ {
+ if (null === $this->document) {
+ $this->document = $this->createDocument(null, null, true);
+ $this->currentNode->appendChild($textNode = $this->document->createTextNode((string) $data));
+
+ return $textNode;
+ }
+
+ return $this->document->createTextNode((string) $data);
+ }
+
+ /**
+ * Checks that the name is a valid XML element name.
+ *
+ * @param string $name
+ *
+ * @return boolean
+ */
+ private function isElementNameValid($name)
+ {
+ return $name && false === strpos($name, ' ') && preg_match('#^[\pL_][\pL0-9._-]*$#ui', $name);
+ }
+
+ private function attachNullNamespace()
+ {
+ if ( ! $this->nullWasVisited) {
+ $this->document->documentElement->setAttributeNS(
+ 'http://www.w3.org/2000/xmlns/',
+ 'xmlns:xsi',
+ 'http://www.w3.org/2001/XMLSchema-instance'
+ );
+ $this->nullWasVisited = true;
+ }
+ }
+
+ /**
+ * Adds namespace attributes to the XML root element
+ *
+ * @param \JMS\Serializer\Metadata\ClassMetadata $metadata
+ * @param \DOMElement $element
+ */
+ private function addNamespaceAttributes(ClassMetadata $metadata, \DOMElement $element)
+ {
+ foreach ($metadata->xmlNamespaces as $prefix => $uri) {
+ $attribute = 'xmlns';
+ if ($prefix !== '') {
+ $attribute .= ':'.$prefix;
+ } elseif ($element->namespaceURI === $uri) {
+ continue;
+ }
+ $element->setAttributeNS('http://www.w3.org/2000/xmlns/', $attribute, $uri);
+ }
+ }
+
+ private function createElement($tagName, $namespace = null)
+ {
+ if (null === $namespace) {
+ return $this->document->createElement($tagName);
+ }
+ if ($this->currentNode->isDefaultNamespace($namespace)) {
+ return $this->document->createElementNS($namespace, $tagName);
+ }
+ if (!($prefix = $this->currentNode->lookupPrefix($namespace)) && !($prefix = $this->document->lookupPrefix($namespace))) {
+ $prefix = 'ns-'. substr(sha1($namespace), 0, 8);
+ }
+ return $this->document->createElementNS($namespace, $prefix . ':' . $tagName);
+ }
+
+ private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null)
+ {
+ if (null !== $namespace) {
+ if (!$prefix = $node->lookupPrefix($namespace)) {
+ $prefix = 'ns-'. substr(sha1($namespace), 0, 8);
+ }
+ $node->setAttributeNS($namespace, $prefix.':'.$name, $value);
+ } else {
+ $node->setAttribute($name, $value);
+ }
+ }
+
+ private function getClassDefaultNamespace(ClassMetadata $metadata)
+ {
+ return (isset($metadata->xmlNamespaces[''])?$metadata->xmlNamespaces['']:null);
+ }
+
+ /**
+ * @return bool
+ */
+ public function isFormatOutput()
+ {
+ return $this->formatOutput;
+ }
+
+ /**
+ * @param bool $formatOutput
+ */
+ public function setFormatOutput($formatOutput)
+ {
+ $this->formatOutput = (boolean) $formatOutput;
+ }
+}
diff --git a/vendor/jms/serializer/src/JMS/Serializer/YamlSerializationVisitor.php b/vendor/jms/serializer/src/JMS/Serializer/YamlSerializationVisitor.php
new file mode 100644
index 0000000000..b3bc77b879
--- /dev/null
+++ b/vendor/jms/serializer/src/JMS/Serializer/YamlSerializationVisitor.php
@@ -0,0 +1,222 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Accessor\AccessorStrategyInterface;
+use Symfony\Component\Yaml\Inline;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Naming\PropertyNamingStrategyInterface;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Util\Writer;
+
+/**
+ * Serialization Visitor for the YAML format.
+ *
+ * @see http://www.yaml.org/spec/
+ * @author Johannes M. Schmitt
+ */
+class YamlSerializationVisitor extends AbstractVisitor
+{
+ public $writer;
+
+ private $navigator;
+ private $stack;
+ private $metadataStack;
+ private $currentMetadata;
+
+ public function __construct(PropertyNamingStrategyInterface $namingStrategy, AccessorStrategyInterface $accessorStrategy = null)
+ {
+ parent::__construct($namingStrategy, $accessorStrategy);
+
+ $this->writer = new Writer();
+ }
+
+ public function setNavigator(GraphNavigator $navigator)
+ {
+ $this->navigator = $navigator;
+ $this->writer->reset();
+ $this->stack = new \SplStack;
+ $this->metadataStack = new \SplStack;
+ }
+
+ public function visitNull($data, array $type, Context $context)
+ {
+ if ('' === $this->writer->content) {
+ $this->writer->writeln('null');
+ }
+
+ return 'null';
+ }
+
+ public function visitString($data, array $type, Context $context)
+ {
+ $v = Inline::dump($data);
+
+ if ('' === $this->writer->content) {
+ $this->writer->writeln($v);
+ }
+
+ return $v;
+ }
+
+ /**
+ * @param array $data
+ * @param array $type
+ */
+ public function visitArray($data, array $type, Context $context)
+ {
+ $isHash = isset($type['params'][1]);
+
+ $count = $this->writer->changeCount;
+ $isList = (isset($type['params'][0]) && ! isset($type['params'][1]))
+ || array_keys($data) === range(0, count($data) - 1);
+
+ foreach ($data as $k => $v) {
+ if (null === $v && $context->shouldSerializeNull() !== true) {
+ continue;
+ }
+
+ if ($isList && !$isHash) {
+ $this->writer->writeln('-');
+ } else {
+ $this->writer->writeln(Inline::dump($k).':');
+ }
+
+ $this->writer->indent();
+
+ if (null !== $v = $this->navigator->accept($v, $this->getElementType($type), $context)) {
+ $this->writer
+ ->rtrim(false)
+ ->writeln(' '.$v)
+ ;
+ }
+
+ $this->writer->outdent();
+ }
+
+ if ($count === $this->writer->changeCount && isset($type['params'][1])) {
+ $this->writer
+ ->rtrim(false)
+ ->writeln(' {}')
+ ;
+ } elseif (empty($data)) {
+ $this->writer
+ ->rtrim(false)
+ ->writeln(' []')
+ ;
+ }
+ }
+
+ public function visitBoolean($data, array $type, Context $context)
+ {
+ $v = $data ? 'true' : 'false';
+
+ if ('' === $this->writer->content) {
+ $this->writer->writeln($v);
+ }
+
+ return $v;
+ }
+
+ public function visitDouble($data, array $type, Context $context)
+ {
+ $v = (string) $data;
+
+ if ('' === $this->writer->content) {
+ $this->writer->writeln($v);
+ }
+
+ return $v;
+ }
+
+ public function visitInteger($data, array $type, Context $context)
+ {
+ $v = (string) $data;
+
+ if ('' === $this->writer->content) {
+ $this->writer->writeln($v);
+ }
+
+ return $v;
+ }
+
+ public function startVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ }
+
+ public function visitProperty(PropertyMetadata $metadata, $data, Context $context)
+ {
+ $v = $this->accessor->getValue($data, $metadata);
+
+ if (null === $v && $context->shouldSerializeNull() !== true) {
+ return;
+ }
+
+ $name = $this->namingStrategy->translateName($metadata);
+
+ if ( ! $metadata->inline) {
+ $this->writer
+ ->writeln(Inline::dump($name).':')
+ ->indent();
+ }
+
+ $this->setCurrentMetadata($metadata);
+
+ $count = $this->writer->changeCount;
+
+ if (null !== $v = $this->navigator->accept($v, $metadata->type, $context)) {
+ $this->writer
+ ->rtrim(false)
+ ->writeln(' '.$v)
+ ;
+ } elseif ($count === $this->writer->changeCount && ! $metadata->inline) {
+ $this->writer->revert();
+ }
+
+ if ( ! $metadata->inline) {
+ $this->writer->outdent();
+ }
+ $this->revertCurrentMetadata();
+ }
+
+ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
+ {
+ }
+
+ public function setCurrentMetadata(PropertyMetadata $metadata)
+ {
+ $this->metadataStack->push($this->currentMetadata);
+ $this->currentMetadata = $metadata;
+ }
+
+ public function revertCurrentMetadata()
+ {
+ return $this->currentMetadata = $this->metadataStack->pop();
+ }
+
+ public function getNavigator()
+ {
+ return $this->navigator;
+ }
+
+ public function getResult()
+ {
+ return $this->writer->getContent();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Exclusion/DisjunctExclusionStrategyTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Exclusion/DisjunctExclusionStrategyTest.php
new file mode 100644
index 0000000000..36374c6a50
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Exclusion/DisjunctExclusionStrategyTest.php
@@ -0,0 +1,161 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Exclusion\DisjunctExclusionStrategy;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\StaticPropertyMetadata;
+use JMS\Serializer\SerializationContext;
+
+class DisjunctExclusionStrategyTest extends \PHPUnit_Framework_TestCase
+{
+ public function testShouldSkipClassShortCircuiting()
+ {
+ $metadata = new ClassMetadata('stdClass');
+ $context = SerializationContext::create();
+
+ $strat = new DisjunctExclusionStrategy(array(
+ $first = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ $last = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ ));
+
+ $first->expects($this->once())
+ ->method('shouldSkipClass')
+ ->with($metadata, $context)
+ ->will($this->returnValue(true));
+
+ $last->expects($this->never())
+ ->method('shouldSkipClass');
+
+ $this->assertTrue($strat->shouldSkipClass($metadata, $context));
+ }
+
+ public function testShouldSkipClassDisjunctBehavior()
+ {
+ $metadata = new ClassMetadata('stdClass');
+ $context = SerializationContext::create();
+
+ $strat = new DisjunctExclusionStrategy(array(
+ $first = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ $last = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ ));
+
+ $first->expects($this->once())
+ ->method('shouldSkipClass')
+ ->with($metadata, $context)
+ ->will($this->returnValue(false));
+
+ $last->expects($this->once())
+ ->method('shouldSkipClass')
+ ->with($metadata, $context)
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($strat->shouldSkipClass($metadata, $context));
+ }
+
+ public function testShouldSkipClassReturnsFalseIfNoPredicateMatched()
+ {
+ $metadata = new ClassMetadata('stdClass');
+ $context = SerializationContext::create();
+
+ $strat = new DisjunctExclusionStrategy(array(
+ $first = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ $last = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ ));
+
+ $first->expects($this->once())
+ ->method('shouldSkipClass')
+ ->with($metadata, $context)
+ ->will($this->returnValue(false));
+
+ $last->expects($this->once())
+ ->method('shouldSkipClass')
+ ->with($metadata, $context)
+ ->will($this->returnValue(false));
+
+ $this->assertFalse($strat->shouldSkipClass($metadata, $context));
+ }
+
+ public function testShouldSkipPropertyShortCircuiting()
+ {
+ $metadata = new StaticPropertyMetadata('stdClass', 'foo', 'bar');
+ $context = SerializationContext::create();
+
+ $strat = new DisjunctExclusionStrategy(array(
+ $first = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ $last = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ ));
+
+ $first->expects($this->once())
+ ->method('shouldSkipProperty')
+ ->with($metadata, $context)
+ ->will($this->returnValue(true));
+
+ $last->expects($this->never())
+ ->method('shouldSkipProperty');
+
+ $this->assertTrue($strat->shouldSkipProperty($metadata, $context));
+ }
+
+ public function testShouldSkipPropertyDisjunct()
+ {
+ $metadata = new StaticPropertyMetadata('stdClass', 'foo', 'bar');
+ $context = SerializationContext::create();
+
+ $strat = new DisjunctExclusionStrategy(array(
+ $first = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ $last = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ ));
+
+ $first->expects($this->once())
+ ->method('shouldSkipProperty')
+ ->with($metadata, $context)
+ ->will($this->returnValue(false));
+
+ $last->expects($this->once())
+ ->method('shouldSkipProperty')
+ ->with($metadata, $context)
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($strat->shouldSkipProperty($metadata, $context));
+ }
+
+ public function testShouldSkipPropertyReturnsFalseIfNoPredicateMatches()
+ {
+ $metadata = new StaticPropertyMetadata('stdClass', 'foo', 'bar');
+ $context = SerializationContext::create();
+
+ $strat = new DisjunctExclusionStrategy(array(
+ $first = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ $last = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface'),
+ ));
+
+ $first->expects($this->once())
+ ->method('shouldSkipProperty')
+ ->with($metadata, $context)
+ ->will($this->returnValue(false));
+
+ $last->expects($this->once())
+ ->method('shouldSkipProperty')
+ ->with($metadata, $context)
+ ->will($this->returnValue(false));
+
+ $this->assertFalse($strat->shouldSkipProperty($metadata, $context));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Exclusion/GroupsExclusionStrategyTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Exclusion/GroupsExclusionStrategyTest.php
new file mode 100644
index 0000000000..f073b11818
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Exclusion/GroupsExclusionStrategyTest.php
@@ -0,0 +1,68 @@
+
+ *
+ * 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\Exclusion;
+
+use JMS\Serializer\Exclusion\GroupsExclusionStrategy;
+use JMS\Serializer\Metadata\StaticPropertyMetadata;
+use JMS\Serializer\SerializationContext;
+
+class GroupsExclusionStrategyTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider getExclusionRules
+ * @param array $propertyGroups
+ * @param array $groups
+ * @param $exclude
+ */
+ public function testUninitializedContextIsWorking(array $propertyGroups, array $groups, $exclude)
+ {
+ $metadata = new StaticPropertyMetadata('stdClass', 'prop', 'propVal');
+ $metadata->groups = $propertyGroups;
+
+ $strat = new GroupsExclusionStrategy($groups);
+ $this->assertEquals($strat->shouldSkipProperty($metadata, SerializationContext::create()), $exclude);
+ }
+
+ public function getExclusionRules()
+ {
+ return [
+ [['foo'], ['foo'], false],
+ [['foo'], [], true],
+ [[], ['foo'], true],
+ [['foo'], ['bar'], true],
+ [['bar'], ['foo'], true],
+
+ [['foo', GroupsExclusionStrategy::DEFAULT_GROUP], [], false],
+ [['foo', 'bar'], [], true],
+ [['foo', 'bar'], [GroupsExclusionStrategy::DEFAULT_GROUP], true],
+ [['foo', 'bar'], ['foo'], false],
+
+ [['foo', GroupsExclusionStrategy::DEFAULT_GROUP], ['test'], true],
+ [['foo', GroupsExclusionStrategy::DEFAULT_GROUP, 'test'], ['test'], false],
+
+ [['foo'], [GroupsExclusionStrategy::DEFAULT_GROUP], true],
+ [[GroupsExclusionStrategy::DEFAULT_GROUP], [], false],
+ [[], [GroupsExclusionStrategy::DEFAULT_GROUP], false],
+ [[GroupsExclusionStrategy::DEFAULT_GROUP], [GroupsExclusionStrategy::DEFAULT_GROUP], false],
+ [[GroupsExclusionStrategy::DEFAULT_GROUP, 'foo'], [GroupsExclusionStrategy::DEFAULT_GROUP], false],
+ [[GroupsExclusionStrategy::DEFAULT_GROUP], [GroupsExclusionStrategy::DEFAULT_GROUP, 'foo'], false],
+ [['foo'], [GroupsExclusionStrategy::DEFAULT_GROUP, 'foo'], false],
+ ];
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderChild.php
new file mode 100644
index 0000000000..273b8b9daa
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderChild.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/** @Serializer\AccessorOrder("custom", custom = {"c", "d", "a", "b"}) */
+class AccessorOrderChild extends AccessorOrderParent
+{
+ private $c = 'c', $d = 'd';
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderMethod.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderMethod.php
new file mode 100644
index 0000000000..2277ff972f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderMethod.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/** @Serializer\AccessorOrder("custom", custom = {"method", "b", "a"}) */
+class AccessorOrderMethod
+{
+ private $b = 'b', $a = 'a';
+
+ /**
+ * @Serializer\VirtualProperty
+ * @Serializer\SerializedName("foo")
+ *
+ * @return string
+ */
+ public function getMethod()
+ {
+ return 'c';
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderParent.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderParent.php
new file mode 100644
index 0000000000..7b2d850284
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorOrderParent.php
@@ -0,0 +1,27 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/** @Serializer\AccessorOrder("alphabetical") */
+class AccessorOrderParent
+{
+ private $b = 'b', $a = 'a';
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorSetter.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorSetter.php
new file mode 100644
index 0000000000..95d452919a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AccessorSetter.php
@@ -0,0 +1,108 @@
+")
+ * @Serializer\Accessor(setter="setCollectionDifferent")
+ * @Serializer\XmlList(inline=false)
+ */
+ protected $collection;
+
+ /**
+ * @return \stdClass
+ */
+ public function getElement()
+ {
+ return $this->element;
+ }
+
+ /**
+ * @param AccessorSetterElement $element
+ */
+ public function setElementDifferent(AccessorSetterElement $element)
+ {
+ $this->element = new \stdClass();
+ $this->element->element = $element;
+ }
+
+ /**
+ * @return array
+ */
+ public function getCollection()
+ {
+ return $this->collection;
+ }
+
+ /**
+ * @param array $collection
+ */
+ public function setCollectionDifferent($collection)
+ {
+ $this->collection = array_combine($collection, $collection);
+ }
+}
+
+class AccessorSetterElement
+{
+ /**
+ * @var string
+ * @Serializer\Type("string")
+ * @Serializer\Accessor(setter="setAttributeDifferent")
+ * @Serializer\XmlAttribute
+ */
+ protected $attribute;
+
+ /**
+ * @var string
+ * @Serializer\Type("string")
+ * @Serializer\Accessor(setter="setElementDifferent")
+ * @Serializer\XmlValue
+ */
+ protected $element;
+
+ /**
+ * @return string
+ */
+ public function getAttribute()
+ {
+ return $this->attribute;
+ }
+
+ /**
+ * @param string $attribute
+ */
+ public function setAttributeDifferent($attribute)
+ {
+ $this->attribute = $attribute . "-different";
+ }
+
+
+ /**
+ * @param string $element
+ */
+ public function setElementDifferent($element)
+ {
+ $this->element = $element . "-different";
+ }
+
+ /**
+ * @return string
+ */
+ public function getElement()
+ {
+ return $this->element;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AllExcludedObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AllExcludedObject.php
new file mode 100644
index 0000000000..41c0ead275
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AllExcludedObject.php
@@ -0,0 +1,37 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Expose;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+
+/**
+ * @ExclusionPolicy("all")
+ *
+ * @author Johannes M. Schmitt
+ */
+class AllExcludedObject
+{
+ private $foo = 'foo';
+
+ /**
+ * @Expose
+ */
+ private $bar = 'bar';
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Article.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Article.php
new file mode 100644
index 0000000000..af13d7f1ab
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Article.php
@@ -0,0 +1,70 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\JsonDeserializationVisitor;
+use JMS\Serializer\XmlDeserializationVisitor;
+use Symfony\Component\Yaml\Inline;
+use JMS\Serializer\YamlSerializationVisitor;
+use JMS\Serializer\JsonSerializationVisitor;
+use JMS\Serializer\XmlSerializationVisitor;
+use JMS\Serializer\Annotation\HandlerCallback;
+
+class Article
+{
+ public $element;
+ public $value;
+
+ /** @HandlerCallback("xml", direction = "serialization") */
+ public function serializeToXml(XmlSerializationVisitor $visitor, $data, Context $context)
+ {
+ if (null === $visitor->document) {
+ $visitor->document = $visitor->createDocument(null, null, false);
+ }
+
+ $visitor->document->appendChild($visitor->document->createElement($this->element, $this->value));
+ }
+
+ /** @HandlerCallback("json", direction = "serialization") */
+ public function serializeToJson(JsonSerializationVisitor $visitor)
+ {
+ $visitor->setRoot(array($this->element => $this->value));
+ }
+
+ /** @HandlerCallback("yml", direction = "serialization") */
+ public function serializeToYml(YamlSerializationVisitor $visitor)
+ {
+ $visitor->writer->writeln(Inline::dump($this->element).': '.Inline::dump($this->value));
+ }
+
+ /** @HandlerCallback("xml", direction = "deserialization") */
+ public function deserializeFromXml(XmlDeserializationVisitor $visitor, \SimpleXMLElement $data)
+ {
+ $this->element = $data->getName();
+ $this->value = (string) $data;
+ }
+
+ /** @HandlerCallback("json", direction = "deserialization") */
+ public function deserializeFromJson(JsonDeserializationVisitor $visitor, array $data)
+ {
+ $this->element = key($data);
+ $this->value = reset($data);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Author.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Author.php
new file mode 100644
index 0000000000..4171761969
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Author.php
@@ -0,0 +1,41 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+
+class Author
+{
+ /**
+ * @Type("string")
+ * @SerializedName("full_name")
+ */
+ private $name;
+
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorExpressionAccess.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorExpressionAccess.php
new file mode 100644
index 0000000000..4969023b7c
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorExpressionAccess.php
@@ -0,0 +1,59 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\VirtualProperty("firstName", exp="object.getFirstName()", options={@Serializer\SerializedName("my_first_name")})
+ */
+class AuthorExpressionAccess
+{
+ private $id;
+ /**
+ * @Serializer\Exclude()
+ */
+ private $firstName;
+
+ /**
+ * @Serializer\Exclude()
+ */
+ private $lastName;
+
+ public function __construct($id, $firstName, $lastName)
+ {
+ $this->id = $id;
+ $this->firstName = $firstName;
+ $this->lastName = $lastName;
+ }
+
+ public function getFirstName()
+ {
+ return $this->firstName;
+ }
+
+ /**
+ * @Serializer\VirtualProperty()
+ */
+ public function getLastName()
+ {
+ return $this->lastName;
+ }
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorList.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorList.php
new file mode 100644
index 0000000000..642bef824e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorList.php
@@ -0,0 +1,94 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * An array-acting object that holds many author instances.
+ */
+class AuthorList implements \IteratorAggregate, \Countable, \ArrayAccess
+{
+ /**
+ * @Serializer\Type("array")
+ * @var array
+ */
+ protected $authors = array();
+
+ /**
+ * @param Author $author
+ */
+ public function add(Author $author)
+ {
+ $this->authors[] = $author;
+ }
+
+ /**
+ * @see IteratorAggregate
+ */
+ public function getIterator()
+ {
+ return new \ArrayIterator($this->authors);
+ }
+
+ /**
+ * @see Countable
+ */
+ public function count()
+ {
+ return count($this->authors);
+ }
+
+ /**
+ * @see ArrayAccess
+ */
+ public function offsetExists($offset)
+ {
+ return isset($this->authors[$offset]);
+ }
+
+ /**
+ * @see ArrayAccess
+ */
+ public function offsetGet($offset)
+ {
+ return isset($this->authors[$offset]) ? $this->authors[$offset] : null;
+ }
+
+ /**
+ * @see ArrayAccess
+ */
+ public function offsetSet($offset, $value)
+ {
+ if (null === $offset) {
+ $this->authors[] = $value;
+ } else {
+ $this->authors[$offset] = $value;
+ }
+ }
+
+ /**
+ * @see ArrayAccess
+ */
+ public function offsetUnset($offset)
+ {
+ unset($this->authors[$offset]);
+ }
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorReadOnly.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorReadOnly.php
new file mode 100644
index 0000000000..274c9fe241
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorReadOnly.php
@@ -0,0 +1,58 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\ReadOnly;
+use JMS\Serializer\Annotation\Accessor;
+
+/** @XmlRoot("author") */
+class AuthorReadOnly
+{
+ /**
+ * @ReadOnly
+ * @SerializedName("id")
+ */
+ private $id;
+
+ /**
+ * @Type("string")
+ * @SerializedName("full_name")
+ * @Accessor("getName")
+ */
+ private $name;
+
+ public function __construct($id, $name)
+ {
+ $this->id = $id;
+ $this->name = $name;
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorReadOnlyPerClass.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorReadOnlyPerClass.php
new file mode 100644
index 0000000000..3180bc0906
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/AuthorReadOnlyPerClass.php
@@ -0,0 +1,62 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\ReadOnly;
+use JMS\Serializer\Annotation\Accessor;
+
+/**
+ * @XmlRoot("author")
+ * @ReadOnly
+ */
+class AuthorReadOnlyPerClass
+{
+ /**
+ * @ReadOnly
+ * @SerializedName("id")
+ */
+ private $id;
+
+ /**
+ * @Type("string")
+ * @SerializedName("full_name")
+ * @Accessor("getName")
+ * @ReadOnly(false)
+ */
+ private $name;
+
+ public function __construct($id, $name)
+ {
+ $this->id = $id;
+ $this->name = $name;
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/BlogPost.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/BlogPost.php
new file mode 100644
index 0000000000..a59392e981
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/BlogPost.php
@@ -0,0 +1,150 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Annotation\Groups;
+use Doctrine\Common\Collections\ArrayCollection;
+use PhpCollection\Map;
+use PhpCollection\Sequence;
+
+/**
+ * @XmlRoot("blog-post")
+ * @XmlNamespace(uri="http://example.com/namespace")
+ * @XmlNamespace(uri="http://schemas.google.com/g/2005", prefix="gd")
+ * @XmlNamespace(uri="http://www.w3.org/2005/Atom", prefix="atom")
+ * @XmlNamespace(uri="http://purl.org/dc/elements/1.1/", prefix="dc")
+ */
+class BlogPost
+{
+ /**
+ * @Type("string")
+ * @XmlElement(cdata=false)
+ * @Groups({"comments","post"})
+ */
+ private $id = 'what_a_nice_id';
+
+ /**
+ * @Type("string")
+ * @Groups({"comments","post"})
+ * @XmlElement(namespace="http://purl.org/dc/elements/1.1/");
+ */
+ private $title;
+
+ /**
+ * @Type("DateTime")
+ * @XmlAttribute
+ */
+ private $createdAt;
+
+ /**
+ * @Type("boolean")
+ * @SerializedName("is_published")
+ * @XmlAttribute
+ * @Groups({"post"})
+ */
+ private $published;
+
+ /**
+ * @Type("string")
+ * @XmlAttribute(namespace="http://schemas.google.com/g/2005")
+ * @Groups({"post"})
+ */
+ private $etag;
+
+ /**
+ * @Type("ArrayCollection")
+ * @XmlList(inline=true, entry="comment")
+ * @Groups({"comments"})
+ */
+ private $comments;
+
+ /**
+ * @Type("PhpCollection\Sequence")
+ * @XmlList(inline=true, entry="comment2")
+ * @Groups({"comments"})
+ */
+ private $comments2;
+
+ /**
+ * @Type("PhpCollection\Map")
+ * @XmlMap(keyAttribute = "key")
+ */
+ private $metadata;
+
+ /**
+ * @Type("JMS\Serializer\Tests\Fixtures\Author")
+ * @Groups({"post"})
+ * @XmlElement(namespace="http://www.w3.org/2005/Atom")
+ */
+ private $author;
+
+ /**
+ * @Type("JMS\Serializer\Tests\Fixtures\Publisher")
+ */
+ private $publisher;
+
+ /**
+ * @Type("array")
+ * @XmlList(inline=true, entry="tag", namespace="http://purl.org/dc/elements/1.1/");
+ */
+ private $tag;
+
+ public function __construct($title, Author $author, \DateTime $createdAt, Publisher $publisher)
+ {
+ $this->title = $title;
+ $this->author = $author;
+ $this->publisher = $publisher;
+ $this->published = false;
+ $this->comments = new ArrayCollection();
+ $this->comments2 = new Sequence();
+ $this->metadata = new Map();
+ $this->metadata->set('foo', 'bar');
+ $this->createdAt = $createdAt;
+ $this->etag = sha1($this->createdAt->format(\DateTime::ISO8601));
+ }
+
+ public function setPublished()
+ {
+ $this->published = true;
+ }
+
+ public function getMetadata()
+ {
+ return $this->metadata;
+ }
+
+ public function addComment(Comment $comment)
+ {
+ $this->comments->add($comment);
+ $this->comments2->add($comment);
+ }
+
+ public function addTag(Tag $tag)
+ {
+ $this->tag[] = $tag;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CircularReferenceChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CircularReferenceChild.php
new file mode 100644
index 0000000000..bdefc5eeec
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CircularReferenceChild.php
@@ -0,0 +1,51 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+
+class CircularReferenceChild
+{
+ /** @Type("string") */
+ private $name;
+
+ /** @Type("JMS\Serializer\Tests\Fixtures\CircularReferenceParent") */
+ private $parent;
+
+ public function __construct($name, CircularReferenceParent $parent)
+ {
+ $this->name = $name;
+ $this->parent = $parent;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ public function setParent(CircularReferenceParent $parent)
+ {
+ $this->parent = $parent;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CircularReferenceParent.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CircularReferenceParent.php
new file mode 100644
index 0000000000..90745bdf81
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CircularReferenceParent.php
@@ -0,0 +1,61 @@
+
+ *
+ * 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;
+
+use Doctrine\Common\Collections\ArrayCollection;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\PostDeserialize;
+
+/** No annotation */
+class CircularReferenceParent
+{
+ /** @Type("array") */
+ protected $collection = array();
+
+ /** @Type("ArrayCollection") */
+ private $anotherCollection;
+
+ public function __construct()
+ {
+ $this->collection[] = new CircularReferenceChild('child1', $this);
+ $this->collection[] = new CircularReferenceChild('child2', $this);
+
+ $this->anotherCollection = new ArrayCollection();
+ $this->anotherCollection->add(new CircularReferenceChild('child1', $this));
+ $this->anotherCollection->add(new CircularReferenceChild('child2', $this));
+ }
+
+ /** @PostDeserialize */
+ private function afterDeserialization()
+ {
+ if (!$this->collection) {
+ $this->collection = array();
+ }
+ foreach ($this->collection as $v) {
+ $v->setParent($this);
+ }
+
+ if (!$this->anotherCollection) {
+ $this->anotherCollection = new ArrayCollection();
+ }
+ foreach ($this->anotherCollection as $v) {
+ $v->setParent($this);
+ }
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Comment.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Comment.php
new file mode 100644
index 0000000000..9c061576d2
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Comment.php
@@ -0,0 +1,45 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+
+class Comment
+{
+ /**
+ * @Type("JMS\Serializer\Tests\Fixtures\Author")
+ */
+ private $author;
+
+ /**
+ * @Type("string")
+ */
+ private $text;
+
+ public function __construct(Author $author = null, $text)
+ {
+ $this->author = $author;
+ $this->text = $text;
+ }
+
+ public function getAuthor()
+ {
+ return $this->author;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CurrencyAwareOrder.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CurrencyAwareOrder.php
new file mode 100644
index 0000000000..07e65cb601
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CurrencyAwareOrder.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\Type;
+
+/** @XmlRoot("order") */
+class CurrencyAwareOrder
+{
+ /** @Type("JMS\Serializer\Tests\Fixtures\CurrencyAwarePrice") */
+ private $cost;
+
+ public function __construct(CurrencyAwarePrice $price = null)
+ {
+ $this->cost = $price ?: new CurrencyAwarePrice(5);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CurrencyAwarePrice.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CurrencyAwarePrice.php
new file mode 100644
index 0000000000..654022ea1f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CurrencyAwarePrice.php
@@ -0,0 +1,43 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/** @Serializer\XmlRoot("price") */
+class CurrencyAwarePrice
+{
+ /**
+ * @Serializer\XmlAttribute
+ * @Serializer\Type("string")
+ */
+ private $currency;
+
+ /**
+ * @Serializer\XmlValue
+ * @Serializer\Type("double")
+ */
+ private $amount;
+
+ public function __construct($amount, $currency = 'EUR')
+ {
+ $this->currency = $currency;
+ $this->amount = $amount;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CustomDeserializationObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CustomDeserializationObject.php
new file mode 100644
index 0000000000..3a37e4968c
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/CustomDeserializationObject.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+
+class CustomDeserializationObject
+{
+ /**
+ * @Type("string")
+ */
+ public $someProperty;
+
+ public function __construct($value)
+ {
+ $this->someProperty = $value;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DateTimeArraysObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DateTimeArraysObject.php
new file mode 100644
index 0000000000..0ef62977e1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DateTimeArraysObject.php
@@ -0,0 +1,63 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlKeyValuePairs;
+
+
+class DateTimeArraysObject
+{
+ /**
+ * @var \DateTime[]
+ * @Type("array")
+ */
+ private $arrayWithDefaultDateTime;
+
+ /**
+ * @var \DateTime[]
+ * @Type("array>")
+ */
+ private $arrayWithFormattedDateTime;
+
+
+ function __construct($arrayWithDefaultDateTime, $arrayWithFormattedDateTime)
+ {
+ $this->arrayWithDefaultDateTime = $arrayWithDefaultDateTime;
+ $this->arrayWithFormattedDateTime = $arrayWithFormattedDateTime;
+ }
+
+ /**
+ * @return \DateTime[]
+ */
+ public function getArrayWithDefaultDateTime()
+ {
+ return $this->arrayWithDefaultDateTime;
+ }
+
+ /**
+ * @return \DateTime[]
+ */
+ public function getArrayWithFormattedDateTime()
+ {
+ return $this->arrayWithFormattedDateTime;
+ }
+
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Car.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Car.php
new file mode 100644
index 0000000000..3b2ed3d66b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Car.php
@@ -0,0 +1,23 @@
+
+ *
+ * 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\Discriminator;
+
+class Car extends Vehicle implements VehicleInterface
+{
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Moped.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Moped.php
new file mode 100644
index 0000000000..d6867b2f3b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Moped.php
@@ -0,0 +1,23 @@
+
+ *
+ * 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\Discriminator;
+
+class Moped extends Vehicle implements VehicleInterface
+{
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlAttributeDiscriminatorChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlAttributeDiscriminatorChild.php
new file mode 100644
index 0000000000..2a39644166
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlAttributeDiscriminatorChild.php
@@ -0,0 +1,23 @@
+
+ *
+ * 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\Discriminator;
+
+class ObjectWithXmlAttributeDiscriminatorChild extends ObjectWithXmlAttributeDiscriminatorParent
+{
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlAttributeDiscriminatorParent.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlAttributeDiscriminatorParent.php
new file mode 100644
index 0000000000..8aeded603f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlAttributeDiscriminatorParent.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\Discriminator;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\Discriminator(field = "type", map = {
+ * "child": "JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorChild"
+ * })
+ * @Serializer\XmlDiscriminator(attribute=true, cdata=false)
+ */
+class ObjectWithXmlAttributeDiscriminatorParent
+{
+
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNamespaceDiscriminatorChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNamespaceDiscriminatorChild.php
new file mode 100644
index 0000000000..2ffd4280e5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNamespaceDiscriminatorChild.php
@@ -0,0 +1,23 @@
+
+ *
+ * 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\Discriminator;
+
+class ObjectWithXmlNamespaceDiscriminatorChild extends ObjectWithXmlNamespaceDiscriminatorParent
+{
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNamespaceDiscriminatorParent.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNamespaceDiscriminatorParent.php
new file mode 100644
index 0000000000..ca433a4e05
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNamespaceDiscriminatorParent.php
@@ -0,0 +1,33 @@
+
+ *
+ * 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\Discriminator;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\Discriminator(field = "type", map = {
+ * "child": "JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorChild"
+ * })
+ * @Serializer\XmlDiscriminator(namespace="http://example.com/", cdata=false)
+ * @Serializer\XmlNamespace(prefix="foo", uri="http://example.com/")
+ */
+class ObjectWithXmlNamespaceDiscriminatorParent
+{
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNotCDataDiscriminatorChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNotCDataDiscriminatorChild.php
new file mode 100644
index 0000000000..e45af7b4b1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNotCDataDiscriminatorChild.php
@@ -0,0 +1,23 @@
+
+ *
+ * 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\Discriminator;
+
+class ObjectWithXmlNotCDataDiscriminatorChild extends ObjectWithXmlNotCDataDiscriminatorParent
+{
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNotCDataDiscriminatorParent.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNotCDataDiscriminatorParent.php
new file mode 100644
index 0000000000..b57d568f1a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/ObjectWithXmlNotCDataDiscriminatorParent.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\Discriminator;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\Discriminator(field = "type", map = {
+ * "child": "JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNotCDataDiscriminatorChild"
+ * })
+ * @Serializer\XmlDiscriminator(cdata=false)
+ */
+class ObjectWithXmlNotCDataDiscriminatorParent
+{
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Vehicle.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Vehicle.php
new file mode 100644
index 0000000000..d9e5c3c1af
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/Vehicle.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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\Discriminator;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\Discriminator(field = "type", map = {
+ * "car": "JMS\Serializer\Tests\Fixtures\Discriminator\Car",
+ * "moped": "JMS\Serializer\Tests\Fixtures\Discriminator\Moped",
+ * })
+ */
+abstract class Vehicle
+{
+ /** @Serializer\Type("integer") */
+ public $km;
+
+ public function __construct($km)
+ {
+ $this->km = (integer) $km;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/VehicleInterface.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/VehicleInterface.php
new file mode 100644
index 0000000000..1fe39e5309
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Discriminator/VehicleInterface.php
@@ -0,0 +1,31 @@
+
+ *
+ * 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\Discriminator;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\Discriminator(field = "type", map = {
+ * "car": "JMS\Serializer\Tests\Fixtures\Discriminator\Car",
+ * "moped": "JMS\Serializer\Tests\Fixtures\Discriminator\Moped",
+ * })
+ */
+interface VehicleInterface
+{
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DiscriminatorGroup/Car.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DiscriminatorGroup/Car.php
new file mode 100644
index 0000000000..01a10bb9c5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DiscriminatorGroup/Car.php
@@ -0,0 +1,23 @@
+
+ *
+ * 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\DiscriminatorGroup;
+
+class Car extends Vehicle
+{
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DiscriminatorGroup/Vehicle.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DiscriminatorGroup/Vehicle.php
new file mode 100644
index 0000000000..77add2ede7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DiscriminatorGroup/Vehicle.php
@@ -0,0 +1,40 @@
+
+ *
+ * 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\DiscriminatorGroup;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\Discriminator(field = "type", groups={"foo"}, map = {
+ * "car": "JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Car"
+ * })
+ */
+abstract class Vehicle
+{
+ /**
+ * @Serializer\Type("integer")
+ * @Serializer\Groups({"foo"})
+ */
+ public $km;
+
+ public function __construct($km)
+ {
+ $this->km = (integer) $km;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/Author.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/Author.php
new file mode 100644
index 0000000000..614a4dadf8
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/Author.php
@@ -0,0 +1,50 @@
+
+ *
+ * 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\Doctrine;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\SerializedName;
+
+use Doctrine\ORM\Mapping as ORM;
+
+/** @ORM\Entity */
+class Author
+{
+ /**
+ * @ORM\Id @ORM\Column(type="integer")
+ */
+ protected $id;
+
+ /**
+ * @ORM\Column(type="string")
+ * @SerializedName("full_name")
+ */
+ private $name;
+
+ public function __construct($name, $id = null)
+ {
+ $this->name = $name;
+ $this->id = $id;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/BlogPost.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/BlogPost.php
new file mode 100644
index 0000000000..bf610e4c54
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/BlogPost.php
@@ -0,0 +1,117 @@
+
+ *
+ * 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\Doctrine;
+
+use JMS\Serializer\Annotation as Serializer;
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\Groups;
+use JMS\Serializer\Annotation\Type;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\ORM\Mapping as ORM;
+
+/**
+ * @ORM\Entity
+ * @XmlRoot("blog-post")
+ */
+class BlogPost
+{
+ /**
+ * @ORM\Id @ORM\Column(type="integer")
+ */
+ protected $id;
+
+ /**
+ * @ORM\Column(type="string")
+ * @Groups({"comments","post"})
+ */
+ private $title;
+
+ /**
+ * @ORM\Column(type="some_custom_type")
+ */
+ protected $slug;
+
+ /**
+ * @ORM\Column(type="datetime")
+ * @XmlAttribute
+ */
+ private $createdAt;
+
+ /**
+ * @ORM\Column(type="boolean")
+ * @Type("integer")
+ * This boolean to integer conversion is one of the few changes between this
+ * and the standard BlogPost class. It's used to test the override behavior
+ * of the DoctrineTypeDriver so notice it, but please don't change it.
+ *
+ * @SerializedName("is_published")
+ * @Groups({"post"})
+ * @XmlAttribute
+ */
+ private $published;
+
+ /**
+ * @ORM\OneToMany(targetEntity="Comment", mappedBy="blogPost")
+ * @XmlList(inline=true, entry="comment")
+ * @Groups({"comments"})
+ */
+ private $comments;
+
+ /**
+ * @ORM\OneToOne(targetEntity="Author")
+ * @Groups({"post"})
+ */
+ private $author;
+
+ /**
+ * @ORM\Column(type="integer")
+ * @Serializer\Exclude()
+ */
+ private $ref;
+
+ public function __construct($title, Author $author, \DateTime $createdAt)
+ {
+ $this->title = $title;
+ $this->author = $author;
+ $this->published = false;
+ $this->comments = new ArrayCollection();
+ $this->createdAt = $createdAt;
+ }
+
+ public function setPublished()
+ {
+ $this->published = true;
+ }
+
+ public function addComment(Comment $comment)
+ {
+ $this->comments->add($comment);
+ }
+
+ /**
+ * @Serializer\VirtualProperty()
+ */
+ public function getRef()
+ {
+ return $this->ref;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/Comment.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/Comment.php
new file mode 100644
index 0000000000..f1fa126dc3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/Comment.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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\Doctrine;
+
+use JMS\Serializer\Annotation\Type;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\ORM\Mapping as ORM;
+
+/** @ORM\Entity */
+class Comment
+{
+ /**
+ * @ORM\Id @ORM\Column(type="integer")
+ */
+ protected $id;
+
+ /**
+ * @ORM\Column(type="Author")
+ */
+ private $author;
+
+ /** @ORM\ManyToOne(targetEntity="BlogPost") */
+ private $blogPost;
+
+ /**
+ * @ORM\Column(type="string")
+ */
+ private $text;
+
+ public function __construct(Author $author, $text)
+ {
+ $this->author = $author;
+ $this->text = $text;
+ $this->blogPost = new ArrayCollection();
+ }
+
+ public function getAuthor()
+ {
+ return $this->author;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/SingleTableInheritance/AbstractModel.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/SingleTableInheritance/AbstractModel.php
new file mode 100644
index 0000000000..d6994e476f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/SingleTableInheritance/AbstractModel.php
@@ -0,0 +1,10 @@
+teacher = $teacher;
+ $this->students = new ArrayCollection($students);
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function getTeacher()
+ {
+ return $this->teacher;
+ }
+
+ public function getStudents()
+ {
+ return $this->students;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/SingleTableInheritance/Organization.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/SingleTableInheritance/Organization.php
new file mode 100644
index 0000000000..1c386b4fb6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Doctrine/SingleTableInheritance/Organization.php
@@ -0,0 +1,19 @@
+
+ *
+ * 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\DoctrinePHPCR;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\SerializedName;
+
+use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
+
+/** @PHPCRODM\Document */
+class Author
+{
+ /**
+ * @PHPCRODM\Id()
+ */
+ protected $id;
+
+ /**
+ * @PHPCRODM\Field(type="string")
+ * @SerializedName("full_name")
+ */
+ private $name;
+
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DoctrinePHPCR/BlogPost.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DoctrinePHPCR/BlogPost.php
new file mode 100644
index 0000000000..aa238bc247
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DoctrinePHPCR/BlogPost.php
@@ -0,0 +1,102 @@
+
+ *
+ * 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\DoctrinePHPCR;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\Groups;
+use JMS\Serializer\Annotation\Type;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
+
+/**
+ * @PHPCRODM\Document
+ * @XmlRoot("blog-post")
+ */
+class BlogPost
+{
+ /**
+ * @PHPCRODM\Id()
+ */
+ protected $id;
+
+ /**
+ * @PHPCRODM\Field(type="string")
+ * @Groups({"comments","post"})
+ */
+ private $title;
+
+ /**
+ * @PHPCRODM\Field(type="string")
+ */
+ protected $slug;
+
+ /**
+ * @PHPCRODM\Field(type="date")
+ * @XmlAttribute
+ */
+ private $createdAt;
+
+ /**
+ * @PHPCRODM\Field(type="boolean")
+ * @Type("integer")
+ * This boolean to integer conversion is one of the few changes between this
+ * and the standard BlogPost class. It's used to test the override behavior
+ * of the DoctrineTypeDriver so notice it, but please don't change it.
+ *
+ * @SerializedName("is_published")
+ * @Groups({"post"})
+ * @XmlAttribute
+ */
+ private $published;
+
+ /**
+ * @PHPCRODM\ReferenceMany(targetDocument="Comment", property="blogPost")
+ * @XmlList(inline=true, entry="comment")
+ * @Groups({"comments"})
+ */
+ private $comments;
+
+ /**
+ * @PHPCRODM\ReferenceOne(targetDocument="Author")
+ * @Groups({"post"})
+ */
+ private $author;
+
+ public function __construct($title, Author $author, \DateTime $createdAt)
+ {
+ $this->title = $title;
+ $this->author = $author;
+ $this->published = false;
+ $this->comments = new ArrayCollection();
+ $this->createdAt = $createdAt;
+ }
+
+ public function setPublished()
+ {
+ $this->published = true;
+ }
+
+ public function addComment(Comment $comment)
+ {
+ $this->comments->add($comment);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DoctrinePHPCR/Comment.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DoctrinePHPCR/Comment.php
new file mode 100644
index 0000000000..936de482c5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/DoctrinePHPCR/Comment.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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\DoctrinePHPCR;
+
+use JMS\Serializer\Annotation\Type;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
+
+/** @PHPCRODM\Document */
+class Comment
+{
+ /**
+ * @PHPCRODM\Id()
+ */
+ protected $id;
+
+ /**
+ * @PHPCRODM\ReferenceOne(targetDocument="Author")
+ */
+ private $author;
+
+ /** @PHPCRODM\ReferenceOne(targetDocument="BlogPost") */
+ private $blogPost;
+
+ /**
+ * @PHPCRODM\Field(type="string")
+ */
+ private $text;
+
+ public function __construct(Author $author, $text)
+ {
+ $this->author = $author;
+ $this->text = $text;
+ $this->blogPost = new ArrayCollection();
+ }
+
+ public function getAuthor()
+ {
+ return $this->author;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ExclusionStrategy/AlwaysExcludeExclusionStrategy.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ExclusionStrategy/AlwaysExcludeExclusionStrategy.php
new file mode 100644
index 0000000000..184a0e7084
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ExclusionStrategy/AlwaysExcludeExclusionStrategy.php
@@ -0,0 +1,21 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+
+class Garage
+{
+ /**
+ * @Type("array")
+ */
+ public $vehicles;
+
+ public function __construct($vehicles) {
+ $this->vehicles = $vehicles;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GetSetObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GetSetObject.php
new file mode 100644
index 0000000000..cfa369a6ff
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GetSetObject.php
@@ -0,0 +1,65 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\AccessType;
+use JMS\Serializer\Annotation\Exclude;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\ReadOnly;
+
+/** @AccessType("public_method") */
+class GetSetObject
+{
+ /** @AccessType("property") @Type("integer") */
+ private $id = 1;
+
+ /** @Type("string") */
+ private $name = 'Foo';
+
+ /**
+ * @ReadOnly
+ */
+ private $readOnlyProperty = 42;
+
+ /**
+ * This property should be exlcluded
+ * @Exclude()
+ */
+ private $excludedProperty;
+
+ public function getId()
+ {
+ throw new \RuntimeException('This should not be called.');
+ }
+
+ public function getName()
+ {
+ return 'Johannes';
+ }
+
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ public function getReadOnlyProperty()
+ {
+ return $this->readOnlyProperty;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GroupsObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GroupsObject.php
new file mode 100644
index 0000000000..88e4618d42
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GroupsObject.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Groups;
+use JMS\Serializer\Annotation\Type;
+
+/** blablub */
+class GroupsObject
+{
+ /**
+ * @Groups({"foo"})
+ * @Type("string")
+ */
+ private $foo;
+
+ /**
+ * @Groups({"foo","bar"})
+ * @Type("string")
+ */
+ private $foobar;
+
+ /**
+ * @Groups({"bar", "Default"})
+ * @Type("string")
+ */
+ private $bar;
+
+ /**
+ * @Type("string")
+ */
+ private $none;
+
+ public function __construct()
+ {
+ $this->foo = "foo";
+ $this->bar = "bar";
+ $this->foobar = "foobar";
+ $this->none = "none";
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GroupsUser.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GroupsUser.php
new file mode 100644
index 0000000000..534df6516f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/GroupsUser.php
@@ -0,0 +1,48 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Groups;
+
+class GroupsUser
+{
+ private $name;
+
+ /**
+ * @Groups({"nickname_group"})
+ */
+ private $nickname = 'nickname';
+
+ /**
+ * @Groups({"manager_group"})
+ */
+ private $manager;
+
+ /**
+ * @Groups({"friends_group"})
+ */
+ private $friends;
+
+ public function __construct($name, GroupsUser $manager = null, array $friends = array())
+ {
+ $this->name = $name;
+ $this->manager = $manager;
+ $this->friends = $friends;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/IndexedCommentsBlogPost.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/IndexedCommentsBlogPost.php
new file mode 100644
index 0000000000..446f9776e1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/IndexedCommentsBlogPost.php
@@ -0,0 +1,73 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Accessor;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlAttribute;
+
+/** @XmlRoot("post") */
+class IndexedCommentsBlogPost
+{
+ /**
+ * @XmlMap(keyAttribute="author-name", inline=true, entry="comments")
+ * @Accessor(getter="getCommentsIndexedByAuthor")
+ */
+ private $comments = array();
+
+ public function __construct()
+ {
+ $author = new Author('Foo');
+ $this->comments[] = new Comment($author, 'foo');
+ $this->comments[] = new Comment($author, 'bar');
+ }
+
+ public function getCommentsIndexedByAuthor()
+ {
+ $indexedComments = array();
+ foreach ($this->comments as $comment) {
+ $authorName = $comment->getAuthor()->getName();
+
+ if (!isset($indexedComments[$authorName])) {
+ $indexedComments[$authorName] = new IndexedCommentsList();
+ }
+
+ $indexedComments[$authorName]->addComment($comment);
+ }
+
+ return $indexedComments;
+ }
+}
+
+class IndexedCommentsList
+{
+ /** @XmlList(inline=true, entry="comment") */
+ private $comments = array();
+
+ /** @XmlAttribute */
+ private $count = 0;
+
+ public function addComment(Comment $comment)
+ {
+ $this->comments[] = $comment;
+ $this->count += 1;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InitializedBlogPostConstructor.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InitializedBlogPostConstructor.php
new file mode 100644
index 0000000000..3b7dc69525
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InitializedBlogPostConstructor.php
@@ -0,0 +1,43 @@
+
+ *
+ * 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;
+
+use Doctrine\Common\Collections\ArrayCollection;
+
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\DeserializationContext;
+
+use JMS\Serializer\Construction\ObjectConstructorInterface;
+use JMS\Serializer\VisitorInterface;
+
+use JMS\Serializer\Tests\Fixtures\Author;
+use JMS\Serializer\Tests\Fixtures\Publisher;
+use JMS\Serializer\Construction\UnserializeObjectConstructor;
+
+class InitializedBlogPostConstructor extends UnserializeObjectConstructor
+{
+ public function construct(VisitorInterface $visitor, ClassMetadata $metadata, $data, array $type, DeserializationContext $context)
+ {
+ if ($type['name'] !== 'JMS\Serializer\Tests\Fixtures\BlogPost') {
+ return parent::construct($visitor, $metadata, $data, $type);
+ }
+
+ return new BlogPost('This is a nice title.', new Author('Foo Bar'), new \DateTime('2011-07-30 00:00', new \DateTimeZone('UTC')), new Publisher('Bar Foo'));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InitializedObjectConstructor.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InitializedObjectConstructor.php
new file mode 100644
index 0000000000..f5bbcd8e40
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InitializedObjectConstructor.php
@@ -0,0 +1,56 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\DeserializationContext;
+use JMS\Serializer\Construction\ObjectConstructorInterface;
+
+/**
+ * Object constructor that allows deserialization into already constructed
+ * objects passed through the deserialization context
+ */
+class InitializedObjectConstructor implements ObjectConstructorInterface
+{
+ private $fallbackConstructor;
+
+ /**
+ * Constructor.
+ *
+ * @param ObjectConstructorInterface $fallbackConstructor Fallback object constructor
+ */
+ public function __construct(ObjectConstructorInterface $fallbackConstructor)
+ {
+ $this->fallbackConstructor = $fallbackConstructor;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function construct(VisitorInterface $visitor, ClassMetadata $metadata, $data, array $type, DeserializationContext $context)
+ {
+ if ($context->attributes->containsKey('target') && $context->getDepth() === 1) {
+ return $context->attributes->get('target')->get();
+ }
+
+ return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
+ }
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChild.php
new file mode 100644
index 0000000000..645bb37e82
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChild.php
@@ -0,0 +1,35 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+use JMS\Serializer\Annotation\Type;
+
+class InlineChild
+{
+ /**
+ * @Type("string")
+ */
+ public $a = 'a';
+
+ /**
+ * @Type("string")
+ */
+ public $b = 'b';
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChildEmpty.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChildEmpty.php
new file mode 100644
index 0000000000..fc69a3edb9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChildEmpty.php
@@ -0,0 +1,26 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class InlineChildEmpty
+{
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChildWithGroups.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChildWithGroups.php
new file mode 100644
index 0000000000..ceb592bab5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineChildWithGroups.php
@@ -0,0 +1,37 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+use JMS\Serializer\Annotation\Type;
+
+class InlineChildWithGroups
+{
+ /**
+ * @Type("string")
+ * @Serializer\Groups({"a"})
+ */
+ public $a = 'a';
+
+ /**
+ * @Type("string")
+ * @Serializer\Groups({"b"})
+ */
+ public $b = 'b';
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineParent.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineParent.php
new file mode 100644
index 0000000000..39b71a614d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InlineParent.php
@@ -0,0 +1,46 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+use JMS\Serializer\Annotation\Type;
+
+/** @Serializer\AccessorOrder("alphabetical") */
+class InlineParent
+{
+ /**
+ * @Type("string")
+ */
+ private $c = 'c';
+
+ /**
+ * @Type("string")
+ */
+ private $d = 'd';
+
+ /**
+ * @Serializer\Inline
+ */
+ private $child;
+
+ public function __construct($child = null)
+ {
+ $this->child = $child ?: new InlineChild();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Input.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Input.php
new file mode 100644
index 0000000000..a052ba395f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Input.php
@@ -0,0 +1,41 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\XmlRoot("input")
+ */
+class Input
+{
+ /**
+ * @Serializer\XmlAttributeMap
+ */
+ private $attributes;
+
+ public function __construct($attributes = null)
+ {
+ $this->attributes = $attributes ?: array(
+ 'type' => 'text',
+ 'name' => 'firstname',
+ 'value' => 'Adrien',
+ );
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InvalidGroupsObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InvalidGroupsObject.php
new file mode 100644
index 0000000000..737a167c80
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InvalidGroupsObject.php
@@ -0,0 +1,31 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Groups;
+use JMS\Serializer\Annotation\Type;
+
+class InvalidGroupsObject
+{
+ /**
+ * @Groups({"foo, bar"})
+ * @Type("string")
+ */
+ private $foo;
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InvalidUsageOfXmlValue.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InvalidUsageOfXmlValue.php
new file mode 100644
index 0000000000..4001433b28
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/InvalidUsageOfXmlValue.php
@@ -0,0 +1,30 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlValue;
+
+/** Dummy */
+class InvalidUsageOfXmlValue
+{
+ /** @XmlValue */
+ private $value = 'bar';
+
+ private $element = 'foo';
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Log.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Log.php
new file mode 100644
index 0000000000..2fe9068888
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Log.php
@@ -0,0 +1,55 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\Type;
+
+/** @XmlRoot("log") */
+class Log
+{
+ /**
+ * @SerializedName("author_list")
+ * @XmlMap
+ * @Type("AuthorList")
+ */
+ private $authors;
+
+ /**
+ * @XmlList(inline=true, entry = "comment")
+ * @Type("array")
+ */
+ private $comments;
+
+ public function __construct()
+ {
+ $this->authors = new AuthorList();
+ $this->authors->add(new Author('Johannes Schmitt'));
+ $this->authors->add(new Author('John Doe'));
+
+ $author = new Author('Foo Bar');
+ $this->comments = array();
+ $this->comments[] = new Comment($author, 'foo');
+ $this->comments[] = new Comment($author, 'bar');
+ $this->comments[] = new Comment($author, 'baz');
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/MaxDepth/Gh236Bar.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/MaxDepth/Gh236Bar.php
new file mode 100644
index 0000000000..ab08c13592
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/MaxDepth/Gh236Bar.php
@@ -0,0 +1,19 @@
+a = new Gh236Bar();
+ $this->a->inner = new Gh236Bar();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/NamedDateTimeArraysObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/NamedDateTimeArraysObject.php
new file mode 100644
index 0000000000..8b88032241
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/NamedDateTimeArraysObject.php
@@ -0,0 +1,47 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlKeyValuePairs;
+
+
+class NamedDateTimeArraysObject
+{
+ /**
+ * @var \DateTime[]
+ * @Type("array>")
+ * @XmlKeyValuePairs
+ */
+ private $namedArrayWithFormattedDate;
+
+ function __construct($namedArrayWithFormattedDate)
+ {
+ $this->namedArrayWithFormattedDate = $namedArrayWithFormattedDate;
+ }
+
+ /**
+ * @return \DateTime[]
+ */
+ public function getNamedArrayWithFormattedDate()
+ {
+ return $this->namedArrayWithFormattedDate;
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/NamedDateTimeImmutableArraysObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/NamedDateTimeImmutableArraysObject.php
new file mode 100644
index 0000000000..60416cb8d1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/NamedDateTimeImmutableArraysObject.php
@@ -0,0 +1,44 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlKeyValuePairs;
+
+class NamedDateTimeImmutableArraysObject
+{
+ /**
+ * @var \DateTime[]
+ * @Type("array>")
+ * @XmlKeyValuePairs
+ */
+ private $namedArrayWithFormattedDate;
+
+ function __construct($namedArrayWithFormattedDate)
+ {
+ $this->namedArrayWithFormattedDate = $namedArrayWithFormattedDate;
+ }
+
+ /**
+ * @return \DateTimeImmutable[]
+ */
+ public function getNamedArrayWithFormattedDate()
+ {
+ return $this->namedArrayWithFormattedDate;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Node.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Node.php
new file mode 100644
index 0000000000..0de749cead
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Node.php
@@ -0,0 +1,36 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class Node
+{
+ /**
+ * @Serializer\MaxDepth(2)
+ */
+ public $children;
+
+ public $foo = 'bar';
+
+ public function __construct($children = array())
+ {
+ $this->children = $children;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithAbsentXmlListNode.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithAbsentXmlListNode.php
new file mode 100644
index 0000000000..739c643bc6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithAbsentXmlListNode.php
@@ -0,0 +1,47 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class ObjectWithAbsentXmlListNode
+{
+ /**
+ * @Serializer\XmlList(inline=false, entry="comment", skipWhenEmpty=true)
+ * @Serializer\Type("array")
+ */
+ public $absent;
+ /**
+ * @Serializer\XmlList(inline=false, entry="comment", skipWhenEmpty=false)
+ * @Serializer\Type("array")
+ */
+ public $present;
+
+ /**
+ * @Serializer\XmlList(inline=false, entry="comment")
+ * @Serializer\Type("array")
+ */
+ public $skipDefault;
+
+ /**
+ * @Serializer\XmlList(inline=false, namespace="http://www.example.com")
+ * @Serializer\Type("array")
+ */
+ public $absentAndNs;
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyArrayAndHash.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyArrayAndHash.php
new file mode 100644
index 0000000000..6376b82717
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyArrayAndHash.php
@@ -0,0 +1,45 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class ObjectWithEmptyArrayAndHash
+{
+ /**
+ * @Serializer\Type("array")
+ * @Serializer\SkipWhenEmpty()
+ */
+ private $hash = array();
+ /**
+ * @Serializer\Type("array")
+ * @Serializer\SkipWhenEmpty()
+ */
+ private $array = array();
+
+ /**
+ * @Serializer\SkipWhenEmpty()
+ */
+ private $object = array();
+
+ public function __construct()
+ {
+ $this->object = new InlineChildEmpty();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyHash.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyHash.php
new file mode 100644
index 0000000000..032b6d09ce
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyHash.php
@@ -0,0 +1,30 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class ObjectWithEmptyHash
+{
+ /**
+ * @Serializer\Type("array")
+ * @Serializer\XmlList(skipWhenEmpty=false)
+ */
+ private $hash = array();
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyNullableAndEmptyArrays.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyNullableAndEmptyArrays.php
new file mode 100644
index 0000000000..b8a0b17bbd
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithEmptyNullableAndEmptyArrays.php
@@ -0,0 +1,80 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class ObjectWithEmptyNullableAndEmptyArrays
+{
+ /**
+ * @Serializer\XmlList(inline = true, entry = "comment")
+ * @Serializer\Type("array")
+ */
+ public $null_inline = null;
+
+ /**
+ * @Serializer\XmlList(inline = true, entry = "comment")
+ * @Serializer\Type("array")
+ */
+ public $empty_inline = [];
+
+
+ /**
+ * @Serializer\XmlList(inline = true, entry = "comment")
+ * @Serializer\Type("array")
+ */
+ public $not_empty_inline = ['not_empty_inline'];
+
+ /**
+ * @Serializer\XmlList(inline = false, entry = "comment")
+ * @Serializer\Type("array")
+ */
+ public $null_not_inline = null;
+
+ /**
+ * @Serializer\XmlList(inline = false, entry = "comment")
+ * @Serializer\Type("array")
+ */
+ public $empty_not_inline = [];
+
+ /**
+ * @Serializer\XmlList(inline = false, entry = "comment", skipWhenEmpty=false)
+ * @Serializer\Type("array")
+ */
+ public $not_empty_not_inline = ['not_empty_not_inline'];
+
+ /**
+ * @Serializer\XmlList(inline = false, entry = "comment", skipWhenEmpty=false)
+ * @Serializer\Type("array")
+ */
+ public $null_not_inline_skip = null;
+
+ /**
+ * @Serializer\XmlList(inline = false, entry = "comment", skipWhenEmpty=false)
+ * @Serializer\Type("array")
+ */
+ public $empty_not_inline_skip = [];
+
+
+ /**
+ * @Serializer\XmlList(inline = false, entry = "comment", skipWhenEmpty=false)
+ * @Serializer\Type("array")
+ */
+ public $not_empty_not_inline_skip = ['not_empty_not_inline_skip'];
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithExpressionVirtualPropertiesAndExcludeAll.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithExpressionVirtualPropertiesAndExcludeAll.php
new file mode 100644
index 0000000000..7afe283d30
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithExpressionVirtualPropertiesAndExcludeAll.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\VirtualProperty;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+
+/**
+ * @VirtualProperty(
+ * "virtualValue",
+ * exp="object.getVirtualValue()"
+ * )
+ * @ExclusionPolicy("all")
+ */
+class ObjectWithExpressionVirtualPropertiesAndExcludeAll
+{
+
+ public function getVirtualValue()
+ {
+ return 'value';
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithHandlerCallbacks.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithHandlerCallbacks.php
new file mode 100644
index 0000000000..3ab9c3d2db
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithHandlerCallbacks.php
@@ -0,0 +1,46 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\HandlerCallback;
+use JMS\Serializer\Annotation\Type;
+
+class ObjectWithHandlerCallbacks
+{
+ /**
+ * @Type("string")
+ */
+ public $name;
+
+ /**
+ * @HandlerCallback(direction="serialization", format="json")
+ */
+ public function toJson()
+ {
+ return $this->name;
+ }
+
+ /**
+ * @HandlerCallback(direction="serialization", format="xml")
+ */
+ public function toXml()
+ {
+ return $this->name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithIntListAndIntMap.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithIntListAndIntMap.php
new file mode 100644
index 0000000000..f5f1e8da8a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithIntListAndIntMap.php
@@ -0,0 +1,20 @@
+") @Serializer\XmlList */
+ private $list;
+
+ /** @Serializer\Type("array") @Serializer\XmlMap */
+ private $map;
+
+ public function __construct(array $list, array $map)
+ {
+ $this->list = $list;
+ $this->map = $map;
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithLifecycleCallbacks.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithLifecycleCallbacks.php
new file mode 100644
index 0000000000..ca22593196
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithLifecycleCallbacks.php
@@ -0,0 +1,74 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Exclude;
+use JMS\Serializer\Annotation\PreSerialize;
+use JMS\Serializer\Annotation\PostSerialize;
+use JMS\Serializer\Annotation\PostDeserialize;
+use JMS\Serializer\Annotation\Type;
+
+class ObjectWithLifecycleCallbacks
+{
+ /**
+ * @Exclude
+ */
+ private $firstname;
+
+ /**
+ * @Exclude
+ */
+ private $lastname;
+
+ /**
+ * @Type("string")
+ */
+ private $name;
+
+ public function __construct($firstname = 'Foo', $lastname = 'Bar')
+ {
+ $this->firstname = $firstname;
+ $this->lastname = $lastname;
+ }
+
+ /**
+ * @PreSerialize
+ */
+ private function prepareForSerialization()
+ {
+ $this->name = $this->firstname.' '.$this->lastname;
+ }
+
+ /**
+ * @PostSerialize
+ */
+ private function cleanUpAfterSerialization()
+ {
+ $this->name = null;
+ }
+
+ /**
+ * @PostDeserialize
+ */
+ private function afterDeserialization()
+ {
+ list($this->firstname, $this->lastname) = explode(' ', $this->name);
+ $this->name = null;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithNamespacesAndList.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithNamespacesAndList.php
new file mode 100644
index 0000000000..2bca2c7ac7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithNamespacesAndList.php
@@ -0,0 +1,103 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlMap;
+/**
+ * @XmlRoot("ObjectWithNamespacesAndList", namespace="http://example.com/namespace")
+ * @XmlNamespace(uri="http://example.com/namespace")
+ * @XmlNamespace(uri="http://example.com/namespace2", prefix="x")
+ */
+class ObjectWithNamespacesAndList
+{
+ /**
+ * @Type("string")
+ * @SerializedName("name")
+ * @XmlElement(namespace="http://example.com/namespace")
+ */
+ public $name;
+ /**
+ * @Type("string")
+ * @SerializedName("name")
+ * @XmlElement(namespace="http://example.com/namespace2")
+ */
+ public $nameAlternativeB;
+
+ /**
+ * @Type("array")
+ * @SerializedName("phones")
+ * @XmlElement(namespace="http://example.com/namespace2")
+ * @XmlList(inline = false, entry = "phone", namespace="http://example.com/namespace2")
+ */
+ public $phones;
+ /**
+ * @Type("array")
+ * @SerializedName("addresses")
+ * @XmlElement(namespace="http://example.com/namespace2")
+ * @XmlMap(inline = false, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace2")
+ */
+ public $addresses;
+
+ /**
+ * @Type("array")
+ * @SerializedName("phones")
+ * @XmlList(inline = true, entry = "phone", namespace="http://example.com/namespace")
+ */
+ public $phonesAlternativeB;
+ /**
+ * @Type("array")
+ * @SerializedName("addresses")
+ * @XmlMap(inline = true, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace")
+ */
+ public $addressesAlternativeB;
+
+ /**
+ * @Type("array")
+ * @SerializedName("phones")
+ * @XmlList(inline = true, entry = "phone", namespace="http://example.com/namespace2")
+ */
+ public $phonesAlternativeC;
+ /**
+ * @Type("array")
+ * @SerializedName("addresses")
+ * @XmlMap(inline = true, entry = "address", keyAttribute = "id", namespace="http://example.com/namespace2")
+ */
+ public $addressesAlternativeC;
+
+ /**
+ * @Type("array")
+ * @SerializedName("phones")
+ * @XmlList(inline = false, entry = "phone")
+ */
+ public $phonesAlternativeD;
+ /**
+ * @Type("array")
+ * @SerializedName("addresses")
+ * @XmlMap(inline = false, entry = "address", keyAttribute = "id")
+ */
+ public $addressesAlternativeD;
+
+}
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithNullProperty.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithNullProperty.php
new file mode 100644
index 0000000000..7434434a87
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithNullProperty.php
@@ -0,0 +1,26 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Tests\Fixtures\SimpleObject;
+
+class ObjectWithNullProperty extends SimpleObject
+{
+ private $nullProperty = null;
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithObjectProperty.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithObjectProperty.php
new file mode 100644
index 0000000000..ea56a567bf
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithObjectProperty.php
@@ -0,0 +1,53 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+
+
+class ObjectWithObjectProperty
+{
+ /**
+ * @Type("string")
+ */
+ private $foo;
+
+ /**
+ * @Type("JMS\Serializer\Tests\Fixtures\Author")
+ */
+ private $author;
+
+ /**
+ * @return string
+ */
+ public function getFoo()
+ {
+ return $this->foo;
+ }
+
+ /**
+ * @return \JMS\Serializer\Tests\Fixtures\Author
+ */
+ public function getAuthor()
+ {
+ return $this->author;
+ }
+
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithToString.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithToString.php
new file mode 100644
index 0000000000..e4df6b9299
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithToString.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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;
+
+class ObjectWithToString
+{
+ private $input;
+
+ public function __construct($input)
+ {
+ $this->input = $input;
+ }
+
+ public function __toString()
+ {
+ return $this->input;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVersionedVirtualProperties.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVersionedVirtualProperties.php
new file mode 100644
index 0000000000..67c3d79fd6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVersionedVirtualProperties.php
@@ -0,0 +1,57 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Groups;
+use JMS\Serializer\Annotation\XmlValue;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\Since;
+use JMS\Serializer\Annotation\Until;
+use JMS\Serializer\Annotation\VirtualProperty;
+use JMS\Serializer\Annotation\SerializedName;
+
+/**
+ * dummy comment
+ */
+class ObjectWithVersionedVirtualProperties
+{
+ /**
+ * @Groups({"versions"})
+ * @VirtualProperty
+ * @SerializedName("low")
+ * @Until("8")
+ */
+ public function getVirualLowValue()
+ {
+ return 1;
+ }
+
+ /**
+ * @Groups({"versions"})
+ * @VirtualProperty
+ * @SerializedName("high")
+ * @Since("6")
+ */
+ public function getVirualHighValue()
+ {
+ return 8;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualProperties.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualProperties.php
new file mode 100644
index 0000000000..c6e7f35d97
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualProperties.php
@@ -0,0 +1,64 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\AccessorOrder;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\VirtualProperty;
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Exclude;
+
+/**
+ * @AccessorOrder("custom", custom = {"prop_name", "existField", "foo" })
+ */
+class ObjectWithVirtualProperties
+{
+
+ /**
+ * @Type("string")
+ */
+ protected $existField = 'value';
+
+ /**
+ *
+ * @VirtualProperty
+ */
+ public function getVirtualValue()
+ {
+ return 'value';
+ }
+
+ /**
+ * @VirtualProperty
+ * @SerializedName("test")
+ */
+ public function getVirtualSerializedValue()
+ {
+ return 'other-name';
+ }
+
+ /**
+ * @VirtualProperty
+ * @Type("integer")
+ */
+ public function getTypedVirtualProperty()
+ {
+ return '1';
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualPropertiesAndExcludeAll.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualPropertiesAndExcludeAll.php
new file mode 100644
index 0000000000..a39b96bde2
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualPropertiesAndExcludeAll.php
@@ -0,0 +1,36 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\VirtualProperty;
+use JMS\Serializer\Annotation\ExclusionPolicy;
+
+/**
+ * @ExclusionPolicy("all")
+ */
+class ObjectWithVirtualPropertiesAndExcludeAll
+{
+ /**
+ * @VirtualProperty
+ */
+ public function getVirtualValue()
+ {
+ return 'value';
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualXmlProperties.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualXmlProperties.php
new file mode 100644
index 0000000000..7881e8be4c
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithVirtualXmlProperties.php
@@ -0,0 +1,108 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Groups;
+use JMS\Serializer\Annotation\XmlValue;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlList;
+use JMS\Serializer\Annotation\XmlMap;
+use JMS\Serializer\Annotation\Since;
+use JMS\Serializer\Annotation\Until;
+use JMS\Serializer\Annotation\VirtualProperty;
+use JMS\Serializer\Annotation\SerializedName;
+
+class ObjectWithVirtualXmlProperties
+{
+
+ /**
+ *
+ * @VirtualProperty
+ * @SerializedName("foo")
+ * @Groups({"attributes"})
+ * @XmlAttribute
+ */
+ public function getVirualXmlAttributeValue()
+ {
+ return 'bar';
+ }
+
+ /**
+ *
+ * @VirtualProperty
+ * @SerializedName("xml-value")
+ * @Groups({"values"})
+ * @XmlValue
+ */
+ public function getVirualXmlValue()
+ {
+ return 'xml-value';
+ }
+
+ /**
+ *
+ * @VirtualProperty
+ * @SerializedName("list")
+ * @Groups({"list"})
+ * @XmlList(inline = true, entry = "val")
+ */
+ public function getVirualXmlList()
+ {
+ return array('One','Two');
+ }
+
+ /**
+ *
+ * @VirtualProperty
+ * @SerializedName("map")
+ * @Groups({"map"})
+ * @XmlMap(keyAttribute = "key")
+ */
+ public function getVirualXmlMap()
+ {
+ return array(
+ 'key-one' => 'One',
+ 'key-two' => 'Two'
+ );
+ }
+
+ /**
+ *
+ * @VirtualProperty
+ * @SerializedName("low")
+ * @Groups({"versions"})
+ * @Until("8")
+ */
+ public function getVirualLowValue()
+ {
+ return 1;
+ }
+
+ /**
+ * @VirtualProperty
+ * @SerializedName("hight")
+ * @Groups({"versions"})
+ * @Since("8")
+ */
+ public function getVirualHighValue()
+ {
+ return 8;
+ }
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlKeyValuePairs.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlKeyValuePairs.php
new file mode 100644
index 0000000000..95a3469fd9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlKeyValuePairs.php
@@ -0,0 +1,46 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlKeyValuePairs;
+
+class ObjectWithXmlKeyValuePairs
+{
+ /**
+ * @var array
+ * @XmlKeyValuePairs
+ */
+ private $array = array(
+ 'key-one' => 'foo',
+ 'key-two' => 1,
+ 'nested-array' => array(
+ 'bar' => 'foo',
+ ),
+ 'without-keys' => array(
+ 1,
+ 'test'
+ ),
+ 'mixed' => array(
+ 'test',
+ 'foo' => 'bar',
+ '1_foo' => 'bar'
+ ),
+ 1 => 'foo'
+ );
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespaces.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespaces.php
new file mode 100644
index 0000000000..84345ed0d4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespaces.php
@@ -0,0 +1,73 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Annotation\XmlAttribute;
+
+/**
+ * @XmlRoot("test-object", namespace="http://example.com/namespace")
+ * @XmlNamespace(uri="http://example.com/namespace")
+ * @XmlNamespace(uri="http://schemas.google.com/g/2005", prefix="gd")
+ * @XmlNamespace(uri="http://www.w3.org/2005/Atom", prefix="atom")
+ */
+class ObjectWithXmlNamespaces
+{
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://purl.org/dc/elements/1.1/");
+ */
+ private $title;
+
+ /**
+ * @Type("DateTime")
+ * @XmlAttribute
+ */
+ private $createdAt;
+
+ /**
+ * @Type("string")
+ * @XmlAttribute(namespace="http://schemas.google.com/g/2005")
+ */
+ private $etag;
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://www.w3.org/2005/Atom")
+ */
+ private $author;
+
+ /**
+ * @Type("string")
+ * @XmlAttribute(namespace="http://purl.org/dc/elements/1.1/");
+ */
+ private $language;
+
+ public function __construct($title, $author, \DateTime $createdAt, $language)
+ {
+ $this->title = $title;
+ $this->author = $author;
+ $this->createdAt = $createdAt;
+ $this->language = $language;
+ $this->etag = sha1($this->createdAt->format(\DateTime::ISO8601));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectProperty.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectProperty.php
new file mode 100644
index 0000000000..8340bb679e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectProperty.php
@@ -0,0 +1,49 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlElement;
+
+/**
+ * @XmlRoot("property:test-object", namespace="http://example.com/namespace-property")
+ * @XmlNamespace(uri="http://example.com/namespace-property", prefix="property")
+ */
+class ObjectWithXmlNamespacesAndObjectProperty
+{
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://example.com/namespace-property");
+ */
+ private $title;
+
+ /**
+ * @Type("JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespacesAndObjectPropertyAuthor")
+ * @XmlElement(namespace="http://example.com/namespace-property")
+ */
+ private $author;
+
+ public function __construct($title, $author)
+ {
+ $this->title = $title;
+ $this->author = $author;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectPropertyAuthor.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectPropertyAuthor.php
new file mode 100644
index 0000000000..458347c852
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectPropertyAuthor.php
@@ -0,0 +1,53 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlElement;
+
+/**
+ * @XmlNamespace(uri="http://example.com/namespace-author")
+ */
+class ObjectWithXmlNamespacesAndObjectPropertyAuthor
+{
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://example.com/namespace-modified");
+ */
+ private $author;
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://example.com/namespace-author");
+ */
+ private $info = "hidden-info";
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://example.com/namespace-property")
+ */
+ private $name;
+
+ public function __construct($name, $author)
+ {
+ $this->name = $name;
+ $this->author = $author;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectPropertyVirtual.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectPropertyVirtual.php
new file mode 100644
index 0000000000..30d9bc9c05
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlNamespacesAndObjectPropertyVirtual.php
@@ -0,0 +1,49 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlElement;
+
+/**
+ * @XmlRoot("property:test-object", namespace="http://example.com/namespace-property")
+ * @XmlNamespace(uri="http://example.com/namespace-property", prefix="property")
+ */
+class ObjectWithXmlNamespacesAndObjectPropertyVirtual
+{
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://example.com/namespace-property");
+ */
+ private $title;
+
+ /**
+ * @Type("ObjectWithXmlNamespacesAndObjectPropertyAuthorVirtual")
+ * @XmlElement(namespace="http://example.com/namespace-property")
+ */
+ private $author;
+
+ public function __construct($title, $author)
+ {
+ $this->title = $title;
+ $this->author = $author;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlRootNamespace.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlRootNamespace.php
new file mode 100644
index 0000000000..f4ca835939
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ObjectWithXmlRootNamespace.php
@@ -0,0 +1,68 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Annotation\XmlAttribute;
+
+/**
+ * @XmlRoot("test-object", namespace="http://example.com/namespace")
+ */
+class ObjectWithXmlRootNamespace
+{
+ /**
+ * @Type("string")
+ */
+ private $title;
+
+ /**
+ * @Type("DateTime")
+ * @XmlAttribute
+ */
+ private $createdAt;
+
+ /**
+ * @Type("string")
+ * @XmlAttribute
+ */
+ private $etag;
+
+ /**
+ * @Type("string")
+ */
+ private $author;
+
+ /**
+ * @Type("string")
+ * @XmlAttribute
+ */
+ private $language;
+
+ public function __construct($title, $author, \DateTime $createdAt, $language)
+ {
+ $this->title = $title;
+ $this->author = $author;
+ $this->createdAt = $createdAt;
+ $this->language = $language;
+ $this->etag = sha1($this->createdAt->format(\DateTime::ISO8601));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Order.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Order.php
new file mode 100644
index 0000000000..aef963b3fe
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Order.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\Type;
+
+/** @XmlRoot("order") */
+class Order
+{
+ /** @Type("JMS\Serializer\Tests\Fixtures\Price") */
+ private $cost;
+
+ public function __construct(Price $price = null)
+ {
+ $this->cost = $price ?: new Price(5);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ParentDoNotSkipWithEmptyChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ParentDoNotSkipWithEmptyChild.php
new file mode 100644
index 0000000000..7cc30b49b1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ParentDoNotSkipWithEmptyChild.php
@@ -0,0 +1,36 @@
+
+ *
+ * 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;
+
+class ParentDoNotSkipWithEmptyChild
+{
+ private $c = 'c';
+
+ private $d = 'd';
+
+ /**
+ * @var InlineChild
+ */
+ private $child;
+
+ public function __construct($child = null)
+ {
+ $this->child = $child ?: new InlineChild();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ParentSkipWithEmptyChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ParentSkipWithEmptyChild.php
new file mode 100644
index 0000000000..5c05f97382
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/ParentSkipWithEmptyChild.php
@@ -0,0 +1,39 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class ParentSkipWithEmptyChild
+{
+ private $c = 'c';
+
+ private $d = 'd';
+
+ /**
+ * @Serializer\SkipWhenEmpty()
+ * @var InlineChild
+ */
+ private $child;
+
+ public function __construct($child = null)
+ {
+ $this->child = $child ?: new InlineChild();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Person.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Person.php
new file mode 100644
index 0000000000..aec22e94c8
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Person.php
@@ -0,0 +1,43 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlValue;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlElement;
+use JMS\Serializer\Annotation\Type;
+
+/**
+ * @XmlRoot("child")
+ */
+class Person
+{
+ /**
+ * @Type("string")
+ * @XmlValue(cdata=false)
+ */
+ public $name;
+
+ /**
+ * @Type("int")
+ * @XmlAttribute
+ */
+ public $age;
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonCollection.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonCollection.php
new file mode 100644
index 0000000000..090b723708
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonCollection.php
@@ -0,0 +1,46 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlList;
+use Doctrine\Common\Collections\ArrayCollection;
+use JMS\Serializer\Annotation\Type;
+
+/**
+ * @XmlRoot("person_collection")
+ */
+class PersonCollection
+{
+ /**
+ * @Type("ArrayCollection")
+ * @XmlList(entry = "person", inline = true)
+ */
+ public $persons;
+
+ /**
+ * @Type("string")
+ */
+ public $location;
+
+ public function __construct()
+ {
+ $this->persons = new ArrayCollection;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonLocation.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonLocation.php
new file mode 100644
index 0000000000..62c31d6b75
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonLocation.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\Type;
+
+/**
+ * @XmlRoot("person_location")
+ */
+class PersonLocation
+{
+ /**
+ * @Type("JMS\Serializer\Tests\Fixtures\Person")
+ */
+ public $person;
+
+ /**
+ * @Type("string")
+ */
+ public $location;
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecret.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecret.php
new file mode 100644
index 0000000000..a2dc13c48f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecret.php
@@ -0,0 +1,45 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\ExclusionPolicy("NONE")
+ * @Serializer\AccessorOrder("custom",custom = {"name", "gender" ,"age"})
+ */
+class PersonSecret
+{
+ /**
+ * @Serializer\Type("string")
+ */
+ public $name;
+
+ /**
+ * @Serializer\Type("string")
+ * @Serializer\Exclude(if="show_data('gender')")
+ */
+ public $gender;
+
+ /**
+ * @Serializer\Type("string")
+ * @Serializer\Expose(if="show_data('age')")
+ */
+ public $age;
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretMore.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretMore.php
new file mode 100644
index 0000000000..ef7877357a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretMore.php
@@ -0,0 +1,40 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\ExclusionPolicy("ALL")
+ * @Serializer\AccessorOrder("custom",custom = {"name", "gender"})
+ */
+class PersonSecretMore
+{
+ /**
+ * @Serializer\Type("string")
+ * @Serializer\Expose()
+ */
+ public $name;
+
+ /**
+ * @Serializer\Type("string")
+ * @Serializer\Expose(if="show_data('gender')")
+ */
+ public $gender;
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretMoreVirtual.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretMoreVirtual.php
new file mode 100644
index 0000000000..2f0a64a5b7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretMoreVirtual.php
@@ -0,0 +1,46 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\ExclusionPolicy("ALL")
+ * @Serializer\AccessorOrder("custom",custom = {"name", "gender"})
+ */
+class PersonSecretMoreVirtual
+{
+ /**
+ * @Serializer\Type("string")
+ * @Serializer\Expose()
+ */
+ public $name;
+
+ public $gender;
+
+ /**
+ * @Serializer\VirtualProperty()
+ * @Serializer\Type("string")
+ * @Serializer\Expose(if="show_data('gender')")
+ */
+ public function getGender()
+ {
+ return $this->gender;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretVirtual.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretVirtual.php
new file mode 100644
index 0000000000..913ff4701c
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/PersonSecretVirtual.php
@@ -0,0 +1,54 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+/**
+ * @Serializer\ExclusionPolicy("NONE")
+ * @Serializer\AccessorOrder("custom",custom = {"name", "gender", "age"})
+ */
+class PersonSecretVirtual
+{
+ /**
+ * @Serializer\Type("string")
+ */
+ public $name;
+
+ /**
+ * @Serializer\Exclude()
+ */
+ public $gender;
+
+ /**
+ * @Serializer\Type("string")
+ * @Serializer\Expose(if="show_data('age')")
+ */
+ public $age;
+
+ /**
+ * @Serializer\VirtualProperty()
+ * @Serializer\Type("string")
+ * @Serializer\Exclude(if="show_data('gender')")
+ */
+ public function getGender()
+ {
+ return $this->gender;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Price.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Price.php
new file mode 100644
index 0000000000..501ffdcab5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Price.php
@@ -0,0 +1,40 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlValue;
+use JMS\Serializer\Annotation\XmlRoot;
+
+/**
+ * @XmlRoot("price")
+ */
+class Price
+{
+ /**
+ * @Type("float")
+ * @XmlValue
+ */
+ private $price;
+
+ public function __construct($price)
+ {
+ $this->price = $price;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Publisher.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Publisher.php
new file mode 100644
index 0000000000..5aa8c38485
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Publisher.php
@@ -0,0 +1,49 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlRoot;
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\XmlElement;
+
+/**
+ * @XmlRoot("publisher")
+ * @XmlNamespace(uri="http://example.com/namespace2", prefix="ns2")
+ */
+class Publisher
+{
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://example.com/namespace2")
+ * @SerializedName("pub_name")
+ */
+ private $name;
+
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleClassObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleClassObject.php
new file mode 100644
index 0000000000..c3d782fe48
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleClassObject.php
@@ -0,0 +1,51 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlElement;
+
+/**
+ * @XmlNamespace(prefix="old_foo", uri="http://old.foo.example.org");
+ * @XmlNamespace(prefix="foo", uri="http://foo.example.org");
+ * @XmlNamespace(prefix="new_foo", uri="http://new.foo.example.org");
+ */
+class SimpleClassObject
+{
+ /**
+ * @Type("string")
+ * @XmlAttribute(namespace="http://old.foo.example.org")
+ */
+ public $foo;
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://foo.example.org")
+ */
+ public $bar;
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://new.foo.example.org")
+ */
+ public $moo;
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleObject.php
new file mode 100644
index 0000000000..77a968694a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleObject.php
@@ -0,0 +1,53 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Type;
+
+class SimpleObject
+{
+ /** @Type("string") */
+ private $foo;
+
+ /**
+ * @SerializedName("moo")
+ * @Type("string")
+ */
+ private $bar;
+
+ /** @Type("string") */
+ protected $camelCase = 'boo';
+
+ public function __construct($foo, $bar)
+ {
+ $this->foo = $foo;
+ $this->bar = $bar;
+ }
+
+ public function getFoo()
+ {
+ return $this->foo;
+ }
+
+ public function getBar()
+ {
+ return $this->bar;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleObjectProxy.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleObjectProxy.php
new file mode 100644
index 0000000000..dffa7268cd
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleObjectProxy.php
@@ -0,0 +1,41 @@
+
+ *
+ * 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;
+
+use Doctrine\Common\Persistence\Proxy;
+
+class SimpleObjectProxy extends SimpleObject implements Proxy
+{
+ public $__isInitialized__ = false;
+
+ private $baz = 'baz';
+
+ public function __load()
+ {
+ if (!$this->__isInitialized__) {
+ $this->camelCase = 'proxy-boo';
+ $this->__isInitialized__ = true;
+ }
+ }
+
+ public function __isInitialized()
+ {
+ return $this->__isInitialized__;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleSubClassObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleSubClassObject.php
new file mode 100644
index 0000000000..52f02e2d1f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/SimpleSubClassObject.php
@@ -0,0 +1,52 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\XmlNamespace;
+use JMS\Serializer\Annotation\Type;
+use JMS\Serializer\Annotation\XmlAttribute;
+use JMS\Serializer\Annotation\XmlElement;
+
+/**
+ * @XmlNamespace(prefix="old_foo", uri="http://foo.example.org");
+ * @XmlNamespace(prefix="foo", uri="http://better.foo.example.org");
+ */
+class SimpleSubClassObject
+ extends SimpleClassObject
+{
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://better.foo.example.org")
+ */
+ public $moo;
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://foo.example.org")
+ */
+ public $baz;
+
+ /**
+ * @Type("string")
+ * @XmlElement(namespace="http://new.foo.example.org")
+ */
+ public $qux;
+
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Tag.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Tag.php
new file mode 100644
index 0000000000..5c1e92264b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Tag.php
@@ -0,0 +1,42 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as JMS;
+
+
+/**
+ * @JMS\XmlRoot("tag")
+ * @JMS\XmlNamespace(uri="http://purl.org/dc/elements/1.1/", prefix="dc")
+ */
+class Tag {
+
+ /**
+ * @JMS\XmlElement(cdata=false)
+ * @JMS\Type("string")
+ */
+ public $name;
+
+ function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Timestamp.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Timestamp.php
new file mode 100644
index 0000000000..7d3d0476b5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Timestamp.php
@@ -0,0 +1,39 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+
+class Timestamp
+{
+ /**
+ * @Type("DateTime<'U'>")
+ */
+ private $timestamp;
+
+ public function __construct($timestamp)
+ {
+ $this->timestamp = $timestamp;
+ }
+
+ public function getTimestamp()
+ {
+ return $this->timestamp;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Tree.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Tree.php
new file mode 100644
index 0000000000..e5066b8088
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/Tree.php
@@ -0,0 +1,34 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation as Serializer;
+
+class Tree
+{
+ /**
+ * @Serializer\MaxDepth(10)
+ */
+ public $tree;
+
+ public function __construct($tree)
+ {
+ $this->tree = $tree;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/VehicleInterfaceGarage.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/VehicleInterfaceGarage.php
new file mode 100644
index 0000000000..ca27b33d78
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/VehicleInterfaceGarage.php
@@ -0,0 +1,33 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\Type;
+
+class VehicleInterfaceGarage
+{
+ /**
+ * @Type("array")
+ */
+ public $vehicles;
+
+ public function __construct($vehicles) {
+ $this->vehicles = $vehicles;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/VersionedObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/VersionedObject.php
new file mode 100644
index 0000000000..b4bfb5155d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Fixtures/VersionedObject.php
@@ -0,0 +1,43 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\Since;
+use JMS\Serializer\Annotation\Until;
+
+class VersionedObject
+{
+ /**
+ * @Until("1.0.0")
+ */
+ private $name;
+
+ /**
+ * @Since("1.0.1")
+ * @SerializedName("name")
+ */
+ private $name2;
+
+ public function __construct($name, $name2)
+ {
+ $this->name = $name;
+ $this->name2 = $name2;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/ArrayCollectionHandlerTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/ArrayCollectionHandlerTest.php
new file mode 100644
index 0000000000..4012a07c9f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/ArrayCollectionHandlerTest.php
@@ -0,0 +1,52 @@
+getMockBuilder(VisitorInterface::class)->getMock();
+ $visitor->method('visitArray')->with(['foo'])->willReturn(['foo']);
+
+ $context = $this->getMockBuilder(SerializationContext::class)->getMock();
+ $type = ['name' => 'ArrayCollection', 'params' => []];
+
+ $collection = new ArrayCollection(['foo']);
+
+ $handler->serializeCollection($visitor, $collection, $type, $context);
+ }
+
+ public function testSerializeArraySkipByExclusionStrategy()
+ {
+ $handler = new ArrayCollectionHandler(false);
+
+ $visitor = $this->getMockBuilder(VisitorInterface::class)->getMock();
+ $visitor->method('visitArray')->with([])->willReturn([]);
+
+ $context = $this->getMockBuilder(SerializationContext::class)->getMock();
+
+ $factoryMock = $this->getMockBuilder(MetadataFactoryInterface::class)->getMock();
+ $factoryMock->method('getMetadataForClass')->willReturn(new ClassMetadata(ArrayCollection::class));
+
+ $context->method('getExclusionStrategy')->willReturn(new AlwaysExcludeExclusionStrategy());
+ $context->method('getMetadataFactory')->willReturn($factoryMock);
+
+
+ $type = ['name' => 'ArrayCollection', 'params' => []];
+
+ $collection = new ArrayCollection(['foo']);
+
+ $handler->serializeCollection($visitor, $collection, $type, $context);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/FormErrorHandlerTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/FormErrorHandlerTest.php
new file mode 100644
index 0000000000..93bcdb26f5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/FormErrorHandlerTest.php
@@ -0,0 +1,137 @@
+handler = new FormErrorHandler(new Translator('en'));
+ $this->visitor = new JsonSerializationVisitor(new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy()));
+ $this->dispatcher = new EventDispatcher();
+ $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
+ }
+
+ protected function tearDown()
+ {
+ $this->handler = null;
+ $this->visitor = null;
+ $this->dispatcher = null;
+ $this->factory = null;
+ }
+
+ public function testSerializeEmptyFormError()
+ {
+ $form = $this->createForm();
+ $json = json_encode($this->handler->serializeFormToJson($this->visitor, $form, array()));
+
+ $this->assertSame('{}', $json);
+ }
+
+ public function testSerializeHasFormError()
+ {
+ $form = $this->createForm();
+ $form->addError(new FormError('error!'));
+ $json = json_encode($this->handler->serializeFormToJson($this->visitor, $form, array()));
+
+ $this->assertSame(json_encode(array(
+ 'errors' => array(
+ 'error!',
+ ),
+ )), $json);
+ }
+
+
+ public function testSerializeChildElements()
+ {
+ $formFactory = Forms::createFormFactory();
+ $form = $formFactory->createBuilder()
+ ->add('child')
+ ->add('date')
+ ->getForm();
+
+ $form->addError(new FormError('error!'));
+ $form->get('date')->addError(new FormError('child-error'));
+
+ $json = json_encode($this->handler->serializeFormToJson($this->visitor, $form, array()));
+
+ $this->assertSame(json_encode(array(
+ 'errors' => array(
+ 'error!',
+ ),
+ 'children' => [
+ 'child' => new \stdClass(),
+ 'date' => ['errors' => ['child-error']]
+ ]
+ )), $json);
+
+ }
+
+ /**
+ * @param string $name
+ * @param EventDispatcherInterface $dispatcher
+ * @param string $dataClass
+ *
+ * @return FormBuilder
+ */
+ protected function getBuilder($name = 'name', EventDispatcherInterface $dispatcher = null, $dataClass = null)
+ {
+ return new FormBuilder($name, $dataClass, $dispatcher ?: $this->dispatcher, $this->factory);
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return \PHPUnit_Framework_MockObject_MockObject
+ */
+ protected function getMockForm($name = 'name')
+ {
+ $form = $this->getMock('Symfony\Component\Form\Test\FormInterface');
+ $config = $this->getMock('Symfony\Component\Form\FormConfigInterface');
+
+ $form->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue($name));
+ $form->expects($this->any())
+ ->method('getConfig')
+ ->will($this->returnValue($config));
+
+ return $form;
+ }
+
+ protected function createForm()
+ {
+ return $this->getBuilder()->getForm();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/PropelCollectionHandlerTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/PropelCollectionHandlerTest.php
new file mode 100644
index 0000000000..b59d723dcc
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Handler/PropelCollectionHandlerTest.php
@@ -0,0 +1,43 @@
+serializer = SerializerBuilder::create()
+ ->addDefaultHandlers() //load PropelCollectionHandler
+ ->build();
+ }
+
+ public function testSerializePropelObjectCollection()
+ {
+ $collection = new \PropelObjectCollection();
+ $collection->setData(array(new TestSubject('lolo'), new TestSubject('pepe')));
+ $json = $this->serializer->serialize($collection, 'json');
+
+ $data = json_decode($json, true);
+
+ $this->assertCount(2, $data); //will fail if PropelCollectionHandler not loaded
+
+ foreach ($data as $testSubject) {
+ $this->assertArrayHasKey('name', $testSubject);
+ }
+ }
+}
+
+class TestSubject
+{
+ protected $name;
+
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/ClassMetadataTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/ClassMetadataTest.php
new file mode 100644
index 0000000000..d1219745de
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/ClassMetadataTest.php
@@ -0,0 +1,168 @@
+
+ *
+ * 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\Metadata;
+
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\ClassMetadata;
+
+class ClassMetadataTest extends \PHPUnit_Framework_TestCase
+{
+ public function getAccessOrderCases()
+ {
+ return [
+ [array('b', 'a'), array('b', 'a')],
+ [array('a', 'b'), array('a', 'b')],
+ [array('b'), array('b', 'a')],
+ [array('a'), array('a', 'b')],
+ [array('foo', 'bar'), array('b', 'a')],
+ ];
+ }
+
+ public function testSerialization()
+ {
+ $meta = new PropertyMetadata('JMS\Serializer\Tests\Metadata\PropertyMetadataOrder', 'b');
+ $restoredMeta = unserialize(serialize($meta));
+ $this->assertEquals($meta, $restoredMeta);
+ }
+
+ /**
+ * @dataProvider getAccessOrderCases
+ */
+ public function testSetAccessorOrderCustom(array $order, array $expected)
+ {
+ $metadata = new ClassMetadata('JMS\Serializer\Tests\Metadata\PropertyMetadataOrder');
+ $metadata->addPropertyMetadata(new PropertyMetadata('JMS\Serializer\Tests\Metadata\PropertyMetadataOrder', 'b'));
+ $metadata->addPropertyMetadata(new PropertyMetadata('JMS\Serializer\Tests\Metadata\PropertyMetadataOrder', 'a'));
+ $this->assertEquals(array('b', 'a'), array_keys($metadata->propertyMetadata));
+
+ $metadata->setAccessorOrder(ClassMetadata::ACCESSOR_ORDER_CUSTOM, $order);
+ $this->assertEquals($expected, array_keys($metadata->propertyMetadata));
+ }
+
+ public function testSetAccessorOrderAlphabetical()
+ {
+ $metadata = new ClassMetadata('JMS\Serializer\Tests\Metadata\PropertyMetadataOrder');
+ $metadata->addPropertyMetadata(new PropertyMetadata('JMS\Serializer\Tests\Metadata\PropertyMetadataOrder', 'b'));
+ $metadata->addPropertyMetadata(new PropertyMetadata('JMS\Serializer\Tests\Metadata\PropertyMetadataOrder', 'a'));
+ $this->assertEquals(array('b', 'a'), array_keys($metadata->propertyMetadata));
+
+ $metadata->setAccessorOrder(ClassMetadata::ACCESSOR_ORDER_ALPHABETICAL);
+ $this->assertEquals(array('a', 'b'), array_keys($metadata->propertyMetadata));
+ }
+
+ /**
+ * @dataProvider providerPublicMethodData
+ */
+ public function testAccessorTypePublicMethod($property, $getterInit, $setterInit, $getterName, $setterName)
+ {
+ $object = new PropertyMetadataPublicMethod();
+
+ $metadata = new PropertyMetadata(get_class($object), $property);
+ $metadata->setAccessor(PropertyMetadata::ACCESS_TYPE_PUBLIC_METHOD, $getterInit, $setterInit);
+
+ $this->assertEquals($getterName, $metadata->getter);
+ $this->assertEquals($setterName, $metadata->setter);
+
+ $metadata->setValue($object, 'x');
+
+ $this->assertEquals(sprintf('%1$s:%1$s:x', strtoupper($property)), $metadata->getValue($object));
+ }
+
+ /**
+ * @dataProvider providerPublicMethodException
+ */
+ public function testAccessorTypePublicMethodException($getter, $setter, $message)
+ {
+ $this->setExpectedException('\JMS\Serializer\Exception\RuntimeException', $message);
+
+ $object = new PropertyMetadataPublicMethod();
+
+ $metadata = new PropertyMetadata(get_class($object), 'e');
+ $metadata->setAccessor(PropertyMetadata::ACCESS_TYPE_PUBLIC_METHOD, $getter, $setter);
+ }
+
+ public function providerPublicMethodData()
+ {
+ return array(
+ array('a', null, null, 'geta', 'seta'),
+ array('b', null, null, 'isb', 'setb'),
+ array('c', null, null, 'hasc', 'setc'),
+ array('d', 'fetchd', 'saved', 'fetchd', 'saved')
+ );
+ }
+
+ public function providerPublicMethodException()
+ {
+ return array(
+ array(null, null, 'a public getE method, nor a public isE method, nor a public hasE method in class'),
+ array(null, 'setx', 'a public getE method, nor a public isE method, nor a public hasE method in class'),
+ array('getx', null, 'no public setE method in class'),
+ );
+ }
+}
+
+class PropertyMetadataOrder
+{
+ private $b, $a;
+}
+
+class PropertyMetadataPublicMethod
+{
+ private $a, $b, $c, $d, $e;
+
+ public function getA()
+ {
+ return 'A:' . $this->a;
+ }
+
+ public function setA($a)
+ {
+ $this->a = 'A:' . $a;
+ }
+
+ public function isB()
+ {
+ return 'B:' . $this->b;
+ }
+
+ public function setB($b)
+ {
+ $this->b = 'B:' . $b;
+ }
+
+ public function hasC()
+ {
+ return 'C:' . $this->c;
+ }
+
+ public function setC($c)
+ {
+ $this->c = 'C:' . $c;
+ }
+
+ public function fetchD()
+ {
+ return 'D:' . $this->d;
+ }
+
+ public function saveD($d)
+ {
+ $this->d = 'D:' . $d;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/AnnotationDriverTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/AnnotationDriverTest.php
new file mode 100644
index 0000000000..419d11eb94
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/AnnotationDriverTest.php
@@ -0,0 +1,30 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use Doctrine\Common\Annotations\AnnotationReader;
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+
+class AnnotationDriverTest extends BaseDriverTest
+{
+ protected function getDriver()
+ {
+ return new AnnotationDriver(new AnnotationReader());
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/BaseDriverTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/BaseDriverTest.php
new file mode 100644
index 0000000000..0f4824a6af
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/BaseDriverTest.php
@@ -0,0 +1,485 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\ExpressionPropertyMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\VirtualPropertyMetadata;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorChild;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorParent;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorChild;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorParent;
+use JMS\Serializer\Tests\Fixtures\ParentSkipWithEmptyChild;
+use Metadata\Driver\DriverInterface;
+
+abstract class BaseDriverTest extends \PHPUnit_Framework_TestCase
+{
+ public function testLoadBlogPostMetadata()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $this->assertNotNull($m);
+ $this->assertEquals('blog-post', $m->xmlRootName);
+ $this->assertCount(4, $m->xmlNamespaces);
+ $this->assertArrayHasKey('', $m->xmlNamespaces);
+ $this->assertEquals('http://example.com/namespace', $m->xmlNamespaces['']);
+ $this->assertArrayHasKey('gd', $m->xmlNamespaces);
+ $this->assertEquals('http://schemas.google.com/g/2005', $m->xmlNamespaces['gd']);
+ $this->assertArrayHasKey('atom', $m->xmlNamespaces);
+ $this->assertEquals('http://www.w3.org/2005/Atom', $m->xmlNamespaces['atom']);
+ $this->assertArrayHasKey('dc', $m->xmlNamespaces);
+ $this->assertEquals('http://purl.org/dc/elements/1.1/', $m->xmlNamespaces['dc']);
+
+ $p = new PropertyMetadata($m->name, 'id');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->groups = array("comments","post");
+ $p->xmlElementCData = false;
+ $this->assertEquals($p, $m->propertyMetadata['id']);
+
+ $p = new PropertyMetadata($m->name, 'title');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->groups = array("comments","post");
+ $p->xmlNamespace = "http://purl.org/dc/elements/1.1/";
+ $this->assertEquals($p, $m->propertyMetadata['title']);
+
+ $p = new PropertyMetadata($m->name, 'createdAt');
+ $p->type = array('name' => 'DateTime', 'params' => array());
+ $p->xmlAttribute = true;
+ $this->assertEquals($p, $m->propertyMetadata['createdAt']);
+
+ $p = new PropertyMetadata($m->name, 'published');
+ $p->type = array('name' => 'boolean', 'params' => array());
+ $p->serializedName = 'is_published';
+ $p->xmlAttribute = true;
+ $p->groups = array("post");
+ $this->assertEquals($p, $m->propertyMetadata['published']);
+
+ $p = new PropertyMetadata($m->name, 'etag');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlAttribute = true;
+ $p->groups = array("post");
+ $p->xmlNamespace = "http://schemas.google.com/g/2005";
+ $this->assertEquals($p, $m->propertyMetadata['etag']);
+
+ $p = new PropertyMetadata($m->name, 'comments');
+ $p->type = array('name' => 'ArrayCollection', 'params' => array(array('name' => 'JMS\Serializer\Tests\Fixtures\Comment', 'params' => array())));
+ $p->xmlCollection = true;
+ $p->xmlCollectionInline = true;
+ $p->xmlEntryName = 'comment';
+ $p->groups = array("comments");
+ $this->assertEquals($p, $m->propertyMetadata['comments']);
+
+ $p = new PropertyMetadata($m->name, 'author');
+ $p->type = array('name' => 'JMS\Serializer\Tests\Fixtures\Author', 'params' => array());
+ $p->groups = array("post");
+ $p->xmlNamespace = 'http://www.w3.org/2005/Atom';
+ $this->assertEquals($p, $m->propertyMetadata['author']);
+
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Price'));
+ $this->assertNotNull($m);
+
+ $p = new PropertyMetadata($m->name, 'price');
+ $p->type = array('name' => 'float', 'params' => array());
+ $p->xmlValue = true;
+ $this->assertEquals($p, $m->propertyMetadata['price']);
+ }
+
+ public function testXMLListAbsentNode()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\ObjectWithAbsentXmlListNode'));
+
+ $this->assertArrayHasKey('absent', $m->propertyMetadata);
+ $this->assertArrayHasKey('present', $m->propertyMetadata);
+ $this->assertArrayHasKey('skipDefault', $m->propertyMetadata);
+
+ $this->assertTrue($m->propertyMetadata['absent']->xmlCollectionSkipWhenEmpty);
+ $this->assertTrue($m->propertyMetadata['skipDefault']->xmlCollectionSkipWhenEmpty);
+ $this->assertFalse($m->propertyMetadata['present']->xmlCollectionSkipWhenEmpty);
+ }
+
+ public function testVirtualProperty()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\ObjectWithVirtualProperties'));
+
+ $this->assertArrayHasKey('existField', $m->propertyMetadata);
+ $this->assertArrayHasKey('virtualValue', $m->propertyMetadata);
+ $this->assertArrayHasKey('virtualSerializedValue', $m->propertyMetadata);
+ $this->assertArrayHasKey('typedVirtualProperty', $m->propertyMetadata);
+
+ $this->assertEquals($m->propertyMetadata['virtualSerializedValue']->serializedName, 'test', 'Serialized name is missing' );
+
+ $p = new VirtualPropertyMetadata($m->name, 'virtualValue');
+ $p->getter = 'getVirtualValue';
+
+ $this->assertEquals($p, $m->propertyMetadata['virtualValue']);
+ }
+
+ public function testXmlKeyValuePairs()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\ObjectWithXmlKeyValuePairs'));
+
+ $this->assertArrayHasKey('array', $m->propertyMetadata);
+ $this->assertTrue($m->propertyMetadata['array']->xmlKeyValuePairs);
+ }
+
+ public function testExpressionVirtualPropertyWithExcludeAll()
+ {
+ $a = new \JMS\Serializer\Tests\Fixtures\ObjectWithExpressionVirtualPropertiesAndExcludeAll();
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass($a));;
+
+ $this->assertArrayHasKey('virtualValue', $m->propertyMetadata);
+
+ $p = new ExpressionPropertyMetadata($m->name, 'virtualValue', 'object.getVirtualValue()');
+ $this->assertEquals($p, $m->propertyMetadata['virtualValue']);
+ }
+
+ public function testVirtualPropertyWithExcludeAll()
+ {
+ $a = new \JMS\Serializer\Tests\Fixtures\ObjectWithVirtualPropertiesAndExcludeAll();
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass($a));
+
+ $this->assertArrayHasKey('virtualValue', $m->propertyMetadata);
+
+ $p = new VirtualPropertyMetadata($m->name, 'virtualValue');
+ $p->getter = 'getVirtualValue';
+
+ $this->assertEquals($p, $m->propertyMetadata['virtualValue']);
+ }
+
+ public function testReadOnlyDefinedBeforeGetterAndSetter()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\AuthorReadOnly'));
+
+ $this->assertNotNull($m);
+ }
+
+ public function testExpressionVirtualProperty()
+ {
+ /** @var $m ClassMetadata */
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\AuthorExpressionAccess'));
+
+ $keys = array_keys($m->propertyMetadata);
+ $this->assertEquals(['firstName', 'lastName', 'id'], $keys);
+ }
+
+ public function testLoadDiscriminator()
+ {
+ /** @var $m ClassMetadata */
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Discriminator\Vehicle'));
+
+ $this->assertNotNull($m);
+ $this->assertEquals('type', $m->discriminatorFieldName);
+ $this->assertEquals($m->name, $m->discriminatorBaseClass);
+ $this->assertEquals(
+ array(
+ 'car' => 'JMS\Serializer\Tests\Fixtures\Discriminator\Car',
+ 'moped' => 'JMS\Serializer\Tests\Fixtures\Discriminator\Moped',
+ ),
+ $m->discriminatorMap
+ );
+ }
+
+ public function testLoadXmlDiscriminator()
+ {
+ /** @var $m ClassMetadata */
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass(ObjectWithXmlAttributeDiscriminatorParent::class));
+
+ $this->assertNotNull($m);
+ $this->assertEquals('type', $m->discriminatorFieldName);
+ $this->assertEquals($m->name, $m->discriminatorBaseClass);
+ $this->assertEquals(
+ array(
+ 'child' => ObjectWithXmlAttributeDiscriminatorChild::class,
+ ),
+ $m->discriminatorMap
+ );
+ $this->assertTrue($m->xmlDiscriminatorAttribute);
+ $this->assertFalse($m->xmlDiscriminatorCData);
+ }
+
+ public function testLoadXmlDiscriminatorWithNamespaces()
+ {
+ /** @var $m ClassMetadata */
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass(ObjectWithXmlNamespaceDiscriminatorParent::class));
+
+ $this->assertNotNull($m);
+ $this->assertEquals('type', $m->discriminatorFieldName);
+ $this->assertEquals($m->name, $m->discriminatorBaseClass);
+ $this->assertEquals(
+ array(
+ 'child' => ObjectWithXmlNamespaceDiscriminatorChild::class,
+ ),
+ $m->discriminatorMap
+ );
+ $this->assertEquals('http://example.com/', $m->xmlDiscriminatorNamespace);
+ }
+
+ public function testLoadDiscriminatorWithGroup()
+ {
+ /** @var $m ClassMetadata */
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Vehicle'));
+
+ $this->assertNotNull($m);
+ $this->assertEquals('type', $m->discriminatorFieldName);
+ $this->assertEquals(array('foo'), $m->discriminatorGroups);
+ $this->assertEquals($m->name, $m->discriminatorBaseClass);
+ $this->assertEquals(
+ array(
+ 'car' => 'JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Car'
+ ),
+ $m->discriminatorMap
+ );
+ }
+
+ public function testSkipWhenEmptyOption()
+ {
+ /** @var $m ClassMetadata */
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass(ParentSkipWithEmptyChild::class));
+
+ $this->assertNotNull($m);
+
+ $this->assertInstanceOf(PropertyMetadata::class, $m->propertyMetadata['c']);
+ $this->assertInstanceOf(PropertyMetadata::class, $m->propertyMetadata['d']);
+ $this->assertInstanceOf(PropertyMetadata::class, $m->propertyMetadata['child']);
+ $this->assertFalse($m->propertyMetadata['c']->skipWhenEmpty);
+ $this->assertFalse($m->propertyMetadata['d']->skipWhenEmpty);
+ $this->assertTrue($m->propertyMetadata['child']->skipWhenEmpty);
+ }
+
+ public function testLoadDiscriminatorSubClass()
+ {
+ /** @var $m ClassMetadata */
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Discriminator\Car'));
+
+ $this->assertNotNull($m);
+ $this->assertNull($m->discriminatorValue);
+ $this->assertNull($m->discriminatorBaseClass);
+ $this->assertNull($m->discriminatorFieldName);
+ $this->assertEquals(array(), $m->discriminatorMap);
+ }
+
+ public function testLoadXmlObjectWithNamespacesMetadata()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces'));
+ $this->assertNotNull($m);
+ $this->assertEquals('test-object', $m->xmlRootName);
+ $this->assertEquals('http://example.com/namespace', $m->xmlRootNamespace);
+ $this->assertCount(3, $m->xmlNamespaces);
+ $this->assertArrayHasKey('', $m->xmlNamespaces);
+ $this->assertEquals('http://example.com/namespace', $m->xmlNamespaces['']);
+ $this->assertArrayHasKey('gd', $m->xmlNamespaces);
+ $this->assertEquals('http://schemas.google.com/g/2005', $m->xmlNamespaces['gd']);
+ $this->assertArrayHasKey('atom', $m->xmlNamespaces);
+ $this->assertEquals('http://www.w3.org/2005/Atom', $m->xmlNamespaces['atom']);
+
+ $p = new PropertyMetadata($m->name, 'title');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://purl.org/dc/elements/1.1/";
+ $this->assertEquals($p, $m->propertyMetadata['title']);
+
+ $p = new PropertyMetadata($m->name, 'createdAt');
+ $p->type = array('name' => 'DateTime', 'params' => array());
+ $p->xmlAttribute = true;
+ $this->assertEquals($p, $m->propertyMetadata['createdAt']);
+
+ $p = new PropertyMetadata($m->name, 'etag');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlAttribute = true;
+ $p->xmlNamespace = "http://schemas.google.com/g/2005";
+ $this->assertEquals($p, $m->propertyMetadata['etag']);
+
+ $p = new PropertyMetadata($m->name, 'author');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlAttribute = false;
+ $p->xmlNamespace = "http://www.w3.org/2005/Atom";
+ $this->assertEquals($p, $m->propertyMetadata['author']);
+
+ $p = new PropertyMetadata($m->name, 'language');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlAttribute = true;
+ $p->xmlNamespace = "http://purl.org/dc/elements/1.1/";
+ $this->assertEquals($p, $m->propertyMetadata['language']);
+ }
+
+ public function testMaxDepth()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Node'));
+
+ $this->assertEquals(2, $m->propertyMetadata['children']->maxDepth);
+ }
+
+ public function testPersonCData()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Person'));
+
+ $this->assertNotNull($m);
+ $this->assertFalse($m->propertyMetadata['name']->xmlElementCData);
+ }
+
+ public function testXmlNamespaceInheritanceMetadata()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\SimpleClassObject'));
+ $this->assertNotNull($m);
+ $this->assertCount(3, $m->xmlNamespaces);
+ $this->assertArrayHasKey('old_foo', $m->xmlNamespaces);
+ $this->assertEquals('http://old.foo.example.org', $m->xmlNamespaces['old_foo']);
+ $this->assertArrayHasKey('foo', $m->xmlNamespaces);
+ $this->assertEquals('http://foo.example.org', $m->xmlNamespaces['foo']);
+ $this->assertArrayHasKey('new_foo', $m->xmlNamespaces);
+ $this->assertEquals('http://new.foo.example.org', $m->xmlNamespaces['new_foo']);
+ $this->assertCount(3, $m->propertyMetadata);
+
+ $p = new PropertyMetadata($m->name, 'foo');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://old.foo.example.org";
+ $p->xmlAttribute = true;
+ $this->assertEquals($p, $m->propertyMetadata['foo']);
+
+ $p = new PropertyMetadata($m->name, 'bar');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://foo.example.org";
+ $this->assertEquals($p, $m->propertyMetadata['bar']);
+
+ $p = new PropertyMetadata($m->name, 'moo');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://new.foo.example.org";
+ $this->assertEquals($p, $m->propertyMetadata['moo']);
+
+
+ $subm = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\SimpleSubClassObject'));
+ $this->assertNotNull($subm);
+ $this->assertCount(2, $subm->xmlNamespaces);
+ $this->assertArrayHasKey('old_foo', $subm->xmlNamespaces);
+ $this->assertEquals('http://foo.example.org', $subm->xmlNamespaces['old_foo']);
+ $this->assertArrayHasKey('foo', $subm->xmlNamespaces);
+ $this->assertEquals('http://better.foo.example.org', $subm->xmlNamespaces['foo']);
+ $this->assertCount(3, $subm->propertyMetadata);
+
+ $p = new PropertyMetadata($subm->name, 'moo');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://better.foo.example.org";
+ $this->assertEquals($p, $subm->propertyMetadata['moo']);
+
+ $p = new PropertyMetadata($subm->name, 'baz');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://foo.example.org";
+ $this->assertEquals($p, $subm->propertyMetadata['baz']);
+
+ $p = new PropertyMetadata($subm->name, 'qux');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://new.foo.example.org";
+ $this->assertEquals($p, $subm->propertyMetadata['qux']);
+
+ $m->merge($subm);
+ $this->assertNotNull($m);
+ $this->assertCount(3, $m->xmlNamespaces);
+ $this->assertArrayHasKey('old_foo', $m->xmlNamespaces);
+ $this->assertEquals('http://foo.example.org', $m->xmlNamespaces['old_foo']);
+ $this->assertArrayHasKey('foo', $m->xmlNamespaces);
+ $this->assertEquals('http://better.foo.example.org', $m->xmlNamespaces['foo']);
+ $this->assertArrayHasKey('new_foo', $m->xmlNamespaces);
+ $this->assertEquals('http://new.foo.example.org', $m->xmlNamespaces['new_foo']);
+ $this->assertCount(5, $m->propertyMetadata);
+
+ $p = new PropertyMetadata($m->name, 'foo');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://old.foo.example.org";
+ $p->xmlAttribute = true;
+ $p->class = 'JMS\Serializer\Tests\Fixtures\SimpleClassObject';
+ $this->assetMetadataEquals($p, $m->propertyMetadata['foo']);
+
+ $p = new PropertyMetadata($m->name, 'bar');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://foo.example.org";
+ $p->class = 'JMS\Serializer\Tests\Fixtures\SimpleClassObject';
+ $this->assetMetadataEquals($p, $m->propertyMetadata['bar']);
+
+ $p = new PropertyMetadata($m->name, 'moo');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://better.foo.example.org";
+ $this->assetMetadataEquals($p, $m->propertyMetadata['moo']);
+
+ $p = new PropertyMetadata($m->name, 'baz');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://foo.example.org";
+ $this->assetMetadataEquals($p, $m->propertyMetadata['baz']);
+
+ $p = new PropertyMetadata($m->name, 'qux');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->xmlNamespace = "http://new.foo.example.org";
+ $this->assetMetadataEquals($p, $m->propertyMetadata['qux']);
+ }
+
+ private function assetMetadataEquals(PropertyMetadata $expected, PropertyMetadata $actual)
+ {
+ $expectedVars = get_object_vars($expected);
+ $actualVars = get_object_vars($actual);
+
+ $expectedReflection = (array)$expectedVars['reflection'];
+ $actualReflection = (array)$actualVars['reflection'];
+
+ // HHVM bug with class property
+ unset($expectedVars['reflection'], $actualVars['reflection']);
+ $this->assertEquals($expectedVars, $actualVars);
+
+ // HHVM bug with class property
+ if (isset($expectedReflection['info']) || isset($actualReflection['info'])){
+ $expectedReflection['class'] = $expectedReflection['info']['class'];
+ $actualReflection['class'] = $actualReflection['info']['class'];
+ }
+
+ $this->assertEquals($expectedReflection, $actualReflection);
+ }
+
+ public function testHandlerCallbacks()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\ObjectWithHandlerCallbacks'));
+
+ $this->assertEquals('toJson', $m->handlerCallbacks[GraphNavigator::DIRECTION_SERIALIZATION]['json']);
+ $this->assertEquals('toXml', $m->handlerCallbacks[GraphNavigator::DIRECTION_SERIALIZATION]['xml']);
+ }
+
+ public function testExclusionIf()
+ {
+ $class = 'JMS\Serializer\Tests\Fixtures\PersonSecret';
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass($class));
+
+ $p = new PropertyMetadata($class, 'name');
+ $p->type = array('name' => 'string', 'params' => array());
+ $this->assertEquals($p, $m->propertyMetadata['name']);
+
+ $p = new PropertyMetadata($class, 'gender');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->excludeIf = "show_data('gender')";
+ $this->assertEquals($p, $m->propertyMetadata['gender']);
+
+ $p = new PropertyMetadata($class, 'age');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->excludeIf = "!(show_data('age'))";
+ $this->assertEquals($p, $m->propertyMetadata['age']);
+ }
+
+
+ /**
+ * @return DriverInterface
+ */
+ abstract protected function getDriver();
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/DoctrineDriverTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/DoctrineDriverTest.php
new file mode 100644
index 0000000000..c4f8ae1b87
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/DoctrineDriverTest.php
@@ -0,0 +1,143 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+use JMS\Serializer\Metadata\Driver\DoctrineTypeDriver;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\ORM\Configuration;
+use Doctrine\ORM\EntityManager;
+use Doctrine\ORM\Mapping\Driver\AnnotationDriver as DoctrineDriver;
+
+class DoctrineDriverTest extends \PHPUnit_Framework_TestCase
+{
+ public function getMetadata()
+ {
+ $refClass = new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Doctrine\BlogPost');
+ $metadata = $this->getDoctrineDriver()->loadMetadataForClass($refClass);
+
+ return $metadata;
+ }
+
+ public function testTypelessPropertyIsGivenTypeFromDoctrineMetadata()
+ {
+ $metadata = $this->getMetadata();
+
+ $this->assertEquals(
+ array('name'=> 'DateTime', 'params' => array()),
+ $metadata->propertyMetadata['createdAt']->type
+ );
+ }
+
+ public function testSingleValuedAssociationIsProperlyHinted()
+ {
+ $metadata = $this->getMetadata();
+ $this->assertEquals(
+ array('name'=> 'JMS\Serializer\Tests\Fixtures\Doctrine\Author', 'params' => array()),
+ $metadata->propertyMetadata['author']->type
+ );
+ }
+
+ public function testMultiValuedAssociationIsProperlyHinted()
+ {
+ $metadata = $this->getMetadata();
+
+ $this->assertEquals(
+ array('name'=> 'ArrayCollection', 'params' => array(
+ array('name' => 'JMS\Serializer\Tests\Fixtures\Doctrine\Comment', 'params' => array()))
+ ),
+ $metadata->propertyMetadata['comments']->type
+ );
+ }
+
+ public function testTypeGuessByDoctrineIsOverwrittenByDelegateDriver()
+ {
+ $metadata = $this->getMetadata();
+
+ // This would be guessed as boolean but we've overriden it to integer
+ $this->assertEquals(
+ array('name'=> 'integer', 'params' => array()),
+ $metadata->propertyMetadata['published']->type
+ );
+ }
+
+ public function testUnknownDoctrineTypeDoesNotResultInAGuess()
+ {
+ $metadata = $this->getMetadata();
+ $this->assertNull($metadata->propertyMetadata['slug']->type);
+ }
+
+ public function testNonDoctrineEntityClassIsNotModified()
+ {
+ // Note: Using regular BlogPost fixture here instead of Doctrine fixture
+ // because it has no Doctrine metadata.
+ $refClass = new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost');
+
+ $plainMetadata = $this->getAnnotationDriver()->loadMetadataForClass($refClass);
+ $doctrineMetadata = $this->getDoctrineDriver()->loadMetadataForClass($refClass);
+
+ // Do not compare timestamps
+ if (abs($doctrineMetadata->createdAt - $plainMetadata->createdAt) < 2) {
+ $plainMetadata->createdAt = $doctrineMetadata->createdAt;
+ }
+
+ $this->assertEquals($plainMetadata, $doctrineMetadata);
+ }
+
+ public function testVirtualPropertiesAreNotModified()
+ {
+ $doctrineMetadata = $this->getMetadata();
+ $this->assertNull($doctrineMetadata->propertyMetadata['ref']->type);
+ }
+
+ protected function getEntityManager()
+ {
+ $config = new Configuration();
+ $config->setProxyDir(sys_get_temp_dir() . '/JMSDoctrineTestProxies');
+ $config->setProxyNamespace('JMS\Tests\Proxies');
+ $config->setMetadataDriverImpl(
+ new DoctrineDriver(new AnnotationReader(), __DIR__.'/../../Fixtures/Doctrine')
+ );
+
+ $conn = array(
+ 'driver' => 'pdo_sqlite',
+ 'memory' => true,
+ );
+
+ return EntityManager::create($conn, $config);
+ }
+
+ public function getAnnotationDriver()
+ {
+ return new AnnotationDriver(new AnnotationReader());
+ }
+
+ protected function getDoctrineDriver()
+ {
+ $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $registry->expects($this->atLeastOnce())
+ ->method('getManagerForClass')
+ ->will($this->returnValue($this->getEntityManager()));
+
+ return new DoctrineTypeDriver(
+ $this->getAnnotationDriver(),
+ $registry
+ );
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/DoctrinePHPCRDriverTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/DoctrinePHPCRDriverTest.php
new file mode 100644
index 0000000000..361b0e2929
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/DoctrinePHPCRDriverTest.php
@@ -0,0 +1,127 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+use JMS\Serializer\Metadata\Driver\DoctrinePHPCRTypeDriver;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\ODM\PHPCR\Configuration;
+use Doctrine\ODM\PHPCR\DocumentManager;
+use Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver as DoctrinePHPCRDriver;
+
+class DoctrinePHPCRDriverTest extends \PHPUnit_Framework_TestCase
+{
+ public function getMetadata()
+ {
+ $refClass = new \ReflectionClass('JMS\Serializer\Tests\Fixtures\DoctrinePHPCR\BlogPost');
+ $metadata = $this->getDoctrinePHPCRDriver()->loadMetadataForClass($refClass);
+
+ return $metadata;
+ }
+
+ public function testTypelessPropertyIsGivenTypeFromDoctrineMetadata()
+ {
+ $metadata = $this->getMetadata();
+ $this->assertEquals(
+ array('name'=> 'DateTime', 'params' => array()),
+ $metadata->propertyMetadata['createdAt']->type
+ );
+ }
+
+ public function testSingleValuedAssociationIsProperlyHinted()
+ {
+ $metadata = $this->getMetadata();
+ $this->assertEquals(
+ array('name'=> 'JMS\Serializer\Tests\Fixtures\DoctrinePHPCR\Author', 'params' => array()),
+ $metadata->propertyMetadata['author']->type
+ );
+ }
+
+ public function testMultiValuedAssociationIsProperlyHinted()
+ {
+ $metadata = $this->getMetadata();
+
+ $this->assertEquals(
+ array('name'=> 'ArrayCollection', 'params' => array(
+ array('name' => 'JMS\Serializer\Tests\Fixtures\DoctrinePHPCR\Comment', 'params' => array()))
+ ),
+ $metadata->propertyMetadata['comments']->type
+ );
+ }
+
+ public function testTypeGuessByDoctrineIsOverwrittenByDelegateDriver()
+ {
+ $metadata = $this->getMetadata();
+
+ // This would be guessed as boolean but we've overridden it to integer
+ $this->assertEquals(
+ array('name'=> 'integer', 'params' => array()),
+ $metadata->propertyMetadata['published']->type
+ );
+ }
+
+ public function testNonDoctrineDocumentClassIsNotModified()
+ {
+ // Note: Using regular BlogPost fixture here instead of Doctrine fixture
+ // because it has no Doctrine metadata.
+ $refClass = new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost');
+
+ $plainMetadata = $this->getAnnotationDriver()->loadMetadataForClass($refClass);
+ $doctrineMetadata = $this->getDoctrinePHPCRDriver()->loadMetadataForClass($refClass);
+
+ // Do not compare timestamps
+ if (abs($doctrineMetadata->createdAt - $plainMetadata->createdAt) < 2) {
+ $plainMetadata->createdAt = $doctrineMetadata->createdAt;
+ }
+
+ $this->assertEquals($plainMetadata, $doctrineMetadata);
+ }
+
+ protected function getDocumentManager()
+ {
+ $config = new Configuration();
+ $config->setProxyDir(sys_get_temp_dir() . '/JMSDoctrineTestProxies');
+ $config->setProxyNamespace('JMS\Tests\Proxies');
+ $config->setMetadataDriverImpl(
+ new DoctrinePHPCRDriver(new AnnotationReader(), __DIR__.'/../../Fixtures/DoctrinePHPCR')
+ );
+
+ $session = $this->getMock('PHPCR\SessionInterface');
+
+ return DocumentManager::create($session, $config);
+ }
+
+ public function getAnnotationDriver()
+ {
+ return new AnnotationDriver(new AnnotationReader());
+ }
+
+ protected function getDoctrinePHPCRDriver()
+ {
+ $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $registry->expects($this->atLeastOnce())
+ ->method('getManagerForClass')
+ ->will($this->returnValue($this->getDocumentManager()));
+
+ return new DoctrinePHPCRTypeDriver(
+ $this->getAnnotationDriver(),
+ $registry
+ );
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/PhpDriverTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/PhpDriverTest.php
new file mode 100644
index 0000000000..3ac1d6cff3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/PhpDriverTest.php
@@ -0,0 +1,32 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use Metadata\Driver\FileLocator;
+use JMS\Serializer\Metadata\Driver\PhpDriver;
+
+class PhpDriverTest extends BaseDriverTest
+{
+ protected function getDriver()
+ {
+ return new PhpDriver(new FileLocator(array(
+ 'JMS\Serializer\Tests\Fixtures' => __DIR__.'/php',
+ )));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/XmlDriverTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/XmlDriverTest.php
new file mode 100644
index 0000000000..76e51eec54
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/XmlDriverTest.php
@@ -0,0 +1,96 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use Metadata\Driver\FileLocator;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\Driver\XmlDriver;
+
+class XmlDriverTest extends BaseDriverTest
+{
+ /**
+ * @expectedException JMS\Serializer\Exception\XmlErrorException
+ * @expectedExceptionMessage [FATAL] Start tag expected, '<' not found
+ */
+ public function testInvalidXml()
+ {
+ $driver = $this->getDriver();
+
+ $ref = new \ReflectionMethod($driver, 'loadMetadataFromFile');
+ $ref->setAccessible(true);
+ $ref->invoke($driver, new \ReflectionClass('stdClass'), __DIR__.'/xml/invalid.xml');
+ }
+
+ public function testBlogPostExcludeAllStrategy()
+ {
+ $m = $this->getDriver('exclude_all')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $this->assertArrayHasKey('title', $m->propertyMetadata);
+
+ $excluded = array('createdAt', 'published', 'comments', 'author');
+ foreach ($excluded as $key) {
+ $this->assertArrayNotHasKey($key, $m->propertyMetadata);
+ }
+ }
+
+ public function testBlogPostExcludeNoneStrategy()
+ {
+ $m = $this->getDriver('exclude_none')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $this->assertArrayNotHasKey('title', $m->propertyMetadata);
+
+ $excluded = array('createdAt', 'published', 'comments', 'author');
+ foreach ($excluded as $key) {
+ $this->assertArrayHasKey($key, $m->propertyMetadata);
+ }
+ }
+
+ public function testBlogPostCaseInsensitive()
+ {
+ $m = $this->getDriver('case')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $p = new PropertyMetadata($m->name, 'title');
+ $p->type = array('name' => 'string', 'params' => array());
+ $this->assertEquals($p, $m->propertyMetadata['title']);
+ }
+
+ public function testAccessorAttributes()
+ {
+ $m = $this->getDriver()->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\GetSetObject'));
+
+ $p = new PropertyMetadata($m->name, 'name');
+ $p->type = array('name' => 'string', 'params' => array());
+ $p->getter = 'getTrimmedName';
+ $p->setter = 'setCapitalizedName';
+
+ $this->assertEquals($p, $m->propertyMetadata['name']);
+ }
+
+ protected function getDriver()
+ {
+ $append = '';
+ if (func_num_args() == 1) {
+ $append = '/'.func_get_arg(0);
+ }
+
+ return new XmlDriver(new FileLocator(array(
+ 'JMS\Serializer\Tests\Fixtures' => __DIR__.'/xml'.$append,
+ )));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/YamlDriverTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/YamlDriverTest.php
new file mode 100644
index 0000000000..d295a7f912
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/YamlDriverTest.php
@@ -0,0 +1,97 @@
+
+ *
+ * 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\Metadata\Driver;
+
+use Metadata\Driver\FileLocator;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\Metadata\Driver\YamlDriver;
+
+class YamlDriverTest extends BaseDriverTest
+{
+ public function testAccessorOrderIsInferred()
+ {
+ $m = $this->getDriverForSubDir('accessor_inferred')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Person'));
+ $this->assertEquals(array('age', 'name'), array_keys($m->propertyMetadata));
+ }
+
+ public function testShortExposeSyntax()
+ {
+ $m = $this->getDriverForSubDir('short_expose')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\Person'));
+
+ $this->assertArrayHasKey('name', $m->propertyMetadata);
+ $this->assertArrayNotHasKey('age', $m->propertyMetadata);
+ }
+
+ public function testBlogPost()
+ {
+ $m = $this->getDriverForSubDir('exclude_all')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $this->assertArrayHasKey('title', $m->propertyMetadata);
+
+ $excluded = array('createdAt', 'published', 'comments', 'author');
+ foreach ($excluded as $key) {
+ $this->assertArrayNotHasKey($key, $m->propertyMetadata);
+ }
+ }
+
+ public function testBlogPostExcludeNoneStrategy()
+ {
+ $m = $this->getDriverForSubDir('exclude_none')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $this->assertArrayNotHasKey('title', $m->propertyMetadata);
+
+ $excluded = array('createdAt', 'published', 'comments', 'author');
+ foreach ($excluded as $key) {
+ $this->assertArrayHasKey($key, $m->propertyMetadata);
+ }
+ }
+
+ public function testBlogPostCaseInsensitive()
+ {
+ $m = $this->getDriverForSubDir('case')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $p = new PropertyMetadata($m->name, 'title');
+ $p->type = array('name' => 'string', 'params' => array());
+ $this->assertEquals($p, $m->propertyMetadata['title']);
+ }
+
+ public function testBlogPostAccessor()
+ {
+ $m = $this->getDriverForSubDir('accessor')->loadMetadataForClass(new \ReflectionClass('JMS\Serializer\Tests\Fixtures\BlogPost'));
+
+ $this->assertArrayHasKey('title', $m->propertyMetadata);
+
+ $p = new PropertyMetadata($m->name, 'title');
+ $p->getter = 'getOtherTitle';
+ $p->setter = 'setOtherTitle';
+ $this->assertEquals($p, $m->propertyMetadata['title']);
+ }
+
+ private function getDriverForSubDir($subDir = null)
+ {
+ return new YamlDriver(new FileLocator(array(
+ 'JMS\Serializer\Tests\Fixtures' => __DIR__.'/yml' . ($subDir ? '/'.$subDir : ''),
+ )));
+ }
+
+ protected function getDriver()
+ {
+ return $this->getDriverForSubDir();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/AuthorExpressionAccess.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/AuthorExpressionAccess.php
new file mode 100644
index 0000000000..a452ea7777
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/AuthorExpressionAccess.php
@@ -0,0 +1,19 @@
+addPropertyMetadata($p);
+
+$p = new VirtualPropertyMetadata('JMS\Serializer\Tests\Fixtures\AuthorExpressionAccess', 'getLastName');
+$metadata->addPropertyMetadata($p);
+
+$p = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\AuthorExpressionAccess', 'id');
+$metadata->addPropertyMetadata($p);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/AuthorReadOnly.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/AuthorReadOnly.php
new file mode 100644
index 0000000000..d323d6e4da
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/AuthorReadOnly.php
@@ -0,0 +1,7 @@
+xmlRootName = 'blog-post';
+
+$metadata->registerNamespace('http://example.com/namespace');
+$metadata->registerNamespace('http://schemas.google.com/g/2005', 'gd');
+$metadata->registerNamespace('http://www.w3.org/2005/Atom', 'atom');
+$metadata->registerNamespace('http://purl.org/dc/elements/1.1/', 'dc');
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\BlogPost', 'id');
+$pMetadata->setType('string');
+$pMetadata->groups = array('comments','post');
+$pMetadata->xmlElementCData = false;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\BlogPost', 'title');
+$pMetadata->setType('string');
+$pMetadata->groups = array('comments','post');
+$pMetadata->xmlNamespace = "http://purl.org/dc/elements/1.1/";
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\BlogPost', 'createdAt');
+$pMetadata->setType('DateTime');
+$pMetadata->xmlAttribute = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\BlogPost', 'published');
+$pMetadata->setType('boolean');
+$pMetadata->serializedName = 'is_published';
+$pMetadata->groups = array('post');
+$pMetadata->xmlAttribute = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\BlogPost', 'etag');
+$pMetadata->setType('string');
+$pMetadata->groups = array('post');
+$pMetadata->xmlAttribute = true;
+$pMetadata->xmlNamespace = 'http://schemas.google.com/g/2005';
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\BlogPost', 'comments');
+$pMetadata->setType('ArrayCollection');
+$pMetadata->xmlCollection = true;
+$pMetadata->xmlCollectionInline = true;
+$pMetadata->xmlEntryName = 'comment';
+$pMetadata->groups = array('comments');
+
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\BlogPost', 'author');
+$pMetadata->setType('JMS\Serializer\Tests\Fixtures\Author');
+$pMetadata->groups = array('post');
+$pMetadata->xmlNamespace = 'http://www.w3.org/2005/Atom';
+
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.Car.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.Car.php
new file mode 100644
index 0000000000..a3b07b5001
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.Car.php
@@ -0,0 +1,7 @@
+setDiscriminator('type', array(
+ 'child' => 'JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorChild'
+));
+$metadata->xmlDiscriminatorAttribute = true;
+$metadata->xmlDiscriminatorCData = false;
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.php
new file mode 100644
index 0000000000..a10ee1f520
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.php
@@ -0,0 +1,11 @@
+setDiscriminator('type', array(
+ 'child' => 'JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorChild'
+));
+$metadata->xmlDiscriminatorNamespace = 'http://example.com/';
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.Vehicle.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.Vehicle.php
new file mode 100644
index 0000000000..9267162a4a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Discriminator.Vehicle.php
@@ -0,0 +1,16 @@
+setDiscriminator('type', array(
+ 'car' => 'JMS\Serializer\Tests\Fixtures\Discriminator\Car',
+ 'moped' => 'JMS\Serializer\Tests\Fixtures\Discriminator\Moped',
+));
+
+$km = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\Discriminator\Vehicle', 'km');
+$km->setType('integer');
+$metadata->addPropertyMetadata($km);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/DiscriminatorGroup.Vehicle.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/DiscriminatorGroup.Vehicle.php
new file mode 100644
index 0000000000..792d93ff7a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/DiscriminatorGroup.Vehicle.php
@@ -0,0 +1,15 @@
+setDiscriminator('type', array(
+ 'car' => 'JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Car',
+), array('foo'));
+
+$km = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Vehicle', 'km');
+$km->setType('integer');
+$metadata->addPropertyMetadata($km);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Node.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Node.php
new file mode 100644
index 0000000000..782c9ab29a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Node.php
@@ -0,0 +1,12 @@
+maxDepth = 2;
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithAbsentXmlListNode.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithAbsentXmlListNode.php
new file mode 100644
index 0000000000..3599ac3f4a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithAbsentXmlListNode.php
@@ -0,0 +1,23 @@
+xmlCollectionSkipWhenEmpty = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata($className, 'present');
+$pMetadata->xmlCollectionSkipWhenEmpty = false;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata($className, 'skipDefault');
+$metadata->addPropertyMetadata($pMetadata);
+
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithExpressionVirtualPropertiesAndExcludeAll.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithExpressionVirtualPropertiesAndExcludeAll.php
new file mode 100644
index 0000000000..b6365ecac4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithExpressionVirtualPropertiesAndExcludeAll.php
@@ -0,0 +1,13 @@
+addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithHandlerCallbacks.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithHandlerCallbacks.php
new file mode 100644
index 0000000000..5edaa0c675
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithHandlerCallbacks.php
@@ -0,0 +1,16 @@
+type = 'string';
+$metadata->addPropertyMetadata($pMetadata);
+
+$metadata->addHandlerCallback(GraphNavigator::DIRECTION_SERIALIZATION, 'json', 'toJson');
+$metadata->addHandlerCallback(GraphNavigator::DIRECTION_SERIALIZATION, 'xml', 'toXml');
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithVirtualProperties.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithVirtualProperties.php
new file mode 100644
index 0000000000..913688bfd5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithVirtualProperties.php
@@ -0,0 +1,28 @@
+addPropertyMetadata($pMetadata);
+
+$pMetadata = new VirtualPropertyMetadata($className, 'virtualValue');
+$pMetadata->getter = 'getVirtualValue';
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new VirtualPropertyMetadata($className, 'virtualSerializedValue');
+$pMetadata->getter = 'getVirtualSerializedValue';
+$pMetadata->serializedName = 'test';
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new VirtualPropertyMetadata($className, 'typedVirtualProperty');
+$pMetadata->getter = 'getTypedVirtualProperty';
+$pMetadata->setType('integer');
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithVirtualPropertiesAndExcludeAll.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithVirtualPropertiesAndExcludeAll.php
new file mode 100644
index 0000000000..9feef55f27
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithVirtualPropertiesAndExcludeAll.php
@@ -0,0 +1,14 @@
+getter = 'getVirtualValue';
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithXmlKeyValuePairs.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithXmlKeyValuePairs.php
new file mode 100644
index 0000000000..ca1115b009
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithXmlKeyValuePairs.php
@@ -0,0 +1,13 @@
+xmlKeyValuePairs = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithXmlNamespaces.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithXmlNamespaces.php
new file mode 100644
index 0000000000..5904dc6744
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ObjectWithXmlNamespaces.php
@@ -0,0 +1,41 @@
+xmlRootName = 'test-object';
+$metadata->xmlRootNamespace = 'http://example.com/namespace';
+
+$metadata->registerNamespace('http://example.com/namespace');
+$metadata->registerNamespace('http://schemas.google.com/g/2005', 'gd');
+$metadata->registerNamespace('http://www.w3.org/2005/Atom', 'atom');
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces', 'title');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = "http://purl.org/dc/elements/1.1/";
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces', 'createdAt');
+$pMetadata->setType('DateTime');
+$pMetadata->xmlAttribute = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces', 'etag');
+$pMetadata->setType('string');
+$pMetadata->xmlAttribute = true;
+$pMetadata->xmlNamespace = 'http://schemas.google.com/g/2005';
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces', 'author');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = 'http://www.w3.org/2005/Atom';
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces', 'language');
+$pMetadata->setType('string');
+$pMetadata->xmlAttribute = true;
+$pMetadata->xmlNamespace = 'http://purl.org/dc/elements/1.1/';
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ParentSkipWithEmptyChild.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ParentSkipWithEmptyChild.php
new file mode 100644
index 0000000000..537430f3f0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/ParentSkipWithEmptyChild.php
@@ -0,0 +1,19 @@
+name, 'c');
+$metadata->addPropertyMetadata($pMeta);
+
+$pMeta = new PropertyMetadata($metadata->name, 'd');
+$metadata->addPropertyMetadata($pMeta);
+
+$pMeta = new PropertyMetadata($metadata->name, 'child');
+$pMeta->skipWhenEmpty = true;
+
+$metadata->addPropertyMetadata($pMeta);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Person.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Person.php
new file mode 100644
index 0000000000..1de706f281
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Person.php
@@ -0,0 +1,20 @@
+xmlRootName = 'child';
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\Person', 'name');
+$pMetadata->setType('string');
+$pMetadata->xmlValue = true;
+$pMetadata->xmlElementCData = false;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\Person', 'age');
+$pMetadata->setType('integer');
+$pMetadata->xmlAttribute = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/PersonSecret.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/PersonSecret.php
new file mode 100644
index 0000000000..065ea45579
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/PersonSecret.php
@@ -0,0 +1,22 @@
+setType('string');
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\PersonSecret', 'gender');
+$pMetadata->setType('string');
+$pMetadata->excludeIf = "show_data('gender')";
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\PersonSecret', 'age');
+$pMetadata->setType('string');
+$pMetadata->excludeIf = "!(show_data('age'))";
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Price.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Price.php
new file mode 100644
index 0000000000..541bcd89dc
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/Price.php
@@ -0,0 +1,13 @@
+setType('float');
+$pMetadata->xmlValue = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/SimpleClassObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/SimpleClassObject.php
new file mode 100644
index 0000000000..8baf68a629
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/SimpleClassObject.php
@@ -0,0 +1,28 @@
+registerNamespace('http://foo.example.org', 'foo');
+$metadata->registerNamespace('http://old.foo.example.org', 'old_foo');
+$metadata->registerNamespace('http://new.foo.example.org', 'new_foo');
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\SimpleClassObject', 'foo');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = "http://old.foo.example.org";
+$pMetadata->xmlAttribute = true;
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\SimpleClassObject', 'bar');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = "http://foo.example.org";
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\SimpleClassObject', 'moo');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = "http://new.foo.example.org";
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/SimpleSubClassObject.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/SimpleSubClassObject.php
new file mode 100644
index 0000000000..ed750857ef
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/php/SimpleSubClassObject.php
@@ -0,0 +1,26 @@
+registerNamespace('http://better.foo.example.org', 'foo');
+$metadata->registerNamespace('http://foo.example.org', 'old_foo');
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\SimpleSubClassObject', 'moo');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = "http://better.foo.example.org";
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\SimpleSubClassObject', 'baz');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = "http://foo.example.org";
+$metadata->addPropertyMetadata($pMetadata);
+
+$pMetadata = new PropertyMetadata('JMS\Serializer\Tests\Fixtures\SimpleSubClassObject', 'qux');
+$pMetadata->setType('string');
+$pMetadata->xmlNamespace = "http://new.foo.example.org";
+$metadata->addPropertyMetadata($pMetadata);
+
+return $metadata;
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorExpressionAccess.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorExpressionAccess.xml
new file mode 100644
index 0000000000..426ed6f5eb
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorExpressionAccess.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorReadOnly.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorReadOnly.xml
new file mode 100644
index 0000000000..d145ced786
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorReadOnly.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorReadOnlyPerClass.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorReadOnlyPerClass.xml
new file mode 100644
index 0000000000..b7a140fe89
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/AuthorReadOnlyPerClass.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/BlogPost.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/BlogPost.xml
new file mode 100644
index 0000000000..98fb667c06
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/BlogPost.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Car.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Car.xml
new file mode 100644
index 0000000000..638d67bcb7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Car.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Moped.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Moped.xml
new file mode 100644
index 0000000000..b46eca19a3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Moped.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.ObjectWithXmlAttributeDiscriminatorParent.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.ObjectWithXmlAttributeDiscriminatorParent.xml
new file mode 100644
index 0000000000..5a5ac6eb4f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.ObjectWithXmlAttributeDiscriminatorParent.xml
@@ -0,0 +1,9 @@
+
+
+
+ JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorChild
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.xml
new file mode 100644
index 0000000000..ff021cc7fb
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.xml
@@ -0,0 +1,9 @@
+
+
+
+ JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorChild
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Vehicle.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Vehicle.xml
new file mode 100644
index 0000000000..252c5a3776
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Discriminator.Vehicle.xml
@@ -0,0 +1,8 @@
+
+
+
+ JMS\Serializer\Tests\Fixtures\Discriminator\Car
+ JMS\Serializer\Tests\Fixtures\Discriminator\Moped
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/DiscriminatorGroup.Vehicle.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/DiscriminatorGroup.Vehicle.xml
new file mode 100644
index 0000000000..4b40bbb7c9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/DiscriminatorGroup.Vehicle.xml
@@ -0,0 +1,10 @@
+
+
+
+ JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Car
+
+ foo
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/GetSetObject.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/GetSetObject.xml
new file mode 100644
index 0000000000..1835a5ba60
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/GetSetObject.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Node.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Node.xml
new file mode 100644
index 0000000000..fd4162c099
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Node.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithAbsentXmlListNode.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithAbsentXmlListNode.xml
new file mode 100644
index 0000000000..5ebeb9aec0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithAbsentXmlListNode.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ array
+
+
+
+ array
+
+
+
+ array
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithExpressionVirtualPropertiesAndExcludeAll.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithExpressionVirtualPropertiesAndExcludeAll.xml
new file mode 100644
index 0000000000..0219cbe11d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithExpressionVirtualPropertiesAndExcludeAll.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithHandlerCallbacks.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithHandlerCallbacks.xml
new file mode 100644
index 0000000000..14202907c7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithHandlerCallbacks.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithVirtualProperties.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithVirtualProperties.xml
new file mode 100644
index 0000000000..9f65def74a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithVirtualProperties.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithVirtualPropertiesAndExcludeAll.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithVirtualPropertiesAndExcludeAll.xml
new file mode 100644
index 0000000000..8128445d39
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithVirtualPropertiesAndExcludeAll.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithXmlKeyValuePairs.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithXmlKeyValuePairs.xml
new file mode 100644
index 0000000000..6cabc2ca0b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithXmlKeyValuePairs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithXmlNamespaces.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithXmlNamespaces.xml
new file mode 100644
index 0000000000..c9a0b5f7d0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ObjectWithXmlNamespaces.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ParentSkipWithEmptyChild.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ParentSkipWithEmptyChild.xml
new file mode 100644
index 0000000000..30b8643c84
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/ParentSkipWithEmptyChild.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Person.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Person.xml
new file mode 100644
index 0000000000..a723e7baf5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Person.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/PersonSecret.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/PersonSecret.xml
new file mode 100644
index 0000000000..141f79504d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/PersonSecret.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Price.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Price.xml
new file mode 100644
index 0000000000..1e6c31fc7d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/Price.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/SimpleClassObject.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/SimpleClassObject.xml
new file mode 100644
index 0000000000..bdd17116ca
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/SimpleClassObject.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/SimpleSubClassObject.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/SimpleSubClassObject.xml
new file mode 100644
index 0000000000..8acd396227
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/SimpleSubClassObject.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/case/BlogPost.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/case/BlogPost.xml
new file mode 100644
index 0000000000..663ccd6351
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/case/BlogPost.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/exclude_all/BlogPost.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/exclude_all/BlogPost.xml
new file mode 100644
index 0000000000..a0e77c52a0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/exclude_all/BlogPost.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/exclude_none/BlogPost.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/exclude_none/BlogPost.xml
new file mode 100644
index 0000000000..e0394ee2c0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/exclude_none/BlogPost.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/invalid.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/invalid.xml
new file mode 100644
index 0000000000..619d54aec2
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/xml/invalid.xml
@@ -0,0 +1 @@
+This contains no valid XML markup.
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorExpressionAccess.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorExpressionAccess.yml
new file mode 100644
index 0000000000..9d65e6215e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorExpressionAccess.yml
@@ -0,0 +1,11 @@
+JMS\Serializer\Tests\Fixtures\AuthorExpressionAccess:
+ xml_root_name: author
+ properties:
+ id:
+ expose: true
+ virtual_properties:
+ firstName:
+ exp: object.getFirstName()
+ getLastName:
+ expose: true
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorReadOnly.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorReadOnly.yml
new file mode 100644
index 0000000000..07859d2a1d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorReadOnly.yml
@@ -0,0 +1,10 @@
+JMS\Serializer\Tests\Fixtures\AuthorReadOnly:
+ xml_root_name: author
+ properties:
+ id:
+ read_only: true
+ name:
+ serialized_name: full_name
+ access_type: public_method
+ accessor_getter: getName
+ read_only: true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorReadOnlyPerClass.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorReadOnlyPerClass.yml
new file mode 100644
index 0000000000..95f87eee1d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/AuthorReadOnlyPerClass.yml
@@ -0,0 +1,11 @@
+JMS\Serializer\Tests\Fixtures\AuthorReadOnlyPerClass:
+ xml_root_name: author
+ read_only: true
+ properties:
+ id:
+
+ name:
+ serialized_name: full_name
+ access_type: public_method
+ accessor_getter: getName
+ read_only: false
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/BlogPost.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/BlogPost.yml
new file mode 100644
index 0000000000..bb9ff7fa45
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/BlogPost.yml
@@ -0,0 +1,43 @@
+JMS\Serializer\Tests\Fixtures\BlogPost:
+ xml_root_name: blog-post
+ xml_namespaces:
+ "": http://example.com/namespace
+ gd: http://schemas.google.com/g/2005
+ atom: http://www.w3.org/2005/Atom
+ dc: http://purl.org/dc/elements/1.1/
+ properties:
+ id:
+ type: string
+ groups: [comments, post]
+ xml_element:
+ cdata: false
+ title:
+ type: string
+ groups: [comments, post]
+ xml_element:
+ namespace: http://purl.org/dc/elements/1.1/
+ createdAt:
+ type: DateTime
+ xml_attribute: true
+ published:
+ type: boolean
+ serialized_name: is_published
+ xml_attribute: true
+ groups: [post]
+ etag:
+ type: string
+ groups: [post]
+ xml_attribute: true
+ xml_element:
+ namespace: http://schemas.google.com/g/2005
+ comments:
+ type: ArrayCollection
+ groups: [comments]
+ xml_list:
+ inline: true
+ entry_name: comment
+ author:
+ type: JMS\Serializer\Tests\Fixtures\Author
+ groups: [post]
+ xml_element:
+ namespace: http://www.w3.org/2005/Atom
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Car.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Car.yml
new file mode 100644
index 0000000000..9f0fcba4ab
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Car.yml
@@ -0,0 +1 @@
+JMS\Serializer\Tests\Fixtures\Discriminator\Car: { }
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Moped.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Moped.yml
new file mode 100644
index 0000000000..d52a81d4bd
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Moped.yml
@@ -0,0 +1 @@
+JMS\Serializer\Tests\Fixtures\Discriminator\Moped: { }
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.ObjectWithXmlAttributeDiscriminatorParent.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.ObjectWithXmlAttributeDiscriminatorParent.yml
new file mode 100644
index 0000000000..ba572c561a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.ObjectWithXmlAttributeDiscriminatorParent.yml
@@ -0,0 +1,8 @@
+JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorParent:
+ discriminator:
+ field_name: type
+ map:
+ child: JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorChild
+ xml_attribute: true
+ xml_element:
+ cdata: false
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.yml
new file mode 100644
index 0000000000..e04a81d246
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.ObjectWithXmlNamespaceDiscriminatorParent.yml
@@ -0,0 +1,7 @@
+JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorParent:
+ discriminator:
+ field_name: type
+ map:
+ child: JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorChild
+ xml_element:
+ namespace: http://example.com/
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Vehicle.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Vehicle.yml
new file mode 100644
index 0000000000..bcd5dc91f9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Discriminator.Vehicle.yml
@@ -0,0 +1,10 @@
+JMS\Serializer\Tests\Fixtures\Discriminator\Vehicle:
+ discriminator:
+ field_name: type
+ map:
+ car: JMS\Serializer\Tests\Fixtures\Discriminator\Car
+ moped: JMS\Serializer\Tests\Fixtures\Discriminator\Moped
+
+ properties:
+ km:
+ type: integer
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/DiscriminatorGroup.Vehicle.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/DiscriminatorGroup.Vehicle.yml
new file mode 100644
index 0000000000..6d1ad8dbc4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/DiscriminatorGroup.Vehicle.yml
@@ -0,0 +1,10 @@
+JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Vehicle:
+ discriminator:
+ field_name: type
+ map:
+ car: JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Car
+ groups: [foo]
+
+ properties:
+ km:
+ type: integer
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Node.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Node.yml
new file mode 100644
index 0000000000..c4651fd616
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Node.yml
@@ -0,0 +1,4 @@
+JMS\Serializer\Tests\Fixtures\Node:
+ properties:
+ children:
+ max_depth: 2
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithAbsentXmlListNode.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithAbsentXmlListNode.yml
new file mode 100644
index 0000000000..fd4d8e6af1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithAbsentXmlListNode.yml
@@ -0,0 +1,14 @@
+JMS\Serializer\Tests\Fixtures\ObjectWithAbsentXmlListNode:
+ properties:
+ absent:
+ type: array
+ xml_list:
+ skip_when_empty: true
+ present:
+ type: array
+ xml_list:
+ skip_when_empty: false
+ skipDefault:
+ type: array
+ xml_list:
+ inline: false
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithExpressionVirtualPropertiesAndExcludeAll.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithExpressionVirtualPropertiesAndExcludeAll.yml
new file mode 100644
index 0000000000..4b7efd039f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithExpressionVirtualPropertiesAndExcludeAll.yml
@@ -0,0 +1,5 @@
+JMS\Serializer\Tests\Fixtures\ObjectWithExpressionVirtualPropertiesAndExcludeAll:
+ exclusion_policy: all
+ virtual_properties:
+ virtualValue:
+ exp: object.getVirtualValue()
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithHandlerCallbacks.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithHandlerCallbacks.yml
new file mode 100644
index 0000000000..6c5ad76e9f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithHandlerCallbacks.yml
@@ -0,0 +1,8 @@
+JMS\Serializer\Tests\Fixtures\ObjectWithHandlerCallbacks:
+ properties:
+ name:
+ type: string
+ handler_callbacks:
+ serialization:
+ xml: toXml
+ json: toJson
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithVirtualProperties.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithVirtualProperties.yml
new file mode 100644
index 0000000000..9f6a04d3ab
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithVirtualProperties.yml
@@ -0,0 +1,10 @@
+JMS\Serializer\Tests\Fixtures\ObjectWithVirtualProperties:
+ properties:
+ existField:
+ type: string
+ virtual_properties:
+ getVirtualValue: ~
+ getVirtualSerializedValue:
+ serialized_name: test
+ getTypedVirtualProperty:
+ type: integer
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithVirtualPropertiesAndExcludeAll.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithVirtualPropertiesAndExcludeAll.yml
new file mode 100644
index 0000000000..7351bf7ad9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithVirtualPropertiesAndExcludeAll.yml
@@ -0,0 +1,4 @@
+JMS\Serializer\Tests\Fixtures\ObjectWithVirtualPropertiesAndExcludeAll:
+ exclusion_policy: all
+ virtual_properties:
+ getVirtualValue: ~
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithXmlKeyValuePairs.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithXmlKeyValuePairs.yml
new file mode 100644
index 0000000000..2195b67c3b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithXmlKeyValuePairs.yml
@@ -0,0 +1,5 @@
+JMS\Serializer\Tests\Fixtures\ObjectWithXmlKeyValuePairs:
+ properties:
+ array:
+ type: array
+ xml_key_value_pairs: true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithXmlNamespaces.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithXmlNamespaces.yml
new file mode 100644
index 0000000000..3e340d10d3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ObjectWithXmlNamespaces.yml
@@ -0,0 +1,29 @@
+JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces:
+ xml_root_name: test-object
+ xml_root_namespace: http://example.com/namespace
+ xml_namespaces:
+ "": http://example.com/namespace
+ gd: http://schemas.google.com/g/2005
+ atom: http://www.w3.org/2005/Atom
+ properties:
+ title:
+ type: string
+ xml_element:
+ namespace: http://purl.org/dc/elements/1.1/
+ createdAt:
+ type: DateTime
+ xml_attribute: true
+ etag:
+ type: string
+ xml_attribute: true
+ xml_element:
+ namespace: http://schemas.google.com/g/2005
+ author:
+ type: string
+ xml_element:
+ namespace: http://www.w3.org/2005/Atom
+ language:
+ type: string
+ xml_attribute: true
+ xml_element:
+ namespace: http://purl.org/dc/elements/1.1/
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ParentSkipWithEmptyChild.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ParentSkipWithEmptyChild.yml
new file mode 100644
index 0000000000..daf228b970
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/ParentSkipWithEmptyChild.yml
@@ -0,0 +1,8 @@
+JMS\Serializer\Tests\Fixtures\ParentSkipWithEmptyChild:
+ properties:
+ c:
+ type: string
+ d:
+ type: string
+ child:
+ skip_when_empty: true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Person.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Person.yml
new file mode 100644
index 0000000000..c98e8655d3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Person.yml
@@ -0,0 +1,11 @@
+JMS\Serializer\Tests\Fixtures\Person:
+ xml_root_name: child
+ properties:
+ name:
+ type: string
+ xml_value: true
+ xml_element:
+ cdata: false
+ age:
+ type: integer
+ xml_attribute: true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/PersonSecret.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/PersonSecret.yml
new file mode 100644
index 0000000000..88a6f554d3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/PersonSecret.yml
@@ -0,0 +1,10 @@
+JMS\Serializer\Tests\Fixtures\PersonSecret:
+ properties:
+ name:
+ type: string
+ gender:
+ type: string
+ exclude_if: "show_data('gender')"
+ age:
+ type: string
+ expose_if: "show_data('age')"
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Price.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Price.yml
new file mode 100644
index 0000000000..678d53e167
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/Price.yml
@@ -0,0 +1,5 @@
+JMS\Serializer\Tests\Fixtures\Price:
+ properties:
+ price:
+ type: float
+ xml_value: true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/SimpleClassObject.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/SimpleClassObject.yml
new file mode 100644
index 0000000000..609713406e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/SimpleClassObject.yml
@@ -0,0 +1,19 @@
+JMS\Serializer\Tests\Fixtures\SimpleClassObject:
+ xml_namespaces:
+ foo: http://foo.example.org
+ old_foo: http://old.foo.example.org
+ new_foo: http://new.foo.example.org
+ properties:
+ foo:
+ type: string
+ xml_attribute: true
+ xml_element:
+ namespace: http://old.foo.example.org
+ bar:
+ type: string
+ xml_element:
+ namespace: http://foo.example.org
+ moo:
+ type: string
+ xml_element:
+ namespace: http://new.foo.example.org
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/SimpleSubClassObject.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/SimpleSubClassObject.yml
new file mode 100644
index 0000000000..d99c7b113f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/SimpleSubClassObject.yml
@@ -0,0 +1,17 @@
+JMS\Serializer\Tests\Fixtures\SimpleSubClassObject:
+ xml_namespaces:
+ foo: http://better.foo.example.org
+ old_foo: http://foo.example.org
+ properties:
+ moo:
+ type: string
+ xml_element:
+ namespace: http://better.foo.example.org
+ baz:
+ type: string
+ xml_element:
+ namespace: http://foo.example.org
+ qux:
+ type: string
+ xml_element:
+ namespace: http://new.foo.example.org
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/accessor/BlogPost.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/accessor/BlogPost.yml
new file mode 100644
index 0000000000..9b57d39314
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/accessor/BlogPost.yml
@@ -0,0 +1,7 @@
+JMS\Serializer\Tests\Fixtures\BlogPost:
+ xml_root_name: blog-post
+ properties:
+ title:
+ accessor:
+ getter: getOtherTitle
+ setter: setOtherTitle
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/accessor_inferred/Person.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/accessor_inferred/Person.yml
new file mode 100644
index 0000000000..933e03fc3e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/accessor_inferred/Person.yml
@@ -0,0 +1,6 @@
+JMS\Serializer\Tests\Fixtures\Person:
+ custom_accessor_order: ["age", "name"]
+
+ properties:
+ age: ~
+ name: ~
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/case/BlogPost.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/case/BlogPost.yml
new file mode 100644
index 0000000000..4cc2f8ac10
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/case/BlogPost.yml
@@ -0,0 +1,7 @@
+JMS\Serializer\Tests\Fixtures\BlogPost:
+ xml_root_name: blog-post
+ exclusion_policy: all
+ properties:
+ title:
+ type: string
+ expose: TRUE
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/exclude_all/BlogPost.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/exclude_all/BlogPost.yml
new file mode 100644
index 0000000000..419cb7ea67
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/exclude_all/BlogPost.yml
@@ -0,0 +1,7 @@
+JMS\Serializer\Tests\Fixtures\BlogPost:
+ xml_root_name: blog-post
+ exclusion_policy: ALL
+ properties:
+ title:
+ type: string
+ expose: true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/exclude_none/BlogPost.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/exclude_none/BlogPost.yml
new file mode 100644
index 0000000000..7067cf8222
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/exclude_none/BlogPost.yml
@@ -0,0 +1,7 @@
+JMS\Serializer\Tests\Fixtures\BlogPost:
+ xml_root_name: blog-post
+ exclusion_policy: NONE
+ properties:
+ title:
+ type: string
+ exclude: true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/short_expose/Person.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/short_expose/Person.yml
new file mode 100644
index 0000000000..4ab55bea97
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Metadata/Driver/yml/short_expose/Person.yml
@@ -0,0 +1,4 @@
+JMS\Serializer\Tests\Fixtures\Person:
+ exclusion_policy: ALL
+ properties:
+ name: ~
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/ArrayTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/ArrayTest.php
new file mode 100644
index 0000000000..3658ef7108
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/ArrayTest.php
@@ -0,0 +1,123 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Handler\HandlerRegistry;
+use JMS\Serializer\Tests\Fixtures\Author;
+use JMS\Serializer\Tests\Fixtures\AuthorList;
+use JMS\Serializer\Tests\Fixtures\Order;
+use JMS\Serializer\Tests\Fixtures\Price;
+use PhpCollection\Map;
+use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
+use Metadata\MetadataFactory;
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+use Doctrine\Common\Annotations\AnnotationReader;
+use JMS\Serializer\Construction\UnserializeObjectConstructor;
+use JMS\Serializer\JsonSerializationVisitor;
+use JMS\Serializer\JsonDeserializationVisitor;
+use JMS\Serializer\Serializer;
+use JMS\Serializer\Naming\CamelCaseNamingStrategy;
+
+class ArrayTest extends \PHPUnit_Framework_TestCase
+{
+ protected $serializer;
+
+ public function setUp()
+ {
+ $namingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
+
+ $this->serializer = new Serializer(
+ new MetadataFactory(new AnnotationDriver(new AnnotationReader())),
+ new HandlerRegistry(),
+ new UnserializeObjectConstructor(),
+ new Map(array('json' => new JsonSerializationVisitor($namingStrategy))),
+ new Map(array('json' => new JsonDeserializationVisitor($namingStrategy)))
+ );
+ }
+
+ public function testToArray()
+ {
+ $order = new Order(new Price(5));
+
+ $expected = array(
+ 'cost' => array(
+ 'price' => 5
+ )
+ );
+
+ $result = $this->serializer->toArray($order);
+
+ $this->assertEquals($expected, $result);
+ }
+
+ /**
+ * @dataProvider scalarValues
+ */
+ public function testToArrayWithScalar($input)
+ {
+ $this->setExpectedException('JMS\Serializer\Exception\RuntimeException', sprintf(
+ 'The input data of type "%s" did not convert to an array, but got a result of type "%s".',
+ gettype($input),
+ gettype($input)
+ ));
+ $result = $this->serializer->toArray($input);
+
+ $this->assertEquals(array($input), $result);
+ }
+
+ public function scalarValues()
+ {
+ return array(
+ array(42),
+ array(3.14159),
+ array('helloworld'),
+ array(true),
+ );
+ }
+
+ public function testFromArray()
+ {
+ $data = array(
+ 'cost' => array(
+ 'price' => 2.5
+ )
+ );
+
+ $expected = new Order(new Price(2.5));
+ $result = $this->serializer->fromArray($data, 'JMS\Serializer\Tests\Fixtures\Order');
+
+ $this->assertEquals($expected, $result);
+ }
+
+ public function testToArrayReturnsArrayObjectAsArray()
+ {
+ $result = $this->serializer->toArray(new Author(null));
+
+ $this->assertSame(array(), $result);
+ }
+
+ public function testToArrayConversNestedArrayObjects()
+ {
+ $list = new AuthorList();
+ $list->add(new Author(null));
+
+ $result = $this->serializer->toArray($list);
+ $this->assertSame(array('authors' => array(array())), $result);
+ }
+}
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php
new file mode 100644
index 0000000000..8dfb48570e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php
@@ -0,0 +1,1436 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Accessor\DefaultAccessorStrategy;
+use JMS\Serializer\Accessor\ExpressionAccessorStrategy;
+use JMS\Serializer\Context;
+use JMS\Serializer\DeserializationContext;
+use JMS\Serializer\Exclusion\GroupsExclusionStrategy;
+use JMS\Serializer\Expression\ExpressionEvaluator;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Handler\PhpCollectionHandler;
+use JMS\Serializer\Handler\StdClassHandler;
+use JMS\Serializer\SerializationContext;
+use JMS\Serializer\Tests\Fixtures\AuthorExpressionAccess;
+use JMS\Serializer\Tests\Fixtures\DateTimeArraysObject;
+use JMS\Serializer\Tests\Fixtures\Discriminator\Car;
+use JMS\Serializer\Tests\Fixtures\Discriminator\Moped;
+use JMS\Serializer\Tests\Fixtures\Garage;
+use JMS\Serializer\Tests\Fixtures\GroupsUser;
+use JMS\Serializer\Tests\Fixtures\InlineChild;
+use JMS\Serializer\Tests\Fixtures\InlineChildEmpty;
+use JMS\Serializer\Tests\Fixtures\InlineChildWithGroups;
+use JMS\Serializer\Tests\Fixtures\NamedDateTimeArraysObject;
+use JMS\Serializer\Tests\Fixtures\ObjectWithEmptyNullableAndEmptyArrays;
+use JMS\Serializer\Tests\Fixtures\NamedDateTimeImmutableArraysObject;
+use JMS\Serializer\Tests\Fixtures\ObjectWithIntListAndIntMap;
+use JMS\Serializer\Tests\Fixtures\ParentDoNotSkipWithEmptyChild;
+use JMS\Serializer\Tests\Fixtures\ParentSkipWithEmptyChild;
+use JMS\Serializer\Tests\Fixtures\PersonSecret;
+use JMS\Serializer\Tests\Fixtures\PersonSecretMore;
+use JMS\Serializer\Tests\Fixtures\PersonSecretMoreVirtual;
+use JMS\Serializer\Tests\Fixtures\PersonSecretVirtual;
+use JMS\Serializer\Tests\Fixtures\Tag;
+use JMS\Serializer\Tests\Fixtures\Timestamp;
+use JMS\Serializer\Tests\Fixtures\Tree;
+use JMS\Serializer\Tests\Fixtures\VehicleInterfaceGarage;
+use PhpCollection\Sequence;
+use Symfony\Component\ExpressionLanguage\ExpressionFunction;
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
+use Symfony\Component\Form\FormFactoryBuilder;
+use Symfony\Component\Translation\MessageSelector;
+use Symfony\Component\Translation\IdentityTranslator;
+use JMS\Serializer\EventDispatcher\Subscriber\DoctrineProxySubscriber;
+use JMS\Serializer\Handler\HandlerRegistry;
+use JMS\Serializer\EventDispatcher\EventDispatcher;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\Collections\ArrayCollection;
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+use JMS\Serializer\Construction\UnserializeObjectConstructor;
+use JMS\Serializer\Handler\ArrayCollectionHandler;
+use JMS\Serializer\Handler\ConstraintViolationHandler;
+use JMS\Serializer\Handler\DateHandler;
+use JMS\Serializer\Handler\FormErrorHandler;
+use JMS\Serializer\JsonDeserializationVisitor;
+use JMS\Serializer\JsonSerializationVisitor;
+use JMS\Serializer\Naming\CamelCaseNamingStrategy;
+use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
+use JMS\Serializer\Serializer;
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\XmlDeserializationVisitor;
+use JMS\Serializer\XmlSerializationVisitor;
+use JMS\Serializer\YamlSerializationVisitor;
+use JMS\Serializer\Tests\Fixtures\AccessorOrderChild;
+use JMS\Serializer\Tests\Fixtures\AccessorOrderParent;
+use JMS\Serializer\Tests\Fixtures\AccessorOrderMethod;
+use JMS\Serializer\Tests\Fixtures\Author;
+use JMS\Serializer\Tests\Fixtures\Publisher;
+use JMS\Serializer\Tests\Fixtures\AuthorList;
+use JMS\Serializer\Tests\Fixtures\AuthorReadOnly;
+use JMS\Serializer\Tests\Fixtures\BlogPost;
+use JMS\Serializer\Tests\Fixtures\CircularReferenceParent;
+use JMS\Serializer\Tests\Fixtures\Comment;
+use JMS\Serializer\Tests\Fixtures\CurrencyAwareOrder;
+use JMS\Serializer\Tests\Fixtures\CurrencyAwarePrice;
+use JMS\Serializer\Tests\Fixtures\CustomDeserializationObject;
+use JMS\Serializer\Tests\Fixtures\GetSetObject;
+use JMS\Serializer\Tests\Fixtures\MaxDepth\Gh236Foo;
+use JMS\Serializer\Tests\Fixtures\GroupsObject;
+use JMS\Serializer\Tests\Fixtures\InvalidGroupsObject;
+use JMS\Serializer\Tests\Fixtures\IndexedCommentsBlogPost;
+use JMS\Serializer\Tests\Fixtures\InlineParent;
+use JMS\Serializer\Tests\Fixtures\InitializedObjectConstructor;
+use JMS\Serializer\Tests\Fixtures\InitializedBlogPostConstructor;
+use JMS\Serializer\Tests\Fixtures\Log;
+use JMS\Serializer\Tests\Fixtures\ObjectWithLifecycleCallbacks;
+use JMS\Serializer\Tests\Fixtures\ObjectWithVersionedVirtualProperties;
+use JMS\Serializer\Tests\Fixtures\ObjectWithVirtualProperties;
+use JMS\Serializer\Tests\Fixtures\Order;
+use JMS\Serializer\Tests\Fixtures\Price;
+use JMS\Serializer\Tests\Fixtures\SimpleObject;
+use JMS\Serializer\Tests\Fixtures\ObjectWithNullProperty;
+use JMS\Serializer\Tests\Fixtures\SimpleObjectProxy;
+use JMS\Serializer\Tests\Fixtures\Article;
+use JMS\Serializer\Tests\Fixtures\Input;
+use JMS\Serializer\Tests\Fixtures\ObjectWithEmptyHash;
+use Metadata\MetadataFactory;
+use Symfony\Component\Form\Form;
+use Symfony\Component\Form\FormError;
+use Symfony\Component\Validator\Constraints\Time;
+use Symfony\Component\Validator\ConstraintViolation;
+use Symfony\Component\Validator\ConstraintViolationList;
+use PhpCollection\Map;
+use JMS\Serializer\Exclusion\DepthExclusionStrategy;
+use JMS\Serializer\Tests\Fixtures\Node;
+use JMS\Serializer\Tests\Fixtures\AuthorReadOnlyPerClass;
+
+abstract class BaseSerializationTest extends \PHPUnit_Framework_TestCase
+{
+ protected $factory;
+
+ /**
+ * @var EventDispatcher
+ */
+ protected $dispatcher;
+
+ /** @var Serializer */
+ protected $serializer;
+ protected $handlerRegistry;
+ protected $serializationVisitors;
+ protected $deserializationVisitors;
+ protected $objectConstructor;
+
+ public function testSerializeNullArray()
+ {
+ $arr = array('foo' => 'bar', 'baz' => null, null);
+
+ $this->assertEquals(
+ $this->getContent('nullable'),
+ $this->serializer->serialize($arr, $this->getFormat(), SerializationContext::create()->setSerializeNull(true))
+ );
+ }
+
+ public function testSerializeNullArrayExcludingNulls()
+ {
+ $arr = array('foo' => 'bar', 'baz' => null, null);
+
+ $this->assertEquals(
+ $this->getContent('nullable_skip'),
+ $this->serializer->serialize($arr, $this->getFormat(), SerializationContext::create()->setSerializeNull(false))
+ );
+ }
+
+ public function testSerializeNullObject()
+ {
+ $obj = new ObjectWithNullProperty('foo', 'bar');
+
+ $this->assertEquals(
+ $this->getContent('simple_object_nullable'),
+ $this->serializer->serialize($obj, $this->getFormat(), SerializationContext::create()->setSerializeNull(true))
+ );
+ }
+
+ /**
+ * @dataProvider getTypes
+ */
+ public function testNull($type)
+ {
+ $this->assertEquals($this->getContent('null'), $this->serialize(null), $type);
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals(null, $this->deserialize($this->getContent('null'), $type));
+ }
+ }
+
+ public function getTypes()
+ {
+ return array(
+ array('NULL'),
+ array('integer'),
+ array('double'),
+ array('float'),
+ array('string'),
+ array('DateTime'),
+ );
+ }
+
+ public function testString()
+ {
+ $this->assertEquals($this->getContent('string'), $this->serialize('foo'));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals('foo', $this->deserialize($this->getContent('string'), 'string'));
+ }
+ }
+
+ /**
+ * @expectedException \JMS\Serializer\Exception\ExpressionLanguageRequiredException
+ * @expectedExceptionMessage To use conditional exclude/expose in JMS\Serializer\Tests\Fixtures\PersonSecret you must configure the expression language.
+ */
+ public function testExpressionExclusionNotConfigured()
+ {
+ $person = new PersonSecret();
+ $person->gender = 'f';
+ $person->name = 'mike';
+ $this->serialize($person);
+ }
+
+
+ public function testExpressionExclusionConfiguredWithDisjunctStrategy()
+ {
+ $person = new PersonSecret();
+ $person->gender = 'f';
+ $person->name = 'mike';
+
+ $language = new ExpressionLanguage();
+ $language->addFunction(new ExpressionFunction('show_data', function () {
+ return "true";
+ }, function () {
+ return true;
+ }));
+
+ $serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher, null, new ExpressionEvaluator($language));
+
+ $this->assertEquals($this->getContent('person_secret_hide'), $serializer->serialize($person, $this->getFormat()));
+ }
+
+ public function expressionFunctionProvider()
+ {
+ $person = new PersonSecret();
+ $person->gender = 'f';
+ $person->name = 'mike';
+
+ $personMoreSecret = new PersonSecretMore();
+ $personMoreSecret->gender = 'f';
+ $personMoreSecret->name = 'mike';
+
+ $personVirtual = new PersonSecretVirtual();
+ $personVirtual->gender = 'f';
+ $personVirtual->name = 'mike';
+
+ $personMoreSecretVirtual = new PersonSecretMoreVirtual();
+ $personMoreSecretVirtual->gender = 'f';
+ $personMoreSecretVirtual->name = 'mike';
+
+ $showGender = new ExpressionFunction('show_data', function () {
+ return "true";
+ }, function () {
+ return true;
+ });
+
+ $hideGender = new ExpressionFunction('show_data', function () {
+ return "false";
+ }, function () {
+ return false;
+ });
+
+ return [
+ [
+ $person,
+ $showGender,
+ 'person_secret_hide'
+ ],
+ [
+ $person,
+ $hideGender,
+ 'person_secret_show'
+ ],
+ [
+ $personMoreSecret,
+ $showGender,
+ 'person_secret_show'
+ ],
+ [
+ $personMoreSecret,
+ $hideGender,
+ 'person_secret_hide'
+ ],
+ [
+ $personVirtual,
+ $showGender,
+ 'person_secret_hide'
+ ],
+ [
+ $personVirtual,
+ $hideGender,
+ 'person_secret_show'
+ ],
+ [
+ $personMoreSecretVirtual,
+ $showGender,
+ 'person_secret_show'
+ ],
+ [
+ $personMoreSecretVirtual,
+ $hideGender,
+ 'person_secret_hide'
+ ]
+ ];
+ }
+
+ /**
+ * @dataProvider expressionFunctionProvider
+ * @param PersonSecret|PersonSecretMore $person
+ * @param ExpressionFunction $function
+ * @param $json
+ */
+ public function testExpressionExclusion($person, ExpressionFunction $function, $json)
+ {
+ $language = new ExpressionLanguage();
+ $language->addFunction($function);
+
+ $serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher, null, new ExpressionEvaluator($language));
+ $this->assertEquals($this->getContent($json), $serializer->serialize($person, $this->getFormat()));
+ }
+
+ /**
+ * @dataProvider getBooleans
+ */
+ public function testBooleans($strBoolean, $boolean)
+ {
+ $this->assertEquals($this->getContent('boolean_'.$strBoolean), $this->serialize($boolean));
+
+ if ($this->hasDeserializer()) {
+ $this->assertSame($boolean, $this->deserialize($this->getContent('boolean_'.$strBoolean), 'boolean'));
+ }
+ }
+
+ public function getBooleans()
+ {
+ return array(array('true', true), array('false', false));
+ }
+
+ /**
+ * @dataProvider getNumerics
+ */
+ public function testNumerics($key, $value, $type)
+ {
+ $this->assertEquals($this->getContent($key), $this->serialize($value));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($value, $this->deserialize($this->getContent($key), $type));
+ }
+ }
+
+ public function getNumerics()
+ {
+ return array(
+ array('integer', 1, 'integer'),
+ array('float', 4.533, 'double'),
+ array('float', 4.533, 'float'),
+ array('float_trailing_zero', 1.0, 'double'),
+ array('float_trailing_zero', 1.0, 'float'),
+ );
+ }
+
+ public function testSimpleObject()
+ {
+ $this->assertEquals($this->getContent('simple_object'), $this->serialize($obj = new SimpleObject('foo', 'bar')));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($obj, $this->deserialize($this->getContent('simple_object'), get_class($obj)));
+ }
+ }
+
+ public function testArrayStrings()
+ {
+ $data = array('foo', 'bar');
+ $this->assertEquals($this->getContent('array_strings'), $this->serialize($data));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($data, $this->deserialize($this->getContent('array_strings'), 'array'));
+ }
+ }
+
+ public function testArrayBooleans()
+ {
+ $data = array(true, false);
+ $this->assertEquals($this->getContent('array_booleans'), $this->serialize($data));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($data, $this->deserialize($this->getContent('array_booleans'), 'array'));
+ }
+ }
+
+ public function testArrayIntegers()
+ {
+ $data = array(1, 3, 4);
+ $this->assertEquals($this->getContent('array_integers'), $this->serialize($data));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($data, $this->deserialize($this->getContent('array_integers'), 'array'));
+ }
+ }
+
+ public function testArrayEmpty()
+ {
+ if ('xml' === $this->getFormat()) {
+ $this->markTestSkipped('XML can\'t be tested for empty array');
+ }
+
+ $data = array('array' => []);
+ $this->assertEquals($this->getContent('array_empty'), $this->serialize($data));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($data, $this->deserialize($this->getContent('array_empty'), 'array'));
+ }
+ }
+
+ public function testArrayFloats()
+ {
+ $data = array(1.34, 3.0, 6.42);
+ $this->assertEquals($this->getContent('array_floats'), $this->serialize($data));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($data, $this->deserialize($this->getContent('array_floats'), 'array'));
+ }
+ }
+
+ public function testArrayObjects()
+ {
+ $data = array(new SimpleObject('foo', 'bar'), new SimpleObject('baz', 'boo'));
+ $this->assertEquals($this->getContent('array_objects'), $this->serialize($data));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($data, $this->deserialize($this->getContent('array_objects'), 'array'));
+ }
+ }
+
+ public function testArrayListAndMapDifference()
+ {
+ $arrayData = array(0 => 1, 2 => 2, 3 => 3); // Misses key 1
+ $data = new ObjectWithIntListAndIntMap($arrayData, $arrayData);
+
+ $this->assertEquals($this->getContent('array_list_and_map_difference'), $this->serialize($data));
+ }
+
+ public function testDateTimeArrays()
+ {
+ $data = array(
+ new \DateTime('2047-01-01 12:47:47', new \DateTimeZone('UTC')),
+ new \DateTime('2016-12-05 00:00:00', new \DateTimeZone('UTC'))
+ );
+
+ $object = new DateTimeArraysObject($data, $data);
+ $serializedObject = $this->serialize( $object );
+
+ $this->assertEquals($this->getContent('array_datetimes_object'), $serializedObject);
+
+ if ($this->hasDeserializer()) {
+ /** @var DateTimeArraysObject $deserializedObject */
+ $deserializedObject = $this->deserialize($this->getContent('array_datetimes_object'), 'Jms\Serializer\Tests\Fixtures\DateTimeArraysObject');
+
+ /** deserialized object has a default timezone set depending on user's timezone settings. That's why we manually set the UTC timezone on the DateTime objects. */
+ foreach ($deserializedObject->getArrayWithDefaultDateTime() as $dateTime) {
+ $dateTime->setTimezone(new \DateTimeZone('UTC'));
+ }
+
+ foreach ($deserializedObject->getArrayWithFormattedDateTime() as $dateTime) {
+ $dateTime->setTimezone(new \DateTimeZone('UTC'));
+ }
+
+ $this->assertEquals($object, $deserializedObject);
+ }
+ }
+
+ public function testNamedDateTimeArrays()
+ {
+ $data = array(
+ new \DateTime('2047-01-01 12:47:47', new \DateTimeZone('UTC')),
+ new \DateTime('2016-12-05 00:00:00', new \DateTimeZone('UTC'))
+ );
+
+ $object = new NamedDateTimeArraysObject(array('testdate1' => $data[0], 'testdate2' => $data[1]));
+ $serializedObject = $this->serialize( $object );
+
+ $this->assertEquals($this->getContent('array_named_datetimes_object'), $serializedObject);
+
+ if ($this->hasDeserializer()) {
+
+ // skip XML deserialization
+ if ($this->getFormat() === 'xml') {
+ return;
+ }
+
+ /** @var NamedDateTimeArraysObject $deserializedObject */
+ $deserializedObject = $this->deserialize($this->getContent('array_named_datetimes_object'), 'Jms\Serializer\Tests\Fixtures\NamedDateTimeArraysObject');
+
+ /** deserialized object has a default timezone set depending on user's timezone settings. That's why we manually set the UTC timezone on the DateTime objects. */
+ foreach ($deserializedObject->getNamedArrayWithFormattedDate() as $dateTime) {
+ $dateTime->setTimezone(new \DateTimeZone('UTC'));
+ }
+
+ $this->assertEquals($object, $deserializedObject);
+ }
+ }
+
+ /**
+ * @group datetime
+ */
+ public function testNamedDateTimeImmutableArrays()
+ {
+ $data = array(
+ new \DateTimeImmutable('2047-01-01 12:47:47', new \DateTimeZone('UTC')),
+ new \DateTimeImmutable('2016-12-05 00:00:00', new \DateTimeZone('UTC'))
+ );
+
+ $object = new NamedDateTimeImmutableArraysObject(array('testdate1' => $data[0], 'testdate2' => $data[1]));
+ $serializedObject = $this->serialize($object);
+
+ $this->assertEquals($this->getContent('array_named_datetimeimmutables_object'), $serializedObject);
+
+ if ($this->hasDeserializer()) {
+
+ if ('xml' == $this->getFormat()) {
+ $this->markTestSkipped("XML deserialization does not support key-val pairs mode");
+ }
+ /** @var NamedDateTimeArraysObject $deserializedObject */
+ $deserializedObject = $this->deserialize($this->getContent('array_named_datetimeimmutables_object'), 'Jms\Serializer\Tests\Fixtures\NamedDateTimeImmutableArraysObject');
+
+ /** deserialized object has a default timezone set depending on user's timezone settings. That's why we manually set the UTC timezone on the DateTime objects. */
+ foreach ($deserializedObject->getNamedArrayWithFormattedDate() as $dateTime) {
+ $dateTime->setTimezone(new \DateTimeZone('UTC'));
+ }
+
+ $this->assertEquals($object, $deserializedObject);
+ }
+ }
+
+
+ public function testArrayMixed()
+ {
+ $this->assertEquals($this->getContent('array_mixed'), $this->serialize(array('foo', 1, true, new SimpleObject('foo', 'bar'), array(1, 3, true))));
+ }
+
+ /**
+ * @dataProvider getDateTime
+ * @group datetime
+ */
+ public function testDateTime($key, $value, $type)
+ {
+ $this->assertEquals($this->getContent($key), $this->serialize($value));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent($key), $type);
+
+ $this->assertTrue(is_object($deserialized));
+ $this->assertEquals(get_class($value), get_class($deserialized));
+ $this->assertEquals($value->getTimestamp(), $deserialized->getTimestamp());
+ }
+ }
+
+ public function getDateTime()
+ {
+ return array(
+ array('date_time', new \DateTime('2011-08-30 00:00', new \DateTimeZone('UTC')), 'DateTime'),
+ );
+ }
+
+ /**
+ * @dataProvider getDateTimeImmutable
+ * @group datetime
+ */
+ public function testDateTimeImmutable($key, $value, $type)
+ {
+ $this->assertEquals($this->getContent($key), $this->serialize($value));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent($key), $type);
+
+ $this->assertTrue(is_object($deserialized));
+ $this->assertEquals(get_class($value), get_class($deserialized));
+ $this->assertEquals($value->getTimestamp(), $deserialized->getTimestamp());
+ }
+ }
+
+ public function getDateTimeImmutable()
+ {
+ return array(
+ array('date_time_immutable', new \DateTimeImmutable('2011-08-30 00:00', new \DateTimeZone('UTC')), 'DateTimeImmutable'),
+ );
+ }
+
+ public function testTimestamp()
+ {
+ $value = new Timestamp(new \DateTime('2016-02-11 00:00:00', new \DateTimeZone('UTC')));
+ $this->assertEquals($this->getContent('timestamp'), $this->serialize($value));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('timestamp'), Timestamp::class);
+ $this->assertEquals($value, $deserialized);
+ $this->assertEquals($value->getTimestamp()->getTimestamp(), $deserialized->getTimestamp()->getTimestamp());
+
+ $deserialized = $this->deserialize($this->getContent('timestamp_prev'), Timestamp::class);
+ $this->assertEquals($value, $deserialized);
+ $this->assertEquals($value->getTimestamp()->getTimestamp(), $deserialized->getTimestamp()->getTimestamp());
+ }
+ }
+
+ public function testDateInterval()
+ {
+ $duration = new \DateInterval('PT45M');
+
+ $this->assertEquals($this->getContent('date_interval'), $this->serializer->serialize($duration, $this->getFormat()));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('date_interval'), \DateInterval::class);
+ $this->assertEquals($duration, $deserialized);
+ $this->assertEquals($duration->i, $deserialized->i);
+ }
+ }
+
+ public function testBlogPost()
+ {
+ $post = new BlogPost('This is a nice title.', $author = new Author('Foo Bar'), new \DateTime('2011-07-30 00:00', new \DateTimeZone('UTC')), new Publisher('Bar Foo'));
+ $post->addComment($comment = new Comment($author, 'foo'));
+
+ $post->addTag($tag1 = New Tag("tag1"));
+ $post->addTag($tag2 = New Tag("tag2"));
+
+ $this->assertEquals($this->getContent('blog_post'), $this->serialize($post));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('blog_post'), get_class($post));
+ $this->assertEquals('2011-07-30T00:00:00+0000', $this->getField($deserialized, 'createdAt')->format(\DateTime::ISO8601));
+ $this->assertAttributeEquals('This is a nice title.', 'title', $deserialized);
+ $this->assertAttributeSame(false, 'published', $deserialized);
+ $this->assertAttributeSame('1edf9bf60a32d89afbb85b2be849e3ceed5f5b10', 'etag', $deserialized);
+ $this->assertAttributeEquals(new ArrayCollection(array($comment)), 'comments', $deserialized);
+ $this->assertAttributeEquals(new Sequence(array($comment)), 'comments2', $deserialized);
+ $this->assertAttributeEquals($author, 'author', $deserialized);
+ $this->assertAttributeEquals(array($tag1, $tag2), 'tag', $deserialized);
+ }
+ }
+
+ public function testDeserializingNull()
+ {
+ $objectConstructor = new InitializedBlogPostConstructor();
+ $this->serializer = new Serializer($this->factory, $this->handlerRegistry, $objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher);
+
+ $post = new BlogPost('This is a nice title.', $author = new Author('Foo Bar'), new \DateTime('2011-07-30 00:00', new \DateTimeZone('UTC')), new Publisher('Bar Foo'));
+
+ $this->setField($post, 'author', null);
+ $this->setField($post, 'publisher', null);
+
+ $this->assertEquals($this->getContent('blog_post_unauthored'), $this->serialize($post, SerializationContext::create()->setSerializeNull(true)));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('blog_post_unauthored'), get_class($post), DeserializationContext::create()->setSerializeNull(true));
+
+ $this->assertEquals('2011-07-30T00:00:00+0000', $this->getField($deserialized, 'createdAt')->format(\DateTime::ISO8601));
+ $this->assertAttributeEquals('This is a nice title.', 'title', $deserialized);
+ $this->assertAttributeSame(false, 'published', $deserialized);
+ $this->assertAttributeEquals(new ArrayCollection(), 'comments', $deserialized);
+ $this->assertEquals(null, $this->getField($deserialized, 'author'));
+ }
+ }
+
+ public function testExpressionAuthor()
+ {
+ $namingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
+
+ $evaluator = new ExpressionEvaluator(new ExpressionLanguage());
+ $accessor = new ExpressionAccessorStrategy($evaluator, new DefaultAccessorStrategy());
+
+ $this->serializationVisitors = new Map(array(
+ 'json' => new JsonSerializationVisitor($namingStrategy, $accessor),
+ 'xml' => new XmlSerializationVisitor($namingStrategy, $accessor),
+ 'yml' => new YamlSerializationVisitor($namingStrategy, $accessor),
+ ));
+
+ $serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher, null, $evaluator);
+
+ $author = new AuthorExpressionAccess(123, "Ruud", "Kamphuis");
+ $this->assertEquals($this->getContent('author_expression'), $serializer->serialize($author, $this->getFormat()));
+ }
+
+ /**
+ * @expectedException \JMS\Serializer\Exception\ExpressionLanguageRequiredException
+ * @expectedExceptionMessage The property firstName on JMS\Serializer\Tests\Fixtures\AuthorExpressionAccess requires the expression accessor strategy to be enabled.
+ */
+ public function testExpressionAccessorStrategNotEnabled()
+ {
+ $author = new AuthorExpressionAccess(123, "Ruud", "Kamphuis");
+ $this->assertEquals($this->getContent('author_expression'), $this->serialize($author));
+ }
+
+ public function testReadOnly()
+ {
+ $author = new AuthorReadOnly(123, 'Ruud Kamphuis');
+ $this->assertEquals($this->getContent('readonly'), $this->serialize($author));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('readonly'), get_class($author));
+ $this->assertNull($this->getField($deserialized, 'id'));
+ $this->assertEquals('Ruud Kamphuis', $this->getField($deserialized, 'name'));
+ }
+ }
+
+ public function testReadOnlyClass()
+ {
+ $author = new AuthorReadOnlyPerClass(123, 'Ruud Kamphuis');
+ $this->assertEquals($this->getContent('readonly'), $this->serialize($author));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('readonly'), get_class($author));
+ $this->assertNull($this->getField($deserialized, 'id'));
+ $this->assertEquals('Ruud Kamphuis', $this->getField($deserialized, 'name'));
+ }
+ }
+
+ public function testPrice()
+ {
+ $price = new Price(3);
+ $this->assertEquals($this->getContent('price'), $this->serialize($price));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('price'), get_class($price));
+ $this->assertEquals(3, $this->getField($deserialized, 'price'));
+ }
+ }
+
+ public function testOrder()
+ {
+ $order = new Order(new Price(12.34));
+ $this->assertEquals($this->getContent('order'), $this->serialize($order));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($order, $this->deserialize($this->getContent('order'), get_class($order)));
+ }
+ }
+
+ public function testCurrencyAwarePrice()
+ {
+ $price = new CurrencyAwarePrice(2.34);
+ $this->assertEquals($this->getContent('currency_aware_price'), $this->serialize($price));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($price, $this->deserialize($this->getContent('currency_aware_price'), get_class($price)));
+ }
+ }
+
+ public function testOrderWithCurrencyAwarePrice()
+ {
+ $order = new CurrencyAwareOrder(new CurrencyAwarePrice(1.23));
+ $this->assertEquals($this->getContent('order_with_currency_aware_price'), $this->serialize($order));
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($order, $this->deserialize($this->getContent('order_with_currency_aware_price'), get_class($order)));
+ }
+ }
+
+ /**
+ * @group handlerCallback
+ */
+ public function testArticle()
+ {
+ $article = new Article();
+ $article->element = 'custom';
+ $article->value = 'serialized';
+
+ $result = $this->serialize($article);
+ $this->assertEquals($this->getContent('article'), $result);
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals($article, $this->deserialize($result, 'JMS\Serializer\Tests\Fixtures\Article'));
+ }
+ }
+
+ public function testInline()
+ {
+ $inline = new InlineParent();
+
+ $result = $this->serialize($inline);
+ $this->assertEquals($this->getContent('inline'), $result);
+
+ // no deserialization support
+ }
+
+ public function testInlineEmptyChild()
+ {
+ $inline = new InlineParent(new InlineChildEmpty());
+
+ $result = $this->serialize($inline);
+ $this->assertEquals($this->getContent('inline_child_empty'), $result);
+
+ // no deserialization support
+ }
+
+ public function testEmptyChild()
+ {
+ // by empty object
+ $inline = new ParentDoNotSkipWithEmptyChild(new InlineChildEmpty());
+ $this->assertEquals($this->getContent('empty_child'), $this->serialize($inline));
+
+ // by nulls
+ $inner = new InlineChild();
+ $inner->a = null;
+ $inner->b = null;
+ $inline = new ParentDoNotSkipWithEmptyChild($inner);
+ $this->assertEquals($this->getContent('empty_child'), $this->serialize($inline));
+
+ // by exclusion strategy
+ $context = SerializationContext::create()->setGroups(['Default']);
+ $inline = new ParentDoNotSkipWithEmptyChild(new InlineChildWithGroups());
+ $this->assertEquals($this->getContent('empty_child'), $this->serialize($inline, $context));
+ }
+
+ public function testSkipEmptyChild()
+ {
+ // by empty object
+ $inline = new ParentSkipWithEmptyChild(new InlineChildEmpty());
+ $this->assertEquals($this->getContent('empty_child_skip'), $this->serialize($inline));
+
+ // by nulls
+ $inner = new InlineChild();
+ $inner->a = null;
+ $inner->b = null;
+ $inline = new ParentSkipWithEmptyChild($inner);
+ $this->assertEquals($this->getContent('empty_child_skip'), $this->serialize($inline));
+
+ // by exclusion strategy
+ $context = SerializationContext::create()->setGroups(['Default']);
+ $inline = new ParentSkipWithEmptyChild(new InlineChildWithGroups());
+ $this->assertEquals($this->getContent('empty_child_skip'), $this->serialize($inline, $context));
+ }
+
+ /**
+ * @group log
+ */
+ public function testLog()
+ {
+ $this->assertEquals($this->getContent('log'), $this->serialize($log = new Log()));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('log'), get_class($log));
+ $this->assertEquals($log, $deserialized);
+ }
+ }
+
+ public function testCircularReference()
+ {
+ $object = new CircularReferenceParent();
+ $this->assertEquals($this->getContent('circular_reference'), $this->serialize($object));
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('circular_reference'), get_class($object));
+
+ $col = $this->getField($deserialized, 'collection');
+ $this->assertEquals(2, count($col));
+ $this->assertEquals('child1', $col[0]->getName());
+ $this->assertEquals('child2', $col[1]->getName());
+ $this->assertSame($deserialized, $col[0]->getParent());
+ $this->assertSame($deserialized, $col[1]->getParent());
+
+ $col = $this->getField($deserialized, 'anotherCollection');
+ $this->assertEquals(2, count($col));
+ $this->assertEquals('child1', $col[0]->getName());
+ $this->assertEquals('child2', $col[1]->getName());
+ $this->assertSame($deserialized, $col[0]->getParent());
+ $this->assertSame($deserialized, $col[1]->getParent());
+ }
+ }
+
+ public function testLifecycleCallbacks()
+ {
+ $object = new ObjectWithLifecycleCallbacks();
+ $this->assertEquals($this->getContent('lifecycle_callbacks'), $this->serialize($object));
+ $this->assertAttributeSame(null, 'name', $object);
+
+ if ($this->hasDeserializer()) {
+ $deserialized = $this->deserialize($this->getContent('lifecycle_callbacks'), get_class($object));
+ $this->assertEquals($object, $deserialized);
+ }
+ }
+
+ public function testFormErrors()
+ {
+ $errors = array(
+ new FormError('This is the form error'),
+ new FormError('Another error')
+ );
+
+ $this->assertEquals($this->getContent('form_errors'), $this->serialize($errors));
+ }
+
+ public function testNestedFormErrors()
+ {
+ $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
+
+ $formConfigBuilder = new \Symfony\Component\Form\FormConfigBuilder('foo', null, $dispatcher);
+ $formConfigBuilder->setCompound(true);
+ $formConfigBuilder->setDataMapper($this->getMock('Symfony\Component\Form\DataMapperInterface'));
+ $fooConfig = $formConfigBuilder->getFormConfig();
+
+ $form = new Form($fooConfig);
+ $form->addError(new FormError('This is the form error'));
+
+ $formConfigBuilder = new \Symfony\Component\Form\FormConfigBuilder('bar', null, $dispatcher);
+ $barConfig = $formConfigBuilder->getFormConfig();
+ $child = new Form($barConfig);
+ $child->addError(new FormError('Error of the child form'));
+ $form->add($child);
+
+ $this->assertEquals($this->getContent('nested_form_errors'), $this->serialize($form));
+ }
+
+ public function testFormErrorsWithNonFormComponents()
+ {
+ if (!class_exists('Symfony\Component\Form\Extension\Core\Type\SubmitType')) {
+ $this->markTestSkipped('Not using Symfony Form >= 2.3 with submit type');
+ }
+
+ $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
+
+ $factoryBuilder = new FormFactoryBuilder();
+ $factoryBuilder->addType(new \Symfony\Component\Form\Extension\Core\Type\SubmitType);
+ $factoryBuilder->addType(new \Symfony\Component\Form\Extension\Core\Type\ButtonType);
+ $factory = $factoryBuilder->getFormFactory();
+
+ $formConfigBuilder = new \Symfony\Component\Form\FormConfigBuilder('foo', null, $dispatcher);
+ $formConfigBuilder->setFormFactory($factory);
+ $formConfigBuilder->setCompound(true);
+ $formConfigBuilder->setDataMapper($this->getMock('Symfony\Component\Form\DataMapperInterface'));
+ $fooConfig = $formConfigBuilder->getFormConfig();
+
+ $form = new Form($fooConfig);
+ $form->add('save', \Symfony\Component\Form\Extension\Core\Type\SubmitType::class);
+
+ try {
+ $this->serialize($form);
+ } catch (\Exception $e) {
+ $this->assertTrue(false, 'Serialization should not throw an exception');
+ }
+ }
+
+ public function testConstraintViolation()
+ {
+ $violation = new ConstraintViolation('Message of violation', 'Message of violation', array(), null, 'foo', null);
+
+ $this->assertEquals($this->getContent('constraint_violation'), $this->serialize($violation));
+ }
+
+ public function testConstraintViolationList()
+ {
+ $violations = new ConstraintViolationList();
+ $violations->add(new ConstraintViolation('Message of violation', 'Message of violation', array(), null, 'foo', null));
+ $violations->add(new ConstraintViolation('Message of another violation', 'Message of another violation', array(), null, 'bar', null));
+
+ $this->assertEquals($this->getContent('constraint_violation_list'), $this->serialize($violations));
+ }
+
+ public function testDoctrineProxy()
+ {
+ if (!class_exists('Doctrine\ORM\Version')) {
+ $this->markTestSkipped('Doctrine is not available.');
+ }
+
+ $object = new SimpleObjectProxy('foo', 'bar');
+
+ $this->assertEquals($this->getContent('orm_proxy'), $this->serialize($object));
+ }
+
+ public function testInitializedDoctrineProxy()
+ {
+ if (!class_exists('Doctrine\ORM\Version')) {
+ $this->markTestSkipped('Doctrine is not available.');
+ }
+
+ $object = new SimpleObjectProxy('foo', 'bar');
+ $object->__load();
+
+ $this->assertEquals($this->getContent('orm_proxy'), $this->serialize($object));
+ }
+
+ public function testCustomAccessor()
+ {
+ $post = new IndexedCommentsBlogPost();
+
+ $this->assertEquals($this->getContent('custom_accessor'), $this->serialize($post));
+ }
+
+ public function testMixedAccessTypes()
+ {
+ $object = new GetSetObject();
+
+ $this->assertEquals($this->getContent('mixed_access_types'), $this->serialize($object));
+
+ if ($this->hasDeserializer()) {
+ $object = $this->deserialize($this->getContent('mixed_access_types'), 'JMS\Serializer\Tests\Fixtures\GetSetObject');
+ $this->assertAttributeEquals(1, 'id', $object);
+ $this->assertAttributeEquals('Johannes', 'name', $object);
+ $this->assertAttributeEquals(42, 'readOnlyProperty', $object);
+ }
+ }
+
+ public function testAccessorOrder()
+ {
+ $this->assertEquals($this->getContent('accessor_order_child'), $this->serialize(new AccessorOrderChild()));
+ $this->assertEquals($this->getContent('accessor_order_parent'), $this->serialize(new AccessorOrderParent()));
+ $this->assertEquals($this->getContent('accessor_order_methods'), $this->serialize(new AccessorOrderMethod()));
+ }
+
+ public function testGroups()
+ {
+ $groupsObject = new GroupsObject();
+
+ $this->assertEquals($this->getContent('groups_all'), $this->serializer->serialize($groupsObject, $this->getFormat()));
+
+ $this->assertEquals(
+ $this->getContent('groups_foo'),
+ $this->serializer->serialize($groupsObject, $this->getFormat(), SerializationContext::create()->setGroups(array('foo')))
+ );
+
+ $this->assertEquals(
+ $this->getContent('groups_foobar'),
+ $this->serializer->serialize($groupsObject, $this->getFormat(), SerializationContext::create()->setGroups(array('foo', 'bar')))
+ );
+
+ $this->assertEquals(
+ $this->getContent('groups_all'),
+ $this->serializer->serialize($groupsObject, $this->getFormat())
+ );
+
+ $this->assertEquals(
+ $this->getContent('groups_default'),
+ $this->serializer->serialize($groupsObject, $this->getFormat(), SerializationContext::create()->setGroups(array(GroupsExclusionStrategy::DEFAULT_GROUP)))
+ );
+
+ $this->assertEquals(
+ $this->getContent('groups_default'),
+ $this->serializer->serialize($groupsObject, $this->getFormat(), SerializationContext::create()->setGroups(array(GroupsExclusionStrategy::DEFAULT_GROUP)))
+ );
+ }
+
+ public function testAdvancedGroups()
+ {
+ $adrien = new GroupsUser(
+ 'John',
+ new GroupsUser(
+ 'John Manager',
+ null,
+ array(
+ new GroupsUser(
+ 'John Manager friend 1',
+ new GroupsUser('John Manager friend 1 manager')
+ ),
+ new GroupsUser('John Manager friend 2'),
+ )
+ ),
+ array(
+ new GroupsUser(
+ 'John friend 1',
+ new GroupsUser('John friend 1 manager')
+ ),
+ new GroupsUser(
+ 'John friend 2',
+ new GroupsUser('John friend 2 manager')
+ )
+ )
+ );
+
+ $this->assertEquals(
+ $this->getContent('groups_advanced'),
+ $this->serializer->serialize(
+ $adrien,
+ $this->getFormat(),
+ SerializationContext::create()->setGroups(array(
+ GroupsExclusionStrategy::DEFAULT_GROUP,
+ 'manager_group',
+ 'friends_group',
+
+ 'manager' => array(
+ GroupsExclusionStrategy::DEFAULT_GROUP,
+ 'friends_group',
+
+ 'friends' => array('nickname_group'),
+ ),
+ 'friends' => array(
+ 'manager_group'
+ )
+ ))
+ )
+ );
+ }
+
+ /**
+ * @expectedException JMS\Serializer\Exception\InvalidArgumentException
+ * @expectedExceptionMessage Invalid group name "foo, bar" on "JMS\Serializer\Tests\Fixtures\InvalidGroupsObject->foo", did you mean to create multiple groups?
+ */
+ public function testInvalidGroupName()
+ {
+ $groupsObject = new InvalidGroupsObject();
+
+ $this->serializer->serialize($groupsObject, $this->getFormat());
+ }
+
+ public function testVirtualProperty()
+ {
+ $this->assertEquals($this->getContent('virtual_properties'), $this->serialize(new ObjectWithVirtualProperties()));
+ }
+
+ public function testVirtualVersions()
+ {
+ $this->assertEquals(
+ $this->getContent('virtual_properties_low'),
+ $this->serialize(new ObjectWithVersionedVirtualProperties(), SerializationContext::create()->setVersion(2))
+ );
+
+ $this->assertEquals(
+ $this->getContent('virtual_properties_all'),
+ $this->serialize(new ObjectWithVersionedVirtualProperties(), SerializationContext::create()->setVersion(7))
+ );
+
+ $this->assertEquals(
+ $this->getContent('virtual_properties_high'),
+ $this->serialize(new ObjectWithVersionedVirtualProperties(), SerializationContext::create()->setVersion(9))
+ );
+ }
+
+ public function testCustomHandler()
+ {
+ if ( ! $this->hasDeserializer()) {
+ return;
+ }
+
+ $handler = function() {
+ return new CustomDeserializationObject('customly_unserialized_value');
+ };
+
+ $this->handlerRegistry->registerHandler(GraphNavigator::DIRECTION_DESERIALIZATION, 'CustomDeserializationObject', $this->getFormat(), $handler);
+
+ $serialized = $this->serializer->serialize(new CustomDeserializationObject('sometext'), $this->getFormat());
+ $object = $this->serializer->deserialize($serialized, 'CustomDeserializationObject', $this->getFormat());
+ $this->assertEquals('customly_unserialized_value', $object->someProperty);
+ }
+
+ public function testInput()
+ {
+ $this->assertEquals($this->getContent('input'), $this->serializer->serialize(new Input(), $this->getFormat()));
+ }
+
+ public function testObjectWithEmptyHash()
+ {
+ $this->assertEquals($this->getContent('hash_empty'), $this->serializer->serialize(new ObjectWithEmptyHash(), $this->getFormat()));
+ }
+
+ /**
+ * @group null
+ */
+ public function testSerializeObjectWhenNull()
+ {
+ $this->assertEquals(
+ $this->getContent('object_when_null'),
+ $this->serialize(new Comment(null, 'foo'), SerializationContext::create()->setSerializeNull(false))
+ );
+
+ $this->assertEquals(
+ $this->getContent('object_when_null_and_serialized'),
+ $this->serialize(new Comment(null, 'foo'), SerializationContext::create()->setSerializeNull(true))
+ );
+ }
+
+ /**
+ * @group polymorphic
+ */
+ public function testPolymorphicObjectsWithGroup()
+ {
+ $context = SerializationContext::create();
+ $context->setGroups(array("foo"));
+
+ $this->assertEquals(
+ $this->getContent('car'),
+ $this->serialize(new \JMS\Serializer\Tests\Fixtures\DiscriminatorGroup\Car(5), $context)
+ );
+ }
+
+ /**
+ * @group polymorphic
+ */
+ public function testPolymorphicObjects()
+ {
+ $this->assertEquals(
+ $this->getContent('car'),
+ $this->serialize(new Car(5))
+ );
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals(
+ new Car(5),
+ $this->deserialize(
+ $this->getContent('car'),
+ 'JMS\Serializer\Tests\Fixtures\Discriminator\Car'
+ ),
+ 'Class is resolved correctly when concrete sub-class is used.'
+ );
+
+ $this->assertEquals(
+ new Car(5),
+ $this->deserialize(
+ $this->getContent('car'),
+ 'JMS\Serializer\Tests\Fixtures\Discriminator\Vehicle'
+ ),
+ 'Class is resolved correctly when least supertype is used.'
+ );
+
+ $this->assertEquals(
+ new Car(5),
+ $this->deserialize(
+ $this->getContent('car_without_type'),
+ 'JMS\Serializer\Tests\Fixtures\Discriminator\Car'
+ ),
+ 'Class is resolved correctly when concrete sub-class is used and no type is defined.'
+ );
+ }
+ }
+
+ /**
+ * @group polymorphic
+ */
+ public function testNestedPolymorphicObjects()
+ {
+ $garage = new Garage(array(new Car(3), new Moped(1)));
+ $this->assertEquals(
+ $this->getContent('garage'),
+ $this->serialize($garage)
+ );
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals(
+ $garage,
+ $this->deserialize(
+ $this->getContent('garage'),
+ 'JMS\Serializer\Tests\Fixtures\Garage'
+ )
+ );
+ }
+ }
+
+ /**
+ * @group polymorphic
+ */
+ public function testNestedPolymorphicInterfaces()
+ {
+ $garage = new VehicleInterfaceGarage(array(new Car(3), new Moped(1)));
+ $this->assertEquals(
+ $this->getContent('garage'),
+ $this->serialize($garage)
+ );
+
+ if ($this->hasDeserializer()) {
+ $this->assertEquals(
+ $garage,
+ $this->deserialize(
+ $this->getContent('garage'),
+ 'JMS\Serializer\Tests\Fixtures\VehicleInterfaceGarage'
+ )
+ );
+ }
+ }
+
+ /**
+ * @group polymorphic
+ * @expectedException LogicException
+ */
+ public function testPolymorphicObjectsInvalidDeserialization()
+ {
+ if (!$this->hasDeserializer()) {
+ throw new \LogicException('No deserializer');
+ }
+
+ $this->deserialize(
+ $this->getContent('car_without_type'),
+ 'JMS\Serializer\Tests\Fixtures\Discriminator\Vehicle'
+ );
+ }
+
+ public function testDepthExclusionStrategy()
+ {
+ $context = SerializationContext::create()
+ ->addExclusionStrategy(new DepthExclusionStrategy())
+ ;
+
+ $data = new Tree(
+ new Node(array(
+ new Node(array(
+ new Node(array(
+ new Node(array(
+ new Node(),
+ )),
+ )),
+ )),
+ ))
+ );
+
+ $this->assertEquals($this->getContent('tree'), $this->serializer->serialize($data, $this->getFormat(), $context));
+ }
+
+ public function testMaxDepthWithSkippableObject()
+ {
+ $data = new Gh236Foo();
+
+ $context = SerializationContext::create()->enableMaxDepthChecks();
+ $serialized = $this->serialize($data, $context);
+
+ $this->assertEquals($this->getContent('maxdepth_skippabe_object'), $serialized);
+ }
+
+ public function testDeserializingIntoExistingObject()
+ {
+ if (!$this->hasDeserializer()) {
+ return;
+ }
+
+ $objectConstructor = new InitializedObjectConstructor(new UnserializeObjectConstructor());
+ $serializer = new Serializer(
+ $this->factory, $this->handlerRegistry, $objectConstructor,
+ $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher
+ );
+
+ $order = new Order(new Price(12));
+
+ $context = new DeserializationContext();
+ $context->attributes->set('target', $order);
+
+ $deseralizedOrder = $serializer->deserialize(
+ $this->getContent('order'),
+ get_class($order),
+ $this->getFormat(),
+ $context
+ );
+
+ $this->assertSame($order, $deseralizedOrder);
+ $this->assertEquals(new Order(new Price(12.34)), $deseralizedOrder);
+ $this->assertAttributeInstanceOf('JMS\Serializer\Tests\Fixtures\Price', 'cost', $deseralizedOrder);
+ }
+
+ public function testObjectWithNullableArrays()
+ {
+ $object = new ObjectWithEmptyNullableAndEmptyArrays();
+ $this->assertEquals($this->getContent('nullable_arrays'), $this->serializer->serialize($object, $this->getFormat()));
+ }
+
+ abstract protected function getContent($key);
+ abstract protected function getFormat();
+
+ protected function hasDeserializer()
+ {
+ return true;
+ }
+
+ protected function serialize($data, Context $context = null)
+ {
+ return $this->serializer->serialize($data, $this->getFormat(), $context);
+ }
+
+ protected function deserialize($content, $type, Context $context = null)
+ {
+ return $this->serializer->deserialize($content, $type, $this->getFormat(), $context);
+ }
+
+ protected function setUp()
+ {
+ $this->factory = new MetadataFactory(new AnnotationDriver(new AnnotationReader()));
+
+ $this->handlerRegistry = new HandlerRegistry();
+ $this->handlerRegistry->registerSubscribingHandler(new ConstraintViolationHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new StdClassHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new DateHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new FormErrorHandler(new IdentityTranslator(new MessageSelector())));
+ $this->handlerRegistry->registerSubscribingHandler(new PhpCollectionHandler());
+ $this->handlerRegistry->registerSubscribingHandler(new ArrayCollectionHandler());
+ $this->handlerRegistry->registerHandler(GraphNavigator::DIRECTION_SERIALIZATION, 'AuthorList', $this->getFormat(),
+ function(VisitorInterface $visitor, $object, array $type, Context $context) {
+ return $visitor->visitArray(iterator_to_array($object), $type, $context);
+ }
+ );
+ $this->handlerRegistry->registerHandler(GraphNavigator::DIRECTION_DESERIALIZATION, 'AuthorList', $this->getFormat(),
+ function(VisitorInterface $visitor, $data, $type, Context $context) {
+ $type = array(
+ 'name' => 'array',
+ 'params' => array(
+ array('name' => 'integer', 'params' => array()),
+ array('name' => 'JMS\Serializer\Tests\Fixtures\Author', 'params' => array()),
+ ),
+ );
+
+ $elements = $visitor->getNavigator()->accept($data, $type, $context);
+ $list = new AuthorList();
+ foreach ($elements as $author) {
+ $list->add($author);
+ }
+
+ return $list;
+ }
+ );
+
+ $this->dispatcher = new EventDispatcher();
+ $this->dispatcher->addSubscriber(new DoctrineProxySubscriber());
+
+ $namingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
+ $this->objectConstructor = new UnserializeObjectConstructor();
+ $this->serializationVisitors = new Map(array(
+ 'json' => new JsonSerializationVisitor($namingStrategy),
+ 'xml' => new XmlSerializationVisitor($namingStrategy),
+ 'yml' => new YamlSerializationVisitor($namingStrategy),
+ ));
+ $this->deserializationVisitors = new Map(array(
+ 'json' => new JsonDeserializationVisitor($namingStrategy),
+ 'xml' => new XmlDeserializationVisitor($namingStrategy),
+ ));
+
+ $this->serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher);
+ }
+
+ protected function getField($obj, $name)
+ {
+ $ref = new \ReflectionProperty($obj, $name);
+ $ref->setAccessible(true);
+
+ return $ref->getValue($obj);
+ }
+
+ private function setField($obj, $name, $value)
+ {
+ $ref = new \ReflectionProperty($obj, $name);
+ $ref->setAccessible(true);
+ $ref->setValue($obj, $value);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/ContextTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/ContextTest.php
new file mode 100644
index 0000000000..2b7d6fb1b6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/ContextTest.php
@@ -0,0 +1,202 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Metadata\PropertyMetadata;
+use JMS\Serializer\SerializationContext;
+use JMS\Serializer\Tests\Fixtures\InlineChild;
+use JMS\Serializer\Tests\Fixtures\Node;
+use JMS\Serializer\SerializerBuilder;
+
+class ContextTest extends \PHPUnit_Framework_TestCase
+{
+ public function testSerializationContextPathAndDepth()
+ {
+ $object = new Node(array(
+ new Node(),
+ new Node(array(
+ new Node()
+ )),
+ ));
+ $objects = array($object, $object->children[0], $object->children[1], $object->children[1]->children[0]);
+
+ $self = $this;
+
+ $exclusionStrategy = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface');
+ $exclusionStrategy->expects($this->any())
+ ->method('shouldSkipClass')
+ ->with($this->anything(), $this->callback(function (SerializationContext $context) use ($self, $objects) {
+ $expectedDepth = $expectedPath = null;
+
+ if ($context->getObject() === $objects[0]) {
+ $expectedDepth = 1;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node';
+ } elseif ($context->getObject() === $objects[1]) {
+ $expectedDepth = 2;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node';
+ } elseif ($context->getObject() === $objects[2]) {
+ $expectedDepth = 2;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node';
+ } elseif ($context->getObject() === $objects[3]) {
+ $expectedDepth = 3;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node';
+ }
+
+ $self->assertEquals($expectedDepth, $context->getDepth(), 'shouldSkipClass depth');
+ $self->assertEquals($expectedPath, $context->getPath(), 'shouldSkipClass path');
+
+ return true;
+ }))
+ ->will($this->returnValue(false));
+
+ $exclusionStrategy->expects($this->any())
+ ->method('shouldSkipProperty')
+ ->with($this->anything(), $this->callback(function (SerializationContext $context) use ($self, $objects) {
+ $expectedDepth = $expectedPath = null;
+
+ if ($context->getObject() === $objects[0]) {
+ $expectedDepth = 1;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node';
+ } elseif ($context->getObject() === $objects[1]) {
+ $expectedDepth = 2;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node';
+ } elseif ($context->getObject() === $objects[2]) {
+ $expectedDepth = 2;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node';
+ } elseif ($context->getObject() === $objects[3]) {
+ $expectedDepth = 3;
+ $expectedPath = 'JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node -> JMS\Serializer\Tests\Fixtures\Node';
+ }
+
+ $self->assertEquals($expectedDepth, $context->getDepth(), 'shouldSkipProperty depth');
+ $self->assertEquals($expectedPath, $context->getPath(), 'shouldSkipProperty path');
+
+ return true;
+ }))
+ ->will($this->returnValue(false));
+
+ $serializer = SerializerBuilder::create()->build();
+
+ $serializer->serialize($object, 'json', SerializationContext::create()->addExclusionStrategy($exclusionStrategy));
+ }
+
+ public function testSerializationMetadataStack()
+ {
+ $object = new Node(array(
+ $child = new InlineChild(),
+ ));
+ $self = $this;
+
+ $exclusionStrategy = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface');
+ $exclusionStrategy->expects($this->any())
+ ->method('shouldSkipClass')
+ ->will($this->returnCallback(function (ClassMetadata $classMetadata, SerializationContext $context) use ($self, $object, $child) {
+ $stack = $context->getMetadataStack();
+
+ if ($object === $context->getObject()) {
+ $self->assertEquals(0, $stack->count());
+ }
+
+ if ($child === $context->getObject()) {
+ $self->assertEquals(2, $stack->count());
+ $self->assertEquals('JMS\Serializer\Tests\Fixtures\Node', $stack[1]->name);
+ $self->assertEquals('children', $stack[0]->name);
+ }
+
+ return false;
+ }));
+
+ $exclusionStrategy->expects($this->any())
+ ->method('shouldSkipProperty')
+ ->will($this->returnCallback(function (PropertyMetadata $propertyMetadata, SerializationContext $context) use ($self, $object, $child) {
+ $stack = $context->getMetadataStack();
+
+ if ('JMS\Serializer\Tests\Fixtures\Node' === $propertyMetadata->class && $propertyMetadata->name === 'children') {
+ $self->assertEquals(1, $stack->count());
+ $self->assertEquals('JMS\Serializer\Tests\Fixtures\Node', $stack[0]->name);
+ }
+
+ if ('JMS\Serializer\Tests\Fixtures\InlineChild' === $propertyMetadata->class) {
+ $self->assertEquals(3, $stack->count());
+ $self->assertEquals('JMS\Serializer\Tests\Fixtures\Node', $stack[2]->name);
+ $self->assertEquals('children', $stack[1]->name);
+ $self->assertEquals('JMS\Serializer\Tests\Fixtures\InlineChild', $stack[0]->name);
+ }
+
+ return false;
+ }));
+
+ $serializer = SerializerBuilder::create()->build();
+ $serializer->serialize($object, 'json', SerializationContext::create()->addExclusionStrategy($exclusionStrategy));
+ }
+
+ public function getScalars()
+ {
+ return array(
+ array("string"),
+ array(5),
+ array(5.5),
+ array(array())
+ );
+ }
+
+ /**
+ * @dataProvider getScalars
+ */
+ public function testCanVisitScalars($scalar)
+ {
+ $context = SerializationContext::create();
+
+ $context->startVisiting($scalar);
+ $this->assertFalse($context->isVisiting($scalar));
+ $context->stopVisiting($scalar);
+ }
+
+ public function testInitialTypeCompatibility()
+ {
+ $context = SerializationContext::create();
+ $context->setInitialType('foo');
+ $this->assertEquals('foo', $context->getInitialType());
+ $this->assertEquals('foo', $context->attributes->get('initial_type')->get());
+
+ $context = SerializationContext::create();
+ $context->attributes->set('initial_type', 'foo');
+ $this->assertEquals('foo', $context->getInitialType());
+ }
+
+ public function testSerializeNullOption()
+ {
+ $context = SerializationContext::create();
+ $this->assertNull($context->shouldSerializeNull());
+
+ $context->setSerializeNull(false);
+ $this->assertFalse($context->shouldSerializeNull());
+
+ $context->setSerializeNull(true);
+ $this->assertTrue($context->shouldSerializeNull());
+
+ $context->setSerializeNull("foo");
+ $this->assertTrue($context->shouldSerializeNull());
+
+ $context->setSerializeNull("0");
+ $this->assertFalse($context->shouldSerializeNull());
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/DateIntervalFormatTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/DateIntervalFormatTest.php
new file mode 100644
index 0000000000..1a624ac7d9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/DateIntervalFormatTest.php
@@ -0,0 +1,47 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Handler\DateHandler;
+
+class DateIntervalFormatTest extends \PHPUnit_Framework_TestCase
+{
+ public function testFormat()
+ {
+ $dtf = new DateHandler();
+
+ $iso8601DateIntervalString = $dtf->format(new \DateInterval('P0D'));
+ $this->assertEquals($iso8601DateIntervalString, 'P0DT0S');
+
+ $iso8601DateIntervalString = $dtf->format(new \DateInterval('P0DT0S'));
+ $this->assertEquals($iso8601DateIntervalString, 'P0DT0S');
+
+ $iso8601DateIntervalString = $dtf->format(new \DateInterval('PT45M'));
+
+ $this->assertEquals($iso8601DateIntervalString, 'PT45M');
+
+ $iso8601DateIntervalString = $dtf->format(new \DateInterval('P2YT45M'));
+
+ $this->assertEquals($iso8601DateIntervalString, 'P2YT45M');
+
+ $iso8601DateIntervalString = $dtf->format(new \DateInterval('P2Y4DT6H8M16S'));
+
+ $this->assertEquals($iso8601DateIntervalString, 'P2Y4DT6H8M16S');
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Doctrine/IntegrationTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Doctrine/IntegrationTest.php
new file mode 100644
index 0000000000..c497a56e36
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Doctrine/IntegrationTest.php
@@ -0,0 +1,204 @@
+serializer->serialize($school, 'json');
+ $this->assertEquals('{"type":"school"}', $json);
+
+ $deserialized = $this->serializer->deserialize($json, Organization::class, 'json');
+ $this->assertEquals($school, $deserialized);
+ }
+
+ public function testDiscriminatorIsInferredForGenericBaseClass()
+ {
+ $student = new Student();
+ $json = $this->serializer->serialize($student, 'json');
+ $this->assertEquals('{"type":"student"}', $json);
+
+ $deserialized = $this->serializer->deserialize($json, Person::class, 'json');
+ $this->assertEquals($student, $deserialized);
+ }
+
+ public function testDiscriminatorIsInferredFromDoctrine()
+ {
+ /** @var EntityManager $em */
+ $em = $this->registry->getManager();
+
+ $student1 = new Student();
+ $student2 = new Student();
+ $teacher = new Teacher();
+ $class = new Clazz($teacher, array($student1, $student2));
+
+ $em->persist($student1);
+ $em->persist($student2);
+ $em->persist($teacher);
+ $em->persist($class);
+ $em->flush();
+ $em->clear();
+
+ $reloadedClass = $em->find(get_class($class), $class->getId());
+ $this->assertNotSame($class, $reloadedClass);
+
+ $json = $this->serializer->serialize($reloadedClass, 'json');
+ $this->assertEquals('{"id":1,"teacher":{"id":1,"type":"teacher"},"students":[{"id":2,"type":"student"},{"id":3,"type":"student"}]}', $json);
+ }
+
+ protected function setUp()
+ {
+ $connection = $this->createConnection();
+ $entityManager = $this->createEntityManager($connection);
+
+ $this->registry = $registry = new SimpleManagerRegistry(
+ function($id) use($connection, $entityManager) {
+ switch ($id) {
+ case 'default_connection':
+ return $connection;
+
+ case 'default_manager':
+ return $entityManager;
+
+ default:
+ throw new \RuntimeException(sprintf('Unknown service id "%s".', $id));
+ }
+ }
+ );
+
+ $this->serializer = SerializerBuilder::create()
+ ->setMetadataDriverFactory(new CallbackDriverFactory(
+ function(array $metadataDirs, Reader $annotationReader) use($registry) {
+ $defaultFactory = new DefaultDriverFactory();
+
+ return new DoctrineTypeDriver($defaultFactory->createDriver($metadataDirs, $annotationReader), $registry);
+ }
+ ))
+ ->build()
+ ;
+
+ $this->prepareDatabase();
+ }
+
+ private function prepareDatabase()
+ {
+ /** @var EntityManager $em */
+ $em = $this->registry->getManager();
+
+ $tool = new SchemaTool($em);
+ $tool->createSchema($em->getMetadataFactory()->getAllMetadata());
+ }
+
+ private function createConnection()
+ {
+ $con = DriverManager::getConnection(array(
+ 'driver' => 'pdo_sqlite',
+ 'memory' => true,
+ ));
+
+ return $con;
+ }
+
+ private function createEntityManager(Connection $con)
+ {
+ $cfg = new Configuration();
+ $cfg->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), array(
+ __DIR__.'/../../Fixtures/Doctrine/SingleTableInheritance',
+ )));
+ $cfg->setAutoGenerateProxyClasses(true);
+ $cfg->setProxyNamespace('JMS\Serializer\DoctrineProxy');
+ $cfg->setProxyDir(sys_get_temp_dir().'/serializer-test-proxies');
+
+ $em = EntityManager::create($con, $cfg);
+
+ return $em;
+ }
+}
+
+class SimpleManagerRegistry extends AbstractManagerRegistry
+{
+ private $services = array();
+ private $serviceCreator;
+
+ public function __construct($serviceCreator, $name = 'anonymous', array $connections = array('default' => 'default_connection'), array $managers = array('default' => 'default_manager'), $defaultConnection = null, $defaultManager = null, $proxyInterface = 'Doctrine\Common\Persistence\Proxy')
+ {
+ if (null === $defaultConnection) {
+ list($defaultConnection, ) = each($connections);
+ }
+ if (null === $defaultManager) {
+ list($defaultManager, ) = each($managers);
+ }
+
+ parent::__construct($name, $connections, $managers, $defaultConnection, $defaultManager, $proxyInterface);
+
+ if ( ! is_callable($serviceCreator)) {
+ throw new \InvalidArgumentException('$serviceCreator must be a valid callable.');
+ }
+ $this->serviceCreator = $serviceCreator;
+ }
+
+ public function getService($name)
+ {
+ if (isset($this->services[$name])) {
+ return $this->services[$name];
+ }
+
+ return $this->services[$name] = call_user_func($this->serviceCreator, $name);
+ }
+
+ public function resetService($name)
+ {
+ unset($this->services[$name]);
+ }
+
+ public function getAliasNamespace($alias)
+ {
+ foreach (array_keys($this->getManagers()) as $name) {
+ $manager = $this->getManager($name);
+
+ if ($manager instanceof EntityManager) {
+ try {
+ return $manager->getConfiguration()->getEntityNamespace($alias);
+ } catch (ORMException $ex) {
+ // Probably mapped by another entity manager, or invalid, just ignore this here.
+ }
+ } else {
+ throw new \LogicException(sprintf('Unsupported manager type "%s".', get_class($manager)));
+ }
+ }
+
+ throw new \RuntimeException(sprintf('The namespace alias "%s" is not known to any manager.', $alias));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Doctrine/ObjectConstructorTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Doctrine/ObjectConstructorTest.php
new file mode 100644
index 0000000000..774501b5b6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Doctrine/ObjectConstructorTest.php
@@ -0,0 +1,313 @@
+registry->getManager();
+
+ $author = new Author('John', 5);
+ $em->persist($author);
+ $em->flush();
+ $em->clear();
+
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback);
+ $authorFetched = $constructor->construct($this->visitor, $class, ['id' => 5], $type, $this->context);
+
+ $this->assertEquals($author, $authorFetched);
+ }
+
+ public function testFindManagedEntity()
+ {
+ $em = $this->registry->getManager();
+
+ $author = new Author('John', 5);
+ $em->persist($author);
+ $em->flush();
+
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback);
+ $authorFetched = $constructor->construct($this->visitor, $class, ['id' => 5], $type, $this->context);
+
+ $this->assertSame($author, $authorFetched);
+ }
+
+ public function testMissingAuthor()
+ {
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback);
+ $author = $constructor->construct($this->visitor, $class, ['id' => 5], $type, $this->context);
+ $this->assertNull($author);
+ }
+
+ public function testMissingAuthorFallback()
+ {
+ $author = new Author('John');
+
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+ $fallback->expects($this->once())->method('construct')->willReturn($author);
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback, DoctrineObjectConstructor::ON_MISSING_FALLBACK);
+ $authorFetched = $constructor->construct($this->visitor, $class, ['id' => 5], $type, $this->context);
+ $this->assertSame($author, $authorFetched);
+ }
+
+ public function testMissingNotManaged()
+ {
+ $author = new \JMS\Serializer\Tests\Fixtures\DoctrinePHPCR\Author('foo');
+
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+ $fallback->expects($this->once())->method('construct')->willReturn($author);
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback, DoctrineObjectConstructor::ON_MISSING_FALLBACK);
+ $authorFetched = $constructor->construct($this->visitor, $class, ['id' => 5], $type, $this->context);
+ $this->assertSame($author, $authorFetched);
+ }
+
+ public function testReference()
+ {
+ $em = $this->registry->getManager();
+
+ $author = new Author('John', 5);
+ $em->persist($author);
+ $em->flush();
+
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback, DoctrineObjectConstructor::ON_MISSING_FALLBACK);
+ $authorFetched = $constructor->construct($this->visitor, $class, 5, $type, $this->context);
+ $this->assertSame($author, $authorFetched);
+ }
+
+ /**
+ * @expectedException \JMS\Serializer\Exception\ObjectConstructionException
+ */
+ public function testMissingAuthorException()
+ {
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback, DoctrineObjectConstructor::ON_MISSING_EXCEPTION);
+ $constructor->construct($this->visitor, $class, ['id' => 5], $type, $this->context);
+ }
+
+ /**
+ * @expectedException \JMS\Serializer\Exception\InvalidArgumentException
+ */
+ public function testInvalidArg()
+ {
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback, 'foo');
+ $constructor->construct($this->visitor, $class, ['id' => 5], $type, $this->context);
+ }
+
+ public function testMissingData()
+ {
+ $author = new Author('John');
+
+ $fallback = $this->getMockBuilder(ObjectConstructorInterface::class)->getMock();
+ $fallback->expects($this->once())->method('construct')->willReturn($author);
+
+ $type = array('name' => Author::class, 'params' => array());
+ $class = new ClassMetadata(Author::class);
+
+ $constructor = new DoctrineObjectConstructor($this->registry, $fallback, 'foo');
+ $authorFetched = $constructor->construct($this->visitor, $class, ['foo' => 5], $type, $this->context);
+ $this->assertSame($author, $authorFetched);
+ }
+
+ protected function setUp()
+ {
+ $this->visitor = $this->getMockBuilder('JMS\Serializer\VisitorInterface')->getMock();
+ $this->context = $this->getMockBuilder('JMS\Serializer\DeserializationContext')->getMock();
+
+ $connection = $this->createConnection();
+ $entityManager = $this->createEntityManager($connection);
+
+ $this->registry = $registry = new SimpleBaseManagerRegistry(
+ function ($id) use ($connection, $entityManager) {
+ switch ($id) {
+ case 'default_connection':
+ return $connection;
+
+ case 'default_manager':
+ return $entityManager;
+
+ default:
+ throw new \RuntimeException(sprintf('Unknown service id "%s".', $id));
+ }
+ }
+ );
+
+ $this->serializer = SerializerBuilder::create()
+ ->setMetadataDriverFactory(new CallbackDriverFactory(
+ function (array $metadataDirs, Reader $annotationReader) use ($registry) {
+ $defaultFactory = new DefaultDriverFactory();
+
+ return new DoctrineTypeDriver($defaultFactory->createDriver($metadataDirs, $annotationReader), $registry);
+ }
+ ))
+ ->build();
+
+ $this->prepareDatabase();
+ }
+
+ private function prepareDatabase()
+ {
+ /** @var EntityManager $em */
+ $em = $this->registry->getManager();
+
+ $tool = new SchemaTool($em);
+ $tool->createSchema($em->getMetadataFactory()->getAllMetadata());
+ }
+
+ private function createConnection()
+ {
+ $con = DriverManager::getConnection(array(
+ 'driver' => 'pdo_sqlite',
+ 'memory' => true,
+ ));
+
+ return $con;
+ }
+
+ private function createEntityManager(Connection $con)
+ {
+ $cfg = new Configuration();
+ $cfg->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), array(
+ __DIR__ . '/../../Fixtures/Doctrine',
+ )));
+ $cfg->setAutoGenerateProxyClasses(true);
+ $cfg->setProxyNamespace('JMS\Serializer\DoctrineProxy');
+ $cfg->setProxyDir(sys_get_temp_dir() . '/serializer-test-proxies');
+
+ $em = EntityManager::create($con, $cfg);
+
+ return $em;
+ }
+}
+
+\Doctrine\DBAL\Types\Type::addType('Author', 'Doctrine\DBAL\Types\StringType');
+\Doctrine\DBAL\Types\Type::addType('some_custom_type', 'Doctrine\DBAL\Types\StringType');
+
+class SimpleBaseManagerRegistry extends AbstractManagerRegistry
+{
+ private $services = array();
+ private $serviceCreator;
+
+ public function __construct($serviceCreator, $name = 'anonymous', array $connections = array('default' => 'default_connection'), array $managers = array('default' => 'default_manager'), $defaultConnection = null, $defaultManager = null, $proxyInterface = 'Doctrine\Common\Persistence\Proxy')
+ {
+ if (null === $defaultConnection) {
+ list($defaultConnection,) = each($connections);
+ }
+ if (null === $defaultManager) {
+ list($defaultManager,) = each($managers);
+ }
+
+ parent::__construct($name, $connections, $managers, $defaultConnection, $defaultManager, $proxyInterface);
+
+ if (!is_callable($serviceCreator)) {
+ throw new \InvalidArgumentException('$serviceCreator must be a valid callable.');
+ }
+ $this->serviceCreator = $serviceCreator;
+ }
+
+ public function getService($name)
+ {
+ if (isset($this->services[$name])) {
+ return $this->services[$name];
+ }
+
+ return $this->services[$name] = call_user_func($this->serviceCreator, $name);
+ }
+
+ public function resetService($name)
+ {
+ unset($this->services[$name]);
+ }
+
+ public function getAliasNamespace($alias)
+ {
+ foreach (array_keys($this->getManagers()) as $name) {
+ $manager = $this->getManager($name);
+
+ if ($manager instanceof EntityManager) {
+ try {
+ return $manager->getConfiguration()->getEntityNamespace($alias);
+ } catch (ORMException $ex) {
+ // Probably mapped by another entity manager, or invalid, just ignore this here.
+ }
+ } else {
+ throw new \LogicException(sprintf('Unsupported manager type "%s".', get_class($manager)));
+ }
+ }
+
+ throw new \RuntimeException(sprintf('The namespace alias "%s" is not known to any manager.', $alias));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/EventDispatcherTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/EventDispatcherTest.php
new file mode 100644
index 0000000000..c130462fe1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/EventDispatcherTest.php
@@ -0,0 +1,202 @@
+
+ *
+ * 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\Serializer\EventDispatcher;
+
+use JMS\Serializer\EventDispatcher\Event;
+use JMS\Serializer\EventDispatcher\EventDispatcher;
+use JMS\Serializer\EventDispatcher\EventDispatcherInterface;
+use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
+use JMS\Serializer\EventDispatcher\ObjectEvent;
+
+class EventDispatcherTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var EventDispatcher
+ */
+ private $dispatcher;
+ private $event;
+
+ public function testHasListeners()
+ {
+ $this->assertFalse($this->dispatcher->hasListeners('foo', 'Foo', 'json'));
+ $this->dispatcher->addListener('foo', function() { });
+ $this->assertTrue($this->dispatcher->hasListeners('foo', 'Foo', 'json'));
+
+ $this->assertFalse($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
+ $this->dispatcher->addListener('bar', function() { }, 'Foo');
+ $this->assertFalse($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
+ $this->dispatcher->addListener('bar', function() { }, 'Bar', 'xml');
+ $this->assertFalse($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
+ $this->dispatcher->addListener('bar', function() { }, null, 'json');
+ $this->assertTrue($this->dispatcher->hasListeners('bar', 'Baz', 'json'));
+ $this->assertTrue($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
+
+ $this->assertFalse($this->dispatcher->hasListeners('baz', 'Bar', 'xml'));
+ $this->dispatcher->addListener('baz', function() { }, 'Bar');
+ $this->assertTrue($this->dispatcher->hasListeners('baz', 'Bar', 'xml'));
+ $this->assertTrue($this->dispatcher->hasListeners('baz', 'bAr', 'xml'));
+ }
+
+ public function testDispatch()
+ {
+ $a = new MockListener();
+ $this->dispatcher->addListener('foo', array($a, 'foo'));
+ $this->dispatch('bar');
+ $a->_verify('Listener is not called for other event.');
+
+ $b = new MockListener();
+ $this->dispatcher->addListener('pre', array($b, 'bar'), 'Bar');
+ $this->dispatcher->addListener('pre', array($b, 'foo'), 'Foo');
+ $this->dispatcher->addListener('pre', array($b, 'all'));
+
+ $b->bar($this->event, 'pre', 'bar', 'json', $this->dispatcher);
+ $b->all($this->event, 'pre', 'bar', 'json', $this->dispatcher);
+ $b->foo($this->event, 'pre', 'foo', 'json', $this->dispatcher);
+ $b->all($this->event, 'pre', 'foo', 'json', $this->dispatcher);
+ $b->_replay();
+ $this->dispatch('pre', 'Bar');
+ $this->dispatch('pre', 'Foo');
+ $b->_verify();
+ }
+
+ public function testListenerCanStopPropagation()
+ {
+ $listener1 = false;
+ $listener2 = false;
+
+ $this->dispatcher->addListener('pre', function (Event $event) use(&$listener1) {
+ $event->stopPropagation();
+ $listener1 = true;
+ });
+
+ $this->dispatcher->addListener('pre', function () use(&$listener2) {
+ $listener2 = true;
+ });
+
+ $this->dispatch('pre');
+
+ $this->assertTrue($listener1);
+ $this->assertFalse($listener2);
+ }
+
+ public function testListenerCanDispatchEvent()
+ {
+ $listener1 = false;
+ $listener2 = false;
+ $listener3 = false;
+
+ $this->dispatcher->addListener('pre', function (Event $event, $eventName, $loweredClass, $format, EventDispatcherInterface $dispatcher) use(&$listener1) {
+ $listener1 = true;
+
+ $event = new Event($event->getContext(), $event->getType());
+
+ $this->assertSame('pre', $eventName);
+ $this->assertSame('json', $format);
+ $this->assertSame('foo', $loweredClass);
+
+ $dispatcher->dispatch('post', 'Blah', 'xml', $event);
+ });
+
+ $this->dispatcher->addListener('pre', function () use(&$listener2) {
+ $listener2 = true;
+ });
+
+ $this->dispatcher->addListener('post', function (Event $event, $eventName, $loweredClass, $format, EventDispatcherInterface $dispatcher) use(&$listener3) {
+ $listener3 = true;
+
+ $this->assertSame('post', $eventName);
+ $this->assertSame('xml', $format);
+ $this->assertSame('blah', $loweredClass);
+ });
+
+ $this->dispatch('pre');
+
+ $this->assertTrue($listener1);
+ $this->assertTrue($listener2);
+ $this->assertTrue($listener3);
+ }
+
+ public function testAddSubscriber()
+ {
+ $subscriber = new MockSubscriber();
+ MockSubscriber::$events = array(
+ array('event' => 'foo.bar_baz', 'format' => 'foo'),
+ array('event' => 'bar', 'method' => 'bar', 'class' => 'foo'),
+ );
+
+ $this->dispatcher->addSubscriber($subscriber);
+ $this->assertAttributeEquals(array(
+ 'foo.bar_baz' => array(
+ array(array($subscriber, 'onfoobarbaz'), null, 'foo'),
+ ),
+ 'bar' => array(
+ array(array($subscriber, 'bar'), 'foo', null),
+ ),
+ ), 'listeners', $this->dispatcher);
+ }
+
+ protected function setUp()
+ {
+ $this->dispatcher = new EventDispatcher();
+ $this->event = new ObjectEvent($this->getMock('JMS\Serializer\Context'), new \stdClass(), array('name' => 'foo', 'params' => array()));
+ }
+
+ private function dispatch($eventName, $class = 'Foo', $format = 'json', Event $event = null)
+ {
+ $this->dispatcher->dispatch($eventName, $class, $format, $event ?: $this->event);
+ }
+}
+
+class MockSubscriber implements EventSubscriberInterface
+{
+ public static $events = array();
+
+ public static function getSubscribedEvents()
+ {
+ return self::$events;
+ }
+}
+
+class MockListener
+{
+ private $expected = array();
+ private $actual = array();
+ private $wasReplayed = false;
+
+ public function __call($method, array $args = array())
+ {
+ if ( ! $this->wasReplayed) {
+ $this->expected[] = array($method, $args);
+
+ return;
+ }
+
+ $this->actual[] = array($method, $args);
+ }
+
+ public function _replay()
+ {
+ $this->wasReplayed = true;
+ }
+
+ public function _verify($message = null)
+ {
+ \PHPUnit_Framework_Assert::assertSame($this->expected, $this->actual, $message);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriberTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriberTest.php
new file mode 100644
index 0000000000..fae03c4c05
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/DoctrineProxySubscriberTest.php
@@ -0,0 +1,146 @@
+
+ *
+ * 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\Serializer\EventDispatcher\Subscriber;
+
+use JMS\Serializer\EventDispatcher\EventDispatcher;
+use JMS\Serializer\EventDispatcher\PreSerializeEvent;
+use JMS\Serializer\EventDispatcher\Subscriber\DoctrineProxySubscriber;
+use JMS\Serializer\Tests\Fixtures\SimpleObjectProxy;
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\Metadata\ClassMetadata;
+use JMS\Serializer\Tests\Fixtures\ExclusionStrategy\AlwaysExcludeExclusionStrategy;
+use JMS\Serializer\Tests\Fixtures\SimpleObject;
+use Metadata\MetadataFactoryInterface;
+
+class DoctrineProxySubscriberTest extends \PHPUnit_Framework_TestCase
+{
+ /** @var VisitorInterface */
+ private $visitor;
+
+ /** @var DoctrineProxySubscriber */
+ private $subscriber;
+
+ /**
+ * @var EventDispatcher
+ */
+ private $dispatcher;
+
+ public function testRewritesProxyClassName()
+ {
+ $event = $this->createEvent($obj = new SimpleObjectProxy('a', 'b'), array('name' => get_class($obj), 'params' => array()));
+ $this->subscriber->onPreSerialize($event);
+
+ $this->assertEquals(array('name' => get_parent_class($obj), 'params' => array()), $event->getType());
+ $this->assertTrue($obj->__isInitialized());
+ }
+
+ public function testDoesNotRewriteCustomType()
+ {
+ $event = $this->createEvent($obj = new SimpleObjectProxy('a', 'b'), array('name' => 'FakedName', 'params' => array()));
+ $this->subscriber->onPreSerialize($event);
+
+ $this->assertEquals(array('name' => 'FakedName', 'params' => array()), $event->getType());
+ $this->assertTrue($obj->__isInitialized());
+ }
+
+ public function testProxyLoadingCanBeSkippedForVirtualTypes()
+ {
+ $subscriber = new DoctrineProxySubscriber(true);
+
+ $event = $this->createEvent($obj = new SimpleObjectProxy('a', 'b'), array('name' => 'FakedName', 'params' => array()));
+ $subscriber->onPreSerialize($event);
+
+ $this->assertEquals(array('name' => 'FakedName', 'params' => array()), $event->getType());
+ $this->assertFalse($obj->__isInitialized());
+ }
+
+ public function testProxyLoadingCanBeSkippedByExclusionStrategy()
+ {
+ $subscriber = new DoctrineProxySubscriber(false, false);
+
+ $factoryMock = $this->getMockBuilder(MetadataFactoryInterface::class)->getMock();
+ $factoryMock->method('getMetadataForClass')->willReturn(new ClassMetadata(SimpleObject::class));
+
+ $this->visitor->method('getExclusionStrategy')->willReturn(new AlwaysExcludeExclusionStrategy());
+ $this->visitor->method('getMetadataFactory')->willReturn($factoryMock);
+
+ $event = $this->createEvent($obj = new SimpleObjectProxy('a', 'b'), array('name' => SimpleObjectProxy::class, 'params' => array()));
+ $subscriber->onPreSerialize($event);
+ $this->assertFalse($obj->__isInitialized());
+
+ // virtual types are still initialized
+ $event = $this->createEvent($obj = new SimpleObjectProxy('a', 'b'), array('name' => 'FakeName', 'params' => array()));
+ $subscriber->onPreSerialize($event);
+ $this->assertTrue($obj->__isInitialized());
+ }
+
+ public function testEventTriggeredOnRealClassName()
+ {
+ $proxy = new SimpleObjectProxy('foo', 'bar');
+
+ $realClassEventTriggered1 = false;
+ $this->dispatcher->addListener('serializer.pre_serialize', function () use (&$realClassEventTriggered1) {
+ $realClassEventTriggered1 = true;
+ }, get_parent_class($proxy));
+
+ $event = $this->createEvent($proxy, array('name' => get_class($proxy), 'params' => array()));
+ $this->dispatcher->dispatch('serializer.pre_serialize', get_class($proxy), 'json', $event);
+
+ $this->assertTrue($realClassEventTriggered1);
+ }
+
+ public function testListenersCanChangeType()
+ {
+ $proxy = new SimpleObjectProxy('foo', 'bar');
+
+ $realClassEventTriggered1 = false;
+ $this->dispatcher->addListener('serializer.pre_serialize', function (PreSerializeEvent $event) use (&$realClassEventTriggered1) {
+ $event->setType('foo', ['bar']);
+ }, get_parent_class($proxy));
+
+ $event = $this->createEvent($proxy, array('name' => get_class($proxy), 'params' => array()));
+ $this->dispatcher->dispatch('serializer.pre_serialize', get_class($proxy), 'json', $event);
+
+ $this->assertSame(['name' => 'foo', 'params' => ['bar']], $event->getType());
+ }
+
+ public function testListenersDoNotChangeTypeOnProxiesAndVirtualTypes()
+ {
+ $proxy = new SimpleObjectProxy('foo', 'bar');
+
+ $event = $this->createEvent($proxy, ['name' => 'foo', 'params' => []]);
+ $this->dispatcher->dispatch('serializer.pre_serialize', get_class($proxy), 'json', $event);
+
+ $this->assertSame(['name' => 'foo', 'params' => []], $event->getType());
+ }
+
+ protected function setUp()
+ {
+ $this->subscriber = new DoctrineProxySubscriber();
+ $this->visitor = $this->getMock('JMS\Serializer\Context');
+
+ $this->dispatcher = new EventDispatcher();
+ $this->dispatcher->addSubscriber($this->subscriber);
+ }
+
+ private function createEvent($object, array $type)
+ {
+ return new PreSerializeEvent($this->visitor, $object, $type);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriberTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriberTest.php
new file mode 100644
index 0000000000..b49b80164a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriberTest.php
@@ -0,0 +1,110 @@
+
+ *
+ * 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\Serializer\EventDispatcher\Subscriber;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\DeserializationContext;
+use JMS\Serializer\EventDispatcher\EventDispatcher;
+use JMS\Serializer\EventDispatcher\ObjectEvent;
+use JMS\Serializer\EventDispatcher\Subscriber\SymfonyValidatorSubscriber;
+use JMS\Serializer\SerializerBuilder;
+use JMS\Serializer\Tests\Fixtures\AuthorList;
+use Symfony\Component\Validator\ConstraintViolation;
+use Symfony\Component\Validator\ConstraintViolationList;
+
+class SymfonyValidatorSubscriberTest extends \PHPUnit_Framework_TestCase
+{
+ private $validator;
+
+ /** @var SymfonyValidatorSubscriber */
+ private $subscriber;
+
+ public function testValidate()
+ {
+ $obj = new \stdClass;
+
+ $this->validator->expects($this->once())
+ ->method('validate')
+ ->with($obj, array('foo'))
+ ->will($this->returnValue(new ConstraintViolationList()));
+
+ $context = DeserializationContext::create()->setAttribute('validation_groups', array('foo'));
+
+ $this->subscriber->onPostDeserialize(new ObjectEvent($context, $obj, array()));
+ }
+
+ /**
+ * @expectedException JMS\Serializer\Exception\ValidationFailedException
+ * @expectedExceptionMessage Validation failed with 1 error(s).
+ */
+ public function testValidateThrowsExceptionWhenListIsNotEmpty()
+ {
+ $obj = new \stdClass;
+
+ $this->validator->expects($this->once())
+ ->method('validate')
+ ->with($obj, array('foo'))
+ ->will($this->returnValue(new ConstraintViolationList(array(new ConstraintViolation('foo', 'foo', array(), 'a', 'b', 'c')))));
+
+ $context = DeserializationContext::create()->setAttribute('validation_groups', array('foo'));
+
+ $this->subscriber->onPostDeserialize(new ObjectEvent($context, $obj, array()));
+ }
+
+ public function testValidatorIsNotCalledWhenNoGroupsAreSet()
+ {
+ $this->validator->expects($this->never())
+ ->method('validate');
+
+ $this->subscriber->onPostDeserialize(new ObjectEvent(DeserializationContext::create(), new \stdClass, array()));
+ }
+
+ public function testValidationIsOnlyPerformedOnRootObject()
+ {
+ $this->validator->expects($this->once())
+ ->method('validate')
+ ->with($this->isInstanceOf('JMS\Serializer\Tests\Fixtures\AuthorList'), array('Foo'))
+ ->will($this->returnValue(new ConstraintViolationList()));
+
+ $subscriber = $this->subscriber;
+ $list = SerializerBuilder::create()
+ ->configureListeners(function(EventDispatcher $dispatcher) use ($subscriber) {
+ $dispatcher->addSubscriber($subscriber);
+ })
+ ->build()
+ ->deserialize(
+ '{"authors":[{"full_name":"foo"},{"full_name":"bar"}]}',
+ 'JMS\Serializer\Tests\Fixtures\AuthorList',
+ 'json',
+ DeserializationContext::create()->setAttribute('validation_groups', array('Foo'))
+ );
+
+ $this->assertCount(2, $list);
+ }
+
+ protected function setUp()
+ {
+ if (!interface_exists('Symfony\Component\Validator\ValidatorInterface')) {
+ $this->markTestSkipped('Symfony\Component\Validator\ValidatorInterface is not available');
+ }
+
+ $this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface');
+ $this->subscriber = new SymfonyValidatorSubscriber($this->validator);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/SymfonyValidatorValidatorSubscriberTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/SymfonyValidatorValidatorSubscriberTest.php
new file mode 100644
index 0000000000..03e90cc3d4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/EventDispatcher/Subscriber/SymfonyValidatorValidatorSubscriberTest.php
@@ -0,0 +1,109 @@
+
+ *
+ * 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\Serializer\EventDispatcher\Subscriber;
+
+use JMS\Serializer\DeserializationContext;
+use JMS\Serializer\EventDispatcher\EventDispatcher;
+use JMS\Serializer\EventDispatcher\ObjectEvent;
+use JMS\Serializer\EventDispatcher\Subscriber\SymfonyValidatorSubscriber;
+use JMS\Serializer\EventDispatcher\Subscriber\SymfonyValidatorValidatorSubscriber;
+use JMS\Serializer\SerializerBuilder;
+use Symfony\Component\Validator\ConstraintViolation;
+use Symfony\Component\Validator\ConstraintViolationList;
+
+class SymfonyValidatorValidatorSubscriberTest extends \PHPUnit_Framework_TestCase
+{
+ private $validator;
+
+ /** @var SymfonyValidatorSubscriber */
+ private $subscriber;
+
+ public function testValidate()
+ {
+ $obj = new \stdClass;
+
+ $this->validator->expects($this->once())
+ ->method('validate')
+ ->with($obj, null, array('foo'))
+ ->will($this->returnValue(new ConstraintViolationList()));
+
+ $context = DeserializationContext::create()->setAttribute('validation_groups', array('foo'));
+
+ $this->subscriber->onPostDeserialize(new ObjectEvent($context, $obj, array()));
+ }
+
+ /**
+ * @expectedException \JMS\Serializer\Exception\ValidationFailedException
+ * @expectedExceptionMessage Validation failed with 1 error(s).
+ */
+ public function testValidateThrowsExceptionWhenListIsNotEmpty()
+ {
+ $obj = new \stdClass;
+
+ $this->validator->expects($this->once())
+ ->method('validate')
+ ->with($obj, null, array('foo'))
+ ->will($this->returnValue(new ConstraintViolationList(array(new ConstraintViolation('foo', 'foo', array(), 'a', 'b', 'c')))));
+
+ $context = DeserializationContext::create()->setAttribute('validation_groups', array('foo'));
+
+ $this->subscriber->onPostDeserialize(new ObjectEvent($context, $obj, array()));
+ }
+
+ public function testValidatorIsNotCalledWhenNoGroupsAreSet()
+ {
+ $this->validator->expects($this->never())
+ ->method('validate');
+
+ $this->subscriber->onPostDeserialize(new ObjectEvent(DeserializationContext::create(), new \stdClass, array()));
+ }
+
+ public function testValidationIsOnlyPerformedOnRootObject()
+ {
+ $this->validator->expects($this->once())
+ ->method('validate')
+ ->with($this->isInstanceOf('JMS\Serializer\Tests\Fixtures\AuthorList'), null, array('Foo'))
+ ->will($this->returnValue(new ConstraintViolationList()));
+
+ $subscriber = $this->subscriber;
+ $list = SerializerBuilder::create()
+ ->configureListeners(function (EventDispatcher $dispatcher) use ($subscriber) {
+ $dispatcher->addSubscriber($subscriber);
+ })
+ ->build()
+ ->deserialize(
+ '{"authors":[{"full_name":"foo"},{"full_name":"bar"}]}',
+ 'JMS\Serializer\Tests\Fixtures\AuthorList',
+ 'json',
+ DeserializationContext::create()->setAttribute('validation_groups', array('Foo'))
+ );
+
+ $this->assertCount(2, $list);
+ }
+
+ protected function setUp()
+ {
+ if (!interface_exists('Symfony\Component\Validator\Validator\ValidatorInterface')) {
+ $this->markTestSkipped('Symfony\Component\Validator\Validator\ValidatorInterface ^2.6|^3.0 is not available');
+ }
+
+ $this->validator = $this->getMock('Symfony\Component\Validator\Validator\ValidatorInterface');
+ $this->subscriber = new SymfonyValidatorValidatorSubscriber($this->validator);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/GraphNavigatorTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/GraphNavigatorTest.php
new file mode 100644
index 0000000000..b179dc03ef
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/GraphNavigatorTest.php
@@ -0,0 +1,177 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Construction\UnserializeObjectConstructor;
+use JMS\Serializer\Handler\HandlerRegistry;
+use JMS\Serializer\EventDispatcher\EventDispatcher;
+use Doctrine\Common\Annotations\AnnotationReader;
+use JMS\Serializer\Handler\SubscribingHandlerInterface;
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+use JMS\Serializer\GraphNavigator;
+use Metadata\MetadataFactory;
+
+class GraphNavigatorTest extends \PHPUnit_Framework_TestCase
+{
+ private $metadataFactory;
+ private $handlerRegistry;
+ private $objectConstructor;
+ private $dispatcher;
+ private $navigator;
+ private $context;
+
+ /**
+ * @expectedException JMS\Serializer\Exception\RuntimeException
+ * @expectedExceptionMessage Resources are not supported in serialized data.
+ */
+ public function testResourceThrowsException()
+ {
+ $this->context->expects($this->any())
+ ->method('getDirection')
+ ->will($this->returnValue(GraphNavigator::DIRECTION_SERIALIZATION));
+
+ $this->navigator->accept(STDIN, null, $this->context);
+ }
+
+ public function testNavigatorPassesInstanceOnSerialization()
+ {
+ $object = new SerializableClass;
+ $metadata = $this->metadataFactory->getMetadataForClass(get_class($object));
+
+ $self = $this;
+ $context = $this->context;
+ $exclusionStrategy = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface');
+ $exclusionStrategy->expects($this->once())
+ ->method('shouldSkipClass')
+ ->will($this->returnCallback(function($passedMetadata, $passedContext) use ($metadata, $context, $self) {
+ $self->assertSame($metadata, $passedMetadata);
+ $self->assertSame($context, $passedContext);
+ }));
+ $exclusionStrategy->expects($this->once())
+ ->method('shouldSkipProperty')
+ ->will($this->returnCallback(function($propertyMetadata, $passedContext) use ($context, $metadata, $self) {
+ $self->assertSame($metadata->propertyMetadata['foo'], $propertyMetadata);
+ $self->assertSame($context, $passedContext);
+ }));
+
+ $this->context->expects($this->once())
+ ->method('getExclusionStrategy')
+ ->will($this->returnValue($exclusionStrategy));
+
+ $this->context->expects($this->any())
+ ->method('getDirection')
+ ->will($this->returnValue(GraphNavigator::DIRECTION_SERIALIZATION));
+
+ $this->context->expects($this->any())
+ ->method('getVisitor')
+ ->will($this->returnValue($this->getMock('JMS\Serializer\VisitorInterface')));
+
+ $this->navigator = new GraphNavigator($this->metadataFactory, $this->handlerRegistry, $this->objectConstructor, $this->dispatcher);
+ $this->navigator->accept($object, null, $this->context);
+ }
+
+ public function testNavigatorPassesNullOnDeserialization()
+ {
+ $class = __NAMESPACE__.'\SerializableClass';
+ $metadata = $this->metadataFactory->getMetadataForClass($class);
+
+ $context = $this->context;
+ $exclusionStrategy = $this->getMock('JMS\Serializer\Exclusion\ExclusionStrategyInterface');
+ $exclusionStrategy->expects($this->once())
+ ->method('shouldSkipClass')
+ ->with($metadata, $this->callback(function ($navigatorContext) use ($context) {
+ return $navigatorContext === $context;
+ }));
+
+ $exclusionStrategy->expects($this->once())
+ ->method('shouldSkipProperty')
+ ->with($metadata->propertyMetadata['foo'], $this->callback(function ($navigatorContext) use ($context) {
+ return $navigatorContext === $context;
+ }));
+
+ $this->context->expects($this->once())
+ ->method('getExclusionStrategy')
+ ->will($this->returnValue($exclusionStrategy));
+
+ $this->context->expects($this->any())
+ ->method('getDirection')
+ ->will($this->returnValue(GraphNavigator::DIRECTION_DESERIALIZATION));
+
+ $this->context->expects($this->any())
+ ->method('getVisitor')
+ ->will($this->returnValue($this->getMock('JMS\Serializer\VisitorInterface')));
+
+ $this->navigator = new GraphNavigator($this->metadataFactory, $this->handlerRegistry, $this->objectConstructor, $this->dispatcher);
+ $this->navigator->accept('random', array('name' => $class, 'params' => array()), $this->context);
+ }
+
+ public function testNavigatorChangeTypeOnSerialization()
+ {
+ $object = new SerializableClass;
+ $typeName = 'JsonSerializable';
+
+ $this->dispatcher->addListener('serializer.pre_serialize', function($event) use ($typeName) {
+ $type = $event->getType();
+ $type['name'] = $typeName;
+ $event->setType($type['name'], $type['params']);
+ });
+
+ $this->handlerRegistry->registerSubscribingHandler(new TestSubscribingHandler());
+
+ $this->context->expects($this->any())
+ ->method('getDirection')
+ ->will($this->returnValue(GraphNavigator::DIRECTION_SERIALIZATION));
+
+ $this->context->expects($this->any())
+ ->method('getVisitor')
+ ->will($this->returnValue($this->getMock('JMS\Serializer\VisitorInterface')));
+
+ $this->navigator = new GraphNavigator($this->metadataFactory, $this->handlerRegistry, $this->objectConstructor, $this->dispatcher);
+ $this->navigator->accept($object, null, $this->context);
+ }
+
+ protected function setUp()
+ {
+ $this->context = $this->getMock('JMS\Serializer\Context');
+ $this->dispatcher = new EventDispatcher();
+ $this->handlerRegistry = new HandlerRegistry();
+ $this->objectConstructor = new UnserializeObjectConstructor();
+
+ $this->metadataFactory = new MetadataFactory(new AnnotationDriver(new AnnotationReader()));
+ $this->navigator = new GraphNavigator($this->metadataFactory, $this->handlerRegistry, $this->objectConstructor, $this->dispatcher);
+ }
+}
+
+class SerializableClass
+{
+ public $foo = 'bar';
+}
+
+class TestSubscribingHandler implements SubscribingHandlerInterface
+{
+ public static function getSubscribingMethods()
+ {
+ return array(array(
+ 'type' => 'JsonSerializable',
+ 'format' => 'foo',
+ 'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
+ 'method' => 'serialize'
+ ));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/JsonSerializationTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/JsonSerializationTest.php
new file mode 100644
index 0000000000..4077a80680
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/JsonSerializationTest.php
@@ -0,0 +1,429 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Context;
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\EventDispatcher\Event;
+use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Tests\Fixtures\ObjectWithEmptyArrayAndHash;
+use JMS\Serializer\Tests\Fixtures\Tag;
+use JMS\Serializer\VisitorInterface;
+use JMS\Serializer\Tests\Fixtures\Author;
+use JMS\Serializer\Tests\Fixtures\AuthorList;
+use JMS\Serializer\SerializationContext;
+
+class JsonSerializationTest extends BaseSerializationTest
+{
+ protected function getContent($key)
+ {
+ static $outputs = array();
+
+ if (!$outputs) {
+ $outputs['readonly'] = '{"id":123,"full_name":"Ruud Kamphuis"}';
+ $outputs['string'] = '"foo"';
+ $outputs['boolean_true'] = 'true';
+ $outputs['boolean_false'] = 'false';
+ $outputs['integer'] = '1';
+ $outputs['float'] = '4.533';
+ $outputs['float_trailing_zero'] = '1';
+ $outputs['simple_object'] = '{"foo":"foo","moo":"bar","camel_case":"boo"}';
+ $outputs['circular_reference'] = '{"collection":[{"name":"child1"},{"name":"child2"}],"another_collection":[{"name":"child1"},{"name":"child2"}]}';
+ $outputs['array_strings'] = '["foo","bar"]';
+ $outputs['array_booleans'] = '[true,false]';
+ $outputs['array_integers'] = '[1,3,4]';
+ $outputs['array_empty'] = '{"array":[]}';
+ $outputs['array_floats'] = '[1.34,3,6.42]';
+ $outputs['array_objects'] = '[{"foo":"foo","moo":"bar","camel_case":"boo"},{"foo":"baz","moo":"boo","camel_case":"boo"}]';
+ $outputs['array_list_and_map_difference'] = '{"list":[1,2,3],"map":{"0":1,"2":2,"3":3}}';
+ $outputs['array_mixed'] = '["foo",1,true,{"foo":"foo","moo":"bar","camel_case":"boo"},[1,3,true]]';
+ $outputs['array_datetimes_object'] = '{"array_with_default_date_time":["2047-01-01T12:47:47+0000","2016-12-05T00:00:00+0000"],"array_with_formatted_date_time":["01.01.2047 12:47:47","05.12.2016 00:00:00"]}';
+ $outputs['array_named_datetimes_object'] = '{"named_array_with_formatted_date":{"testdate1":"01.01.2047 12:47:47","testdate2":"05.12.2016 00:00:00"}}';
+ $outputs['array_datetimes_object'] = '{"array_with_default_date_time":["2047-01-01T12:47:47+0000","2016-12-05T00:00:00+0000"],"array_with_formatted_date_time":["01.01.2047 12:47:47","05.12.2016 00:00:00"]}';
+ $outputs['array_named_datetimes_object'] = '{"named_array_with_formatted_date":{"testdate1":"01.01.2047 12:47:47","testdate2":"05.12.2016 00:00:00"}}';
+ $outputs['array_named_datetimeimmutables_object'] = '{"named_array_with_formatted_date":{"testdate1":"01.01.2047 12:47:47","testdate2":"05.12.2016 00:00:00"}}';
+ $outputs['blog_post'] = '{"id":"what_a_nice_id","title":"This is a nice title.","created_at":"2011-07-30T00:00:00+0000","is_published":false,"etag":"1edf9bf60a32d89afbb85b2be849e3ceed5f5b10","comments":[{"author":{"full_name":"Foo Bar"},"text":"foo"}],"comments2":[{"author":{"full_name":"Foo Bar"},"text":"foo"}],"metadata":{"foo":"bar"},"author":{"full_name":"Foo Bar"},"publisher":{"pub_name":"Bar Foo"},"tag":[{"name":"tag1"},{"name":"tag2"}]}';
+ $outputs['blog_post_unauthored'] = '{"id":"what_a_nice_id","title":"This is a nice title.","created_at":"2011-07-30T00:00:00+0000","is_published":false,"etag":"1edf9bf60a32d89afbb85b2be849e3ceed5f5b10","comments":[],"comments2":[],"metadata":{"foo":"bar"},"author":null,"publisher":null,"tag":null}';
+ $outputs['price'] = '{"price":3}';
+ $outputs['currency_aware_price'] = '{"currency":"EUR","amount":2.34}';
+ $outputs['order'] = '{"cost":{"price":12.34}}';
+ $outputs['order_with_currency_aware_price'] = '{"cost":{"currency":"EUR","amount":1.23}}';
+ $outputs['log'] = '{"author_list":[{"full_name":"Johannes Schmitt"},{"full_name":"John Doe"}],"comments":[{"author":{"full_name":"Foo Bar"},"text":"foo"},{"author":{"full_name":"Foo Bar"},"text":"bar"},{"author":{"full_name":"Foo Bar"},"text":"baz"}]}';
+ $outputs['lifecycle_callbacks'] = '{"name":"Foo Bar"}';
+ $outputs['form_errors'] = '["This is the form error","Another error"]';
+ $outputs['nested_form_errors'] = '{"errors":["This is the form error"],"children":{"bar":{"errors":["Error of the child form"]}}}';
+ $outputs['constraint_violation'] = '{"property_path":"foo","message":"Message of violation"}';
+ $outputs['constraint_violation_list'] = '[{"property_path":"foo","message":"Message of violation"},{"property_path":"bar","message":"Message of another violation"}]';
+ $outputs['article'] = '{"custom":"serialized"}';
+ $outputs['orm_proxy'] = '{"foo":"foo","moo":"bar","camel_case":"proxy-boo"}';
+ $outputs['custom_accessor'] = '{"comments":{"Foo":{"comments":[{"author":{"full_name":"Foo"},"text":"foo"},{"author":{"full_name":"Foo"},"text":"bar"}],"count":2}}}';
+ $outputs['mixed_access_types'] = '{"id":1,"name":"Johannes","read_only_property":42}';
+ $outputs['accessor_order_child'] = '{"c":"c","d":"d","a":"a","b":"b"}';
+ $outputs['accessor_order_parent'] = '{"a":"a","b":"b"}';
+ $outputs['accessor_order_methods'] = '{"foo":"c","b":"b","a":"a"}';
+ $outputs['inline'] = '{"c":"c","a":"a","b":"b","d":"d"}';
+ $outputs['inline_child_empty'] = '{"c":"c","d":"d"}';
+ $outputs['empty_child'] = '{"c":"c","d":"d","child":{}}';
+ $outputs['empty_child_skip'] = '{"c":"c","d":"d"}';
+ $outputs['groups_all'] = '{"foo":"foo","foobar":"foobar","bar":"bar","none":"none"}';
+ $outputs['groups_foo'] = '{"foo":"foo","foobar":"foobar"}';
+ $outputs['groups_foobar'] = '{"foo":"foo","foobar":"foobar","bar":"bar"}';
+ $outputs['groups_default'] = '{"bar":"bar","none":"none"}';
+ $outputs['groups_advanced'] = '{"name":"John","manager":{"name":"John Manager","friends":[{"nickname":"nickname"},{"nickname":"nickname"}]},"friends":[{"manager":{"name":"John friend 1 manager"}},{"manager":{"name":"John friend 2 manager"}}]}';
+ $outputs['virtual_properties'] = '{"exist_field":"value","virtual_value":"value","test":"other-name","typed_virtual_property":1}';
+ $outputs['virtual_properties_low'] = '{"low":1}';
+ $outputs['virtual_properties_high'] = '{"high":8}';
+ $outputs['virtual_properties_all'] = '{"low":1,"high":8}';
+ $outputs['nullable'] = '{"foo":"bar","baz":null,"0":null}';
+ $outputs['nullable_skip'] = '{"foo":"bar"}';
+ $outputs['person_secret_show'] = '{"name":"mike","gender":"f"}';
+ $outputs['person_secret_hide'] = '{"name":"mike"}';
+ $outputs['null'] = 'null';
+ $outputs['simple_object_nullable'] = '{"foo":"foo","moo":"bar","camel_case":"boo","null_property":null}';
+ $outputs['input'] = '{"attributes":{"type":"text","name":"firstname","value":"Adrien"}}';
+ $outputs['hash_empty'] = '{"hash":{}}';
+ $outputs['object_when_null'] = '{"text":"foo"}';
+ $outputs['object_when_null_and_serialized'] = '{"author":null,"text":"foo"}';
+ $outputs['date_time'] = '"2011-08-30T00:00:00+0000"';
+ $outputs['date_time_immutable'] = '"2011-08-30T00:00:00+0000"';
+ $outputs['timestamp'] = '{"timestamp":1455148800}';
+ $outputs['timestamp_prev'] = '{"timestamp":"1455148800"}';
+ $outputs['date_interval'] = '"PT45M"';
+ $outputs['car'] = '{"km":5,"type":"car"}';
+ $outputs['car_without_type'] = '{"km":5}';
+ $outputs['garage'] = '{"vehicles":[{"km":3,"type":"car"},{"km":1,"type":"moped"}]}';
+ $outputs['tree'] = '{"tree":{"children":[{"children":[{"children":[],"foo":"bar"}],"foo":"bar"}],"foo":"bar"}}';
+ $outputs['nullable_arrays'] = '{"empty_inline":[],"not_empty_inline":["not_empty_inline"],"empty_not_inline":[],"not_empty_not_inline":["not_empty_not_inline"],"empty_not_inline_skip":[],"not_empty_not_inline_skip":["not_empty_not_inline_skip"]}';
+ $outputs['object_with_object_property_no_array_to_author'] = '{"foo": "bar", "author": "baz"}';
+ $outputs['object_with_object_property'] = '{"foo": "bar", "author": {"full_name": "baz"}}';
+ $outputs['author_expression'] = '{"my_first_name":"Ruud","last_name":"Kamphuis","id":123}';
+ $outputs['maxdepth_skippabe_object'] = '{"a":{"xxx":"yyy"}}';
+ }
+
+ if (!isset($outputs[$key])) {
+ throw new RuntimeException(sprintf('The key "%s" is not supported.', $key));
+ }
+
+ return $outputs[$key];
+ }
+
+ public function testSkipEmptyArrayAndHash()
+ {
+ $object = new ObjectWithEmptyArrayAndHash();
+
+ $this->assertEquals('{}', $this->serialize($object));
+ }
+
+ public function testAddLinksToOutput()
+ {
+ $this->dispatcher->addListener('serializer.post_serialize', function (Event $event) {
+ $this->assertFalse($event->getVisitor()->hasData('_links'));
+ }, 'JMS\Serializer\Tests\Fixtures\Author', 'json');
+
+ $this->dispatcher->addSubscriber(new LinkAddingSubscriber());
+
+ $this->dispatcher->addListener('serializer.post_serialize', function (Event $event) {
+ $this->assertTrue($event->getVisitor()->hasData('_links'));
+ }, 'JMS\Serializer\Tests\Fixtures\Author', 'json');
+
+ $this->handlerRegistry->registerHandler(GraphNavigator::DIRECTION_SERIALIZATION, 'JMS\Serializer\Tests\Fixtures\AuthorList', 'json',
+ function(VisitorInterface $visitor, AuthorList $data, array $type, Context $context) {
+ return $visitor->visitArray(iterator_to_array($data), $type, $context);
+ }
+ );
+
+ $list = new AuthorList();
+ $list->add(new Author('foo'));
+ $list->add(new Author('bar'));
+
+ $this->assertEquals('[{"full_name":"foo","_links":{"details":"http:\/\/foo.bar\/details\/foo","comments":"http:\/\/foo.bar\/details\/foo\/comments"}},{"full_name":"bar","_links":{"details":"http:\/\/foo.bar\/details\/bar","comments":"http:\/\/foo.bar\/details\/bar\/comments"}}]', $this->serialize($list));
+ }
+
+ public function testReplaceNameInOutput()
+ {
+ $this->dispatcher->addSubscriber(new ReplaceNameSubscriber());
+ $this->handlerRegistry->registerHandler(GraphNavigator::DIRECTION_SERIALIZATION, 'JMS\Serializer\Tests\Fixtures\AuthorList', 'json',
+ function(VisitorInterface $visitor, AuthorList $data, array $type, Context $context) {
+ return $visitor->visitArray(iterator_to_array($data), $type, $context);
+ }
+ );
+
+ $list = new AuthorList();
+ $list->add(new Author('foo'));
+ $list->add(new Author('bar'));
+
+ $this->assertEquals('[{"full_name":"new name"},{"full_name":"new name"}]', $this->serialize($list));
+ }
+
+ /**
+ * @expectedException RuntimeException
+ * @expectedExceptionMessage Invalid data "baz"(string), expected "JMS\Serializer\Tests\Fixtures\Author".
+ */
+ public function testDeserializingObjectWithObjectPropertyWithNoArrayToObject()
+ {
+ $content = $this->getContent('object_with_object_property_no_array_to_author');
+ $object = $this->deserialize($content, 'JMS\Serializer\Tests\Fixtures\ObjectWithObjectProperty');
+ $this->assertEquals('bar', $object->getFoo());
+ $this->assertInstanceOf('JMS\Serializer\Tests\Fixtures\Author', $object->getAuthor());
+ }
+
+ public function testDeserializingObjectWithObjectProperty()
+ {
+ $content = $this->getContent('object_with_object_property');
+ $object = $this->deserialize($content, 'JMS\Serializer\Tests\Fixtures\ObjectWithObjectProperty');
+ $this->assertEquals('bar', $object->getFoo());
+ $this->assertInstanceOf('JMS\Serializer\Tests\Fixtures\Author', $object->getAuthor());
+ $this->assertEquals('baz', $object->getAuthor()->getName());
+ }
+
+ public function getPrimitiveTypes()
+ {
+ return array(
+ array(
+ 'type' => 'boolean',
+ 'data' => true,
+ ),
+ array(
+ 'type' => 'boolean',
+ 'data' => 1,
+ ),
+ array(
+ 'type' => 'integer',
+ 'data' => 123,
+ ),
+ array(
+ 'type' => 'integer',
+ 'data' => "123",
+ ),
+ array(
+ 'type' => 'string',
+ 'data' => "hello",
+ ),
+ array(
+ 'type' => 'string',
+ 'data' => 123,
+ ),
+ array(
+ 'type' => 'double',
+ 'data' => 0.1234,
+ ),
+ array(
+ 'type' => 'double',
+ 'data' => "0.1234",
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider getPrimitiveTypes
+ */
+ public function testPrimitiveTypes($primitiveType, $data)
+ {
+ $visitor = $this->serializationVisitors->get('json')->get();
+ $functionToCall = 'visit' . ucfirst($primitiveType);
+ $result = $visitor->$functionToCall($data, array(), $this->getMock('JMS\Serializer\Context'));
+ if ($primitiveType == 'double') {
+ $primitiveType = 'float';
+ }
+ $this->assertInternalType($primitiveType, $result);
+ }
+
+ /**
+ * @group empty-object
+ */
+ public function testSerializeEmptyObject()
+ {
+ $this->assertEquals('{}', $this->serialize(new Author(null)));
+ }
+
+ /**
+ * @group encoding
+ * @expectedException RuntimeException
+ * @expectedExceptionMessage Your data could not be encoded because it contains invalid UTF8 characters.
+ */
+ public function testSerializeWithNonUtf8EncodingWhenDisplayErrorsOff()
+ {
+ ini_set('display_errors', 1);
+ $this->serialize(array('foo' => 'bar', 'bar' => pack("H*" ,'c32e')));
+ }
+
+ /**
+ * @group encoding
+ * @expectedException RuntimeException
+ * @expectedExceptionMessage Your data could not be encoded because it contains invalid UTF8 characters.
+ */
+ public function testSerializeWithNonUtf8EncodingWhenDisplayErrorsOn()
+ {
+ ini_set('display_errors', 0);
+ $this->serialize(array('foo' => 'bar', 'bar' => pack("H*" ,'c32e')));
+ }
+
+ public function testSerializeArrayWithEmptyObject()
+ {
+ $this->assertEquals('[{}]', $this->serialize(array(new \stdClass())));
+ }
+
+ public function testSerializeRootArrayWithDefinedKeys()
+ {
+ $author1 = new Author("Jim");
+ $author2 = new Author("Mark");
+
+ $data = array(
+ 'jim' => $author1,
+ 'mark' => $author2,
+ );
+
+ $this->assertEquals('{"jim":{"full_name":"Jim"},"mark":{"full_name":"Mark"}}', $this->serializer->serialize($data, $this->getFormat(), SerializationContext::create()->setInitialType('array')));
+ $this->assertEquals('[{"full_name":"Jim"},{"full_name":"Mark"}]', $this->serializer->serialize($data, $this->getFormat(), SerializationContext::create()->setInitialType('array')));
+ $this->assertEquals('{"jim":{"full_name":"Jim"},"mark":{"full_name":"Mark"}}', $this->serializer->serialize($data, $this->getFormat(), SerializationContext::create()->setInitialType('array')));
+
+ $data = array(
+ $author1,
+ $author2,
+ );
+ $this->assertEquals('[{"full_name":"Jim"},{"full_name":"Mark"}]', $this->serializer->serialize($data, $this->getFormat(), SerializationContext::create()->setInitialType('array')));
+ $this->assertEquals('{"0":{"full_name":"Jim"},"1":{"full_name":"Mark"}}', $this->serializer->serialize($data, $this->getFormat(), SerializationContext::create()->setInitialType('array')));
+ $this->assertEquals('{"0":{"full_name":"Jim"},"1":{"full_name":"Mark"}}', $this->serializer->serialize($data, $this->getFormat(), SerializationContext::create()->setInitialType('array')));
+ }
+
+ public function getTypeHintedArrays()
+ {
+ return [
+
+ [[1, 2], '[1,2]', null],
+ [['a', 'b'], '["a","b"]', null],
+ [['a' => 'a', 'b' => 'b'], '{"a":"a","b":"b"}', null],
+
+ [[], '[]', null],
+ [[], '[]', SerializationContext::create()->setInitialType('array')],
+ [[], '[]', SerializationContext::create()->setInitialType('array')],
+ [[], '{}', SerializationContext::create()->setInitialType('array')],
+
+
+ [[1, 2], '[1,2]', SerializationContext::create()->setInitialType('array')],
+ [[1 => 1, 2 => 2], '{"1":1,"2":2}', SerializationContext::create()->setInitialType('array')],
+ [[1 => 1, 2 => 2], '[1,2]', SerializationContext::create()->setInitialType('array')],
+ [['a', 'b'], '["a","b"]', SerializationContext::create()->setInitialType('array')],
+
+ [[1 => 'a', 2 => 'b'], '["a","b"]', SerializationContext::create()->setInitialType('array')],
+ [['a' => 'a', 'b' => 'b'], '["a","b"]', SerializationContext::create()->setInitialType('array')],
+
+
+ [[1,2], '{"0":1,"1":2}', SerializationContext::create()->setInitialType('array')],
+ [[1,2], '{"0":1,"1":2}', SerializationContext::create()->setInitialType('array')],
+ [[1,2], '{"0":"1","1":"2"}', SerializationContext::create()->setInitialType('array')],
+
+
+ [['a', 'b'], '{"0":"a","1":"b"}', SerializationContext::create()->setInitialType('array')],
+ [['a' => 'a', 'b' => 'b'], '{"a":"a","b":"b"}', SerializationContext::create()->setInitialType('array')],
+ ];
+ }
+
+ /**
+ * @dataProvider getTypeHintedArrays
+ * @param array $array
+ * @param string $expected
+ * @param SerializationContext|null $context
+ */
+ public function testTypeHintedArraySerialization(array $array, $expected, $context = null)
+ {
+ $this->assertEquals($expected, $this->serialize($array, $context));
+ }
+
+ public function getTypeHintedArraysAndStdClass()
+ {
+ $c1 = new \stdClass();
+ $c2 = new \stdClass();
+ $c2->foo = 'bar';
+
+ $tag = new Tag("tag");
+
+ $c3 = new \stdClass();
+ $c3->foo = $tag;
+
+ return [
+
+ [[$c1], '[{}]', SerializationContext::create()->setInitialType('array')],
+
+ [[$c2], '[{"foo":"bar"}]', SerializationContext::create()->setInitialType('array')],
+
+ [[$tag], '[{"name":"tag"}]', SerializationContext::create()->setInitialType('array')],
+
+ [[$c1], '{"0":{}}', SerializationContext::create()->setInitialType('array')],
+ [[$c2], '{"0":{"foo":"bar"}}', SerializationContext::create()->setInitialType('array')],
+
+ [[$c3], '{"0":{"foo":{"name":"tag"}}}', SerializationContext::create()->setInitialType('array')],
+ [[$c3], '[{"foo":{"name":"tag"}}]', SerializationContext::create()->setInitialType('array')],
+
+ [[$tag], '{"0":{"name":"tag"}}', SerializationContext::create()->setInitialType('array')],
+ ];
+ }
+
+ /**
+ * @dataProvider getTypeHintedArraysAndStdClass
+ * @param array $array
+ * @param string $expected
+ * @param SerializationContext|null $context
+ */
+ public function testTypeHintedArrayAndStdClassSerialization(array $array, $expected, $context = null)
+ {
+ $this->assertEquals($expected, $this->serialize($array, $context));
+ }
+
+ protected function getFormat()
+ {
+ return 'json';
+ }
+}
+
+class LinkAddingSubscriber implements EventSubscriberInterface
+{
+ public function onPostSerialize(Event $event)
+ {
+ $author = $event->getObject();
+
+ $event->getVisitor()->addData('_links', array(
+ 'details' => 'http://foo.bar/details/'.$author->getName(),
+ 'comments' => 'http://foo.bar/details/'.$author->getName().'/comments',
+ ));
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ array('event' => 'serializer.post_serialize', 'method' => 'onPostSerialize', 'format' => 'json', 'class' => 'JMS\Serializer\Tests\Fixtures\Author'),
+ );
+ }
+}
+
+class ReplaceNameSubscriber implements EventSubscriberInterface
+{
+ public function onPostSerialize(Event $event)
+ {
+ $event->getVisitor()->setData('full_name', 'new name');
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ array('event' => 'serializer.post_serialize', 'method' => 'onPostSerialize', 'format' => 'json', 'class' => 'JMS\Serializer\Tests\Fixtures\Author'),
+ );
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Naming/IdenticalPropertyNamingStrategyTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Naming/IdenticalPropertyNamingStrategyTest.php
new file mode 100644
index 0000000000..b36cb315b1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/Naming/IdenticalPropertyNamingStrategyTest.php
@@ -0,0 +1,45 @@
+
+ *
+ * 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\Serializer\Naming;
+
+use JMS\Serializer\Naming\IdenticalPropertyNamingStrategy;
+
+class IdenticalPropertyNamingStrategyTest extends \PHPUnit_Framework_TestCase
+{
+ public function providePropertyNames()
+ {
+ return array(
+ array('createdAt'),
+ array('my_field'),
+ array('identical')
+ );
+ }
+
+ /**
+ * @dataProvider providePropertyNames
+ */
+ public function testTranslateName($propertyName)
+ {
+ $mockProperty = $this->getMockBuilder('JMS\Serializer\Metadata\PropertyMetadata')->disableOriginalConstructor()->getMock();
+ $mockProperty->name = $propertyName;
+
+ $strategy = new IdenticalPropertyNamingStrategy();
+ $this->assertEquals($propertyName, $strategy->translateName($mockProperty));
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/SerializationContextFactoryTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/SerializationContextFactoryTest.php
new file mode 100644
index 0000000000..def0d0ec8f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/SerializationContextFactoryTest.php
@@ -0,0 +1,127 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Handler\HandlerRegistry;
+use PhpCollection\Map;
+use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
+use Metadata\MetadataFactory;
+use JMS\Serializer\Metadata\Driver\AnnotationDriver;
+use Doctrine\Common\Annotations\AnnotationReader;
+use JMS\Serializer\Construction\UnserializeObjectConstructor;
+use JMS\Serializer\JsonSerializationVisitor;
+use JMS\Serializer\JsonDeserializationVisitor;
+use JMS\Serializer\Serializer;
+use JMS\Serializer\Naming\CamelCaseNamingStrategy;
+use JMS\Serializer\SerializationContext;
+use JMS\Serializer\DeserializationContext;
+
+class SerializationContextFactoryTest extends \PHPUnit_Framework_TestCase
+{
+ protected $serializer;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $namingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
+
+ $this->serializer = new Serializer(
+ new MetadataFactory(new AnnotationDriver(new AnnotationReader())),
+ new HandlerRegistry(),
+ new UnserializeObjectConstructor(),
+ new Map(array('json' => new JsonSerializationVisitor($namingStrategy))),
+ new Map(array('json' => new JsonDeserializationVisitor($namingStrategy)))
+ );
+ }
+
+ public function testSerializeUseProvidedSerializationContext()
+ {
+ $contextFactoryMock = $this->getMockForAbstractClass('JMS\\Serializer\\ContextFactory\\SerializationContextFactoryInterface');
+ $context = new SerializationContext();
+ $context->setSerializeNull(true);
+
+ $contextFactoryMock
+ ->expects($this->once())
+ ->method('createSerializationContext')
+ ->will($this->returnValue($context))
+ ;
+
+ $this->serializer->setSerializationContextFactory($contextFactoryMock);
+
+ $result = $this->serializer->serialize(array('value' => null), 'json');
+
+ $this->assertEquals('{"value":null}', $result);
+ }
+
+ public function testDeserializeUseProvidedDeserializationContext()
+ {
+ $contextFactoryMock = $this->getMockForAbstractClass('JMS\\Serializer\\ContextFactory\\DeserializationContextFactoryInterface');
+ $context = new DeserializationContext();
+
+ $contextFactoryMock
+ ->expects($this->once())
+ ->method('createDeserializationContext')
+ ->will($this->returnValue($context))
+ ;
+
+ $this->serializer->setDeserializationContextFactory($contextFactoryMock);
+
+ $result = $this->serializer->deserialize('{"value":null}', 'array', 'json');
+
+ $this->assertEquals(array('value' => null), $result);
+ }
+
+ public function testToArrayUseProvidedSerializationContext()
+ {
+ $contextFactoryMock = $this->getMockForAbstractClass('JMS\\Serializer\\ContextFactory\\SerializationContextFactoryInterface');
+ $context = new SerializationContext();
+ $context->setSerializeNull(true);
+
+ $contextFactoryMock
+ ->expects($this->once())
+ ->method('createSerializationContext')
+ ->will($this->returnValue($context))
+ ;
+
+ $this->serializer->setSerializationContextFactory($contextFactoryMock);
+
+ $result = $this->serializer->toArray(array('value' => null));
+
+ $this->assertEquals(array('value' => null), $result);
+ }
+
+ public function testFromArrayUseProvidedDeserializationContext()
+ {
+ $contextFactoryMock = $this->getMockForAbstractClass('JMS\\Serializer\\ContextFactory\\DeserializationContextFactoryInterface');
+ $context = new DeserializationContext();
+
+ $contextFactoryMock
+ ->expects($this->once())
+ ->method('createDeserializationContext')
+ ->will($this->returnValue($context))
+ ;
+
+ $this->serializer->setDeserializationContextFactory($contextFactoryMock);
+
+ $result = $this->serializer->fromArray(array('value' => null), 'array');
+
+ $this->assertEquals(array('value' => null), $result);
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/TypeParserTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/TypeParserTest.php
new file mode 100644
index 0000000000..1572c25f62
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/TypeParserTest.php
@@ -0,0 +1,99 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\TypeParser;
+
+class TypeParserTest extends \PHPUnit_Framework_TestCase
+{
+ private $parser;
+
+ /**
+ * @dataProvider getTypes
+ */
+ public function testParse($type, $name, array $params = array())
+ {
+ $this->assertEquals(array('name' => $name, 'params' => $params), $this->parser->parse($type));
+ }
+
+ public function getTypes()
+ {
+ $types = array();
+ $types[] = array('string', 'string');
+ $types[] = array('array', 'array', array(array('name' => 'Foo', 'params' => array())));
+ $types[] = array('array', 'array', array(array('name' => 'Foo', 'params' => array()), array('name' => 'Bar', 'params' => array())));
+ $types[] = array('array', 'array', array(array('name' => 'Foo\Bar', 'params' => array()), array('name' => 'Baz\Boo', 'params' => array())));
+ $types[] = array('a,e>', 'a', array(array('name' => 'b', 'params' => array(array('name' => 'c', 'params' => array()), array('name' => 'd', 'params' => array()))), array('name' => 'e', 'params' => array())));
+ $types[] = array('Foo', 'Foo');
+ $types[] = array('Foo\Bar', 'Foo\Bar');
+ $types[] = array('Foo<"asdf asdf">', 'Foo', array('asdf asdf'));
+
+ return $types;
+ }
+
+ /**
+ * @expectedException \JMS\Parser\SyntaxErrorException
+ * @expectedExceptionMessage Expected T_CLOSE_BRACKET, but got end of input.
+ */
+ public function testParamTypeMustEndWithBracket()
+ {
+ $this->parser->parse('Fooparser->parse(',');
+ }
+
+ /**
+ * @expectedException \JMS\Parser\SyntaxErrorException
+ * @expectedExceptionMessage Expected any of T_NAME or T_STRING, but got ">" of type T_CLOSE_BRACKET at position 4 (0-based).
+ */
+ public function testEmptyParams()
+ {
+ $this->parser->parse('Foo<>');
+ }
+
+ /**
+ * @expectedException \JMS\Parser\SyntaxErrorException
+ * @expectedExceptionMessage Expected any of T_NAME or T_STRING, but got ">" of type T_CLOSE_BRACKET at position 7 (0-based).
+ */
+ public function testNoTrailingComma()
+ {
+ $this->parser->parse('Foo');
+ }
+
+ /**
+ * @expectedException \JMS\Parser\SyntaxErrorException
+ * @expectedExceptionMessage Expected any of T_NAME or T_STRING, but got "\" of type T_NONE at position 4 (0-based).
+ */
+ public function testLeadingBackslash()
+ {
+ $this->parser->parse('Foo<\Bar>');
+ }
+
+ protected function setUp()
+ {
+ $this->parser = new TypeParser();
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/XmlSerializationTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/XmlSerializationTest.php
new file mode 100644
index 0000000000..d9b7ada64d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/XmlSerializationTest.php
@@ -0,0 +1,513 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Construction\UnserializeObjectConstructor;
+use JMS\Serializer\Context;
+use JMS\Serializer\GraphNavigator;
+use JMS\Serializer\Handler\DateHandler;
+use JMS\Serializer\Handler\HandlerRegistry;
+use JMS\Serializer\Naming\CamelCaseNamingStrategy;
+use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
+use JMS\Serializer\Metadata\StaticPropertyMetadata;
+use JMS\Serializer\SerializationContext;
+use JMS\Serializer\Serializer;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorParent;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorChild;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNamespaceDiscriminatorParent;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNotCDataDiscriminatorChild;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlNotCDataDiscriminatorParent;
+use JMS\Serializer\Tests\Fixtures\InvalidUsageOfXmlValue;
+use JMS\Serializer\Exception\InvalidArgumentException;
+use JMS\Serializer\Tests\Fixtures\ObjectWithToString;
+use JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespacesAndObjectProperty;
+use JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespacesAndObjectPropertyAuthor;
+use JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespacesAndObjectPropertyVirtual;
+use JMS\Serializer\Tests\Fixtures\PersonCollection;
+use JMS\Serializer\Tests\Fixtures\PersonLocation;
+use JMS\Serializer\Tests\Fixtures\Person;
+use JMS\Serializer\Tests\Fixtures\ObjectWithVirtualXmlProperties;
+use JMS\Serializer\Tests\Fixtures\ObjectWithXmlKeyValuePairs;
+use JMS\Serializer\Tests\Fixtures\ObjectWithXmlNamespaces;
+use JMS\Serializer\Tests\Fixtures\ObjectWithXmlRootNamespace;
+use JMS\Serializer\Tests\Fixtures\Input;
+use JMS\Serializer\Tests\Fixtures\SimpleClassObject;
+use JMS\Serializer\Tests\Fixtures\SimpleObject;
+use JMS\Serializer\Tests\Fixtures\SimpleSubClassObject;
+use JMS\Serializer\Tests\Fixtures\ObjectWithNamespacesAndList;
+use JMS\Serializer\XmlSerializationVisitor;
+use PhpCollection\Map;
+use JMS\Serializer\Tests\Fixtures\Discriminator\ObjectWithXmlAttributeDiscriminatorChild;
+
+class XmlSerializationTest extends BaseSerializationTest
+{
+ /**
+ * @expectedException JMS\Serializer\Exception\RuntimeException
+ */
+ public function testInvalidUsageOfXmlValue()
+ {
+ $obj = new InvalidUsageOfXmlValue();
+ $this->serialize($obj);
+ }
+
+
+ /**
+ * @dataProvider getXMLBooleans
+ */
+ public function testXMLBooleans($xmlBoolean, $boolean)
+ {
+ if ($this->hasDeserializer()) {
+ $this->assertSame($boolean, $this->deserialize(''.$xmlBoolean.'', 'boolean'));
+ }
+ }
+
+ public function getXMLBooleans()
+ {
+ return array(array('true', true), array('false', false), array('1', true), array('0', false));
+ }
+
+ public function testAccessorSetterDeserialization()
+ {
+ /** @var \JMS\Serializer\Tests\Fixtures\AccessorSetter $object */
+ $object = $this->deserialize('
+
+ element
+
+ collectionEntry
+
+ ',
+ 'JMS\Serializer\Tests\Fixtures\AccessorSetter'
+ );
+
+ $this->assertInstanceOf('stdClass', $object->getElement());
+ $this->assertInstanceOf('JMS\Serializer\Tests\Fixtures\AccessorSetterElement', $object->getElement()->element);
+ $this->assertEquals('attribute-different', $object->getElement()->element->getAttribute());
+ $this->assertEquals('element-different', $object->getElement()->element->getElement());
+ $this->assertEquals(['collectionEntry' => 'collectionEntry'], $object->getCollection());
+ }
+
+ public function testPropertyIsObjectWithAttributeAndValue()
+ {
+ $personCollection = new PersonLocation;
+ $person = new Person;
+ $person->name = 'Matthias Noback';
+ $person->age = 28;
+ $personCollection->person = $person;
+ $personCollection->location = 'The Netherlands';
+
+ $this->assertEquals($this->getContent('person_location'), $this->serialize($personCollection));
+ }
+
+ public function testPropertyIsCollectionOfObjectsWithAttributeAndValue()
+ {
+ $personCollection = new PersonCollection;
+ $person = new Person;
+ $person->name = 'Matthias Noback';
+ $person->age = 28;
+ $personCollection->persons->add($person);
+ $personCollection->location = 'The Netherlands';
+
+ $this->assertEquals($this->getContent('person_collection'), $this->serialize($personCollection));
+ }
+
+ /**
+ * @expectedException JMS\Serializer\Exception\InvalidArgumentException
+ * @expectedExceptionMessage The document type "]>" is not allowed. If it is safe, you may add it to the whitelist configuration.
+ */
+ public function testExternalEntitiesAreDisabledByDefault()
+ {
+ $this->deserialize('
+
+ ]>
+
+ &foo;
+ ', 'stdClass');
+ }
+
+ /**
+ * @expectedException JMS\Serializer\Exception\InvalidArgumentException
+ * @expectedExceptionMessage The document type "" is not allowed. If it is safe, you may add it to the whitelist configuration.
+ */
+ public function testDocumentTypesAreNotAllowed()
+ {
+ $this->deserialize('', 'stdClass');
+ }
+
+ public function testWhitelistedDocumentTypesAreAllowed()
+ {
+ $this->deserializationVisitors->get('xml')->get()->setDoctypeWhitelist(array(
+ '',
+ ']>'));
+
+ $this->serializer->deserialize('
+
+ ', 'stdClass', 'xml');
+
+ $this->serializer->deserialize('
+
+ ]>
+ ', 'stdClass', 'xml');
+ }
+
+ public function testVirtualAttributes()
+ {
+ $this->assertEquals(
+ $this->getContent('virtual_attributes'),
+ $this->serialize(new ObjectWithVirtualXmlProperties(), SerializationContext::create()->setGroups(array('attributes')))
+ );
+ }
+
+ public function testVirtualValues()
+ {
+ $this->assertEquals(
+ $this->getContent('virtual_values'),
+ $this->serialize(new ObjectWithVirtualXmlProperties(), SerializationContext::create()->setGroups(array('values')))
+ );
+ }
+
+ public function testVirtualXmlList()
+ {
+ $this->assertEquals(
+ $this->getContent('virtual_properties_list'),
+ $this->serialize(new ObjectWithVirtualXmlProperties(), SerializationContext::create()->setGroups(array('list')))
+ );
+ }
+
+ public function testVirtualXmlMap()
+ {
+ $this->assertEquals(
+ $this->getContent('virtual_properties_map'),
+ $this->serialize(new ObjectWithVirtualXmlProperties(), SerializationContext::create()->setGroups(array('map')))
+ );
+ }
+
+ public function testUnserializeMissingArray()
+ {
+ $xml = '';
+ $object = $this->serializer->deserialize($xml, 'JMS\Serializer\Tests\Fixtures\ObjectWithAbsentXmlListNode', 'xml');
+ $this->assertEquals($object->absentAndNs, array());
+
+ $xml = '
+
+ foo
+
+ ';
+ $object = $this->serializer->deserialize($xml, 'JMS\Serializer\Tests\Fixtures\ObjectWithAbsentXmlListNode', 'xml');
+ $this->assertEquals($object->absentAndNs, array("foo"));
+ }
+
+ public function testObjectWithNamespacesAndList()
+ {
+ $object = new ObjectWithNamespacesAndList();
+ $object->name = 'name';
+ $object->nameAlternativeB = 'nameB';
+
+ $object->phones = array('111', '222');
+ $object->addresses = array('A'=>'Street 1', 'B'=>'Street 2');
+
+ $object->phonesAlternativeB = array('555', '666');
+ $object->addressesAlternativeB = array('A'=>'Street 5', 'B'=>'Street 6');
+
+ $object->phonesAlternativeC = array('777', '888');
+ $object->addressesAlternativeC = array('A'=>'Street 7', 'B'=>'Street 8');
+
+ $object->phonesAlternativeD = array('999', 'AAA');
+ $object->addressesAlternativeD = array('A'=>'Street 9', 'B'=>'Street A');
+
+ $this->assertEquals(
+ $this->getContent('object_with_namespaces_and_list'),
+ $this->serialize($object, SerializationContext::create())
+ );
+ $this->assertEquals(
+ $object,
+ $this->deserialize($this->getContent('object_with_namespaces_and_list'), get_class($object))
+ );
+ }
+
+ public function testArrayKeyValues()
+ {
+ $this->assertEquals($this->getContent('array_key_values'), $this->serializer->serialize(new ObjectWithXmlKeyValuePairs(), 'xml'));
+ }
+
+ /**
+ * @dataProvider getDateTime
+ * @group datetime
+ */
+ public function testDateTimeNoCData($key, $value, $type)
+ {
+ $handlerRegistry = new HandlerRegistry();
+ $handlerRegistry->registerSubscribingHandler(new DateHandler(\DateTime::ISO8601, 'UTC', false));
+ $objectConstructor = new UnserializeObjectConstructor();
+
+ $serializer = new Serializer($this->factory, $handlerRegistry, $objectConstructor, $this->serializationVisitors, $this->deserializationVisitors);
+
+ $this->assertEquals($this->getContent($key . '_no_cdata'), $serializer->serialize($value, $this->getFormat()));
+ }
+
+ /**
+ * @dataProvider getDateTimeImmutable
+ * @group datetime
+ */
+ public function testDateTimeImmutableNoCData($key, $value, $type)
+ {
+ $handlerRegistry = new HandlerRegistry();
+ $handlerRegistry->registerSubscribingHandler(new DateHandler(\DateTime::ISO8601, 'UTC', false));
+ $objectConstructor = new UnserializeObjectConstructor();
+
+ $serializer = new Serializer($this->factory, $handlerRegistry, $objectConstructor, $this->serializationVisitors, $this->deserializationVisitors);
+
+ $this->assertEquals($this->getContent($key . '_no_cdata'), $serializer->serialize($value, $this->getFormat()));
+ }
+
+ /**
+ * @expectedException JMS\Serializer\Exception\RuntimeException
+ * @expectedExceptionMessage Unsupported value type for XML attribute map. Expected array but got object
+ */
+ public function testXmlAttributeMapWithoutArray()
+ {
+ $attributes = new \ArrayObject(array(
+ 'type' => 'text',
+ ));
+
+ $this->serializer->serialize(new Input($attributes), $this->getFormat());
+ }
+
+ public function testObjectWithOnlyNamespacesAndList()
+ {
+ $object = new ObjectWithNamespacesAndList();
+
+ $object->phones = array();
+ $object->addresses = array();
+
+ $object->phonesAlternativeB = array();
+ $object->addressesAlternativeB = array();
+
+ $object->phonesAlternativeC = array('777', '888');
+ $object->addressesAlternativeC = array('A'=>'Street 7', 'B'=>'Street 8');
+
+ $object->phonesAlternativeD = array();
+ $object->addressesAlternativeD = array();
+
+ $this->assertEquals(
+ $this->getContent('object_with_only_namespaces_and_list'),
+ $this->serialize($object, SerializationContext::create())
+ );
+
+ $deserialized = $this->deserialize($this->getContent('object_with_only_namespaces_and_list'), get_class($object));
+ $this->assertEquals($object, $deserialized);
+ }
+
+ public function testDeserializingNull()
+ {
+ $this->markTestSkipped('Not supported in XML.');
+ }
+
+ public function testDeserializeWithObjectWithToStringMethod()
+ {
+ $input = new ObjectWithToString($this->getContent('simple_object'));
+
+ $object = $this->deserialize($input, SimpleObject::class);
+
+ $this->assertInstanceOf(SimpleObject::class, $object);
+ }
+
+ public function testObjectWithXmlNamespaces()
+ {
+ $object = new ObjectWithXmlNamespaces('This is a nice title.', 'Foo Bar', new \DateTime('2011-07-30 00:00', new \DateTimeZone('UTC')), 'en');
+
+ $serialized = $this->serialize($object);
+ $this->assertEquals($this->getContent('object_with_xml_namespaces'), $this->serialize($object));
+
+ $xml = simplexml_load_string($this->serialize($object));
+ $xml->registerXPathNamespace('ns1', "http://purl.org/dc/elements/1.1/");
+ $xml->registerXPathNamespace('ns2', "http://schemas.google.com/g/2005");
+ $xml->registerXPathNamespace('ns3', "http://www.w3.org/2005/Atom");
+
+ $this->assertEquals('2011-07-30T00:00:00+0000', $this->xpathFirstToString($xml, './@created_at'));
+ $this->assertEquals('1edf9bf60a32d89afbb85b2be849e3ceed5f5b10', $this->xpathFirstToString($xml, './@ns2:etag'));
+ $this->assertEquals('en', $this->xpathFirstToString($xml, './@ns1:language'));
+ $this->assertEquals('This is a nice title.', $this->xpathFirstToString($xml, './ns1:title'));
+ $this->assertEquals('Foo Bar', $this->xpathFirstToString($xml, './ns3:author'));
+
+ $deserialized = $this->deserialize($this->getContent('object_with_xml_namespacesalias'), get_class($object));
+ $this->assertEquals('2011-07-30T00:00:00+0000', $this->getField($deserialized, 'createdAt')->format(\DateTime::ISO8601));
+ $this->assertAttributeEquals('This is a nice title.', 'title', $deserialized);
+ $this->assertAttributeSame('1edf9bf60a32d89afbb85b2be849e3ceed5f5b10', 'etag', $deserialized);
+ $this->assertAttributeSame('en', 'language', $deserialized);
+ $this->assertAttributeEquals('Foo Bar', 'author', $deserialized);
+
+ }
+
+ public function testObjectWithXmlNamespacesAndBackReferencedNamespaces()
+ {
+ $author = new ObjectWithXmlNamespacesAndObjectPropertyAuthor('mr', 'smith');
+ $object = new ObjectWithXmlNamespacesAndObjectProperty('This is a nice title.', $author);
+
+ $serialized = $this->serialize($object);
+ $this->assertEquals($this->getContent('object_with_xml_namespaces_and_object_property'), $serialized);
+ }
+
+ public function testObjectWithXmlNamespacesAndBackReferencedNamespacesWithListeners()
+ {
+ $author = new ObjectWithXmlNamespacesAndObjectPropertyAuthor('mr', 'smith');
+ $object = new ObjectWithXmlNamespacesAndObjectPropertyVirtual('This is a nice title.', new \stdClass());
+
+ $this->handlerRegistry->registerHandler(GraphNavigator::DIRECTION_SERIALIZATION, 'ObjectWithXmlNamespacesAndObjectPropertyAuthorVirtual', $this->getFormat(),
+ function(XmlSerializationVisitor $visitor, $data, $type, Context $context) use($author) {
+ $factory = $context->getMetadataFactory(get_class($author));
+ $classMetadata = $factory->getMetadataForClass(get_class($author));
+
+ $metadata = new StaticPropertyMetadata(get_class($author), 'foo', $author);
+ $metadata->xmlNamespace = $classMetadata->xmlRootNamespace;
+ $metadata->xmlNamespace = $classMetadata->xmlRootNamespace;
+
+ $visitor->visitProperty($metadata, $author, $context);
+ }
+ );
+
+ $serialized = $this->serialize($object);
+ $this->assertEquals($this->getContent('object_with_xml_namespaces_and_object_property_virtual'), $serialized);
+ }
+
+ public function testObjectWithXmlRootNamespace()
+ {
+ $object = new ObjectWithXmlRootNamespace('This is a nice title.', 'Foo Bar', new \DateTime('2011-07-30 00:00', new \DateTimeZone('UTC')), 'en');
+ $this->assertEquals($this->getContent('object_with_xml_root_namespace'), $this->serialize($object));
+ }
+
+ public function testXmlNamespacesInheritance()
+ {
+ $object = new SimpleClassObject();
+ $object->foo = 'foo';
+ $object->bar = 'bar';
+ $object->moo = 'moo';
+
+ $this->assertEquals($this->getContent('simple_class_object'), $this->serialize($object));
+
+ $childObject = new SimpleSubClassObject();
+ $childObject->foo = 'foo';
+ $childObject->bar = 'bar';
+ $childObject->moo = 'moo';
+ $childObject->baz = 'baz';
+ $childObject->qux = 'qux';
+
+ $this->assertEquals($this->getContent('simple_subclass_object'), $this->serialize($childObject));
+ }
+
+ public function testWithoutFormatedOutputByXmlSerializationVisitor()
+ {
+ $namingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
+ $xmlVisitor = new XmlSerializationVisitor($namingStrategy);
+ $xmlVisitor->setFormatOutput(false);
+
+ $visitors = new Map(array(
+ 'xml' => new XmlSerializationVisitor($namingStrategy),
+ ));
+
+ $serializer = new Serializer(
+ $this->factory,
+ $this->handlerRegistry,
+ new UnserializeObjectConstructor(),
+ $visitors,
+ $this->deserializationVisitors,
+ $this->dispatcher
+ );
+
+ $object = new SimpleClassObject;
+ $object->foo = 'foo';
+ $object->bar = 'bar';
+ $object->moo = 'moo';
+
+ $stringXml = $serializer->serialize($object, $this->getFormat());
+ $this->assertXmlStringEqualsXmlString($this->getContent('simple_class_object_minified'), $stringXml);
+ }
+
+ public function testDiscriminatorAsXmlAttribute()
+ {
+ $xml = $this->serialize(new ObjectWithXmlAttributeDiscriminatorChild());
+ $this->assertEquals($this->getContent('xml_discriminator_attribute'), $xml);
+ $this->assertInstanceOf(
+ ObjectWithXmlAttributeDiscriminatorChild::class,
+ $this->deserialize(
+ $xml,
+ ObjectWithXmlAttributeDiscriminatorParent::class
+ )
+ );
+ }
+
+ public function testDiscriminatorAsNotCData()
+ {
+ $xml = $this->serialize(new ObjectWithXmlNotCDataDiscriminatorChild());
+ $this->assertEquals($this->getContent('xml_discriminator_not_cdata'), $xml);
+ $this->assertInstanceOf(
+ ObjectWithXmlNotCDataDiscriminatorChild::class,
+ $this->deserialize(
+ $xml,
+ ObjectWithXmlNotCDataDiscriminatorParent::class
+ )
+ );
+ }
+
+ public function testDiscriminatorWithNamespace()
+ {
+ $xml = $this->serialize(new ObjectWithXmlNamespaceDiscriminatorChild());
+ $this->assertEquals($this->getContent('xml_discriminator_namespace'), $xml);
+
+ $this->assertInstanceOf(
+ ObjectWithXmlNamespaceDiscriminatorChild::class,
+ $this->deserialize(
+ $xml,
+ ObjectWithXmlNamespaceDiscriminatorParent::class
+ )
+ );
+ }
+
+ /**
+ * @expectedException \JMS\Serializer\Exception\XmlErrorException
+ */
+ public function testDeserializeEmptyString()
+ {
+ $this->deserialize('', 'stdClass');
+ }
+
+ private function xpathFirstToString(\SimpleXMLElement $xml, $xpath)
+ {
+ $nodes = $xml->xpath($xpath);
+ return (string) reset($nodes);
+ }
+
+ /**
+ * @param string $key
+ */
+ protected function getContent($key)
+ {
+ if (!file_exists($file = __DIR__.'/xml/'.$key.'.xml')) {
+ throw new InvalidArgumentException(sprintf('The key "%s" is not supported.', $key));
+ }
+
+ return file_get_contents($file);
+ }
+
+ protected function getFormat()
+ {
+ return 'xml';
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/YamlSerializationTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/YamlSerializationTest.php
new file mode 100644
index 0000000000..5ba31b1324
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/YamlSerializationTest.php
@@ -0,0 +1,124 @@
+
+ *
+ * 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\Serializer;
+
+use JMS\Serializer\Exception\RuntimeException;
+use JMS\Serializer\SerializationContext;
+
+class YamlSerializationTest extends BaseSerializationTest
+{
+ public function testEmptyChild()
+ {
+ $this->markTestSkipped('This is not available for the YAML format.');
+ }
+
+ public function testSkipEmptyChild()
+ {
+ $this->markTestSkipped('This is not available for the YAML format.');
+ }
+
+ public function testConstraintViolation()
+ {
+ $this->markTestSkipped('This is not available for the YAML format.');
+ }
+
+ public function testConstraintViolationList()
+ {
+ $this->markTestSkipped('This is not available for the YAML format.');
+ }
+
+ public function testFormErrors()
+ {
+ $this->markTestSkipped('This is not available for the YAML format.');
+ }
+
+ public function testNestedFormErrors()
+ {
+ $this->markTestSkipped('This is not available for the YAML format.');
+ }
+
+ public function testFormErrorsWithNonFormComponents()
+ {
+ $this->markTestSkipped('This is not available for the YAML format.');
+ }
+
+ protected function getContent($key)
+ {
+ if (!file_exists($file = __DIR__.'/yml/'.$key.'.yml')) {
+ throw new RuntimeException(sprintf('The content with key "%s" does not exist.', $key));
+ }
+
+ return file_get_contents($file);
+ }
+
+ public function getTypeHintedArrays()
+ {
+ return [
+
+ [[1, 2], "- 1\n- 2\n", null],
+ [['a', 'b'], "- a\n- b\n", null],
+ [['a' => 'a', 'b' => 'b'], "a: a\nb: b\n", null],
+
+ [[], " []\n", null],
+ [[], " []\n", SerializationContext::create()->setInitialType('array')],
+ [[], " []\n", SerializationContext::create()->setInitialType('array')],
+ [[], " {}\n", SerializationContext::create()->setInitialType('array')],
+
+
+ [[1, 2], "- 1\n- 2\n", SerializationContext::create()->setInitialType('array')],
+ [[1 => 1, 2 => 2], "1: 1\n2: 2\n", SerializationContext::create()->setInitialType('array')],
+ [[1 => 1, 2 => 2], "- 1\n- 2\n", SerializationContext::create()->setInitialType('array')],
+ [['a', 'b'], "- a\n- b\n", SerializationContext::create()->setInitialType('array')],
+
+ [[1 => 'a', 2 => 'b'], "- a\n- b\n", SerializationContext::create()->setInitialType('array')],
+ [['a' => 'a', 'b' => 'b'], "- a\n- b\n", SerializationContext::create()->setInitialType('array')],
+
+
+ [[1,2], "0: 1\n1: 2\n", SerializationContext::create()->setInitialType('array')],
+ [[1,2], "0: 1\n1: 2\n", SerializationContext::create()->setInitialType('array')],
+ [[1,2], "0: 1\n1: 2\n", SerializationContext::create()->setInitialType('array')],
+
+
+ [['a', 'b'], "0: a\n1: b\n", SerializationContext::create()->setInitialType('array')],
+ [['a' => 'a', 'b' => 'b'], "a: a\nb: b\n", SerializationContext::create()->setInitialType('array')],
+ ];
+ }
+
+ /**
+ * @dataProvider getTypeHintedArrays
+ * @param array $array
+ * @param string $expected
+ * @param SerializationContext|null $context
+ */
+ public function testTypeHintedArraySerialization(array $array, $expected, $context = null)
+ {
+ $this->assertEquals($expected, $this->serialize($array, $context));
+ }
+
+
+ protected function getFormat()
+ {
+ return 'yml';
+ }
+
+ protected function hasDeserializer()
+ {
+ return false;
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_child.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_child.xml
new file mode 100644
index 0000000000..1dc3df941f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_child.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_methods.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_methods.xml
new file mode 100644
index 0000000000..0818c57351
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_methods.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_parent.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_parent.xml
new file mode 100644
index 0000000000..1fe55f54f4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/accessor_order_parent.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_booleans.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_booleans.xml
new file mode 100644
index 0000000000..2bce4199a7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_booleans.xml
@@ -0,0 +1,5 @@
+
+
+ true
+ false
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_datetimes_object.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_datetimes_object.xml
new file mode 100644
index 0000000000..648ccbbf3b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_datetimes_object.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_floats.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_floats.xml
new file mode 100644
index 0000000000..8a111662eb
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_floats.xml
@@ -0,0 +1,6 @@
+
+
+ 1.34
+ 3
+ 6.42
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_integers.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_integers.xml
new file mode 100644
index 0000000000..9a9ca15c54
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_integers.xml
@@ -0,0 +1,6 @@
+
+
+ 1
+ 3
+ 4
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_key_values.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_key_values.xml
new file mode 100644
index 0000000000..91fdfb1553
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_key_values.xml
@@ -0,0 +1,20 @@
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_list_and_map_difference.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_list_and_map_difference.xml
new file mode 100644
index 0000000000..557b0ad0ab
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_list_and_map_difference.xml
@@ -0,0 +1,13 @@
+
+
+
+ 1
+ 2
+ 3
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_mixed.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_mixed.xml
new file mode 100644
index 0000000000..0a4ffa3269
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_mixed.xml
@@ -0,0 +1,16 @@
+
+
+
+ 1
+ true
+
+
+
+
+
+
+ 1
+ 3
+ true
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_named_datetimeimmutables_object.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_named_datetimeimmutables_object.xml
new file mode 100644
index 0000000000..40c13c06f1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_named_datetimeimmutables_object.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_named_datetimes_object.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_named_datetimes_object.xml
new file mode 100644
index 0000000000..40c13c06f1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_named_datetimes_object.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_objects.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_objects.xml
new file mode 100644
index 0000000000..ffaf5a9b82
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_objects.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_strings.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_strings.xml
new file mode 100644
index 0000000000..d51496aa7b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/array_strings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/article.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/article.xml
new file mode 100644
index 0000000000..a769bc02a5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/article.xml
@@ -0,0 +1,2 @@
+
+serialized
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/author_expression.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/author_expression.xml
new file mode 100644
index 0000000000..73068ceedc
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/author_expression.xml
@@ -0,0 +1,6 @@
+
+
+
+
+ 123
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/blog_post.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/blog_post.xml
new file mode 100644
index 0000000000..0efe2865c6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/blog_post.xml
@@ -0,0 +1,32 @@
+
+
+ what_a_nice_id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tag1
+
+
+ tag2
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/blog_post_unauthored.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/blog_post_unauthored.xml
new file mode 100644
index 0000000000..5b5ba2b437
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/blog_post_unauthored.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/boolean_false.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/boolean_false.xml
new file mode 100644
index 0000000000..4eaf3156cc
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/boolean_false.xml
@@ -0,0 +1,2 @@
+
+false
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/boolean_true.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/boolean_true.xml
new file mode 100644
index 0000000000..15bf5c438a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/boolean_true.xml
@@ -0,0 +1,2 @@
+
+true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/car.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/car.xml
new file mode 100644
index 0000000000..de04116446
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/car.xml
@@ -0,0 +1,5 @@
+
+
+ 5
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/car_without_type.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/car_without_type.xml
new file mode 100644
index 0000000000..6ff670bdf8
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/car_without_type.xml
@@ -0,0 +1,4 @@
+
+
+ 5
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/circular_reference.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/circular_reference.xml
new file mode 100644
index 0000000000..8507eb4c81
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/circular_reference.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/constraint_violation.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/constraint_violation.xml
new file mode 100644
index 0000000000..080578682d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/constraint_violation.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/constraint_violation_list.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/constraint_violation_list.xml
new file mode 100644
index 0000000000..a5715a4139
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/constraint_violation_list.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/currency_aware_price.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/currency_aware_price.xml
new file mode 100644
index 0000000000..e97a7561ea
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/currency_aware_price.xml
@@ -0,0 +1,2 @@
+
+2.34
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/custom_accessor.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/custom_accessor.xml
new file mode 100644
index 0000000000..614196d734
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/custom_accessor.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_interval.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_interval.xml
new file mode 100644
index 0000000000..a564b6cfac
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_interval.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time.xml
new file mode 100644
index 0000000000..00156d4617
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_immutable.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_immutable.xml
new file mode 100644
index 0000000000..00156d4617
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_immutable.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_immutable_no_cdata.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_immutable_no_cdata.xml
new file mode 100644
index 0000000000..b9c36c25a9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_immutable_no_cdata.xml
@@ -0,0 +1,2 @@
+
+2011-08-30T00:00:00+0000
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_no_cdata.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_no_cdata.xml
new file mode 100644
index 0000000000..b9c36c25a9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/date_time_no_cdata.xml
@@ -0,0 +1,2 @@
+
+2011-08-30T00:00:00+0000
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/empty_child.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/empty_child.xml
new file mode 100644
index 0000000000..c782346b6a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/empty_child.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/empty_child_skip.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/empty_child_skip.xml
new file mode 100644
index 0000000000..4ec8b62504
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/empty_child_skip.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/float.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/float.xml
new file mode 100644
index 0000000000..70e02f42c9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/float.xml
@@ -0,0 +1,2 @@
+
+4.533
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/float_trailing_zero.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/float_trailing_zero.xml
new file mode 100644
index 0000000000..5b5b635ea9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/float_trailing_zero.xml
@@ -0,0 +1,2 @@
+
+1
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/form_errors.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/form_errors.xml
new file mode 100644
index 0000000000..78c8071e56
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/form_errors.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/garage.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/garage.xml
new file mode 100644
index 0000000000..25f486ddff
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/garage.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ 3
+
+
+
+ 1
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_advanced.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_advanced.xml
new file mode 100644
index 0000000000..d37c7d1401
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_advanced.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_all.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_all.xml
new file mode 100644
index 0000000000..4d8c74f3fe
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_all.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_default.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_default.xml
new file mode 100644
index 0000000000..2ec803abb9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_default.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_foo.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_foo.xml
new file mode 100644
index 0000000000..93b4a0d097
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_foo.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_foobar.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_foobar.xml
new file mode 100644
index 0000000000..d922cb67c3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/groups_foobar.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/hash_empty.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/hash_empty.xml
new file mode 100644
index 0000000000..0ea94e970f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/hash_empty.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/inline.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/inline.xml
new file mode 100644
index 0000000000..bccba876de
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/inline.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/inline_child_empty.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/inline_child_empty.xml
new file mode 100644
index 0000000000..4ec8b62504
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/inline_child_empty.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/input.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/input.xml
new file mode 100644
index 0000000000..3c3f7313d9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/input.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/integer.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/integer.xml
new file mode 100644
index 0000000000..5b5b635ea9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/integer.xml
@@ -0,0 +1,2 @@
+
+1
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/lifecycle_callbacks.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/lifecycle_callbacks.xml
new file mode 100644
index 0000000000..fe0501f532
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/lifecycle_callbacks.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/log.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/log.xml
new file mode 100644
index 0000000000..f4de81411f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/log.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/maxdepth_skippabe_object.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/maxdepth_skippabe_object.xml
new file mode 100644
index 0000000000..8d455af3e0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/maxdepth_skippabe_object.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/mixed_access_types.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/mixed_access_types.xml
new file mode 100644
index 0000000000..0badb579db
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/mixed_access_types.xml
@@ -0,0 +1,6 @@
+
+
+ 1
+
+ 42
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nested_form_errors.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nested_form_errors.xml
new file mode 100644
index 0000000000..75b467df7e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nested_form_errors.xml
@@ -0,0 +1,11 @@
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/null.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/null.xml
new file mode 100644
index 0000000000..36766ecd62
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/null.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable.xml
new file mode 100644
index 0000000000..edc0833d59
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable_arrays.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable_arrays.xml
new file mode 100644
index 0000000000..d8c16852b6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable_arrays.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable_skip.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable_skip.xml
new file mode 100644
index 0000000000..8534731abb
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/nullable_skip.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_when_null.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_when_null.xml
new file mode 100644
index 0000000000..3132213433
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_when_null.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_when_null_and_serialized.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_when_null_and_serialized.xml
new file mode 100644
index 0000000000..bd83a5ce8a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_when_null_and_serialized.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_namespaces_and_list.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_namespaces_and_list.xml
new file mode 100644
index 0000000000..a3022bbd78
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_namespaces_and_list.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_only_namespaces_and_list.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_only_namespaces_and_list.xml
new file mode 100644
index 0000000000..0c0242e9b0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_only_namespaces_and_list.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces.xml
new file mode 100644
index 0000000000..6ff33d9c69
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces_and_object_property.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces_and_object_property.xml
new file mode 100644
index 0000000000..a6eb8057f4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces_and_object_property.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces_and_object_property_virtual.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces_and_object_property_virtual.xml
new file mode 100644
index 0000000000..b1dadc1fe2
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespaces_and_object_property_virtual.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespacesalias.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespacesalias.xml
new file mode 100644
index 0000000000..63a8c74e17
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_namespacesalias.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_root_namespace.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_root_namespace.xml
new file mode 100644
index 0000000000..9d5cde47f8
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/object_with_xml_root_namespace.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/order.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/order.xml
new file mode 100644
index 0000000000..ca7c70b28a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/order.xml
@@ -0,0 +1,4 @@
+
+
+ 12.34
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/order_with_currency_aware_price.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/order_with_currency_aware_price.xml
new file mode 100644
index 0000000000..3ab583f2c5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/order_with_currency_aware_price.xml
@@ -0,0 +1,4 @@
+
+
+ 1.23
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/orm_proxy.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/orm_proxy.xml
new file mode 100644
index 0000000000..ecd8c13810
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/orm_proxy.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_collection.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_collection.xml
new file mode 100644
index 0000000000..37654cc20e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_collection.xml
@@ -0,0 +1,5 @@
+
+
+ Matthias Noback
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_location.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_location.xml
new file mode 100644
index 0000000000..fa2aa87a6b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_location.xml
@@ -0,0 +1,5 @@
+
+
+ Matthias Noback
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_secret_hide.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_secret_hide.xml
new file mode 100644
index 0000000000..adf0737ac0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_secret_hide.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_secret_show.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_secret_show.xml
new file mode 100644
index 0000000000..46fe167f8b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/person_secret_show.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/price.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/price.xml
new file mode 100644
index 0000000000..2ee2959d23
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/price.xml
@@ -0,0 +1,2 @@
+
+3
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/readonly.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/readonly.xml
new file mode 100644
index 0000000000..1c3ea3b3b5
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/readonly.xml
@@ -0,0 +1,5 @@
+
+
+ 123
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_class_object.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_class_object.xml
new file mode 100644
index 0000000000..d58fc7078b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_class_object.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_class_object_minified.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_class_object_minified.xml
new file mode 100644
index 0000000000..ff4fbf5950
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_class_object_minified.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_object.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_object.xml
new file mode 100644
index 0000000000..84568d016e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_object.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_object_nullable.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_object_nullable.xml
new file mode 100644
index 0000000000..32f07c22d4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_object_nullable.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_subclass_object.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_subclass_object.xml
new file mode 100644
index 0000000000..6c0ff7db35
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/simple_subclass_object.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/string.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/string.xml
new file mode 100644
index 0000000000..b18254042b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/string.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/timestamp.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/timestamp.xml
new file mode 100644
index 0000000000..a9bf077fac
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/timestamp.xml
@@ -0,0 +1,4 @@
+
+
+ 1455148800
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/timestamp_prev.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/timestamp_prev.xml
new file mode 100644
index 0000000000..a9bf077fac
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/timestamp_prev.xml
@@ -0,0 +1,4 @@
+
+
+ 1455148800
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/tree.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/tree.xml
new file mode 100644
index 0000000000..5388f3dea8
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/tree.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_attributes.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_attributes.xml
new file mode 100644
index 0000000000..072401318e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_attributes.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties.xml
new file mode 100644
index 0000000000..237655e831
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+ 1
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_all.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_all.xml
new file mode 100644
index 0000000000..6341cb48f6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_all.xml
@@ -0,0 +1,5 @@
+
+
+ 1
+ 8
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_high.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_high.xml
new file mode 100644
index 0000000000..30632e862f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_high.xml
@@ -0,0 +1,4 @@
+
+
+ 8
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_list.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_list.xml
new file mode 100644
index 0000000000..06d9842577
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_list.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_low.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_low.xml
new file mode 100644
index 0000000000..5cce97a423
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_low.xml
@@ -0,0 +1,4 @@
+
+
+ 1
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_map.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_map.xml
new file mode 100644
index 0000000000..f8518537fb
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_properties_map.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_values.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_values.xml
new file mode 100644
index 0000000000..c37e7341ba
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/virtual_values.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_attribute.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_attribute.xml
new file mode 100644
index 0000000000..0deec455e9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_attribute.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_namespace.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_namespace.xml
new file mode 100644
index 0000000000..d312627715
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_namespace.xml
@@ -0,0 +1,4 @@
+
+
+ child
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_not_cdata.xml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_not_cdata.xml
new file mode 100644
index 0000000000..7037d5208e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/xml/xml_discriminator_not_cdata.xml
@@ -0,0 +1,4 @@
+
+
+ child
+
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_child.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_child.yml
new file mode 100644
index 0000000000..4e35702b45
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_child.yml
@@ -0,0 +1,4 @@
+c: c
+d: d
+a: a
+b: b
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_methods.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_methods.yml
new file mode 100644
index 0000000000..ee822f27b8
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_methods.yml
@@ -0,0 +1,3 @@
+foo: c
+b: b
+a: a
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_parent.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_parent.yml
new file mode 100644
index 0000000000..5422ec2488
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/accessor_order_parent.yml
@@ -0,0 +1,2 @@
+a: a
+b: b
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_booleans.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_booleans.yml
new file mode 100644
index 0000000000..5c72ab25db
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_booleans.yml
@@ -0,0 +1,2 @@
+- true
+- false
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_datetimes_object.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_datetimes_object.yml
new file mode 100644
index 0000000000..c5f131d20d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_datetimes_object.yml
@@ -0,0 +1,6 @@
+array_with_default_date_time:
+ - '2047-01-01T12:47:47+0000'
+ - '2016-12-05T00:00:00+0000'
+array_with_formatted_date_time:
+ - '01.01.2047 12:47:47'
+ - '05.12.2016 00:00:00'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_empty.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_empty.yml
new file mode 100644
index 0000000000..d4def9ae32
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_empty.yml
@@ -0,0 +1 @@
+array: []
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_floats.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_floats.yml
new file mode 100644
index 0000000000..8255623e62
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_floats.yml
@@ -0,0 +1,3 @@
+- 1.34
+- 3
+- 6.42
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_integers.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_integers.yml
new file mode 100644
index 0000000000..06c0e53ae0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_integers.yml
@@ -0,0 +1,3 @@
+- 1
+- 3
+- 4
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_list_and_map_difference.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_list_and_map_difference.yml
new file mode 100644
index 0000000000..05d6fde21d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_list_and_map_difference.yml
@@ -0,0 +1,8 @@
+list:
+ - 1
+ - 2
+ - 3
+map:
+ 0: 1
+ 2: 2
+ 3: 3
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_mixed.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_mixed.yml
new file mode 100644
index 0000000000..cd9b7f38f0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_mixed.yml
@@ -0,0 +1,11 @@
+- foo
+- 1
+- true
+-
+ foo: foo
+ moo: bar
+ camel_case: boo
+-
+ - 1
+ - 3
+ - true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_named_datetimeimmutables_object.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_named_datetimeimmutables_object.yml
new file mode 100644
index 0000000000..287bcd97eb
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_named_datetimeimmutables_object.yml
@@ -0,0 +1,3 @@
+named_array_with_formatted_date:
+ testdate1: '01.01.2047 12:47:47'
+ testdate2: '05.12.2016 00:00:00'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_named_datetimes_object.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_named_datetimes_object.yml
new file mode 100644
index 0000000000..287bcd97eb
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_named_datetimes_object.yml
@@ -0,0 +1,3 @@
+named_array_with_formatted_date:
+ testdate1: '01.01.2047 12:47:47'
+ testdate2: '05.12.2016 00:00:00'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_objects.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_objects.yml
new file mode 100644
index 0000000000..b1609d4272
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_objects.yml
@@ -0,0 +1,8 @@
+-
+ foo: foo
+ moo: bar
+ camel_case: boo
+-
+ foo: baz
+ moo: boo
+ camel_case: boo
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_strings.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_strings.yml
new file mode 100644
index 0000000000..59121da8a7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/array_strings.yml
@@ -0,0 +1,2 @@
+- foo
+- bar
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/article.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/article.yml
new file mode 100644
index 0000000000..267643d2c4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/article.yml
@@ -0,0 +1 @@
+custom: serialized
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/author_expression.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/author_expression.yml
new file mode 100644
index 0000000000..335e87131d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/author_expression.yml
@@ -0,0 +1,3 @@
+my_first_name: Ruud
+last_name: Kamphuis
+id: 123
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/blog_post.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/blog_post.yml
new file mode 100644
index 0000000000..fd557c18f4
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/blog_post.yml
@@ -0,0 +1,26 @@
+id: what_a_nice_id
+title: 'This is a nice title.'
+created_at: '2011-07-30T00:00:00+0000'
+is_published: false
+etag: 1edf9bf60a32d89afbb85b2be849e3ceed5f5b10
+comments:
+ -
+ author:
+ full_name: 'Foo Bar'
+ text: foo
+comments2:
+ -
+ author:
+ full_name: 'Foo Bar'
+ text: foo
+metadata:
+ foo: bar
+author:
+ full_name: 'Foo Bar'
+publisher:
+ pub_name: 'Bar Foo'
+tag:
+ -
+ name: tag1
+ -
+ name: tag2
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/blog_post_unauthored.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/blog_post_unauthored.yml
new file mode 100644
index 0000000000..5e080297a6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/blog_post_unauthored.yml
@@ -0,0 +1,12 @@
+id: what_a_nice_id
+title: 'This is a nice title.'
+created_at: '2011-07-30T00:00:00+0000'
+is_published: false
+etag: 1edf9bf60a32d89afbb85b2be849e3ceed5f5b10
+comments: []
+comments2: []
+metadata:
+ foo: bar
+author: null
+publisher: null
+tag: null
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/boolean_false.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/boolean_false.yml
new file mode 100644
index 0000000000..c508d5366f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/boolean_false.yml
@@ -0,0 +1 @@
+false
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/boolean_true.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/boolean_true.yml
new file mode 100644
index 0000000000..27ba77ddaf
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/boolean_true.yml
@@ -0,0 +1 @@
+true
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/car.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/car.yml
new file mode 100644
index 0000000000..b2e9c9a097
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/car.yml
@@ -0,0 +1,2 @@
+km: 5
+type: car
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/car_without_type.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/car_without_type.yml
new file mode 100644
index 0000000000..886bbb9705
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/car_without_type.yml
@@ -0,0 +1 @@
+km: 5
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/circular_reference.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/circular_reference.yml
new file mode 100644
index 0000000000..011b690d7c
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/circular_reference.yml
@@ -0,0 +1,10 @@
+collection:
+ -
+ name: child1
+ -
+ name: child2
+another_collection:
+ -
+ name: child1
+ -
+ name: child2
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/currency_aware_price.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/currency_aware_price.yml
new file mode 100644
index 0000000000..66185f5fd9
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/currency_aware_price.yml
@@ -0,0 +1,2 @@
+currency: EUR
+amount: 2.34
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/custom_accessor.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/custom_accessor.yml
new file mode 100644
index 0000000000..5eeb1b2040
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/custom_accessor.yml
@@ -0,0 +1,12 @@
+comments:
+ Foo:
+ comments:
+ -
+ author:
+ full_name: Foo
+ text: foo
+ -
+ author:
+ full_name: Foo
+ text: bar
+ count: 2
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_interval.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_interval.yml
new file mode 100644
index 0000000000..e8286c5b8b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_interval.yml
@@ -0,0 +1 @@
+PT45M
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_time.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_time.yml
new file mode 100644
index 0000000000..a8f98ee452
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_time.yml
@@ -0,0 +1 @@
+'2011-08-30T00:00:00+0000'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_time_immutable.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_time_immutable.yml
new file mode 100644
index 0000000000..a8f98ee452
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/date_time_immutable.yml
@@ -0,0 +1 @@
+'2011-08-30T00:00:00+0000'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/float.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/float.yml
new file mode 100644
index 0000000000..a955e81fa0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/float.yml
@@ -0,0 +1 @@
+4.533
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/float_trailing_zero.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/float_trailing_zero.yml
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/float_trailing_zero.yml
@@ -0,0 +1 @@
+1
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/garage.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/garage.yml
new file mode 100644
index 0000000000..b32204dc30
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/garage.yml
@@ -0,0 +1,7 @@
+vehicles:
+ -
+ km: 3
+ type: car
+ -
+ km: 1
+ type: moped
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_advanced.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_advanced.yml
new file mode 100644
index 0000000000..fbd7c63f0b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_advanced.yml
@@ -0,0 +1,15 @@
+name: John
+manager:
+ name: 'John Manager'
+ friends:
+ -
+ nickname: nickname
+ -
+ nickname: nickname
+friends:
+ -
+ manager:
+ name: 'John friend 1 manager'
+ -
+ manager:
+ name: 'John friend 2 manager'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_all.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_all.yml
new file mode 100644
index 0000000000..6504e203ef
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_all.yml
@@ -0,0 +1,4 @@
+foo: foo
+foobar: foobar
+bar: bar
+none: none
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_default.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_default.yml
new file mode 100644
index 0000000000..c34136a4d7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_default.yml
@@ -0,0 +1,2 @@
+bar: bar
+none: none
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_foo.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_foo.yml
new file mode 100644
index 0000000000..58a24e6cc0
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_foo.yml
@@ -0,0 +1,2 @@
+foo: foo
+foobar: foobar
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_foobar.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_foobar.yml
new file mode 100644
index 0000000000..f50c43e478
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/groups_foobar.yml
@@ -0,0 +1,3 @@
+foo: foo
+foobar: foobar
+bar: bar
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/hash_empty.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/hash_empty.yml
new file mode 100644
index 0000000000..6ec4ff79d1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/hash_empty.yml
@@ -0,0 +1 @@
+hash: {}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/inline.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/inline.yml
new file mode 100644
index 0000000000..5b6dfe9ea7
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/inline.yml
@@ -0,0 +1,4 @@
+c: c
+a: a
+b: b
+d: d
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/inline_child_empty.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/inline_child_empty.yml
new file mode 100644
index 0000000000..606ed684cf
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/inline_child_empty.yml
@@ -0,0 +1,2 @@
+c: c
+d: d
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/input.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/input.yml
new file mode 100644
index 0000000000..6df3ab090b
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/input.yml
@@ -0,0 +1,4 @@
+attributes:
+ type: text
+ name: firstname
+ value: Adrien
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/integer.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/integer.yml
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/integer.yml
@@ -0,0 +1 @@
+1
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/lifecycle_callbacks.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/lifecycle_callbacks.yml
new file mode 100644
index 0000000000..7c302c0fec
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/lifecycle_callbacks.yml
@@ -0,0 +1 @@
+name: 'Foo Bar'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/log.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/log.yml
new file mode 100644
index 0000000000..99d4773596
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/log.yml
@@ -0,0 +1,18 @@
+author_list:
+ -
+ full_name: 'Johannes Schmitt'
+ -
+ full_name: 'John Doe'
+comments:
+ -
+ author:
+ full_name: 'Foo Bar'
+ text: foo
+ -
+ author:
+ full_name: 'Foo Bar'
+ text: bar
+ -
+ author:
+ full_name: 'Foo Bar'
+ text: baz
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/maxdepth_skippabe_object.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/maxdepth_skippabe_object.yml
new file mode 100644
index 0000000000..4c0be60627
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/maxdepth_skippabe_object.yml
@@ -0,0 +1,2 @@
+a:
+ xxx: yyy
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/mixed_access_types.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/mixed_access_types.yml
new file mode 100644
index 0000000000..ef18306ba3
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/mixed_access_types.yml
@@ -0,0 +1,3 @@
+id: 1
+name: Johannes
+read_only_property: 42
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/null.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/null.yml
new file mode 100644
index 0000000000..19765bd501
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/null.yml
@@ -0,0 +1 @@
+null
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable.yml
new file mode 100644
index 0000000000..acb6263fd6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable.yml
@@ -0,0 +1,3 @@
+foo: bar
+baz: null
+0: null
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable_arrays.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable_arrays.yml
new file mode 100644
index 0000000000..4454d39926
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable_arrays.yml
@@ -0,0 +1,9 @@
+empty_inline: []
+not_empty_inline:
+ - not_empty_inline
+empty_not_inline: []
+not_empty_not_inline:
+ - not_empty_not_inline
+empty_not_inline_skip: []
+not_empty_not_inline_skip:
+ - not_empty_not_inline_skip
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable_skip.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable_skip.yml
new file mode 100644
index 0000000000..20e9ff3fea
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/nullable_skip.yml
@@ -0,0 +1 @@
+foo: bar
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/object_when_null.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/object_when_null.yml
new file mode 100644
index 0000000000..10d56bf3b2
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/object_when_null.yml
@@ -0,0 +1 @@
+text: foo
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/object_when_null_and_serialized.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/object_when_null_and_serialized.yml
new file mode 100644
index 0000000000..119ce0e2fa
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/object_when_null_and_serialized.yml
@@ -0,0 +1,2 @@
+author: null
+text: foo
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/order.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/order.yml
new file mode 100644
index 0000000000..e25bd6bb14
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/order.yml
@@ -0,0 +1,2 @@
+cost:
+ price: 12.34
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/order_with_currency_aware_price.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/order_with_currency_aware_price.yml
new file mode 100644
index 0000000000..4000322dfd
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/order_with_currency_aware_price.yml
@@ -0,0 +1,3 @@
+cost:
+ currency: EUR
+ amount: 1.23
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/orm_proxy.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/orm_proxy.yml
new file mode 100644
index 0000000000..6f26058723
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/orm_proxy.yml
@@ -0,0 +1,3 @@
+foo: foo
+moo: bar
+camel_case: proxy-boo
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/person_secret_hide.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/person_secret_hide.yml
new file mode 100644
index 0000000000..710e7dc2f8
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/person_secret_hide.yml
@@ -0,0 +1 @@
+name: mike
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/person_secret_show.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/person_secret_show.yml
new file mode 100644
index 0000000000..f03db3ebde
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/person_secret_show.yml
@@ -0,0 +1,2 @@
+name: mike
+gender: f
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/price.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/price.yml
new file mode 100644
index 0000000000..dc5a58b69f
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/price.yml
@@ -0,0 +1 @@
+price: 3
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/readonly.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/readonly.yml
new file mode 100644
index 0000000000..3c428c3f8d
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/readonly.yml
@@ -0,0 +1,2 @@
+id: 123
+full_name: 'Ruud Kamphuis'
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/simple_object.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/simple_object.yml
new file mode 100644
index 0000000000..594b28959a
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/simple_object.yml
@@ -0,0 +1,3 @@
+foo: foo
+moo: bar
+camel_case: boo
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/simple_object_nullable.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/simple_object_nullable.yml
new file mode 100644
index 0000000000..126d625ab1
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/simple_object_nullable.yml
@@ -0,0 +1,4 @@
+foo: foo
+moo: bar
+camel_case: boo
+null_property: null
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/string.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/string.yml
new file mode 100644
index 0000000000..257cc5642c
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/string.yml
@@ -0,0 +1 @@
+foo
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/timestamp.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/timestamp.yml
new file mode 100644
index 0000000000..b1c38be9d6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/timestamp.yml
@@ -0,0 +1 @@
+timestamp: 1455148800
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/timestamp_prev.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/timestamp_prev.yml
new file mode 100644
index 0000000000..3df27d67ac
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/timestamp_prev.yml
@@ -0,0 +1 @@
+timestamp: "1455148800"
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/tree.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/tree.yml
new file mode 100644
index 0000000000..01e838766e
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/tree.yml
@@ -0,0 +1,10 @@
+tree:
+ children:
+ -
+ children:
+ -
+ children:
+ -
+ foo: bar
+ foo: bar
+ foo: bar
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties.yml
new file mode 100644
index 0000000000..7d1c0b2b54
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties.yml
@@ -0,0 +1,4 @@
+exist_field: value
+virtual_value: value
+test: other-name
+typed_virtual_property: 1
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_all.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_all.yml
new file mode 100644
index 0000000000..0bcf04b862
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_all.yml
@@ -0,0 +1,2 @@
+low: 1
+high: 8
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_high.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_high.yml
new file mode 100644
index 0000000000..2be358dd28
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_high.yml
@@ -0,0 +1 @@
+high: 8
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_low.yml b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_low.yml
new file mode 100644
index 0000000000..a021172b72
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Serializer/yml/virtual_properties_low.yml
@@ -0,0 +1 @@
+low: 1
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/SerializerBuilderTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/SerializerBuilderTest.php
new file mode 100644
index 0000000000..70e6826ab6
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/SerializerBuilderTest.php
@@ -0,0 +1,266 @@
+
+ *
+ * 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;
+
+use JMS\Serializer\Expression\ExpressionEvaluator;
+use JMS\Serializer\SerializerBuilder;
+use JMS\Serializer\Tests\Fixtures\PersonSecret;
+use Symfony\Component\ExpressionLanguage\ExpressionFunction;
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
+use Symfony\Component\Filesystem\Filesystem;
+use JMS\Serializer\Handler\HandlerRegistry;
+use JMS\Serializer\JsonSerializationVisitor;
+use JMS\Serializer\Naming\CamelCaseNamingStrategy;
+use JMS\Serializer\SerializationContext;
+use JMS\Serializer\DeserializationContext;
+
+class SerializerBuilderTest extends \PHPUnit_Framework_TestCase
+{
+ /** @var SerializerBuilder */
+ private $builder;
+ private $fs;
+ private $tmpDir;
+
+ public function testBuildWithoutAnythingElse()
+ {
+ $serializer = $this->builder->build();
+
+ $this->assertEquals('"foo"', $serializer->serialize('foo', 'json'));
+ $this->assertEquals('
+
+', $serializer->serialize('foo', 'xml'));
+ $this->assertEquals('foo
+', $serializer->serialize('foo', 'yml'));
+
+ $this->assertEquals('foo', $serializer->deserialize('"foo"', 'string', 'json'));
+ $this->assertEquals('foo', $serializer->deserialize('', 'string', 'xml'));
+ }
+
+ public function testWithCache()
+ {
+ $this->assertFileNotExists($this->tmpDir);
+
+ $this->assertSame($this->builder, $this->builder->setCacheDir($this->tmpDir));
+ $serializer = $this->builder->build();
+
+ $this->assertFileExists($this->tmpDir);
+ $this->assertFileExists($this->tmpDir.'/annotations');
+ $this->assertFileExists($this->tmpDir.'/metadata');
+
+ $factory = $this->getField($serializer, 'factory');
+ $this->assertAttributeSame(false, 'debug', $factory);
+ $this->assertAttributeNotSame(null, 'cache', $factory);
+ }
+
+ public function testDoesAddDefaultHandlers()
+ {
+ $serializer = $this->builder->build();
+
+ $this->assertEquals('"2020-04-16T00:00:00+0000"', $serializer->serialize(new \DateTime('2020-04-16', new \DateTimeZone('UTC')), 'json'));
+ }
+
+ public function testDoesNotAddDefaultHandlersWhenExplicitlyConfigured()
+ {
+ $this->assertSame($this->builder, $this->builder->configureHandlers(function(HandlerRegistry $registry) {
+ }));
+
+ $this->assertEquals('{}', $this->builder->build()->serialize(new \DateTime('2020-04-16'), 'json'));
+ }
+
+ /**
+ * @expectedException JMS\Serializer\Exception\UnsupportedFormatException
+ * @expectedExceptionMessage The format "xml" is not supported for serialization.
+ */
+ public function testDoesNotAddOtherVisitorsWhenConfiguredExplicitly()
+ {
+ $this->assertSame(
+ $this->builder,
+ $this->builder->setSerializationVisitor('json', new JsonSerializationVisitor(new CamelCaseNamingStrategy()))
+ );
+
+ $this->builder->build()->serialize('foo', 'xml');
+ }
+
+ public function testIncludeInterfaceMetadata()
+ {
+ $this->assertFalse(
+ $this->getIncludeInterfaces($this->builder),
+ 'Interface metadata are not included by default'
+ );
+
+ $this->assertTrue(
+ $this->getIncludeInterfaces($this->builder->includeInterfaceMetadata(true)),
+ 'Force including interface metadata'
+ );
+
+ $this->assertFalse(
+ $this->getIncludeInterfaces($this->builder->includeInterfaceMetadata(false)),
+ 'Force not including interface metadata'
+ );
+
+ $this->assertSame(
+ $this->builder,
+ $this->builder->includeInterfaceMetadata(true)
+ );
+ }
+
+ public function testSetSerializationContext()
+ {
+ $contextFactoryMock = $this->getMockForAbstractClass('JMS\\Serializer\\ContextFactory\\SerializationContextFactoryInterface');
+ $context = new SerializationContext();
+ $context->setSerializeNull(true);
+
+ $contextFactoryMock
+ ->expects($this->once())
+ ->method('createSerializationContext')
+ ->will($this->returnValue($context))
+ ;
+
+ $this->builder->setSerializationContextFactory($contextFactoryMock);
+
+ $serializer = $this->builder->build();
+
+ $result = $serializer->serialize(array('value' => null), 'json');
+
+ $this->assertEquals('{"value":null}', $result);
+ }
+
+ public function testSetDeserializationContext()
+ {
+ $contextFactoryMock = $this->getMockForAbstractClass('JMS\\Serializer\\ContextFactory\\DeserializationContextFactoryInterface');
+ $context = new DeserializationContext();
+
+ $contextFactoryMock
+ ->expects($this->once())
+ ->method('createDeserializationContext')
+ ->will($this->returnValue($context))
+ ;
+
+ $this->builder->setDeserializationContextFactory($contextFactoryMock);
+
+ $serializer = $this->builder->build();
+
+ $result = $serializer->deserialize('{"value":null}', 'array', 'json');
+
+ $this->assertEquals(array('value' => null), $result);
+ }
+
+ public function testSetCallbackSerializationContextWithSerializeNull()
+ {
+ $this->builder->setSerializationContextFactory(function () {
+ return SerializationContext::create()
+ ->setSerializeNull(true)
+ ;
+ });
+
+ $serializer = $this->builder->build();
+
+ $result = $serializer->serialize(array('value' => null), 'json');
+
+ $this->assertEquals('{"value":null}', $result);
+ }
+
+ public function testSetCallbackSerializationContextWithNotSerializeNull()
+ {
+ $this->builder->setSerializationContextFactory(function () {
+ return SerializationContext::create()
+ ->setSerializeNull(false)
+ ;
+ });
+
+ $serializer = $this->builder->build();
+
+ $result = $serializer->serialize(array('value' => null, 'not_null' => 'ok'), 'json');
+
+ $this->assertEquals('{"not_null":"ok"}', $result);
+ }
+
+ public function expressionFunctionProvider()
+ {
+ return [
+ [
+ new ExpressionFunction('show_data', function () {
+ return "true";
+ }, function () {
+ return true;
+ }),
+ '{"name":"mike"}'
+ ],
+ [
+ new ExpressionFunction('show_data', function () {
+ return "false";
+ }, function () {
+ return false;
+ }),
+ '{"name":"mike","gender":"f"}'
+ ]
+ ];
+ }
+
+ /**
+ * @dataProvider expressionFunctionProvider
+ * @param ExpressionFunction $function
+ * @param $json
+ */
+ public function testExpressionEngine(ExpressionFunction $function, $json)
+ {
+ $language = new ExpressionLanguage();
+ $language->addFunction($function);
+
+ $this->builder->setExpressionEvaluator(new ExpressionEvaluator($language));
+
+ $serializer = $this->builder->build();
+
+ $person = new PersonSecret();
+ $person->gender = 'f';
+ $person->name = 'mike';
+
+ $this->assertEquals($json, $serializer->serialize($person, 'json'));
+ }
+
+ protected function setUp()
+ {
+ $this->builder = SerializerBuilder::create();
+ $this->fs = new Filesystem();
+
+ $this->tmpDir = sys_get_temp_dir().'/serializer';
+ $this->fs->remove($this->tmpDir);
+ clearstatcache();
+ }
+
+ protected function tearDown()
+ {
+ $this->fs->remove($this->tmpDir);
+ }
+
+ private function getField($obj, $name)
+ {
+ $ref = new \ReflectionProperty($obj, $name);
+ $ref->setAccessible(true);
+
+ return $ref->getValue($obj);
+ }
+
+ private function getIncludeInterfaces(SerializerBuilder $builder)
+ {
+ $factory = $this->getField($builder->build(), 'factory');
+
+ return $this->getField($factory, 'includeInterfaces');
+ }
+}
diff --git a/vendor/jms/serializer/tests/JMS/Serializer/Tests/Twig/SerializerExtensionTest.php b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Twig/SerializerExtensionTest.php
new file mode 100644
index 0000000000..051294db26
--- /dev/null
+++ b/vendor/jms/serializer/tests/JMS/Serializer/Tests/Twig/SerializerExtensionTest.php
@@ -0,0 +1,78 @@
+
+ *
+ * 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\Twig;
+
+use JMS\Serializer\Twig\SerializerExtension;
+use JMS\Serializer\Twig\SerializerRuntimeExtension;
+use JMS\Serializer\Twig\SerializerRuntimeHelper;
+
+class SerializerExtensionTest extends \PHPUnit_Framework_TestCase
+{
+ public function testSerialize()
+ {
+ $mockSerializer = $this->getMock('JMS\Serializer\SerializerInterface');
+ $obj = new \stdClass();
+ $mockSerializer
+ ->expects($this->once())
+ ->method('serialize')
+ ->with($this->equalTo($obj), $this->equalTo('json'));
+ $serializerExtension = new SerializerExtension($mockSerializer);
+ $serializerExtension->serialize($obj);
+
+ $this->assertEquals('jms_serializer', $serializerExtension->getName());
+
+ $filters = $serializerExtension->getFilters();
+ $this->assertInstanceOf('Twig_SimpleFilter', $filters[0]);
+ $this->assertSame(array($serializerExtension, 'serialize'), $filters[0]->getCallable());
+
+ $this->assertEquals(
+ array(new \Twig_SimpleFunction('serialization_context', '\JMS\Serializer\SerializationContext::create')),
+ $serializerExtension->getFunctions()
+ );
+ }
+
+ public function testRuntimeSerializerHelper()
+ {
+ $obj = new \stdClass();
+
+ $mockSerializer = $this->getMock('JMS\Serializer\SerializerInterface');
+ $mockSerializer
+ ->expects($this->once())
+ ->method('serialize')
+ ->with($this->equalTo($obj), $this->equalTo('json'));
+
+ $serializerExtension = new SerializerRuntimeHelper($mockSerializer);
+ $serializerExtension->serialize($obj);
+ }
+
+ public function testRuntimeSerializerExtension()
+ {
+ $serializerExtension = new SerializerRuntimeExtension();
+
+ $this->assertEquals('jms_serializer', $serializerExtension->getName());
+ $this->assertEquals(
+ array(new \Twig_SimpleFilter('serialize', array(SerializerRuntimeHelper::class, 'serialize'))),
+ $serializerExtension->getFilters()
+ );
+ $this->assertEquals(
+ array(new \Twig_SimpleFunction('serialization_context', '\JMS\Serializer\SerializationContext::create')),
+ $serializerExtension->getFunctions()
+ );
+ }
+}
diff --git a/vendor/jms/serializer/tests/benchmark.php b/vendor/jms/serializer/tests/benchmark.php
new file mode 100644
index 0000000000..f1c8d95f01
--- /dev/null
+++ b/vendor/jms/serializer/tests/benchmark.php
@@ -0,0 +1,63 @@
+ [output-file]'.PHP_EOL;
+ exit(1);
+}
+
+list(, $format, $iterations) = $_SERVER['argv'];
+
+require_once 'bootstrap.php';
+
+function benchmark(\Closure $f, $times = 10)
+{
+ $time = microtime(true);
+ for ($i=0; $i<$times; $i++) {
+ $f();
+ }
+
+ return (microtime(true) - $time) / $times;
+}
+
+function createCollection()
+{
+ $collection = array();
+ for ($i=0; $i<50; $i++) {
+ $collection[] = createObject();
+ }
+
+ return $collection;
+}
+
+function createObject()
+{
+ $p = new \JMS\Serializer\Tests\Fixtures\Publisher('bar');
+ $post = new \JMS\Serializer\Tests\Fixtures\BlogPost('FooooooooooooooooooooooBAR', new \JMS\Serializer\Tests\Fixtures\Author('Foo'), new \DateTime, $p);
+ for ($i=0; $i<10; $i++) {
+ $post->addComment(new \JMS\Serializer\Tests\Fixtures\Comment(new \JMS\Serializer\Tests\Fixtures\Author('foo'), 'foobar'));
+ }
+
+ return $post;
+}
+
+$serializer = \JMS\Serializer\SerializerBuilder::create()->build();
+$collection = createCollection();
+$metrics = array();
+$f = function() use ($serializer, $collection, $format) {
+ $serializer->serialize($collection, $format);
+};
+
+// Load all necessary classes into memory.
+benchmark($f, 1);
+
+printf('Benchmarking collection for format "%s".'.PHP_EOL, $format);
+$metrics['benchmark-collection-'.$format] = benchmark($f, $iterations);
+
+$output = json_encode(array('metrics' => $metrics));
+
+if (isset($_SERVER['argv'][3])) {
+ file_put_contents($_SERVER['argv'][3], $output);
+ echo "Done.".PHP_EOL;
+} else {
+ echo $output.PHP_EOL;
+}
diff --git a/vendor/jms/serializer/tests/bootstrap.php b/vendor/jms/serializer/tests/bootstrap.php
new file mode 100644
index 0000000000..71ce33a6b5
--- /dev/null
+++ b/vendor/jms/serializer/tests/bootstrap.php
@@ -0,0 +1,30 @@
+
+ *
+ * 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.
+ */
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
+call_user_func(function() {
+ if ( ! is_file($autoloadFile = __DIR__.'/../vendor/autoload.php')) {
+ throw new \RuntimeException('Did not find vendor/autoload.php. Did you run "composer install --dev"?');
+ }
+
+ $loader = require $autoloadFile;
+ $loader->add('JMS\Serializer\Tests', __DIR__);
+
+ AnnotationRegistry::registerLoader('class_exists');
+});
diff --git a/vendor/monolog/monolog/CHANGELOG.md b/vendor/monolog/monolog/CHANGELOG.md
new file mode 100644
index 0000000000..757643df9b
--- /dev/null
+++ b/vendor/monolog/monolog/CHANGELOG.md
@@ -0,0 +1,415 @@
+### 1.25.5 (2020-07-23)
+
+ * Fixed array access on null in RavenHandler
+ * Fixed unique_id in WebProcessor not being disableable
+
+### 1.25.4 (2020-05-22)
+
+ * Fixed GitProcessor type error when there is no git repo present
+ * Fixed normalization of SoapFault objects containing deeply nested objects as "detail"
+ * Fixed support for relative paths in RotatingFileHandler
+
+### 1.25.3 (2019-12-20)
+
+ * Fixed formatting of resources in JsonFormatter
+ * Fixed RedisHandler failing to use MULTI properly when passed a proxied Redis instance (e.g. in Symfony with lazy services)
+ * Fixed FilterHandler triggering a notice when handleBatch was filtering all records passed to it
+ * Fixed Turkish locale messing up the conversion of level names to their constant values
+
+### 1.25.2 (2019-11-13)
+
+ * Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable
+ * Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler and SamplingHandler
+ * Fixed BrowserConsoleHandler formatting when using multiple styles
+ * Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings
+ * Fixed normalization of SoapFault objects containing non-strings as "detail"
+ * Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding
+
+### 1.25.1 (2019-09-06)
+
+ * Fixed forward-compatible interfaces to be compatible with Monolog 1.x too.
+
+### 1.25.0 (2019-09-06)
+
+ * Deprecated SlackbotHandler, use SlackWebhookHandler or SlackHandler instead
+ * Deprecated RavenHandler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead
+ * Deprecated HipChatHandler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead
+ * Added forward-compatible interfaces and traits FormattableHandlerInterface, FormattableHandlerTrait, ProcessableHandlerInterface, ProcessableHandlerTrait. If you use modern PHP and want to make code compatible with Monolog 1 and 2 this can help. You will have to require at least Monolog 1.25 though.
+ * Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler
+ * Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records
+ * Fixed issue in SignalHandler restarting syscalls functionality
+ * Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases
+ * Fixed ZendMonitorHandler to work with the latest Zend Server versions
+ * Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB).
+
+### 1.24.0 (2018-11-05)
+
+ * BC Notice: If you are extending any of the Monolog's Formatters' `normalize` method, make sure you add the new `$depth = 0` argument to your function signature to avoid strict PHP warnings.
+ * Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors
+ * Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers)
+ * Added a way to log signals being received using Monolog\SignalHandler
+ * Added ability to customize error handling at the Logger level using Logger::setExceptionHandler
+ * Added InsightOpsHandler to migrate users of the LogEntriesHandler
+ * Added protection to NormalizerHandler against circular and very deep structures, it now stops normalizing at a depth of 9
+ * Added capture of stack traces to ErrorHandler when logging PHP errors
+ * Added RavenHandler support for a `contexts` context or extra key to forward that to Sentry's contexts
+ * Added forwarding of context info to FluentdFormatter
+ * Added SocketHandler::setChunkSize to override the default chunk size in case you must send large log lines to rsyslog for example
+ * Added ability to extend/override BrowserConsoleHandler
+ * Added SlackWebhookHandler::getWebhookUrl and SlackHandler::getToken to enable class extensibility
+ * Added SwiftMailerHandler::getSubjectFormatter to enable class extensibility
+ * Dropped official support for HHVM in test builds
+ * Fixed normalization of exception traces when call_user_func is used to avoid serializing objects and the data they contain
+ * Fixed naming of fields in Slack handler, all field names are now capitalized in all cases
+ * Fixed HipChatHandler bug where slack dropped messages randomly
+ * Fixed normalization of objects in Slack handlers
+ * Fixed support for PHP7's Throwable in NewRelicHandler
+ * Fixed race bug when StreamHandler sometimes incorrectly reported it failed to create a directory
+ * Fixed table row styling issues in HtmlFormatter
+ * Fixed RavenHandler dropping the message when logging exception
+ * Fixed WhatFailureGroupHandler skipping processors when using handleBatch
+ and implement it where possible
+ * Fixed display of anonymous class names
+
+### 1.23.0 (2017-06-19)
+
+ * Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument
+ * Fixed GelfHandler truncation to be per field and not per message
+ * Fixed compatibility issue with PHP <5.3.6
+ * Fixed support for headless Chrome in ChromePHPHandler
+ * Fixed support for latest Aws SDK in DynamoDbHandler
+ * Fixed support for SwiftMailer 6.0+ in SwiftMailerHandler
+
+### 1.22.1 (2017-03-13)
+
+ * Fixed lots of minor issues in the new Slack integrations
+ * Fixed support for allowInlineLineBreaks in LineFormatter when formatting exception backtraces
+
+### 1.22.0 (2016-11-26)
+
+ * Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily
+ * Added MercurialProcessor to add mercurial revision and branch names to log records
+ * Added support for AWS SDK v3 in DynamoDbHandler
+ * Fixed fatal errors occuring when normalizing generators that have been fully consumed
+ * Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix)
+ * Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore
+ * Fixed SyslogUdpHandler to avoid sending empty frames
+ * Fixed a few PHP 7.0 and 7.1 compatibility issues
+
+### 1.21.0 (2016-07-29)
+
+ * Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues
+ * Added support for more formats in RotatingFileHandler::setFilenameFormat as long as they have Y, m and d in order
+ * Added ability to format the main line of text the SlackHandler sends by explictly setting a formatter on the handler
+ * Added information about SoapFault instances in NormalizerFormatter
+ * Added $handleOnlyReportedErrors option on ErrorHandler::registerErrorHandler (default true) to allow logging of all errors no matter the error_reporting level
+
+### 1.20.0 (2016-07-02)
+
+ * Added FingersCrossedHandler::activate() to manually trigger the handler regardless of the activation policy
+ * Added StreamHandler::getUrl to retrieve the stream's URL
+ * Added ability to override addRow/addTitle in HtmlFormatter
+ * Added the $context to context information when the ErrorHandler handles a regular php error
+ * Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d
+ * Fixed WhatFailureGroupHandler to work with PHP7 throwables
+ * Fixed a few minor bugs
+
+### 1.19.0 (2016-04-12)
+
+ * Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it for you. You can retrieve those using getStream() if needed
+ * Added DeduplicationHandler to remove duplicate records from notifications across multiple requests, useful for email or other notifications on errors
+ * Added ability to use `%message%` and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandler
+ * Fixed HipChatHandler handling of long messages
+
+### 1.18.2 (2016-04-02)
+
+ * Fixed ElasticaFormatter to use more precise dates
+ * Fixed GelfMessageFormatter sending too long messages
+
+### 1.18.1 (2016-03-13)
+
+ * Fixed SlackHandler bug where slack dropped messages randomly
+ * Fixed RedisHandler issue when using with the PHPRedis extension
+ * Fixed AmqpHandler content-type being incorrectly set when using with the AMQP extension
+ * Fixed BrowserConsoleHandler regression
+
+### 1.18.0 (2016-03-01)
+
+ * Added optional reduction of timestamp precision via `Logger->useMicrosecondTimestamps(false)`, disabling it gets you a bit of performance boost but reduces the precision to the second instead of microsecond
+ * Added possibility to skip some extra stack frames in IntrospectionProcessor if you have some library wrapping Monolog that is always adding frames
+ * Added `Logger->withName` to clone a logger (keeping all handlers) with a new name
+ * Added FluentdFormatter for the Fluentd unix socket protocol
+ * Added HandlerWrapper base class to ease the creation of handler wrappers, just extend it and override as needed
+ * Added support for replacing context sub-keys using `%context.*%` in LineFormatter
+ * Added support for `payload` context value in RollbarHandler
+ * Added setRelease to RavenHandler to describe the application version, sent with every log
+ * Added support for `fingerprint` context value in RavenHandler
+ * Fixed JSON encoding errors that would gobble up the whole log record, we now handle those more gracefully by dropping chars as needed
+ * Fixed write timeouts in SocketHandler and derivatives, set to 10sec by default, lower it with `setWritingTimeout()`
+ * Fixed PHP7 compatibility with regard to Exception/Throwable handling in a few places
+
+### 1.17.2 (2015-10-14)
+
+ * Fixed ErrorHandler compatibility with non-Monolog PSR-3 loggers
+ * Fixed SlackHandler handling to use slack functionalities better
+ * Fixed SwiftMailerHandler bug when sending multiple emails they all had the same id
+ * Fixed 5.3 compatibility regression
+
+### 1.17.1 (2015-08-31)
+
+ * Fixed RollbarHandler triggering PHP notices
+
+### 1.17.0 (2015-08-30)
+
+ * Added support for `checksum` and `release` context/extra values in RavenHandler
+ * Added better support for exceptions in RollbarHandler
+ * Added UidProcessor::getUid
+ * Added support for showing the resource type in NormalizedFormatter
+ * Fixed IntrospectionProcessor triggering PHP notices
+
+### 1.16.0 (2015-08-09)
+
+ * Added IFTTTHandler to notify ifttt.com triggers
+ * Added Logger::setHandlers() to allow setting/replacing all handlers
+ * Added $capSize in RedisHandler to cap the log size
+ * Fixed StreamHandler creation of directory to only trigger when the first log write happens
+ * Fixed bug in the handling of curl failures
+ * Fixed duplicate logging of fatal errors when both error and fatal error handlers are registered in monolog's ErrorHandler
+ * Fixed missing fatal errors records with handlers that need to be closed to flush log records
+ * Fixed TagProcessor::addTags support for associative arrays
+
+### 1.15.0 (2015-07-12)
+
+ * Added addTags and setTags methods to change a TagProcessor
+ * Added automatic creation of directories if they are missing for a StreamHandler to open a log file
+ * Added retry functionality to Loggly, Cube and Mandrill handlers so they retry up to 5 times in case of network failure
+ * Fixed process exit code being incorrectly reset to 0 if ErrorHandler::registerExceptionHandler was used
+ * Fixed HTML/JS escaping in BrowserConsoleHandler
+ * Fixed JSON encoding errors being silently suppressed (PHP 5.5+ only)
+
+### 1.14.0 (2015-06-19)
+
+ * Added PHPConsoleHandler to send record to Chrome's PHP Console extension and library
+ * Added support for objects implementing __toString in the NormalizerFormatter
+ * Added support for HipChat's v2 API in HipChatHandler
+ * Added Logger::setTimezone() to initialize the timezone monolog should use in case date.timezone isn't correct for your app
+ * Added an option to send formatted message instead of the raw record on PushoverHandler via ->useFormattedMessage(true)
+ * Fixed curl errors being silently suppressed
+
+### 1.13.1 (2015-03-09)
+
+ * Fixed regression in HipChat requiring a new token to be created
+
+### 1.13.0 (2015-03-05)
+
+ * Added Registry::hasLogger to check for the presence of a logger instance
+ * Added context.user support to RavenHandler
+ * Added HipChat API v2 support in the HipChatHandler
+ * Added NativeMailerHandler::addParameter to pass params to the mail() process
+ * Added context data to SlackHandler when $includeContextAndExtra is true
+ * Added ability to customize the Swift_Message per-email in SwiftMailerHandler
+ * Fixed SwiftMailerHandler to lazily create message instances if a callback is provided
+ * Fixed serialization of INF and NaN values in Normalizer and LineFormatter
+
+### 1.12.0 (2014-12-29)
+
+ * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers.
+ * Added PsrHandler to forward records to another PSR-3 logger
+ * Added SamplingHandler to wrap around a handler and include only every Nth record
+ * Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now)
+ * Added exception codes in the output of most formatters
+ * Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line)
+ * Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data
+ * Added $host to HipChatHandler for users of private instances
+ * Added $transactionName to NewRelicHandler and support for a transaction_name context value
+ * Fixed MandrillHandler to avoid outputing API call responses
+ * Fixed some non-standard behaviors in SyslogUdpHandler
+
+### 1.11.0 (2014-09-30)
+
+ * Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names
+ * Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails
+ * Added MandrillHandler to send emails via the Mandrillapp.com API
+ * Added SlackHandler to log records to a Slack.com account
+ * Added FleepHookHandler to log records to a Fleep.io account
+ * Added LogglyHandler::addTag to allow adding tags to an existing handler
+ * Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end
+ * Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing
+ * Added support for PhpAmqpLib in the AmqpHandler
+ * Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs
+ * Added support for adding extra fields from $_SERVER in the WebProcessor
+ * Fixed support for non-string values in PrsLogMessageProcessor
+ * Fixed SwiftMailer messages being sent with the wrong date in long running scripts
+ * Fixed minor PHP 5.6 compatibility issues
+ * Fixed BufferHandler::close being called twice
+
+### 1.10.0 (2014-06-04)
+
+ * Added Logger::getHandlers() and Logger::getProcessors() methods
+ * Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached
+ * Added support for extra data in NewRelicHandler
+ * Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines
+
+### 1.9.1 (2014-04-24)
+
+ * Fixed regression in RotatingFileHandler file permissions
+ * Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records
+ * Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative
+
+### 1.9.0 (2014-04-20)
+
+ * Added LogEntriesHandler to send logs to a LogEntries account
+ * Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler
+ * Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes
+ * Added support for table formatting in FirePHPHandler via the table context key
+ * Added a TagProcessor to add tags to records, and support for tags in RavenHandler
+ * Added $appendNewline flag to the JsonFormatter to enable using it when logging to files
+ * Added sound support to the PushoverHandler
+ * Fixed multi-threading support in StreamHandler
+ * Fixed empty headers issue when ChromePHPHandler received no records
+ * Fixed default format of the ErrorLogHandler
+
+### 1.8.0 (2014-03-23)
+
+ * Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them
+ * Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output
+ * Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler
+ * Added FlowdockHandler to send logs to a Flowdock account
+ * Added RollbarHandler to send logs to a Rollbar account
+ * Added HtmlFormatter to send prettier log emails with colors for each log level
+ * Added GitProcessor to add the current branch/commit to extra record data
+ * Added a Monolog\Registry class to allow easier global access to pre-configured loggers
+ * Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement
+ * Added support for HHVM
+ * Added support for Loggly batch uploads
+ * Added support for tweaking the content type and encoding in NativeMailerHandler
+ * Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor
+ * Fixed batch request support in GelfHandler
+
+### 1.7.0 (2013-11-14)
+
+ * Added ElasticSearchHandler to send logs to an Elastic Search server
+ * Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB
+ * Added SyslogUdpHandler to send logs to a remote syslogd server
+ * Added LogglyHandler to send logs to a Loggly account
+ * Added $level to IntrospectionProcessor so it only adds backtraces when needed
+ * Added $version to LogstashFormatter to allow using the new v1 Logstash format
+ * Added $appName to NewRelicHandler
+ * Added configuration of Pushover notification retries/expiry
+ * Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default
+ * Added chainability to most setters for all handlers
+ * Fixed RavenHandler batch processing so it takes the message from the record with highest priority
+ * Fixed HipChatHandler batch processing so it sends all messages at once
+ * Fixed issues with eAccelerator
+ * Fixed and improved many small things
+
+### 1.6.0 (2013-07-29)
+
+ * Added HipChatHandler to send logs to a HipChat chat room
+ * Added ErrorLogHandler to send logs to PHP's error_log function
+ * Added NewRelicHandler to send logs to NewRelic's service
+ * Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler
+ * Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel
+ * Added stack traces output when normalizing exceptions (json output & co)
+ * Added Monolog\Logger::API constant (currently 1)
+ * Added support for ChromePHP's v4.0 extension
+ * Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel
+ * Added support for sending messages to multiple users at once with the PushoverHandler
+ * Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler)
+ * Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now
+ * Fixed issue in RotatingFileHandler when an open_basedir restriction is active
+ * Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0
+ * Fixed SyslogHandler issue when many were used concurrently with different facilities
+
+### 1.5.0 (2013-04-23)
+
+ * Added ProcessIdProcessor to inject the PID in log records
+ * Added UidProcessor to inject a unique identifier to all log records of one request/run
+ * Added support for previous exceptions in the LineFormatter exception serialization
+ * Added Monolog\Logger::getLevels() to get all available levels
+ * Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle
+
+### 1.4.1 (2013-04-01)
+
+ * Fixed exception formatting in the LineFormatter to be more minimalistic
+ * Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0
+ * Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days
+ * Fixed WebProcessor array access so it checks for data presence
+ * Fixed Buffer, Group and FingersCrossed handlers to make use of their processors
+
+### 1.4.0 (2013-02-13)
+
+ * Added RedisHandler to log to Redis via the Predis library or the phpredis extension
+ * Added ZendMonitorHandler to log to the Zend Server monitor
+ * Added the possibility to pass arrays of handlers and processors directly in the Logger constructor
+ * Added `$useSSL` option to the PushoverHandler which is enabled by default
+ * Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously
+ * Fixed header injection capability in the NativeMailHandler
+
+### 1.3.1 (2013-01-11)
+
+ * Fixed LogstashFormatter to be usable with stream handlers
+ * Fixed GelfMessageFormatter levels on Windows
+
+### 1.3.0 (2013-01-08)
+
+ * Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface`
+ * Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance
+ * Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash)
+ * Added PushoverHandler to send mobile notifications
+ * Added CouchDBHandler and DoctrineCouchDBHandler
+ * Added RavenHandler to send data to Sentry servers
+ * Added support for the new MongoClient class in MongoDBHandler
+ * Added microsecond precision to log records' timestamps
+ * Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing
+ the oldest entries
+ * Fixed normalization of objects with cyclic references
+
+### 1.2.1 (2012-08-29)
+
+ * Added new $logopts arg to SyslogHandler to provide custom openlog options
+ * Fixed fatal error in SyslogHandler
+
+### 1.2.0 (2012-08-18)
+
+ * Added AmqpHandler (for use with AMQP servers)
+ * Added CubeHandler
+ * Added NativeMailerHandler::addHeader() to send custom headers in mails
+ * Added the possibility to specify more than one recipient in NativeMailerHandler
+ * Added the possibility to specify float timeouts in SocketHandler
+ * Added NOTICE and EMERGENCY levels to conform with RFC 5424
+ * Fixed the log records to use the php default timezone instead of UTC
+ * Fixed BufferHandler not being flushed properly on PHP fatal errors
+ * Fixed normalization of exotic resource types
+ * Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog
+
+### 1.1.0 (2012-04-23)
+
+ * Added Monolog\Logger::isHandling() to check if a handler will
+ handle the given log level
+ * Added ChromePHPHandler
+ * Added MongoDBHandler
+ * Added GelfHandler (for use with Graylog2 servers)
+ * Added SocketHandler (for use with syslog-ng for example)
+ * Added NormalizerFormatter
+ * Added the possibility to change the activation strategy of the FingersCrossedHandler
+ * Added possibility to show microseconds in logs
+ * Added `server` and `referer` to WebProcessor output
+
+### 1.0.2 (2011-10-24)
+
+ * Fixed bug in IE with large response headers and FirePHPHandler
+
+### 1.0.1 (2011-08-25)
+
+ * Added MemoryPeakUsageProcessor and MemoryUsageProcessor
+ * Added Monolog\Logger::getName() to get a logger's channel name
+
+### 1.0.0 (2011-07-06)
+
+ * Added IntrospectionProcessor to get info from where the logger was called
+ * Fixed WebProcessor in CLI
+
+### 1.0.0-RC1 (2011-07-01)
+
+ * Initial release
diff --git a/vendor/monolog/monolog/LICENSE b/vendor/monolog/monolog/LICENSE
new file mode 100644
index 0000000000..16473219bf
--- /dev/null
+++ b/vendor/monolog/monolog/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011-2016 Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/monolog/monolog/README.md b/vendor/monolog/monolog/README.md
new file mode 100644
index 0000000000..a578eb2289
--- /dev/null
+++ b/vendor/monolog/monolog/README.md
@@ -0,0 +1,94 @@
+# Monolog - Logging for PHP [![Build Status](https://img.shields.io/travis/Seldaek/monolog.svg)](https://travis-ci.org/Seldaek/monolog)
+
+[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
+[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
+
+
+Monolog sends your logs to files, sockets, inboxes, databases and various
+web services. See the complete list of handlers below. Special handlers
+allow you to build advanced logging strategies.
+
+This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
+interface that you can type-hint against in your own libraries to keep
+a maximum of interoperability. You can also use it in your applications to
+make sure you can always use another compatible logger at a later time.
+As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels.
+Internally Monolog still uses its own level scheme since it predates PSR-3.
+
+## Installation
+
+Install the latest version with
+
+```bash
+$ composer require monolog/monolog
+```
+
+## Basic Usage
+
+```php
+pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
+
+// add records to the log
+$log->addWarning('Foo');
+$log->addError('Bar');
+```
+
+## Documentation
+
+- [Usage Instructions](doc/01-usage.md)
+- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md)
+- [Utility classes](doc/03-utilities.md)
+- [Extending Monolog](doc/04-extending.md)
+
+## Third Party Packages
+
+Third party handlers, formatters and processors are
+[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
+can also add your own there if you publish one.
+
+## About
+
+### Requirements
+
+- Monolog works with PHP 5.3 or above, and is also tested to work with HHVM.
+
+### Submitting bugs and feature requests
+
+Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues)
+
+### Framework Integrations
+
+- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
+ can be used very easily with Monolog since it implements the interface.
+- [Symfony2](http://symfony.com) comes out of the box with Monolog.
+- [Silex](http://silex.sensiolabs.org/) comes out of the box with Monolog.
+- [Laravel 4 & 5](http://laravel.com/) come out of the box with Monolog.
+- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog.
+- [PPI](http://www.ppi.io/) comes out of the box with Monolog.
+- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin.
+- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer.
+- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog.
+- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog.
+- [Nette Framework](http://nette.org/en/) can be used with Monolog via [Kdyby/Monolog](https://github.com/Kdyby/Monolog) extension.
+- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog.
+
+### Author
+
+Jordi Boggiano - -
+See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project.
+
+### License
+
+Monolog is licensed under the MIT License - see the `LICENSE` file for details
+
+### Acknowledgements
+
+This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/)
+library, although most concepts have been adjusted to fit to the PHP world.
diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json
new file mode 100644
index 0000000000..e171e20297
--- /dev/null
+++ b/vendor/monolog/monolog/composer.json
@@ -0,0 +1,65 @@
+{
+ "name": "monolog/monolog",
+ "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
+ "keywords": ["log", "logging", "psr-3"],
+ "homepage": "http://github.com/Seldaek/monolog",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "psr/log": "~1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.5",
+ "graylog2/gelf-php": "~1.0",
+ "sentry/sentry": "^0.13",
+ "ruflin/elastica": ">=0.90 <3.0",
+ "doctrine/couchdb": "~1.0@dev",
+ "aws/aws-sdk-php": "^2.4.9 || ^3.0",
+ "php-amqplib/php-amqplib": "~2.4",
+ "swiftmailer/swiftmailer": "^5.3|^6.0",
+ "php-console/php-console": "^3.1.3",
+ "php-parallel-lint/php-parallel-lint": "^1.0"
+ },
+ "suggest": {
+ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
+ "sentry/sentry": "Allow sending log messages to a Sentry server",
+ "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
+ "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
+ "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
+ "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
+ "ext-mongo": "Allow sending log messages to a MongoDB server",
+ "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
+ "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
+ "rollbar/rollbar": "Allow sending log messages to Rollbar",
+ "php-console/php-console": "Allow sending log messages to Google Chrome"
+ },
+ "autoload": {
+ "psr-4": {"Monolog\\": "src/Monolog"}
+ },
+ "autoload-dev": {
+ "psr-4": {"Monolog\\": "tests/Monolog"}
+ },
+ "provide": {
+ "psr/log-implementation": "1.0.0"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "scripts": {
+ "test": [
+ "parallel-lint . --exclude vendor --exclude src/Monolog/Handler/FormattableHandlerInterface.php --exclude src/Monolog/Handler/FormattableHandlerTrait.php --exclude src/Monolog/Handler/ProcessableHandlerInterface.php --exclude src/Monolog/Handler/ProcessableHandlerTrait.php",
+ "phpunit"
+ ]
+ },
+ "lock": false
+}
diff --git a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php
new file mode 100644
index 0000000000..36ec0098fd
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php
@@ -0,0 +1,238 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog;
+
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
+use Monolog\Handler\AbstractHandler;
+
+/**
+ * Monolog error handler
+ *
+ * A facility to enable logging of runtime errors, exceptions and fatal errors.
+ *
+ * Quick setup: ErrorHandler::register($logger);
+ *
+ * @author Jordi Boggiano
+ */
+class ErrorHandler
+{
+ private $logger;
+
+ private $previousExceptionHandler;
+ private $uncaughtExceptionLevel;
+
+ private $previousErrorHandler;
+ private $errorLevelMap;
+ private $handleOnlyReportedErrors;
+
+ private $hasFatalErrorHandler;
+ private $fatalLevel;
+ private $reservedMemory;
+ private $lastFatalTrace;
+ private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR);
+
+ public function __construct(LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
+
+ /**
+ * Registers a new ErrorHandler for a given Logger
+ *
+ * By default it will handle errors, exceptions and fatal errors
+ *
+ * @param LoggerInterface $logger
+ * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
+ * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling
+ * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling
+ * @return ErrorHandler
+ */
+ public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null)
+ {
+ //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929
+ class_exists('\\Psr\\Log\\LogLevel', true);
+
+ $handler = new static($logger);
+ if ($errorLevelMap !== false) {
+ $handler->registerErrorHandler($errorLevelMap);
+ }
+ if ($exceptionLevel !== false) {
+ $handler->registerExceptionHandler($exceptionLevel);
+ }
+ if ($fatalLevel !== false) {
+ $handler->registerFatalHandler($fatalLevel);
+ }
+
+ return $handler;
+ }
+
+ public function registerExceptionHandler($level = null, $callPrevious = true)
+ {
+ $prev = set_exception_handler(array($this, 'handleException'));
+ $this->uncaughtExceptionLevel = $level;
+ if ($callPrevious && $prev) {
+ $this->previousExceptionHandler = $prev;
+ }
+ }
+
+ public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1, $handleOnlyReportedErrors = true)
+ {
+ $prev = set_error_handler(array($this, 'handleError'), $errorTypes);
+ $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
+ if ($callPrevious) {
+ $this->previousErrorHandler = $prev ?: true;
+ }
+
+ $this->handleOnlyReportedErrors = $handleOnlyReportedErrors;
+ }
+
+ public function registerFatalHandler($level = null, $reservedMemorySize = 20)
+ {
+ register_shutdown_function(array($this, 'handleFatalError'));
+
+ $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
+ $this->fatalLevel = $level;
+ $this->hasFatalErrorHandler = true;
+ }
+
+ protected function defaultErrorLevelMap()
+ {
+ return array(
+ E_ERROR => LogLevel::CRITICAL,
+ E_WARNING => LogLevel::WARNING,
+ E_PARSE => LogLevel::ALERT,
+ E_NOTICE => LogLevel::NOTICE,
+ E_CORE_ERROR => LogLevel::CRITICAL,
+ E_CORE_WARNING => LogLevel::WARNING,
+ E_COMPILE_ERROR => LogLevel::ALERT,
+ E_COMPILE_WARNING => LogLevel::WARNING,
+ E_USER_ERROR => LogLevel::ERROR,
+ E_USER_WARNING => LogLevel::WARNING,
+ E_USER_NOTICE => LogLevel::NOTICE,
+ E_STRICT => LogLevel::NOTICE,
+ E_RECOVERABLE_ERROR => LogLevel::ERROR,
+ E_DEPRECATED => LogLevel::NOTICE,
+ E_USER_DEPRECATED => LogLevel::NOTICE,
+ );
+ }
+
+ /**
+ * @private
+ */
+ public function handleException($e)
+ {
+ $this->logger->log(
+ $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel,
+ sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()),
+ array('exception' => $e)
+ );
+
+ if ($this->previousExceptionHandler) {
+ call_user_func($this->previousExceptionHandler, $e);
+ }
+
+ exit(255);
+ }
+
+ /**
+ * @private
+ */
+ public function handleError($code, $message, $file = '', $line = 0, $context = array())
+ {
+ if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) {
+ return;
+ }
+
+ // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
+ if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
+ $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
+ $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line));
+ } else {
+ // http://php.net/manual/en/function.debug-backtrace.php
+ // As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added.
+ // Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'.
+ $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS);
+ array_shift($trace); // Exclude handleError from trace
+ $this->lastFatalTrace = $trace;
+ }
+
+ if ($this->previousErrorHandler === true) {
+ return false;
+ } elseif ($this->previousErrorHandler) {
+ return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context);
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function handleFatalError()
+ {
+ $this->reservedMemory = null;
+
+ $lastError = error_get_last();
+ if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) {
+ $this->logger->log(
+ $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel,
+ 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
+ array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $this->lastFatalTrace)
+ );
+
+ if ($this->logger instanceof Logger) {
+ foreach ($this->logger->getHandlers() as $handler) {
+ if ($handler instanceof AbstractHandler) {
+ $handler->close();
+ }
+ }
+ }
+ }
+ }
+
+ private static function codeToString($code)
+ {
+ switch ($code) {
+ case E_ERROR:
+ return 'E_ERROR';
+ case E_WARNING:
+ return 'E_WARNING';
+ case E_PARSE:
+ return 'E_PARSE';
+ case E_NOTICE:
+ return 'E_NOTICE';
+ case E_CORE_ERROR:
+ return 'E_CORE_ERROR';
+ case E_CORE_WARNING:
+ return 'E_CORE_WARNING';
+ case E_COMPILE_ERROR:
+ return 'E_COMPILE_ERROR';
+ case E_COMPILE_WARNING:
+ return 'E_COMPILE_WARNING';
+ case E_USER_ERROR:
+ return 'E_USER_ERROR';
+ case E_USER_WARNING:
+ return 'E_USER_WARNING';
+ case E_USER_NOTICE:
+ return 'E_USER_NOTICE';
+ case E_STRICT:
+ return 'E_STRICT';
+ case E_RECOVERABLE_ERROR:
+ return 'E_RECOVERABLE_ERROR';
+ case E_DEPRECATED:
+ return 'E_DEPRECATED';
+ case E_USER_DEPRECATED:
+ return 'E_USER_DEPRECATED';
+ }
+
+ return 'Unknown PHP error';
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
new file mode 100644
index 0000000000..9beda1e763
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
@@ -0,0 +1,78 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Monolog\Logger;
+
+/**
+ * Formats a log message according to the ChromePHP array format
+ *
+ * @author Christophe Coevoet
+ */
+class ChromePHPFormatter implements FormatterInterface
+{
+ /**
+ * Translates Monolog log levels to Wildfire levels.
+ */
+ private $logLevels = array(
+ Logger::DEBUG => 'log',
+ Logger::INFO => 'info',
+ Logger::NOTICE => 'info',
+ Logger::WARNING => 'warn',
+ Logger::ERROR => 'error',
+ Logger::CRITICAL => 'error',
+ Logger::ALERT => 'error',
+ Logger::EMERGENCY => 'error',
+ );
+
+ /**
+ * {@inheritdoc}
+ */
+ public function format(array $record)
+ {
+ // Retrieve the line and file if set and remove them from the formatted extra
+ $backtrace = 'unknown';
+ if (isset($record['extra']['file'], $record['extra']['line'])) {
+ $backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
+ unset($record['extra']['file'], $record['extra']['line']);
+ }
+
+ $message = array('message' => $record['message']);
+ if ($record['context']) {
+ $message['context'] = $record['context'];
+ }
+ if ($record['extra']) {
+ $message['extra'] = $record['extra'];
+ }
+ if (count($message) === 1) {
+ $message = reset($message);
+ }
+
+ return array(
+ $record['channel'],
+ $message,
+ $backtrace,
+ $this->logLevels[$record['level']],
+ );
+ }
+
+ public function formatBatch(array $records)
+ {
+ $formatted = array();
+
+ foreach ($records as $record) {
+ $formatted[] = $this->format($record);
+ }
+
+ return $formatted;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
new file mode 100644
index 0000000000..4c556cf178
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
@@ -0,0 +1,89 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Elastica\Document;
+
+/**
+ * Format a log message into an Elastica Document
+ *
+ * @author Jelle Vink
+ */
+class ElasticaFormatter extends NormalizerFormatter
+{
+ /**
+ * @var string Elastic search index name
+ */
+ protected $index;
+
+ /**
+ * @var string Elastic search document type
+ */
+ protected $type;
+
+ /**
+ * @param string $index Elastic Search index name
+ * @param string $type Elastic Search document type
+ */
+ public function __construct($index, $type)
+ {
+ // elasticsearch requires a ISO 8601 format date with optional millisecond precision.
+ parent::__construct('Y-m-d\TH:i:s.uP');
+
+ $this->index = $index;
+ $this->type = $type;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function format(array $record)
+ {
+ $record = parent::format($record);
+
+ return $this->getDocument($record);
+ }
+
+ /**
+ * Getter index
+ * @return string
+ */
+ public function getIndex()
+ {
+ return $this->index;
+ }
+
+ /**
+ * Getter type
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * Convert a log message into an Elastica Document
+ *
+ * @param array $record Log message
+ * @return Document
+ */
+ protected function getDocument($record)
+ {
+ $document = new Document();
+ $document->setData($record);
+ $document->setType($this->type);
+ $document->setIndex($this->index);
+
+ return $document;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
new file mode 100644
index 0000000000..5094af3c77
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
@@ -0,0 +1,116 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+/**
+ * formats the record to be used in the FlowdockHandler
+ *
+ * @author Dominik Liebler
+ */
+class FlowdockFormatter implements FormatterInterface
+{
+ /**
+ * @var string
+ */
+ private $source;
+
+ /**
+ * @var string
+ */
+ private $sourceEmail;
+
+ /**
+ * @param string $source
+ * @param string $sourceEmail
+ */
+ public function __construct($source, $sourceEmail)
+ {
+ $this->source = $source;
+ $this->sourceEmail = $sourceEmail;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function format(array $record)
+ {
+ $tags = array(
+ '#logs',
+ '#' . strtolower($record['level_name']),
+ '#' . $record['channel'],
+ );
+
+ foreach ($record['extra'] as $value) {
+ $tags[] = '#' . $value;
+ }
+
+ $subject = sprintf(
+ 'in %s: %s - %s',
+ $this->source,
+ $record['level_name'],
+ $this->getShortMessage($record['message'])
+ );
+
+ $record['flowdock'] = array(
+ 'source' => $this->source,
+ 'from_address' => $this->sourceEmail,
+ 'subject' => $subject,
+ 'content' => $record['message'],
+ 'tags' => $tags,
+ 'project' => $this->source,
+ );
+
+ return $record;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function formatBatch(array $records)
+ {
+ $formatted = array();
+
+ foreach ($records as $record) {
+ $formatted[] = $this->format($record);
+ }
+
+ return $formatted;
+ }
+
+ /**
+ * @param string $message
+ *
+ * @return string
+ */
+ public function getShortMessage($message)
+ {
+ static $hasMbString;
+
+ if (null === $hasMbString) {
+ $hasMbString = function_exists('mb_strlen');
+ }
+
+ $maxLength = 45;
+
+ if ($hasMbString) {
+ if (mb_strlen($message, 'UTF-8') > $maxLength) {
+ $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...';
+ }
+ } else {
+ if (strlen($message) > $maxLength) {
+ $message = substr($message, 0, $maxLength - 4) . ' ...';
+ }
+ }
+
+ return $message;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php
new file mode 100644
index 0000000000..f8ead47569
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php
@@ -0,0 +1,88 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Monolog\Utils;
+
+/**
+ * Class FluentdFormatter
+ *
+ * Serializes a log message to Fluentd unix socket protocol
+ *
+ * Fluentd config:
+ *
+ *
+ *
+ * Monolog setup:
+ *
+ * $logger = new Monolog\Logger('fluent.tag');
+ * $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock');
+ * $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter());
+ * $logger->pushHandler($fluentHandler);
+ *
+ * @author Andrius Putna
+ */
+class FluentdFormatter implements FormatterInterface
+{
+ /**
+ * @var bool $levelTag should message level be a part of the fluentd tag
+ */
+ protected $levelTag = false;
+
+ public function __construct($levelTag = false)
+ {
+ if (!function_exists('json_encode')) {
+ throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter');
+ }
+
+ $this->levelTag = (bool) $levelTag;
+ }
+
+ public function isUsingLevelsInTag()
+ {
+ return $this->levelTag;
+ }
+
+ public function format(array $record)
+ {
+ $tag = $record['channel'];
+ if ($this->levelTag) {
+ $tag .= '.' . strtolower($record['level_name']);
+ }
+
+ $message = array(
+ 'message' => $record['message'],
+ 'context' => $record['context'],
+ 'extra' => $record['extra'],
+ );
+
+ if (!$this->levelTag) {
+ $message['level'] = $record['level'];
+ $message['level_name'] = $record['level_name'];
+ }
+
+ return Utils::jsonEncode(array($tag, $record['datetime']->getTimestamp(), $message));
+ }
+
+ public function formatBatch(array $records)
+ {
+ $message = '';
+ foreach ($records as $record) {
+ $message .= $this->format($record);
+ }
+
+ return $message;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
new file mode 100644
index 0000000000..b5de751112
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
@@ -0,0 +1,36 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+/**
+ * Interface for formatters
+ *
+ * @author Jordi Boggiano
+ */
+interface FormatterInterface
+{
+ /**
+ * Formats a log record.
+ *
+ * @param array $record A record to format
+ * @return mixed The formatted record
+ */
+ public function format(array $record);
+
+ /**
+ * Formats a set of log records.
+ *
+ * @param array $records A set of records to format
+ * @return mixed The formatted set of records
+ */
+ public function formatBatch(array $records);
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
new file mode 100644
index 0000000000..2c1b0e86c5
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
@@ -0,0 +1,138 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Monolog\Logger;
+use Gelf\Message;
+
+/**
+ * Serializes a log message to GELF
+ * @see http://www.graylog2.org/about/gelf
+ *
+ * @author Matt Lehner