From 4ed51243b575b3990be29d049005067d0c56d920 Mon Sep 17 00:00:00 2001 From: ekes Date: Fri, 9 Jun 2017 13:30:20 +0100 Subject: [PATCH] Upgrading to 1.0.0-beta1 version of the API PHP implementation. --- composer.json | 6 +- composer.lock | 103 +++++----- radar.inc.php | 9 +- vendor/composer/ClassLoader.php | 8 +- vendor/composer/LICENSE | 21 ++ vendor/composer/autoload_namespaces.php | 1 - vendor/composer/autoload_psr4.php | 1 + vendor/composer/autoload_real.php | 34 ++-- vendor/composer/autoload_static.php | 82 ++++++++ vendor/composer/installed.json | 186 +++++++++--------- .../radar-api-php/docs/files/Connect.php.txt | 2 +- vendor/events-radar/radar-api-php/events.php | 89 +++++++-- .../radar-api-php/radar_client.php | 2 +- .../events-radar/radar-api-php/src/Cache.php | 17 +- .../radar-api-php/src/Connect.php | 159 +++++++++++++-- .../radar-api-php/src/Entity/Entity.php | 1 + .../radar-api-php/src/Entity/Event.php | 16 +- .../radar-api-php/src/Entity/Group.php | 31 ++- .../radar-api-php/src/Entity/Node.php | 16 +- .../radar-api-php/src/Entity/RadarFile.php | 67 +++++++ .../events-radar/radar-api-php/src/Filter.php | 15 +- .../radar-api-php/tests/Entity/EventTest.php | 24 +-- .../radar-api-php/tests/Entity/GroupTest.php | 18 +- .../tests/Entity/ListingsGroupTest.php | 8 +- .../tests/Entity/TaxonomyTermTest.php | 2 +- .../radar-api-php/tests/data/event | 2 +- .../radar-api-php/tests/data/group | 2 +- .../radar-api-php/tests/data/listings_group | 2 +- .../radar-api-php/tests/data/taxonomy_term | 2 +- .../Component/EventDispatcher => }/.gitignore | 0 .../EventDispatcher => }/CHANGELOG.md | 14 ++ .../ContainerAwareEventDispatcher.php | 55 +++--- .../Debug/TraceableEventDispatcher.php | 140 ++++++------- .../TraceableEventDispatcherInterface.php | 0 .../Debug/WrappedListener.php | 45 +++++ .../RegisterListenersPass.php | 73 ++++--- .../Component/EventDispatcher => }/Event.php | 74 +------ .../EventDispatcher => }/EventDispatcher.php | 123 ++++++++---- .../EventDispatcherInterface.php | 26 +-- .../EventSubscriberInterface.php | 6 +- .../EventDispatcher => }/GenericEvent.php | 40 ++-- .../ImmutableEventDispatcher.php | 10 +- .../Component/EventDispatcher => }/LICENSE | 2 +- vendor/symfony/event-dispatcher/README.md | 15 ++ .../Component/EventDispatcher/README.md | 27 --- .../EventDispatcher/Tests/EventTest.php | 100 ---------- .../Tests/AbstractEventDispatcherTest.php | 99 ++++++++-- .../ContainerAwareEventDispatcherTest.php | 109 ++++------ .../Debug/TraceableEventDispatcherTest.php | 101 +++++++--- .../RegisterListenersPassTest.php | 71 ++----- .../Tests/EventDispatcherTest.php | 0 .../event-dispatcher/Tests/EventTest.php | 55 ++++++ .../Tests/GenericEventTest.php | 5 +- .../Tests/ImmutableEventDispatcherTest.php | 9 +- .../EventDispatcher => }/composer.json | 26 +-- .../EventDispatcher => }/phpunit.xml.dist | 3 + 56 files changed, 1330 insertions(+), 824 deletions(-) create mode 100644 vendor/composer/LICENSE create mode 100644 vendor/composer/autoload_static.php create mode 100644 vendor/events-radar/radar-api-php/src/Entity/RadarFile.php rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/.gitignore (100%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/CHANGELOG.md (59%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/ContainerAwareEventDispatcher.php (77%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Debug/TraceableEventDispatcher.php (66%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Debug/TraceableEventDispatcherInterface.php (100%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Debug/WrappedListener.php (54%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/DependencyInjection/RegisterListenersPass.php (57%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Event.php (50%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/EventDispatcher.php (58%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/EventDispatcherInterface.php (85%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/EventSubscriberInterface.php (96%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/GenericEvent.php (81%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/ImmutableEventDispatcher.php (91%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/LICENSE (96%) create mode 100644 vendor/symfony/event-dispatcher/README.md delete mode 100644 vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md delete mode 100644 vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Tests/AbstractEventDispatcherTest.php (77%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Tests/ContainerAwareEventDispatcherTest.php (66%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Tests/Debug/TraceableEventDispatcherTest.php (58%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Tests/DependencyInjection/RegisterListenersPassTest.php (66%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Tests/EventDispatcherTest.php (100%) create mode 100644 vendor/symfony/event-dispatcher/Tests/EventTest.php rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Tests/GenericEventTest.php (94%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/Tests/ImmutableEventDispatcherTest.php (84%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/composer.json (54%) rename vendor/symfony/event-dispatcher/{Symfony/Component/EventDispatcher => }/phpunit.xml.dist (93%) diff --git a/composer.json b/composer.json index 75e1a86..ac30ce3 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ "repositories": [ { "type": "vcs", - "url": "https://github.com/events-radar/radar-api-php" + "url": "https://0xacab.org/radar/radar-api-php" } ], - "minimum-stability": "alpha", + "minimum-stability": "beta", "prefer-stable": true, "require": { - "events-radar/radar-api-php": "0.1.*@alpha" + "events-radar/radar-api-php": "0.1.*@beta" } } diff --git a/composer.lock b/composer.lock index 29f9717..b6af17b 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,11 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "80ea414a6d35f60a21a71bfd55c8ed5a", + "hash": "1c78465da129002f122b2e8e75f6e1db", + "content-hash": "c8fa5cf6c9d380ba0857cf9b16b3103e", "packages": [ { "name": "doctrine/common", @@ -78,17 +79,11 @@ }, { "name": "events-radar/radar-api-php", - "version": "0.1.0-alpha3", + "version": "0.1.0-beta1", "source": { "type": "git", - "url": "https://github.com/events-radar/radar-api-php.git", - "reference": "20e0b5c7d268f413fc1705bb81c46bce99b5ec1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/events-radar/radar-api-php/zipball/20e0b5c7d268f413fc1705bb81c46bce99b5ec1d", - "reference": "20e0b5c7d268f413fc1705bb81c46bce99b5ec1d", - "shasum": "" + "url": "https://0xacab.org/radar/radar-api-php", + "reference": "e272465d34853ffb781b3ea99bad53f40e567f82" }, "require": { "doctrine/common": "2.3.0", @@ -111,11 +106,7 @@ "GPL-2.0+" ], "description": "Radar API connect", - "support": { - "source": "https://github.com/events-radar/radar-api-php/tree/0.1.0-alpha3", - "issues": "https://github.com/events-radar/radar-api-php/issues" - }, - "time": "2015-02-24 20:52:50" + "time": "2017-04-27 15:31:59" }, { "name": "guzzle/cache", @@ -123,12 +114,12 @@ "target-dir": "Guzzle/Cache", "source": { "type": "git", - "url": "https://github.com/guzzle/cache.git", + "url": "https://github.com/Guzzle3/cache.git", "reference": "9d20d5afd4203f84893e809777ffa01e47bd4ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/cache/zipball/9d20d5afd4203f84893e809777ffa01e47bd4ea7", + "url": "https://api.github.com/repos/Guzzle3/cache/zipball/9d20d5afd4203f84893e809777ffa01e47bd4ea7", "reference": "9d20d5afd4203f84893e809777ffa01e47bd4ea7", "shasum": "" }, @@ -167,6 +158,7 @@ "doctrine", "zf" ], + "abandoned": "guzzle/guzzle", "time": "2014-01-08 21:24:51" }, { @@ -175,12 +167,12 @@ "target-dir": "Guzzle/Common", "source": { "type": "git", - "url": "https://github.com/guzzle/common.git", + "url": "https://github.com/Guzzle3/common.git", "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", + "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", "shasum": "" }, @@ -211,6 +203,7 @@ "event", "exception" ], + "abandoned": "guzzle/guzzle", "time": "2014-08-11 04:32:36" }, { @@ -219,12 +212,12 @@ "target-dir": "Guzzle/Http", "source": { "type": "git", - "url": "https://github.com/guzzle/http.git", + "url": "https://github.com/Guzzle3/http.git", "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", + "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", "shasum": "" }, @@ -268,6 +261,7 @@ "http", "http client" ], + "abandoned": "guzzle/guzzle", "time": "2014-08-11 04:32:36" }, { @@ -276,12 +270,12 @@ "target-dir": "Guzzle/Parser", "source": { "type": "git", - "url": "https://github.com/guzzle/parser.git", + "url": "https://github.com/Guzzle3/parser.git", "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", + "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", "shasum": "" }, @@ -312,6 +306,7 @@ "message", "url" ], + "abandoned": "guzzle/guzzle", "time": "2014-02-05 18:29:46" }, { @@ -320,12 +315,12 @@ "target-dir": "Guzzle/Plugin/Cache", "source": { "type": "git", - "url": "https://github.com/guzzle/plugin-cache.git", + "url": "https://github.com/Guzzle3/plugin-cache.git", "reference": "152bc4fa58e1578d01d501a97cbeee1c34edecb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/plugin-cache/zipball/152bc4fa58e1578d01d501a97cbeee1c34edecb6", + "url": "https://api.github.com/repos/Guzzle3/plugin-cache/zipball/152bc4fa58e1578d01d501a97cbeee1c34edecb6", "reference": "152bc4fa58e1578d01d501a97cbeee1c34edecb6", "shasum": "" }, @@ -362,6 +357,7 @@ "Guzzle", "plugin" ], + "abandoned": "guzzle/guzzle", "time": "2014-02-05 10:00:42" }, { @@ -370,12 +366,12 @@ "target-dir": "Guzzle/Stream", "source": { "type": "git", - "url": "https://github.com/guzzle/stream.git", + "url": "https://github.com/Guzzle3/stream.git", "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", + "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", "shasum": "" }, @@ -415,6 +411,7 @@ "component", "stream" ], + "abandoned": "guzzle/guzzle", "time": "2014-05-01 21:36:02" }, { @@ -455,29 +452,30 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.6.5", - "target-dir": "Symfony/Component/EventDispatcher", + "version": "v3.3.2", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "4054a102470665451108f9b59305c79176ef98f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/70f7c8478739ad21e3deef0d977b38c77f1fb284", - "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4054a102470665451108f9b59305c79176ef98f0", + "reference": "4054a102470665451108f9b59305c79176ef98f0", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5.9" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~3.3", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" }, "suggest": { "symfony/dependency-injection": "", @@ -486,38 +484,41 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "3.3-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com", - "time": "2015-03-13 17:37:22" + "homepage": "https://symfony.com", + "time": "2017-06-04 18:15:29" } ], "packages-dev": [], "aliases": [], - "minimum-stability": "alpha", + "minimum-stability": "beta", "stability-flags": { - "events-radar/radar-api-php": 15 + "events-radar/radar-api-php": 10 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/radar.inc.php b/radar.inc.php index 3cd71e4..24be12f 100644 --- a/radar.inc.php +++ b/radar.inc.php @@ -24,7 +24,9 @@ function radar_retrieve_events($settings) { $settings['fields'] = _radar_field_name_mapping($settings['fields']); $filter = radar_filter($settings); $request = $client->prepareEventsRequest($filter, $settings['fields'], $settings['max_count']); - return $client->retrieve($request); + $response = $client->retrieveResponse($request); + $events = $client->parseResponse($response); + return $events; } function radar_retrieve_entities(array $entities) { @@ -111,6 +113,10 @@ function _radar_field_name_mapping($fields) { function _radar_parse_items($type, $items, $fields, $subfields = array()) { $content = array(); foreach ((array) $items as $item) { + if (!is_object($item)) { + error_log('_radar_parse_items called with empty item'); + continue; + } $current_content = array(); // Cycle through the fields in best order that we can. foreach ($fields as $field_name) { @@ -131,7 +137,6 @@ function _radar_parse_items($type, $items, $fields, $subfields = array()) { } $content[] = $current_content; } - return $content; } diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 5e1469e..ff6ecfb 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -13,9 +13,7 @@ namespace Composer\Autoload; /** - * ClassLoader implements a PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. * * $loader = new \Composer\Autoload\ClassLoader(); * @@ -39,6 +37,8 @@ namespace Composer\Autoload; * * @author Fabien Potencier * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ */ class ClassLoader { @@ -147,7 +147,7 @@ class ClassLoader * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-0 base directories + * @param array|string $paths The PSR-4 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 0000000..1a28124 --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) 2016 Nils Adermann, 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/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 36d78b7..15b6640 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -6,7 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), 'Guzzle\\Stream' => array($vendorDir . '/guzzle/stream'), 'Guzzle\\Plugin\\Cache' => array($vendorDir . '/guzzle/plugin-cache'), 'Guzzle\\Parser' => array($vendorDir . '/guzzle/parser'), diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index c5f7265..3fa1019 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), 'Radar\\Connect\\' => array($vendorDir . '/events-radar/radar-api-php/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index cfab793..0a63268 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,19 +23,26 @@ class ComposerAutoloaderInit0602dde9fe6a3b6e770da50fa17cf0fd self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInit0602dde9fe6a3b6e770da50fa17cf0fd', 'loadClassLoader')); - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + call_user_func(\Composer\Autoload\ComposerStaticInit0602dde9fe6a3b6e770da50fa17cf0fd::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } } $loader->register(true); @@ -43,8 +50,3 @@ class ComposerAutoloaderInit0602dde9fe6a3b6e770da50fa17cf0fd return $loader; } } - -function composerRequire0602dde9fe6a3b6e770da50fa17cf0fd($file) -{ - require $file; -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 0000000..aa67b7e --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,82 @@ + + array ( + 'Symfony\\Component\\EventDispatcher\\' => 34, + ), + 'R' => + array ( + 'Radar\\Connect\\' => 14, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Symfony\\Component\\EventDispatcher\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/event-dispatcher', + ), + 'Radar\\Connect\\' => + array ( + 0 => __DIR__ . '/..' . '/events-radar/radar-api-php/src', + ), + ); + + public static $prefixesPsr0 = array ( + 'G' => + array ( + 'Guzzle\\Stream' => + array ( + 0 => __DIR__ . '/..' . '/guzzle/stream', + ), + 'Guzzle\\Plugin\\Cache' => + array ( + 0 => __DIR__ . '/..' . '/guzzle/plugin-cache', + ), + 'Guzzle\\Parser' => + array ( + 0 => __DIR__ . '/..' . '/guzzle/parser', + ), + 'Guzzle\\Http' => + array ( + 0 => __DIR__ . '/..' . '/guzzle/http', + ), + 'Guzzle\\Common' => + array ( + 0 => __DIR__ . '/..' . '/guzzle/common', + ), + 'Guzzle\\Cache' => + array ( + 0 => __DIR__ . '/..' . '/guzzle/cache', + ), + ), + 'D' => + array ( + 'Doctrine\\Common' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/common/lib', + ), + ), + ); + + public static $classMap = array ( + 'geoPHP' => __DIR__ . '/..' . '/phayes/geophp/geoPHP.inc', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit0602dde9fe6a3b6e770da50fa17cf0fd::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit0602dde9fe6a3b6e770da50fa17cf0fd::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit0602dde9fe6a3b6e770da50fa17cf0fd::$prefixesPsr0; + $loader->classMap = ComposerStaticInit0602dde9fe6a3b6e770da50fa17cf0fd::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 1ab4743..d2340db 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -116,12 +116,12 @@ "target-dir": "Guzzle/Common", "source": { "type": "git", - "url": "https://github.com/guzzle/common.git", + "url": "https://github.com/Guzzle3/common.git", "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", + "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", "shasum": "" }, @@ -153,7 +153,8 @@ "common", "event", "exception" - ] + ], + "abandoned": "guzzle/guzzle" }, { "name": "guzzle/cache", @@ -162,12 +163,12 @@ "target-dir": "Guzzle/Cache", "source": { "type": "git", - "url": "https://github.com/guzzle/cache.git", + "url": "https://github.com/Guzzle3/cache.git", "reference": "9d20d5afd4203f84893e809777ffa01e47bd4ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/cache/zipball/9d20d5afd4203f84893e809777ffa01e47bd4ea7", + "url": "https://api.github.com/repos/Guzzle3/cache/zipball/9d20d5afd4203f84893e809777ffa01e47bd4ea7", "reference": "9d20d5afd4203f84893e809777ffa01e47bd4ea7", "shasum": "" }, @@ -207,7 +208,8 @@ "cache", "doctrine", "zf" - ] + ], + "abandoned": "guzzle/guzzle" }, { "name": "guzzle/stream", @@ -216,12 +218,12 @@ "target-dir": "Guzzle/Stream", "source": { "type": "git", - "url": "https://github.com/guzzle/stream.git", + "url": "https://github.com/Guzzle3/stream.git", "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", + "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", "shasum": "" }, @@ -262,7 +264,8 @@ "Guzzle", "component", "stream" - ] + ], + "abandoned": "guzzle/guzzle" }, { "name": "guzzle/parser", @@ -271,12 +274,12 @@ "target-dir": "Guzzle/Parser", "source": { "type": "git", - "url": "https://github.com/guzzle/parser.git", + "url": "https://github.com/Guzzle3/parser.git", "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", + "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", "shasum": "" }, @@ -308,7 +311,8 @@ "http", "message", "url" - ] + ], + "abandoned": "guzzle/guzzle" }, { "name": "guzzle/http", @@ -317,12 +321,12 @@ "target-dir": "Guzzle/Http", "source": { "type": "git", - "url": "https://github.com/guzzle/http.git", + "url": "https://github.com/Guzzle3/http.git", "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", + "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", "shasum": "" }, @@ -367,7 +371,8 @@ "curl", "http", "http client" - ] + ], + "abandoned": "guzzle/guzzle" }, { "name": "guzzle/plugin-cache", @@ -376,12 +381,12 @@ "target-dir": "Guzzle/Plugin/Cache", "source": { "type": "git", - "url": "https://github.com/guzzle/plugin-cache.git", + "url": "https://github.com/Guzzle3/plugin-cache.git", "reference": "152bc4fa58e1578d01d501a97cbeee1c34edecb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/plugin-cache/zipball/152bc4fa58e1578d01d501a97cbeee1c34edecb6", + "url": "https://api.github.com/repos/Guzzle3/plugin-cache/zipball/152bc4fa58e1578d01d501a97cbeee1c34edecb6", "reference": "152bc4fa58e1578d01d501a97cbeee1c34edecb6", "shasum": "" }, @@ -419,23 +424,83 @@ "keywords": [ "Guzzle", "plugin" - ] + ], + "abandoned": "guzzle/guzzle" }, { - "name": "events-radar/radar-api-php", - "version": "0.1.0-alpha3", - "version_normalized": "0.1.0.0-alpha3", + "name": "symfony/event-dispatcher", + "version": "v3.3.2", + "version_normalized": "3.3.2.0", "source": { "type": "git", - "url": "https://github.com/events-radar/radar-api-php.git", - "reference": "20e0b5c7d268f413fc1705bb81c46bce99b5ec1d" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "4054a102470665451108f9b59305c79176ef98f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/events-radar/radar-api-php/zipball/20e0b5c7d268f413fc1705bb81c46bce99b5ec1d", - "reference": "20e0b5c7d268f413fc1705bb81c46bce99b5ec1d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4054a102470665451108f9b59305c79176ef98f0", + "reference": "4054a102470665451108f9b59305c79176ef98f0", "shasum": "" }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~3.3", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "time": "2017-06-04 18:15:29", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com" + }, + { + "name": "events-radar/radar-api-php", + "version": "0.1.0-beta1", + "version_normalized": "0.1.0.0-beta1", + "source": { + "type": "git", + "url": "https://0xacab.org/radar/radar-api-php", + "reference": "e272465d34853ffb781b3ea99bad53f40e567f82" + }, "require": { "doctrine/common": "2.3.0", "guzzle/cache": "3.9.2", @@ -447,9 +512,9 @@ "guzzle/guzzle": "3.9.2", "phpunit/phpunit": "~4.5" }, - "time": "2015-02-24 20:52:50", + "time": "2017-04-27 15:31:59", "type": "library", - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-4": { "Radar\\Connect\\": "src" @@ -458,71 +523,6 @@ "license": [ "GPL-2.0+" ], - "description": "Radar API connect", - "support": { - "source": "https://github.com/events-radar/radar-api-php/tree/0.1.0-alpha3", - "issues": "https://github.com/events-radar/radar-api-php/issues" - } - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.6.5", - "version_normalized": "2.6.5.0", - "target-dir": "Symfony/Component/EventDispatcher", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/70f7c8478739ad21e3deef0d977b38c77f1fb284", - "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2015-03-13 17:37:22", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com" + "description": "Radar API connect" } ] diff --git a/vendor/events-radar/radar-api-php/docs/files/Connect.php.txt b/vendor/events-radar/radar-api-php/docs/files/Connect.php.txt index 1a8e563..dc9515b 100644 --- a/vendor/events-radar/radar-api-php/docs/files/Connect.php.txt +++ b/vendor/events-radar/radar-api-php/docs/files/Connect.php.txt @@ -44,7 +44,7 @@ class Connect { $this->apiUrl = $configuration['api_url']; } else { - $this->apiUrl = 'https://new-radar.squat.net/api/1.0/'; + $this->apiUrl = 'https://radar.squat.net/api/1.0/'; } $this->debug = !empty($configuration['debug']); } diff --git a/vendor/events-radar/radar-api-php/events.php b/vendor/events-radar/radar-api-php/events.php index 1ff5a3b..8cd7a5e 100644 --- a/vendor/events-radar/radar-api-php/events.php +++ b/vendor/events-radar/radar-api-php/events.php @@ -16,8 +16,17 @@ require('radar_client.php'); // Shared radar connect client. $client = radar_client(); + // Basic cache for output. $cache = radar_cache(); +// If you want to empty the cache completely +//$cache->flushAll(); +// If you want to remove one item like the stored HTML for evets.php +$cache->delete('events.php'); + +// Add a prefered language for requests. If none is set 'und' is used and +// content is returned in its original language, first language posted.. +$client->setLanguage('de'); // Check to see if there is a copy in the cache. if ($cache->contains('events.php') && $page = $cache->fetch('events.php')) { @@ -25,15 +34,14 @@ if ($cache->contains('events.php') && $page = $cache->fetch('events.php')) { print $page['html']; // If it's more than an hour old, get a new one. if ($page['created'] + 60 * 60 < time()) { - $events = radar_events_retrieve($client); - $html = radar_events_format($client, $events); + $html = radar_events_page_html($client); $cache->delete('events.php'); } } else { // Generate the page and output it. - $events = radar_events_retrieve($client); - $html = radar_events_format($client, $events, true); + $html = radar_events_page_html($client); + print $html; } if (!empty($html)) { @@ -42,6 +50,17 @@ if (!empty($html)) { $cache->save('events.php', $page); } +/** + * Make HTML page. + */ +function radar_events_page_html($client) { + $request = radar_prepare_events_request($client); + $response = $client->retrieveResponse($request); + $events = $client->parseResponse($response); + $metadata = $client->parseResponseMeta($response); + return radar_events_format($client, $events, $metadata); +} + /** * Set a filter and retrieve events matching the filter. * @@ -51,14 +70,19 @@ if (!empty($html)) { * @return Radar\Connect\Event[] * Array of radar connect events. */ -function radar_events_retrieve(\Radar\Connect\Connect $client) { +function radar_prepare_events_request(\Radar\Connect\Connect $client) { $filter = new \Radar\Connect\Filter; $filter->addCity('Berlin'); // Alternatives:- //$filter->addCity('Amsterdam'); //$filter->addDate(new DateTime('tomorrow')); //$filter->addDay(); + //$filter->addCategory('music'); + //Some filters don't have explicit methods to set them so for tags... + //$filter->add('tag', 'Punk'); // See docs/classes/Radar.Connect.Filter.html for full list of methods. + // You can also see all the filter values and their counts in the metadata + // returned. See the examples at the top of radar_events_format(). // Get the request. // arguments: @@ -66,6 +90,9 @@ function radar_events_retrieve(\Radar\Connect\Connect $client) { // $fields - array of field names to collect, empty for default // $limit - maximum number of events to return. $request = $client->prepareEventsRequest($filter, array(), 50); + return $request; + + // Execute request. return $client->retrieve($request); } @@ -77,17 +104,43 @@ function radar_events_retrieve(\Radar\Connect\Connect $client) { * The connect client. * @param \Radar\Connect\Event[] $events * Array of Event entities, for example response to events request. - * @param bool $output - * If HTML output should also be sent to stdout. + * @param array $metadata + * Array of counts and facets. * * @return string * The HTML output. */ -function radar_events_format(\Radar\Connect\Connect $client, array $events, $output = FALSE) { +function radar_events_format(\Radar\Connect\Connect $client, array $events, array $metadata) { ob_start(); ob_implicit_flush(TRUE); $html = ''; + // Metadata includes the result count. + print "

There are {$metadata['count']} results for the query

\n"; + + // Retrieve some facets. Summaries of filters you can use + // in further narrowed queries, and their result counts. + print '

Forthcoming days

    '; + foreach ($metadata['facets']['date'] as $facet) { + print '
  • ' . date('Y-m-d', $facet['formatted']) . " has {$facet['count']} events
  • \n"; + } + print "
\n"; + + // For other factets it's even more convenient. The 'filter' value is also the value you set to filter the query. + print "

Categories

    \n"; + foreach ($metadata['facets']['category'] as $facet) { + print "
  • {$facet['formatted']} has {$facet['count']} events you could add a filter for them with the \$filter->addCategory('{$facet['filter']}');
  • \n"; + } + print "
      \n"; + + // There's no direct method to set the tag filter. They can all be set using the key that is in this array - here tag. + // So in the example above instead of $filter->addCategory you could have equally $filter->add('category', $facet['filter']); + print "

      Tags

        \n"; + foreach ($metadata['facets']['tag'] as $facet) { + print "
      • {$facet['formatted']} has {$facet['count']} events you could add a filter for them with the \$filter->add('tag', '{$facet['filter']}');
      • \n"; + } + print "
          \n"; + foreach ($events as $event) { // Title and date. print '

          ' . $event->getTitle() . '

          '; @@ -98,20 +151,24 @@ function radar_events_format(\Radar\Connect\Connect $client, array $events, $out // The groups are references. If we want to get details about // them we actually load the group itself as well. - $groups = $client->retrieveEntityMultiple($event->getGroups()); + $groups = $event->getGroups(); + $groups = $client->retrieveEntityMultiple($groups); foreach ($groups as $group) { print '

          ' . $group->getTitle() . '

          '; + print '

          ' . var_dump($group->getLink(), true) . ' ' . var_dump($group->getLinkRaw(), true) . '

          '; } // Just as with the groups the locations are just the references. // So we load them here. - $locations = $client->retrieveEntityMultiple($event->getLocations()); + $locations = $event->getLocations(); + $locations = $client->retrieveEntityMultiple($locations); foreach ($locations as $location) { print '

          ' . $location->getAddress() . '

          '; } // Yep and the categories, and topics. - $categories = $client->retrieveEntityMultiple($event->getCategories()); + $categories = $event->getCategories(); + $categories = $client->retrieveEntityMultiple($categories); $category_names = array(); foreach ($categories as $category) { $category_names[] = $category->getTitle(); @@ -120,7 +177,8 @@ function radar_events_format(\Radar\Connect\Connect $client, array $events, $out print '

          Categories: ' . implode(', ', $category_names); } - $topics = $client->retrieveEntityMultiple($event->getTopics()); + $topics = $event->getTopics(); + $topics = $client->retrieveEntityMultiple($topics); $topic_names = array(); foreach ($topics as $topic) { $topic_names[] = $topic->getTitle(); @@ -131,12 +189,7 @@ function radar_events_format(\Radar\Connect\Connect $client, array $events, $out // Outputs the HTML if requested. $html .= ob_get_contents(); - if ($output) { - ob_flush(); - } - else { - ob_clean(); - } + ob_clean(); } ob_end_clean(); diff --git a/vendor/events-radar/radar-api-php/radar_client.php b/vendor/events-radar/radar-api-php/radar_client.php index 62163d7..f284d2d 100644 --- a/vendor/events-radar/radar-api-php/radar_client.php +++ b/vendor/events-radar/radar-api-php/radar_client.php @@ -5,7 +5,7 @@ * Helper functions to create radar connect classes. */ -require 'vendor/autoload.php'; +require __DIR__ . '/vendor/autoload.php'; use Radar\Connect\Connect; use Radar\Connect\Filter; diff --git a/vendor/events-radar/radar-api-php/src/Cache.php b/vendor/events-radar/radar-api-php/src/Cache.php index 915a03b..773c49c 100644 --- a/vendor/events-radar/radar-api-php/src/Cache.php +++ b/vendor/events-radar/radar-api-php/src/Cache.php @@ -20,15 +20,15 @@ class Cache { $this->cache = $cache; } - public function contains(Entity $entity) { - return $this->cache->contains($entity->apiUri()); + public function contains($uri) { + return $this->cache->contains($uri); } - public function fetch(Entity $entity) { - return $this->cache->fetch($entity->apiUri()); + public function fetch($uri) { + return $this->cache->fetch($uri); } - public function save(Entity $entity) { + public function save($uri, Entity $entity) { // TODO Make configurable. $ttl = array( 'group' => 60 * 60, @@ -36,11 +36,12 @@ class Cache { 'event' => 60 * 5, 'location' => 60 * 60 * 24, 'taxonomy_term' => 60 * 60 * 24 * 30, + 'file' => 60 * 60, ); - return $this->cache->save($entity->apiUri(), $entity, $ttl[$entity->type]); + return $this->cache->save($uri, $entity, $ttl[$entity->type]); } - public function delete(Entity $entity) { - return $this->cache->delete($entity->apiUri()); + public function delete($uri) { + return $this->cache->delete($uri); } } diff --git a/vendor/events-radar/radar-api-php/src/Connect.php b/vendor/events-radar/radar-api-php/src/Connect.php index 0bfa2ec..24b004c 100644 --- a/vendor/events-radar/radar-api-php/src/Connect.php +++ b/vendor/events-radar/radar-api-php/src/Connect.php @@ -29,6 +29,11 @@ class Connect { */ public $debug; + /** + * @var string ISO 639-1 code. + */ + public $language; + /** * Constructor. * @@ -44,7 +49,7 @@ class Connect { $this->apiUrl = $configuration['api_url']; } else { - $this->apiUrl = 'https://radar.squat.net/api/1.0/'; + $this->apiUrl = 'https://radar.squat.net/api/1.1/'; } $this->debug = !empty($configuration['debug']); } @@ -65,6 +70,36 @@ class Connect { $this->cache = $cache; } + /** + * Set, default, language for queries. + */ + public function setLanguage($langcode) { + $this->language = $langcode; + } + + /** + * Retrieve language code. + */ + public function getLanguage() { + if (!empty($this->language)) { + return $this->language; + } + else { + return 'und'; + } + } + + /** + * Compute url for cache storage. + * + * Language is for the language requested, not necessarily the language of + * the entity, as different language requests can return different + * langage entities (not necessarity corresponding) based on fallback. + */ + public function cacheUri($entity) { + return $entity->apiUri() . '?language=' . $this->getLanguage(); + } + /** * Retrieve all fields for single entity. * @@ -80,13 +115,18 @@ class Connect { * The loaded entity. */ public function retrieveEntity(Entity $entity) { - if (!empty($this->cache) && $this->cache->contains($entity)) { - return $this->cache->fetch($entity); + $cacheUri = $this->cacheUri($entity); + if (!empty($this->cache) && $this->cache->contains($cacheUri)) { + return $this->cache->fetch($cacheUri); } $request = $this->client->get($entity->apiUri()); - $entity = $this->parseResponse($response); + if ($this->getLanguage() != 'und') { + $query = $request->getQuery(); + $query->set('language', $this->getLanguage()); + } + $entity = $this->retrieve($request); if (!empty($this->cache)) { - $this->cache->save($entity); + $this->cache->save($cacheUri, $entity); } return $entity; } @@ -106,8 +146,8 @@ class Connect { $cached = array(); if (!empty($this->cache)) { foreach($entities as $key => $entity) { - if ($this->cache->contains($entity)) { - $cached[] = $this->cache->fetch($entity); + if ($this->cache->contains($this->cacheUri($entity))) { + $cached[] = $this->cache->fetch($this->cacheUri($entity)); unset($entities[$key]); } } @@ -115,13 +155,18 @@ class Connect { $requests = array(); foreach ($entities as $entity) { - $requests[] = $this->client->get($entity->apiUri()); + $request = $this->client->get($entity->apiUri()); + if ($this->getLanguage() != 'und') { + $query = $request->getQuery(); + $query->set('language', $this->getLanguage()); + } + $requests[] = $request; } $retrieved = $this->retrieveMultiple($requests); if (!empty($this->cache)) { foreach ($retrieved as $entity) { - $this->cache->save($entity); + $this->cache->save($this->cacheUri($entity), $entity); } } @@ -136,8 +181,6 @@ class Connect { } - - /** * Prepare a request to retrieve events. * @@ -148,14 +191,27 @@ class Connect { * A list of fields to load. Optional, default is most available fields. * @param int $limit * How many events to return. + * @param array $sort + * Optional array ['field_name' => 'order'], where order is ASC or DESC. + * @param array $keys + * Values for full text search ['search', 'words'] for OR ['search words'] for AND. * * @return \Guzzle\Http\Message\Request * Request object to retrieve. */ - public function prepareEventsRequest(Filter $filter, $fields = array(), $limit = 500) { + public function prepareEventsRequest(Filter $filter, $fields = array(), $limit = 500, $sort = array(), $keys = array()) { $request = $this->client->get($this->apiUrl . 'search/events.json'); $query = $request->getQuery(); $query->set('facets', $filter->getQuery()); + if ($this->getLanguage() != 'und') { + $query->set('language', $this->getLanguage()); + } + if (!empty($sort)) { + $query->set('sort', $sort); + } + if (!empty($keys)) { + $query->set('keys', $keys); + } if (! empty($fields)) { // Always retrieve type. $fields = array_merge($fields, array('type')); @@ -165,11 +221,13 @@ class Connect { 'title', 'type', 'uuid', + 'nid', 'og_group_ref', 'date_time', 'offline', 'category', 'topic', + 'price_category', 'price', 'link', 'phone', @@ -196,27 +254,42 @@ class Connect { * A list of fields to load. Optional, default is most available fields. * @param int $limit * How many groups to return. + * @param array $sort + * Optional array ['field_name' => 'order'], where order is ASC or DESC. + * @param array $keys + * Values for full text search ['search', 'words'] for OR ['search words'] for AND. * * @return \Guzzle\Http\Message\Request * Request object to retrieve. */ - public function prepareGroupsRequest(Filter $filter, $fields = array(), $limit = 500) { + public function prepareGroupsRequest(Filter $filter, $fields = array(), $limit = 500, $sort = array(), $keys = array()) { $request = $this->client->get($this->apiUrl . 'search/groups.json'); $query = $request->getQuery(); + if ($this->getLanguage() != 'und') { + $query->set('language', $this->getLanguage()); + } $query->set('facets', $filter->getQuery()); + if (!empty($sort)) { + $query->set('sort', $sort); + } + if (!empty($keys)) { + $query->set('keys', $keys); + } if (! empty($fields)) { $fields += array('type'); } else { $fields = array( + 'uuid', 'title', 'type', + 'nid', 'category', 'offline', 'topic', 'body', 'email', - 'weblink', + 'link', 'offline', 'opening_times', 'phone', @@ -228,6 +301,22 @@ class Connect { return $request; } + /** + * Retrieve API response from a prepared request. + * + * @param \Guzzle\Http\Message\RequestInterface $request + * + * @return \Guzzle\Http\Message\Response + */ + public function retrieveResponse(RequestInterface $request) { + $response = $this->client->send($request); + if ($this->debug) { + var_export($response->getHeaders()); + var_export($response->getBody()); + } + return $response; + } + /** * Retrieve entities from a prepared request. * @@ -241,7 +330,9 @@ class Connect { var_export($response->getHeaders()); var_export($response->getBody()); } - return $this->parseResponse($response); + $items = $this->parseResponse($response); + $entity = reset($items); + return $entity; } /** @@ -277,24 +368,52 @@ class Connect { * * TODO this doesn't need to be in here. */ - protected function parseResponse(Response $response) { + public function parseResponse(Response $response) { $items = array(); $content = $response->json(); + if (isset($content['type'])) { + // Single item response. $class = __NAMESPACE__ . '\\Entity\\' . Entity::className($content['type']); $content['apiBase'] = $this->apiUrl; $items[] = new $class($content); } else { - foreach ($content as $key => $item) { - $class = __NAMESPACE__ . '\\Entity\\' . Entity::className($item['type']); - $item['apiBase'] = $this->apiUrl; - $items[] = new $class($item); + $result = empty($content['result']) ? array() : $content['result']; + $first_content_item = current($result); + if (!empty($first_content_item)) { + // List response, that is non-empty. + foreach ($result as $key => $item) { + $class = __NAMESPACE__ . '\\Entity\\' . Entity::className($item['type']); + $item['apiBase'] = $this->apiUrl; + $items[] = new $class($item); + } + } + else { + // Empty response. + $items = array(); } } return $items; } + /** + * Parse response metadata. + */ + public function parseResponseMeta(Response $response) { + $output = []; + $content = $response->json(); + + if (isset($content['count'])) { + $output['count'] = $content['count']; + } + if (isset($content['facets'])) { + $output['facets'] = $content['facets']; + } + + return $output; + } + } diff --git a/vendor/events-radar/radar-api-php/src/Entity/Entity.php b/vendor/events-radar/radar-api-php/src/Entity/Entity.php index c722e29..81d22a3 100644 --- a/vendor/events-radar/radar-api-php/src/Entity/Entity.php +++ b/vendor/events-radar/radar-api-php/src/Entity/Entity.php @@ -27,6 +27,7 @@ abstract class Entity { 'category' => 'TaxonomyTerm', 'topic' => 'TaxonomyTerm', 'price' => 'TaxonomyTerm', + 'file' => 'RadarFile', ); return $classes[$type]; } diff --git a/vendor/events-radar/radar-api-php/src/Entity/Event.php b/vendor/events-radar/radar-api-php/src/Entity/Event.php index 7f204f5..343c2f4 100644 --- a/vendor/events-radar/radar-api-php/src/Entity/Event.php +++ b/vendor/events-radar/radar-api-php/src/Entity/Event.php @@ -87,11 +87,21 @@ class Event extends Node { /** * Return image field data. - * - * TODO API isn't putting the data into the output. */ public function getImageRaw() { - return $this->image; + return $this->image['file']; + } + + /** + * Return image file object. + * + * @return RadarFile|NULL + */ + public function getImage() { + if (!empty($this->image['file'])) { + return new RadarFile($this->image['file']); + } + return NULL; } public function getPriceCategoryRaw() { diff --git a/vendor/events-radar/radar-api-php/src/Entity/Group.php b/vendor/events-radar/radar-api-php/src/Entity/Group.php index 2a79585..af05db9 100644 --- a/vendor/events-radar/radar-api-php/src/Entity/Group.php +++ b/vendor/events-radar/radar-api-php/src/Entity/Group.php @@ -17,17 +17,42 @@ class Group extends Node { } /** - * TODO not appearing in the API output. + * Logo raw data. */ public function getGroupLogoRaw() { return $this->group_logo; } /** - * TODO not appearing in the API output. + * Logo file object. + * + * @return File|NULL + */ + public function getGroupLogo() { + if (!empty($this->group_logo)) { + return new RadarFile($this->group_logo); + } + return NULL; + } + + + /** + * Raw image entity array. */ public function getImageRaw() { - return $this->image->file; + return $this->image; + } + + /** + * Return image entity object. + * + * @return RadarFile|NULL + */ + public function getImage() { + if (!empty($this->image->file)) { + return new RadarFile($this->image); + } + return NULL; } /** diff --git a/vendor/events-radar/radar-api-php/src/Entity/Node.php b/vendor/events-radar/radar-api-php/src/Entity/Node.php index 21d95fd..ff96762 100644 --- a/vendor/events-radar/radar-api-php/src/Entity/Node.php +++ b/vendor/events-radar/radar-api-php/src/Entity/Node.php @@ -65,7 +65,11 @@ class Node extends Entity { } public function getCategoriesRaw() { - return $this->category; + $categories = array(); + foreach ($this->category as $category) { + $categories[$category['id']] = $category; + } + return $category; } /** @@ -77,14 +81,18 @@ class Node extends Entity { $categories = array(); if (is_array($this->category)) { foreach ($this->category as $category) { - $categories[] = new TaxonomyTerm($category); + $categories[$category['id']] = new TaxonomyTerm($category); } } return $categories; } public function getTopicsRaw() { - return $this->topics; + $topics = array(); + foreach ($this->topic as $topic) { + $topics[$topic['id']] = $topic; + } + return $topics; } /** @@ -96,7 +104,7 @@ class Node extends Entity { $topics = array(); if (is_array($this->topic)) { foreach ($this->topic as $topic) { - $topics[] = new TaxonomyTerm($topic); + $topics[$topic['id']] = new TaxonomyTerm($topic); } } return $topics; diff --git a/vendor/events-radar/radar-api-php/src/Entity/RadarFile.php b/vendor/events-radar/radar-api-php/src/Entity/RadarFile.php new file mode 100644 index 0000000..df4af41 --- /dev/null +++ b/vendor/events-radar/radar-api-php/src/Entity/RadarFile.php @@ -0,0 +1,67 @@ +set($data); + $this->type = 'file'; + } + + public function set($data) { + $data = (array) $data; + parent::set($data); + if (isset($data['fid'])) { + $this->drupalId = $data['fid']; + } + } + + public function apiUri() { + if (isset($this->apiUri)) { + return $this->apiUri; + } + elseif (isset($this->uuid)) { + return $this->apiBase . 'file/' . $this->uuid; + } + + throw new Exception(); + } + + /** + * Title is usually filename. + */ + public function getTitle() { + return $this->title; + } + + /** + * Mimetype, eg image/jpeg + */ + public function getImageRaw() { + return $this->mime; + } + + /** + * URL to the file itself. + * + * @return string + */ + public function getUrl() { + return $this->url; + } + + /** + * Size, in bytes. + * + * @return int + */ + public function getSize() { + return $this->size; + } + +} diff --git a/vendor/events-radar/radar-api-php/src/Filter.php b/vendor/events-radar/radar-api-php/src/Filter.php index 8824666..6f4c4c2 100644 --- a/vendor/events-radar/radar-api-php/src/Filter.php +++ b/vendor/events-radar/radar-api-php/src/Filter.php @@ -9,6 +9,18 @@ class Filter { */ private $query; + /** + * Add arbitary filter, knowing key. + * + * If you add something that doesn't work it usually just returns no results. + * + * @param string key + * @param string value + */ + public function add($key, $value) { + $this->query[$key][] = $value; + } + /** * Filter by group. * @@ -43,7 +55,7 @@ class Filter { /** * Filter by year. * - * @param string $year. + * @param string $year * Optional: year in YYYY format. Default current year. */ public function addYear($year = 'now') { @@ -128,4 +140,5 @@ class Filter { public function getQuery() { return $this->query; } + } diff --git a/vendor/events-radar/radar-api-php/tests/Entity/EventTest.php b/vendor/events-radar/radar-api-php/tests/Entity/EventTest.php index 290ab99..060681b 100644 --- a/vendor/events-radar/radar-api-php/tests/Entity/EventTest.php +++ b/vendor/events-radar/radar-api-php/tests/Entity/EventTest.php @@ -17,22 +17,24 @@ class EventTest extends EntityTestCase { $this->assertEquals($event->getInternalId(), '9171'); $this->assertEquals($event->getInternalVid(), '9680'); // Node level fields - $this->assertEquals($event->apiUri(), 'https://new-radar.squat.net/api/1.0/node/69300100-b104-4c37-b651-48351543e8a6'); + $this->assertEquals($event->apiUri(), 'https://radar.squat.net/api/1.1/node/69300100-b104-4c37-b651-48351543e8a6'); $body_text = "

          This is a handy event that site devs are using.

          \n"; $this->assertEquals($event->getBody(), $body_text); $this->assertEquals($event->getBodyRaw(), array('value' => $body_text, 'summary' => '', 'format' => 'rich_text_editor')); - $this->assertEquals($event->getUrlView(),'https://new-radar.squat.net/en/event/amsterdam/joes-garage/2014-02-24/test-event'); - $this->assertEquals($event->getUrlEdit(),'https://new-radar.squat.net/en/node/9171/edit'); + $this->assertEquals($event->getUrlView(),'https://radar.squat.net/en/event/amsterdam/joes-garage/2014-02-24/test-event'); + $this->assertEquals($event->getUrlEdit(),'https://radar.squat.net/en/node/9171/edit'); $this->assertEquals($event->getStatus(), TRUE); $this->assertEquals($event->getCreated()->getTimestamp(),'1424807163'); $this->assertEquals($event->getUpdated()->getTimestamp(),'1424807163'); // Node level references $categories = $event->getCategories(); - $this->assertTrue($categories[0] instanceof \Radar\Connect\Entity\TaxonomyTerm); - $this->assertEquals($categories[0]->apiUri(),'https://new-radar.squat.net/api/1.0/taxonomy_term/e85a688d-03ac-4008-a3cb-1adb7e8f718a'); + $category = reset($categories); + $this->assertTrue($category instanceof \Radar\Connect\Entity\TaxonomyTerm); + $this->assertEquals($category->apiUri(),'https://radar.squat.net/api/1.1/taxonomy_term/e85a688d-03ac-4008-a3cb-1adb7e8f718a'); $topics = $event->getTopics(); - $this->assertTrue($topics[0] instanceof \Radar\Connect\Entity\TaxonomyTerm); - $this->assertEquals($topics[0]->apiUri(), 'https://new-radar.squat.net/api/1.0/taxonomy_term/6c73cff2-9dc9-41db-a79e-f54bf4c010f7'); + $topic = reset($topics); + $this->assertTrue($topic instanceof \Radar\Connect\Entity\TaxonomyTerm); + $this->assertEquals($topic->apiUri(), 'https://radar.squat.net/api/1.1/taxonomy_term/6c73cff2-9dc9-41db-a79e-f54bf4c010f7'); // Simple fields. $this->assertTrue($event instanceof Event); $this->assertEquals($event->getTitle(), 'Test event'); @@ -45,11 +47,11 @@ class EventTest extends EntityTestCase { // Entity references. $price = $event->getPriceCategory(); $this->assertTrue($price[0] instanceof \Radar\Connect\Entity\TaxonomyTerm); - $this->assertEquals($price[0]->apiUri(), 'https://new-radar.squat.net/api/1.0/taxonomy_term/9d943d0c-e2bf-408e-9110-4bfb044f60c0'); - $this->assertEquals($price[1]->apiUri(), 'https://new-radar.squat.net/api/1.0/taxonomy_term/6f4101f4-cd9b-49f2-91a3-203d2b47a3ed'); + $this->assertEquals($price[0]->apiUri(), 'https://radar.squat.net/api/1.1/taxonomy_term/9d943d0c-e2bf-408e-9110-4bfb044f60c0'); + $this->assertEquals($price[1]->apiUri(), 'https://radar.squat.net/api/1.1/taxonomy_term/6f4101f4-cd9b-49f2-91a3-203d2b47a3ed'); $groups = $event->getGroups(); $this->assertTrue($groups[0] instanceof \Radar\Connect\Entity\Group); - $this->assertEquals($groups[0]->apiUri(), 'https://new-radar.squat.net/api/1.0/node/0df4bcd7-54b4-4559-a960-60b5042d3d48'); + $this->assertEquals($groups[0]->apiUri(), 'https://radar.squat.net/api/1.1/node/0df4bcd7-54b4-4559-a960-60b5042d3d48'); $raw_dates = $event->getDatesRaw(); $this->assertEquals($raw_dates[0]['value'], '1393271100'); $this->assertEquals($raw_dates[0]['time_end'], '2014-02-24T21:00:00+01:00'); @@ -59,6 +61,6 @@ class EventTest extends EntityTestCase { $this->assertEquals($dates[0]['end']->getTimezone()->getName(), '+01:00'); $locations = $event->getLocations(); $this->assertTrue($locations[0] instanceof \Radar\Connect\Entity\Location); - $this->assertEquals($locations[0]->apiUri(), 'https://new-radar.squat.net/api/1.0/location/3c58abc1-e095-4db5-996d-2a064cebb2d3'); + $this->assertEquals($locations[0]->apiUri(), 'https://radar.squat.net/api/1.1/location/3c58abc1-e095-4db5-996d-2a064cebb2d3'); } } diff --git a/vendor/events-radar/radar-api-php/tests/Entity/GroupTest.php b/vendor/events-radar/radar-api-php/tests/Entity/GroupTest.php index 5c373b1..b8a1f08 100644 --- a/vendor/events-radar/radar-api-php/tests/Entity/GroupTest.php +++ b/vendor/events-radar/radar-api-php/tests/Entity/GroupTest.php @@ -17,23 +17,25 @@ class GroupTest extends EntityTestCase { $this->assertEquals($group->getInternalId(), '41'); $this->assertEquals($group->getInternalVid(), '8935'); // Node level fields - $this->assertEquals($group->apiUri(), 'https://new-radar.squat.net/api/1.0/node/0df4bcd7-54b4-4559-a960-60b5042d3d48'); + $this->assertEquals($group->apiUri(), 'https://radar.squat.net/api/1.1/node/0df4bcd7-54b4-4559-a960-60b5042d3d48'); $body_text = "

          Joe's Garage is een ontmoetingsplek voor al dan niet krakers uit de transvaalbuurt en omstreken.

          \n"; $this->assertEquals($group->getBody(), $body_text); $this->assertEquals($group->getBodyRaw(), array('value' => $body_text, 'summary' => '', 'format' => 'rich_text_editor')); - $this->assertEquals($group->getUrlView(),'https://new-radar.squat.net/nl/amsterdam/joes-garage?language=nl'); - $this->assertEquals($group->getUrlEdit(),'https://new-radar.squat.net/nl/node/41/edit?language=nl'); + $this->assertEquals($group->getUrlView(),'https://radar.squat.net/nl/amsterdam/joes-garage?language=nl'); + $this->assertEquals($group->getUrlEdit(),'https://radar.squat.net/nl/node/41/edit?language=nl'); $this->assertEquals($group->getStatus(), TRUE); $this->assertEquals($group->getCreated()->getTimestamp(),'1409775185'); $this->assertEquals($group->getUpdated()->getTimestamp(),'1424352703'); // Node level references $categories = $group->getCategories(); $this->assertEquals(count($categories), 6); - $this->assertTrue($categories[0] instanceof \Radar\Connect\Entity\TaxonomyTerm); - $this->assertEquals($categories[0]->apiUri(),'https://new-radar.squat.net/api/1.0/taxonomy_term/e97f372b-29bc-460b-bff6-35d2462411ff?language=nl'); + $category = reset($categories); + $this->assertTrue($category instanceof \Radar\Connect\Entity\TaxonomyTerm); + $this->assertEquals($category->apiUri(),'https://radar.squat.net/api/1.1/taxonomy_term/e97f372b-29bc-460b-bff6-35d2462411ff?language=nl'); $topics = $group->getTopics(); - $this->assertTrue($topics[0] instanceof \Radar\Connect\Entity\TaxonomyTerm); - $this->assertEquals($topics[0]->apiUri(), 'https://new-radar.squat.net/api/1.0/taxonomy_term/82f00d0a-03df-40ec-a06d-67b875675858?language=nl'); + $topic = reset($topics); + $this->assertTrue($topic instanceof \Radar\Connect\Entity\TaxonomyTerm); + $this->assertEquals($topic->apiUri(), 'https://radar.squat.net/api/1.1/taxonomy_term/82f00d0a-03df-40ec-a06d-67b875675858?language=nl'); // Simple fields. $this->assertTrue($group instanceof Group); $this->assertEquals($group->getTitle(), 'Joe\'s Garage'); @@ -49,6 +51,6 @@ class GroupTest extends EntityTestCase { // Entity references. $locations = $group->getLocations(); $this->assertTrue($locations[0] instanceof \Radar\Connect\Entity\Location); - $this->assertEquals($locations[0]->apiUri(), 'https://new-radar.squat.net/api/1.0/location/3c58abc1-e095-4db5-996d-2a064cebb2d3?language=nl'); + $this->assertEquals($locations[0]->apiUri(), 'https://radar.squat.net/api/1.1/location/3c58abc1-e095-4db5-996d-2a064cebb2d3?language=nl'); } } diff --git a/vendor/events-radar/radar-api-php/tests/Entity/ListingsGroupTest.php b/vendor/events-radar/radar-api-php/tests/Entity/ListingsGroupTest.php index eee4ce3..b94cb83 100644 --- a/vendor/events-radar/radar-api-php/tests/Entity/ListingsGroupTest.php +++ b/vendor/events-radar/radar-api-php/tests/Entity/ListingsGroupTest.php @@ -18,12 +18,12 @@ class ListingsGroupTest extends EntityTestCase { $this->assertEquals($group->getInternalVid(), '8976'); $this->assertEquals($group->getLanguage(), 'de'); // Node level fields - $this->assertEquals($group->apiUri(), 'https://new-radar.squat.net/api/1.0/node/9e43dac6-e1da-4f60-8428-de9f32ac9eb0'); + $this->assertEquals($group->apiUri(), 'https://radar.squat.net/api/1.1/node/9e43dac6-e1da-4f60-8428-de9f32ac9eb0'); $body_text = "

          Berliner Terminkalender für linke Subkultur und Politik

          \n"; $this->assertEquals($group->getBody(), $body_text); $this->assertEquals($group->getBodyRaw(), array('value' => $body_text, 'summary' => '', 'format' => 'rich_text_editor')); - $this->assertEquals($group->getUrlView(),'https://new-radar.squat.net/en/node/1599'); - $this->assertEquals($group->getUrlEdit(),'https://new-radar.squat.net/en/node/1599/edit'); + $this->assertEquals($group->getUrlView(),'https://radar.squat.net/en/node/1599'); + $this->assertEquals($group->getUrlEdit(),'https://radar.squat.net/en/node/1599/edit'); $this->assertEquals($group->getStatus(), TRUE); $this->assertEquals($group->getCreated()->getTimestamp(),'1415355772'); $this->assertEquals($group->getUpdated()->getTimestamp(),'1424428820'); @@ -46,6 +46,6 @@ class ListingsGroupTest extends EntityTestCase { $this->assertEquals(count($locations), 0); $listed_groups = $group->getGroupsListed(); $this->assertEquals(count($listed_groups), 76); - $this->assertEquals($listed_groups[0]->apiUri(), 'https://new-radar.squat.net/api/1.0/node/da296694-ae72-47a9-9073-e450143b9c58'); + $this->assertEquals($listed_groups[0]->apiUri(), 'https://radar.squat.net/api/1.1/node/da296694-ae72-47a9-9073-e450143b9c58'); } } diff --git a/vendor/events-radar/radar-api-php/tests/Entity/TaxonomyTermTest.php b/vendor/events-radar/radar-api-php/tests/Entity/TaxonomyTermTest.php index 5787f1e..4622b75 100644 --- a/vendor/events-radar/radar-api-php/tests/Entity/TaxonomyTermTest.php +++ b/vendor/events-radar/radar-api-php/tests/Entity/TaxonomyTermTest.php @@ -14,7 +14,7 @@ class TaxonomyTermTest extends EntityTestCase { $this->assertTrue($term instanceof TaxonomyTerm); $this->assertEquals($term->getTitle(), 'action/protest/camp'); - $this->assertEquals($term->apiUri(), 'https://new-radar.squat.net/api/1.0/taxonomy_term/e85a688d-03ac-4008-a3cb-1adb7e8f718a'); + $this->assertEquals($term->apiUri(), 'https://radar.squat.net/api/1.1/taxonomy_term/e85a688d-03ac-4008-a3cb-1adb7e8f718a'); $this->assertEquals($term->getUuid(), 'e85a688d-03ac-4008-a3cb-1adb7e8f718a'); $this->assertEquals($term->getVuuid(), null); $this->assertEquals($term->getInternalId(), 7); diff --git a/vendor/events-radar/radar-api-php/tests/data/event b/vendor/events-radar/radar-api-php/tests/data/event index ed7993e..d499cdc 100644 --- a/vendor/events-radar/radar-api-php/tests/data/event +++ b/vendor/events-radar/radar-api-php/tests/data/event @@ -12,4 +12,4 @@ Content-Length: 2613 Content-Type: application/json Strict-Transport-Security: max-age=15768000;includeSubDomains -{"body":{"value":"

          This is a handy event that site devs are using.

          \n","summary":"","format":"rich_text_editor"},"category":[{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/e85a688d-03ac-4008-a3cb-1adb7e8f718a","id":"e85a688d-03ac-4008-a3cb-1adb7e8f718a","resource":"taxonomy_term"},{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8","id":"2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8","resource":"taxonomy_term"}],"group_content_access":"0","og_group_ref":[{"uri":"https://new-radar.squat.net/api/1.0/node/0df4bcd7-54b4-4559-a960-60b5042d3d48","id":"0df4bcd7-54b4-4559-a960-60b5042d3d48","resource":"node"}],"og_group_request":[],"date_time":[{"value":"1393271100","value2":"1393272000","duration":900,"time_start":"2014-02-24T20:45:00+01:00","time_end":"2014-02-24T21:00:00+01:00","rrule":null}],"image":[],"price":"Suggested donation \u20ac3","email":"joe@squat.net","link":[{"url":"http://www.joesgarage.nl/","attributes":[]}],"offline":[{"uri":"https://new-radar.squat.net/api/1.0/location/3c58abc1-e095-4db5-996d-2a064cebb2d3","id":"3c58abc1-e095-4db5-996d-2a064cebb2d3","resource":"location"}],"phone":"01-12345","topic":[{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/6c73cff2-9dc9-41db-a79e-f54bf4c010f7","id":"6c73cff2-9dc9-41db-a79e-f54bf4c010f7","resource":"taxonomy_term"}],"title_field":"Test event","price_category":[{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/9d943d0c-e2bf-408e-9110-4bfb044f60c0","id":"9d943d0c-e2bf-408e-9110-4bfb044f60c0","resource":"taxonomy_term"},{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/6f4101f4-cd9b-49f2-91a3-203d2b47a3ed","id":"6f4101f4-cd9b-49f2-91a3-203d2b47a3ed","resource":"taxonomy_term"}],"og_membership":[],"og_membership__1":[],"og_membership__2":[],"og_membership__3":[],"og_group_ref__og_membership":[],"og_group_ref__og_membership__1":[],"og_group_ref__og_membership__2":[],"og_group_ref__og_membership__3":[],"og_group_request__og_membership":[],"og_group_request__og_membership__1":[],"og_group_request__og_membership__2":[],"og_group_request__og_membership__3":[],"nid":"9171","vid":"9680","is_new":false,"type":"event","title":"Test event","language":"en","url":"https://new-radar.squat.net/en/event/amsterdam/joes-garage/2014-02-24/test-event","edit_url":"https://new-radar.squat.net/en/node/9171/edit","status":"1","promote":"0","sticky":"0","created":"1424807163","changed":"1424807163","feed_nid":null,"flag_abuse_node_user":[],"flag_abuse_whitelist_node_user":[],"uuid":"69300100-b104-4c37-b651-48351543e8a6","vuuid":"a66a7c7d-5ed4-487e-92b8-ee876b91e2d6"} \ No newline at end of file +{"body":{"value":"

          This is a handy event that site devs are using.

          \n","summary":"","format":"rich_text_editor"},"category":[{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/e85a688d-03ac-4008-a3cb-1adb7e8f718a","id":"e85a688d-03ac-4008-a3cb-1adb7e8f718a","resource":"taxonomy_term"},{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8","id":"2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8","resource":"taxonomy_term"}],"group_content_access":"0","og_group_ref":[{"uri":"https://radar.squat.net/api/1.1/node/0df4bcd7-54b4-4559-a960-60b5042d3d48","id":"0df4bcd7-54b4-4559-a960-60b5042d3d48","resource":"node"}],"og_group_request":[],"date_time":[{"value":"1393271100","value2":"1393272000","duration":900,"time_start":"2014-02-24T20:45:00+01:00","time_end":"2014-02-24T21:00:00+01:00","rrule":null}],"image":[],"price":"Suggested donation \u20ac3","email":"joe@squat.net","link":[{"url":"http://www.joesgarage.nl/","attributes":[]}],"offline":[{"uri":"https://radar.squat.net/api/1.1/location/3c58abc1-e095-4db5-996d-2a064cebb2d3","id":"3c58abc1-e095-4db5-996d-2a064cebb2d3","resource":"location"}],"phone":"01-12345","topic":[{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/6c73cff2-9dc9-41db-a79e-f54bf4c010f7","id":"6c73cff2-9dc9-41db-a79e-f54bf4c010f7","resource":"taxonomy_term"}],"title_field":"Test event","price_category":[{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/9d943d0c-e2bf-408e-9110-4bfb044f60c0","id":"9d943d0c-e2bf-408e-9110-4bfb044f60c0","resource":"taxonomy_term"},{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/6f4101f4-cd9b-49f2-91a3-203d2b47a3ed","id":"6f4101f4-cd9b-49f2-91a3-203d2b47a3ed","resource":"taxonomy_term"}],"og_membership":[],"og_membership__1":[],"og_membership__2":[],"og_membership__3":[],"og_group_ref__og_membership":[],"og_group_ref__og_membership__1":[],"og_group_ref__og_membership__2":[],"og_group_ref__og_membership__3":[],"og_group_request__og_membership":[],"og_group_request__og_membership__1":[],"og_group_request__og_membership__2":[],"og_group_request__og_membership__3":[],"nid":"9171","vid":"9680","is_new":false,"type":"event","title":"Test event","language":"en","url":"https://radar.squat.net/en/event/amsterdam/joes-garage/2014-02-24/test-event","edit_url":"https://radar.squat.net/en/node/9171/edit","status":"1","promote":"0","sticky":"0","created":"1424807163","changed":"1424807163","feed_nid":null,"flag_abuse_node_user":[],"flag_abuse_whitelist_node_user":[],"uuid":"69300100-b104-4c37-b651-48351543e8a6","vuuid":"a66a7c7d-5ed4-487e-92b8-ee876b91e2d6"} \ No newline at end of file diff --git a/vendor/events-radar/radar-api-php/tests/data/group b/vendor/events-radar/radar-api-php/tests/data/group index fc18f3a..688aafe 100644 --- a/vendor/events-radar/radar-api-php/tests/data/group +++ b/vendor/events-radar/radar-api-php/tests/data/group @@ -12,4 +12,4 @@ Content-Length: 2872 Content-Type: application/json Strict-Transport-Security: max-age=15768000;includeSubDomains -{"body":{"value":"

          Joe's Garage is een ontmoetingsplek voor al dan niet krakers uit de transvaalbuurt en omstreken.

          \n","summary":"","format":"rich_text_editor"},"category":[{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/e97f372b-29bc-460b-bff6-35d2462411ff?language=nl","id":"e97f372b-29bc-460b-bff6-35d2462411ff","resource":"taxonomy_term"},{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8?language=nl","id":"2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8","resource":"taxonomy_term"},{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/68197b93-2ece-4b0f-9a76-d9e99bda2603?language=nl","id":"68197b93-2ece-4b0f-9a76-d9e99bda2603","resource":"taxonomy_term"},{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/8e846372-fa86-4cb2-87d1-f24da784ec6b?language=nl","id":"8e846372-fa86-4cb2-87d1-f24da784ec6b","resource":"taxonomy_term"},{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/0b9e8d1f-d51d-4d32-b984-2dba1099e0fa?language=nl","id":"0b9e8d1f-d51d-4d32-b984-2dba1099e0fa","resource":"taxonomy_term"},{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/20a888f9-54c1-4767-8af1-40de3d1d2636?language=nl","id":"20a888f9-54c1-4767-8af1-40de3d1d2636","resource":"taxonomy_term"}],"group_group":true,"group_logo":[],"image":[],"email":"joe@squat.net","link":[{"url":"http://www.joesgarage.nl/","attributes":[]}],"offline":[{"uri":"https://new-radar.squat.net/api/1.0/location/3c58abc1-e095-4db5-996d-2a064cebb2d3?language=nl","id":"3c58abc1-e095-4db5-996d-2a064cebb2d3","resource":"location"}],"opening_times":{"value":"

          Maandag: 19u Volkseten Vegazulu

          \n

          Dinsdag: 11u/15u Kraakspreekuur, (daarna is er een borrel)

          \n

          Dinsdag: 20u/21u30 Kraakspreekuur Oost

          \n

          Woensdag: 15u/18u Lonely Collective Day Cafe

          \n

          Donderdag: 19u Volkseten Vegazulu

          \n

          Zaterdag: 14u/18u Weggeefwinkel

          \n

          Zondag: 20u Filmavonden/Infoavonden

          \n","format":"rich_text_editor"},"phone":null,"topic":[{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/82f00d0a-03df-40ec-a06d-67b875675858?language=nl","id":"82f00d0a-03df-40ec-a06d-67b875675858","resource":"taxonomy_term"}],"notifications":["joe@squat.net"],"type":"group","members":[],"members__1":[],"members__2":[],"members__3":[],"nid":"41","vid":"8935","is_new":false,"title":"Joe's Garage","language":"en","url":"https://new-radar.squat.net/nl/amsterdam/joes-garage?language=nl","edit_url":"https://new-radar.squat.net/nl/node/41/edit?language=nl","status":"1","promote":"0","sticky":"0","created":"1409775185","changed":"1424352703","feed_nid":null,"flag_abuse_node_user":[],"flag_abuse_whitelist_node_user":[],"uuid":"0df4bcd7-54b4-4559-a960-60b5042d3d48","vuuid":"c6df91b9-58bd-4a5f-a52e-64ec18f267f0"} \ No newline at end of file +{"body":{"value":"

          Joe's Garage is een ontmoetingsplek voor al dan niet krakers uit de transvaalbuurt en omstreken.

          \n","summary":"","format":"rich_text_editor"},"category":[{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/e97f372b-29bc-460b-bff6-35d2462411ff?language=nl","id":"e97f372b-29bc-460b-bff6-35d2462411ff","resource":"taxonomy_term"},{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8?language=nl","id":"2a56c4d7-eb98-4f96-9ac6-d383a1af5ce8","resource":"taxonomy_term"},{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/68197b93-2ece-4b0f-9a76-d9e99bda2603?language=nl","id":"68197b93-2ece-4b0f-9a76-d9e99bda2603","resource":"taxonomy_term"},{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/8e846372-fa86-4cb2-87d1-f24da784ec6b?language=nl","id":"8e846372-fa86-4cb2-87d1-f24da784ec6b","resource":"taxonomy_term"},{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/0b9e8d1f-d51d-4d32-b984-2dba1099e0fa?language=nl","id":"0b9e8d1f-d51d-4d32-b984-2dba1099e0fa","resource":"taxonomy_term"},{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/20a888f9-54c1-4767-8af1-40de3d1d2636?language=nl","id":"20a888f9-54c1-4767-8af1-40de3d1d2636","resource":"taxonomy_term"}],"group_group":true,"group_logo":[],"image":[],"email":"joe@squat.net","link":[{"url":"http://www.joesgarage.nl/","attributes":[]}],"offline":[{"uri":"https://radar.squat.net/api/1.1/location/3c58abc1-e095-4db5-996d-2a064cebb2d3?language=nl","id":"3c58abc1-e095-4db5-996d-2a064cebb2d3","resource":"location"}],"opening_times":{"value":"

          Maandag: 19u Volkseten Vegazulu

          \n

          Dinsdag: 11u/15u Kraakspreekuur, (daarna is er een borrel)

          \n

          Dinsdag: 20u/21u30 Kraakspreekuur Oost

          \n

          Woensdag: 15u/18u Lonely Collective Day Cafe

          \n

          Donderdag: 19u Volkseten Vegazulu

          \n

          Zaterdag: 14u/18u Weggeefwinkel

          \n

          Zondag: 20u Filmavonden/Infoavonden

          \n","format":"rich_text_editor"},"phone":null,"topic":[{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/82f00d0a-03df-40ec-a06d-67b875675858?language=nl","id":"82f00d0a-03df-40ec-a06d-67b875675858","resource":"taxonomy_term"}],"notifications":["joe@squat.net"],"type":"group","members":[],"members__1":[],"members__2":[],"members__3":[],"nid":"41","vid":"8935","is_new":false,"title":"Joe's Garage","language":"en","url":"https://radar.squat.net/nl/amsterdam/joes-garage?language=nl","edit_url":"https://radar.squat.net/nl/node/41/edit?language=nl","status":"1","promote":"0","sticky":"0","created":"1409775185","changed":"1424352703","feed_nid":null,"flag_abuse_node_user":[],"flag_abuse_whitelist_node_user":[],"uuid":"0df4bcd7-54b4-4559-a960-60b5042d3d48","vuuid":"c6df91b9-58bd-4a5f-a52e-64ec18f267f0"} \ No newline at end of file diff --git a/vendor/events-radar/radar-api-php/tests/data/listings_group b/vendor/events-radar/radar-api-php/tests/data/listings_group index 3990eff..b914eab 100644 --- a/vendor/events-radar/radar-api-php/tests/data/listings_group +++ b/vendor/events-radar/radar-api-php/tests/data/listings_group @@ -12,4 +12,4 @@ Content-Type: application/json Strict-Transport-Security: max-age=15768000;includeSubDomains Transfer-Encoding: chunked -{"body":{"value":"

          Berliner Terminkalender f\u00fcr linke Subkultur und Politik

          \n","summary":"","format":"rich_text_editor"},"category":[],"group_group":true,"group_logo":[],"email":"stressfaktor@squat.net","link":[{"title":"","url":"http://stressfaktor.squat.net","attributes":[]}],"offline":[],"phone":null,"topic":[],"notifications":["stressfaktor@squat.net"],"groups_listed":{"0":{"uri":"https://new-radar.squat.net/api/1.0/node/da296694-ae72-47a9-9073-e450143b9c58","id":"da296694-ae72-47a9-9073-e450143b9c58","resource":"node"},"1":{"uri":"https://new-radar.squat.net/api/1.0/node/2f2f9cb7-49f1-40b8-a609-7b0a2a91e476","id":"2f2f9cb7-49f1-40b8-a609-7b0a2a91e476","resource":"node"},"2":{"uri":"https://new-radar.squat.net/api/1.0/node/4b2b0338-b939-4281-bf79-e584b18f4b99","id":"4b2b0338-b939-4281-bf79-e584b18f4b99","resource":"node"},"3":{"uri":"https://new-radar.squat.net/api/1.0/node/15cc0e0a-ec33-4db6-8957-718cee27cedc","id":"15cc0e0a-ec33-4db6-8957-718cee27cedc","resource":"node"},"4":{"uri":"https://new-radar.squat.net/api/1.0/node/bcc00cbe-c7c7-4999-90a8-e08fe6fc8fa2","id":"bcc00cbe-c7c7-4999-90a8-e08fe6fc8fa2","resource":"node"},"5":{"uri":"https://new-radar.squat.net/api/1.0/node/7d308fd7-8e1d-4fd4-bdde-3fd687846fb3","id":"7d308fd7-8e1d-4fd4-bdde-3fd687846fb3","resource":"node"},"6":{"uri":"https://new-radar.squat.net/api/1.0/node/0d23eabd-4dbe-4450-b236-dc3d6a337071","id":"0d23eabd-4dbe-4450-b236-dc3d6a337071","resource":"node"},"7":{"uri":"https://new-radar.squat.net/api/1.0/node/15e37aa5-b4e6-45b2-91a8-e18fc08cc58d","id":"15e37aa5-b4e6-45b2-91a8-e18fc08cc58d","resource":"node"},"8":{"uri":"https://new-radar.squat.net/api/1.0/node/c3ab0096-5d8d-40b5-984a-eadbb804fff3","id":"c3ab0096-5d8d-40b5-984a-eadbb804fff3","resource":"node"},"9":{"uri":"https://new-radar.squat.net/api/1.0/node/820807d5-5ffd-48b7-b29a-d8c185784598","id":"820807d5-5ffd-48b7-b29a-d8c185784598","resource":"node"},"10":{"uri":"https://new-radar.squat.net/api/1.0/node/ad80054e-768c-4dbb-a18e-7f253b9b2fba","id":"ad80054e-768c-4dbb-a18e-7f253b9b2fba","resource":"node"},"11":{"uri":"https://new-radar.squat.net/api/1.0/node/842db4e3-8d2f-4080-879a-a7ed0b95df77","id":"842db4e3-8d2f-4080-879a-a7ed0b95df77","resource":"node"},"12":{"uri":"https://new-radar.squat.net/api/1.0/node/d0d13e13-8cab-4c17-af04-ef02debdac49","id":"d0d13e13-8cab-4c17-af04-ef02debdac49","resource":"node"},"13":{"uri":"https://new-radar.squat.net/api/1.0/node/52b7b42f-1573-46eb-b6a4-3a57faf72b48","id":"52b7b42f-1573-46eb-b6a4-3a57faf72b48","resource":"node"},"14":{"uri":"https://new-radar.squat.net/api/1.0/node/71ec0d30-befe-45be-8adf-578c1bd30afb","id":"71ec0d30-befe-45be-8adf-578c1bd30afb","resource":"node"},"15":{"uri":"https://new-radar.squat.net/api/1.0/node/9f8cf3bf-e8f6-47b1-9597-78f03f6ac242","id":"9f8cf3bf-e8f6-47b1-9597-78f03f6ac242","resource":"node"},"16":{"uri":"https://new-radar.squat.net/api/1.0/node/1b3c26b8-7f5f-4c2b-8288-7ab9dfbdb217","id":"1b3c26b8-7f5f-4c2b-8288-7ab9dfbdb217","resource":"node"},"18":{"uri":"https://new-radar.squat.net/api/1.0/node/23aa0579-a3a5-4527-ba9b-f099607638c7","id":"23aa0579-a3a5-4527-ba9b-f099607638c7","resource":"node"},"19":{"uri":"https://new-radar.squat.net/api/1.0/node/7fdf5a2c-215d-45d6-9b9b-032c3f7df196","id":"7fdf5a2c-215d-45d6-9b9b-032c3f7df196","resource":"node"},"20":{"uri":"https://new-radar.squat.net/api/1.0/node/44ee4f5d-446f-4819-b986-7554b238a5b6","id":"44ee4f5d-446f-4819-b986-7554b238a5b6","resource":"node"},"21":{"uri":"https://new-radar.squat.net/api/1.0/node/873e7b8d-2377-4bfe-befc-329c76337890","id":"873e7b8d-2377-4bfe-befc-329c76337890","resource":"node"},"22":{"uri":"https://new-radar.squat.net/api/1.0/node/c5f61ab5-8af3-453d-a2d1-c88f6585e063","id":"c5f61ab5-8af3-453d-a2d1-c88f6585e063","resource":"node"},"23":{"uri":"https://new-radar.squat.net/api/1.0/node/1bc74010-ba94-4718-a243-6dd234d2df00","id":"1bc74010-ba94-4718-a243-6dd234d2df00","resource":"node"},"24":{"uri":"https://new-radar.squat.net/api/1.0/node/7b0cd948-4437-420d-8dcf-ff223f15ba66","id":"7b0cd948-4437-420d-8dcf-ff223f15ba66","resource":"node"},"25":{"uri":"https://new-radar.squat.net/api/1.0/node/0ea28719-64b6-4dee-ad1a-fbeeed9f8d8b","id":"0ea28719-64b6-4dee-ad1a-fbeeed9f8d8b","resource":"node"},"26":{"uri":"https://new-radar.squat.net/api/1.0/node/ad25f0d5-93d9-4bf7-a648-5b6d95814357","id":"ad25f0d5-93d9-4bf7-a648-5b6d95814357","resource":"node"},"27":{"uri":"https://new-radar.squat.net/api/1.0/node/537768e6-6019-4fac-97a3-e081358e6e68","id":"537768e6-6019-4fac-97a3-e081358e6e68","resource":"node"},"28":{"uri":"https://new-radar.squat.net/api/1.0/node/198ba0dc-c909-410d-945c-d5198fd352f7","id":"198ba0dc-c909-410d-945c-d5198fd352f7","resource":"node"},"29":{"uri":"https://new-radar.squat.net/api/1.0/node/78479202-6162-47a3-b203-797ed10126d7","id":"78479202-6162-47a3-b203-797ed10126d7","resource":"node"},"30":{"uri":"https://new-radar.squat.net/api/1.0/node/2c517caa-f260-43c4-af4c-8380270a2425","id":"2c517caa-f260-43c4-af4c-8380270a2425","resource":"node"},"31":{"uri":"https://new-radar.squat.net/api/1.0/node/2d419944-166c-4862-9099-3200593a121f","id":"2d419944-166c-4862-9099-3200593a121f","resource":"node"},"32":{"uri":"https://new-radar.squat.net/api/1.0/node/91f16ad9-782b-42bd-80b2-02a30345fb67","id":"91f16ad9-782b-42bd-80b2-02a30345fb67","resource":"node"},"33":{"uri":"https://new-radar.squat.net/api/1.0/node/dce96965-8fe0-4faf-b444-e95b8211a7b6","id":"dce96965-8fe0-4faf-b444-e95b8211a7b6","resource":"node"},"34":{"uri":"https://new-radar.squat.net/api/1.0/node/8f31ca47-89cb-4040-9cc9-8381fc34c427","id":"8f31ca47-89cb-4040-9cc9-8381fc34c427","resource":"node"},"35":{"uri":"https://new-radar.squat.net/api/1.0/node/f786a103-d470-4ab8-86f8-1d656bf021ff","id":"f786a103-d470-4ab8-86f8-1d656bf021ff","resource":"node"},"36":{"uri":"https://new-radar.squat.net/api/1.0/node/1905f47a-219d-47ab-8077-ddc277014a4f","id":"1905f47a-219d-47ab-8077-ddc277014a4f","resource":"node"},"37":{"uri":"https://new-radar.squat.net/api/1.0/node/eb6ec841-14cf-4ff3-9490-db1d8d811a34","id":"eb6ec841-14cf-4ff3-9490-db1d8d811a34","resource":"node"},"38":{"uri":"https://new-radar.squat.net/api/1.0/node/1d78f34f-75f6-4eb1-8712-9bdcde9c1a7d","id":"1d78f34f-75f6-4eb1-8712-9bdcde9c1a7d","resource":"node"},"39":{"uri":"https://new-radar.squat.net/api/1.0/node/d1b33d4a-7ba1-40d7-8df4-3f8ce9a7416e","id":"d1b33d4a-7ba1-40d7-8df4-3f8ce9a7416e","resource":"node"},"40":{"uri":"https://new-radar.squat.net/api/1.0/node/92e1ed31-1426-453e-945f-289b40c63bc0","id":"92e1ed31-1426-453e-945f-289b40c63bc0","resource":"node"},"41":{"uri":"https://new-radar.squat.net/api/1.0/node/e3b08fd0-f8a5-43e3-8a47-70fb0e267a57","id":"e3b08fd0-f8a5-43e3-8a47-70fb0e267a57","resource":"node"},"42":{"uri":"https://new-radar.squat.net/api/1.0/node/e36dd057-211a-4be3-affd-be354426843c","id":"e36dd057-211a-4be3-affd-be354426843c","resource":"node"},"43":{"uri":"https://new-radar.squat.net/api/1.0/node/3dd86ac6-9c80-4a9f-8bd9-813aff5cb864","id":"3dd86ac6-9c80-4a9f-8bd9-813aff5cb864","resource":"node"},"44":{"uri":"https://new-radar.squat.net/api/1.0/node/5327be07-84fd-4106-874f-e63aa57ed315","id":"5327be07-84fd-4106-874f-e63aa57ed315","resource":"node"},"45":{"uri":"https://new-radar.squat.net/api/1.0/node/8b73834c-0f68-4b81-8b42-96b3d64b7d23","id":"8b73834c-0f68-4b81-8b42-96b3d64b7d23","resource":"node"},"46":{"uri":"https://new-radar.squat.net/api/1.0/node/bdca8a0b-f8cf-4ccc-9ba4-3c17665cd4cd","id":"bdca8a0b-f8cf-4ccc-9ba4-3c17665cd4cd","resource":"node"},"47":{"uri":"https://new-radar.squat.net/api/1.0/node/ac98ee2c-ee5d-40a6-b11d-f4857d0eb7e4","id":"ac98ee2c-ee5d-40a6-b11d-f4857d0eb7e4","resource":"node"},"48":{"uri":"https://new-radar.squat.net/api/1.0/node/6966598b-bbf5-4237-8910-72ddcd079143","id":"6966598b-bbf5-4237-8910-72ddcd079143","resource":"node"},"49":{"uri":"https://new-radar.squat.net/api/1.0/node/58ce7e90-753f-4309-ac83-e6bf38e80e7f","id":"58ce7e90-753f-4309-ac83-e6bf38e80e7f","resource":"node"},"50":{"uri":"https://new-radar.squat.net/api/1.0/node/5604e631-b4b0-4be6-a1f2-db853aed3e70","id":"5604e631-b4b0-4be6-a1f2-db853aed3e70","resource":"node"},"51":{"uri":"https://new-radar.squat.net/api/1.0/node/6f80e977-c54d-4251-9756-8e3bd650a20e","id":"6f80e977-c54d-4251-9756-8e3bd650a20e","resource":"node"},"52":{"uri":"https://new-radar.squat.net/api/1.0/node/1759e832-527f-4635-aff2-97b4862ea5ca","id":"1759e832-527f-4635-aff2-97b4862ea5ca","resource":"node"},"53":{"uri":"https://new-radar.squat.net/api/1.0/node/ec485e0a-970b-4b71-a479-14680a1d0da2","id":"ec485e0a-970b-4b71-a479-14680a1d0da2","resource":"node"},"54":{"uri":"https://new-radar.squat.net/api/1.0/node/3ed0a76c-79dd-4d01-948d-0bedb0d1f0b8","id":"3ed0a76c-79dd-4d01-948d-0bedb0d1f0b8","resource":"node"},"55":{"uri":"https://new-radar.squat.net/api/1.0/node/1662899c-ea08-431b-8238-ad775e9ecea6","id":"1662899c-ea08-431b-8238-ad775e9ecea6","resource":"node"},"56":{"uri":"https://new-radar.squat.net/api/1.0/node/f5d3f47b-c826-4ade-91f0-b912597f72f5","id":"f5d3f47b-c826-4ade-91f0-b912597f72f5","resource":"node"},"57":{"uri":"https://new-radar.squat.net/api/1.0/node/aa9325d8-7e14-4f5e-a162-944d5e0a2632","id":"aa9325d8-7e14-4f5e-a162-944d5e0a2632","resource":"node"},"58":{"uri":"https://new-radar.squat.net/api/1.0/node/eee48e7e-95f5-4ff9-8b7e-c4b93b534e02","id":"eee48e7e-95f5-4ff9-8b7e-c4b93b534e02","resource":"node"},"59":{"uri":"https://new-radar.squat.net/api/1.0/node/dba9dbb2-aa6a-458e-83ea-4f8856773c47","id":"dba9dbb2-aa6a-458e-83ea-4f8856773c47","resource":"node"},"60":{"uri":"https://new-radar.squat.net/api/1.0/node/4c7ab8c9-f3c7-4d5f-9f9f-7fa64f0c41d8","id":"4c7ab8c9-f3c7-4d5f-9f9f-7fa64f0c41d8","resource":"node"},"61":{"uri":"https://new-radar.squat.net/api/1.0/node/23d338b5-291b-440b-8222-12f03f438480","id":"23d338b5-291b-440b-8222-12f03f438480","resource":"node"},"62":{"uri":"https://new-radar.squat.net/api/1.0/node/66742b55-0ecd-4030-87d6-975516e7be0c","id":"66742b55-0ecd-4030-87d6-975516e7be0c","resource":"node"},"63":{"uri":"https://new-radar.squat.net/api/1.0/node/00d2eecf-a4f9-4097-aead-9a2010df9a60","id":"00d2eecf-a4f9-4097-aead-9a2010df9a60","resource":"node"},"64":{"uri":"https://new-radar.squat.net/api/1.0/node/87ea3a3a-7061-48b7-a2ab-d33bec626fd3","id":"87ea3a3a-7061-48b7-a2ab-d33bec626fd3","resource":"node"},"65":{"uri":"https://new-radar.squat.net/api/1.0/node/0853ade6-9390-4634-88e0-345aed52ec24","id":"0853ade6-9390-4634-88e0-345aed52ec24","resource":"node"},"66":{"uri":"https://new-radar.squat.net/api/1.0/node/d7177db6-533a-4ba8-83b0-a608433e8e9d","id":"d7177db6-533a-4ba8-83b0-a608433e8e9d","resource":"node"},"68":{"uri":"https://new-radar.squat.net/api/1.0/node/19cdf192-2de9-435d-ba13-e7236d62ca06","id":"19cdf192-2de9-435d-ba13-e7236d62ca06","resource":"node"},"69":{"uri":"https://new-radar.squat.net/api/1.0/node/788ce0f5-e5d6-4f97-9e55-e3715205b90a","id":"788ce0f5-e5d6-4f97-9e55-e3715205b90a","resource":"node"},"70":{"uri":"https://new-radar.squat.net/api/1.0/node/88192058-a635-44f2-a8ff-d5c65ab6b319","id":"88192058-a635-44f2-a8ff-d5c65ab6b319","resource":"node"},"71":{"uri":"https://new-radar.squat.net/api/1.0/node/93dd1b42-8388-494d-b039-b3c1b2963299","id":"93dd1b42-8388-494d-b039-b3c1b2963299","resource":"node"},"72":{"uri":"https://new-radar.squat.net/api/1.0/node/002c6c7d-82d8-402e-ae71-1e66afc5ad81","id":"002c6c7d-82d8-402e-ae71-1e66afc5ad81","resource":"node"},"73":{"uri":"https://new-radar.squat.net/api/1.0/node/1c501be3-0332-4725-9b0f-b85e3f897795","id":"1c501be3-0332-4725-9b0f-b85e3f897795","resource":"node"},"74":{"uri":"https://new-radar.squat.net/api/1.0/node/d6264659-d299-4cce-9ad7-d7e315c9f4fc","id":"d6264659-d299-4cce-9ad7-d7e315c9f4fc","resource":"node"},"75":{"uri":"https://new-radar.squat.net/api/1.0/node/2715ad19-0424-462b-8b8c-153e8420716e","id":"2715ad19-0424-462b-8b8c-153e8420716e","resource":"node"},"76":{"uri":"https://new-radar.squat.net/api/1.0/node/29a4451c-d798-47ef-b3c4-eb492ccf5336","id":"29a4451c-d798-47ef-b3c4-eb492ccf5336","resource":"node"},"77":{"uri":"https://new-radar.squat.net/api/1.0/node/57123ebc-a50a-46d5-99cf-87bb87c3f55f","id":"57123ebc-a50a-46d5-99cf-87bb87c3f55f","resource":"node"}},"members":[],"members__1":[],"members__2":[],"members__3":[],"nid":"1599","vid":"8976","is_new":false,"type":"listings_group","title":"Stressfaktor","language":"de","url":"https://new-radar.squat.net/en/node/1599","edit_url":"https://new-radar.squat.net/en/node/1599/edit","status":"1","promote":"0","sticky":"0","created":"1415355772","changed":"1424428820","feed_nid":null,"flag_abuse_node_user":[],"flag_abuse_whitelist_node_user":[],"uuid":"9e43dac6-e1da-4f60-8428-de9f32ac9eb0","vuuid":"bf8e2d7e-3f35-44cf-aace-12aadba16948"} \ No newline at end of file +{"body":{"value":"

          Berliner Terminkalender f\u00fcr linke Subkultur und Politik

          \n","summary":"","format":"rich_text_editor"},"category":[],"group_group":true,"group_logo":[],"email":"stressfaktor@squat.net","link":[{"title":"","url":"http://stressfaktor.squat.net","attributes":[]}],"offline":[],"phone":null,"topic":[],"notifications":["stressfaktor@squat.net"],"groups_listed":{"0":{"uri":"https://radar.squat.net/api/1.1/node/da296694-ae72-47a9-9073-e450143b9c58","id":"da296694-ae72-47a9-9073-e450143b9c58","resource":"node"},"1":{"uri":"https://radar.squat.net/api/1.1/node/2f2f9cb7-49f1-40b8-a609-7b0a2a91e476","id":"2f2f9cb7-49f1-40b8-a609-7b0a2a91e476","resource":"node"},"2":{"uri":"https://radar.squat.net/api/1.1/node/4b2b0338-b939-4281-bf79-e584b18f4b99","id":"4b2b0338-b939-4281-bf79-e584b18f4b99","resource":"node"},"3":{"uri":"https://radar.squat.net/api/1.1/node/15cc0e0a-ec33-4db6-8957-718cee27cedc","id":"15cc0e0a-ec33-4db6-8957-718cee27cedc","resource":"node"},"4":{"uri":"https://radar.squat.net/api/1.1/node/bcc00cbe-c7c7-4999-90a8-e08fe6fc8fa2","id":"bcc00cbe-c7c7-4999-90a8-e08fe6fc8fa2","resource":"node"},"5":{"uri":"https://radar.squat.net/api/1.1/node/7d308fd7-8e1d-4fd4-bdde-3fd687846fb3","id":"7d308fd7-8e1d-4fd4-bdde-3fd687846fb3","resource":"node"},"6":{"uri":"https://radar.squat.net/api/1.1/node/0d23eabd-4dbe-4450-b236-dc3d6a337071","id":"0d23eabd-4dbe-4450-b236-dc3d6a337071","resource":"node"},"7":{"uri":"https://radar.squat.net/api/1.1/node/15e37aa5-b4e6-45b2-91a8-e18fc08cc58d","id":"15e37aa5-b4e6-45b2-91a8-e18fc08cc58d","resource":"node"},"8":{"uri":"https://radar.squat.net/api/1.1/node/c3ab0096-5d8d-40b5-984a-eadbb804fff3","id":"c3ab0096-5d8d-40b5-984a-eadbb804fff3","resource":"node"},"9":{"uri":"https://radar.squat.net/api/1.1/node/820807d5-5ffd-48b7-b29a-d8c185784598","id":"820807d5-5ffd-48b7-b29a-d8c185784598","resource":"node"},"10":{"uri":"https://radar.squat.net/api/1.1/node/ad80054e-768c-4dbb-a18e-7f253b9b2fba","id":"ad80054e-768c-4dbb-a18e-7f253b9b2fba","resource":"node"},"11":{"uri":"https://radar.squat.net/api/1.1/node/842db4e3-8d2f-4080-879a-a7ed0b95df77","id":"842db4e3-8d2f-4080-879a-a7ed0b95df77","resource":"node"},"12":{"uri":"https://radar.squat.net/api/1.1/node/d0d13e13-8cab-4c17-af04-ef02debdac49","id":"d0d13e13-8cab-4c17-af04-ef02debdac49","resource":"node"},"13":{"uri":"https://radar.squat.net/api/1.1/node/52b7b42f-1573-46eb-b6a4-3a57faf72b48","id":"52b7b42f-1573-46eb-b6a4-3a57faf72b48","resource":"node"},"14":{"uri":"https://radar.squat.net/api/1.1/node/71ec0d30-befe-45be-8adf-578c1bd30afb","id":"71ec0d30-befe-45be-8adf-578c1bd30afb","resource":"node"},"15":{"uri":"https://radar.squat.net/api/1.1/node/9f8cf3bf-e8f6-47b1-9597-78f03f6ac242","id":"9f8cf3bf-e8f6-47b1-9597-78f03f6ac242","resource":"node"},"16":{"uri":"https://radar.squat.net/api/1.1/node/1b3c26b8-7f5f-4c2b-8288-7ab9dfbdb217","id":"1b3c26b8-7f5f-4c2b-8288-7ab9dfbdb217","resource":"node"},"18":{"uri":"https://radar.squat.net/api/1.1/node/23aa0579-a3a5-4527-ba9b-f099607638c7","id":"23aa0579-a3a5-4527-ba9b-f099607638c7","resource":"node"},"19":{"uri":"https://radar.squat.net/api/1.1/node/7fdf5a2c-215d-45d6-9b9b-032c3f7df196","id":"7fdf5a2c-215d-45d6-9b9b-032c3f7df196","resource":"node"},"20":{"uri":"https://radar.squat.net/api/1.1/node/44ee4f5d-446f-4819-b986-7554b238a5b6","id":"44ee4f5d-446f-4819-b986-7554b238a5b6","resource":"node"},"21":{"uri":"https://radar.squat.net/api/1.1/node/873e7b8d-2377-4bfe-befc-329c76337890","id":"873e7b8d-2377-4bfe-befc-329c76337890","resource":"node"},"22":{"uri":"https://radar.squat.net/api/1.1/node/c5f61ab5-8af3-453d-a2d1-c88f6585e063","id":"c5f61ab5-8af3-453d-a2d1-c88f6585e063","resource":"node"},"23":{"uri":"https://radar.squat.net/api/1.1/node/1bc74010-ba94-4718-a243-6dd234d2df00","id":"1bc74010-ba94-4718-a243-6dd234d2df00","resource":"node"},"24":{"uri":"https://radar.squat.net/api/1.1/node/7b0cd948-4437-420d-8dcf-ff223f15ba66","id":"7b0cd948-4437-420d-8dcf-ff223f15ba66","resource":"node"},"25":{"uri":"https://radar.squat.net/api/1.1/node/0ea28719-64b6-4dee-ad1a-fbeeed9f8d8b","id":"0ea28719-64b6-4dee-ad1a-fbeeed9f8d8b","resource":"node"},"26":{"uri":"https://radar.squat.net/api/1.1/node/ad25f0d5-93d9-4bf7-a648-5b6d95814357","id":"ad25f0d5-93d9-4bf7-a648-5b6d95814357","resource":"node"},"27":{"uri":"https://radar.squat.net/api/1.1/node/537768e6-6019-4fac-97a3-e081358e6e68","id":"537768e6-6019-4fac-97a3-e081358e6e68","resource":"node"},"28":{"uri":"https://radar.squat.net/api/1.1/node/198ba0dc-c909-410d-945c-d5198fd352f7","id":"198ba0dc-c909-410d-945c-d5198fd352f7","resource":"node"},"29":{"uri":"https://radar.squat.net/api/1.1/node/78479202-6162-47a3-b203-797ed10126d7","id":"78479202-6162-47a3-b203-797ed10126d7","resource":"node"},"30":{"uri":"https://radar.squat.net/api/1.1/node/2c517caa-f260-43c4-af4c-8380270a2425","id":"2c517caa-f260-43c4-af4c-8380270a2425","resource":"node"},"31":{"uri":"https://radar.squat.net/api/1.1/node/2d419944-166c-4862-9099-3200593a121f","id":"2d419944-166c-4862-9099-3200593a121f","resource":"node"},"32":{"uri":"https://radar.squat.net/api/1.1/node/91f16ad9-782b-42bd-80b2-02a30345fb67","id":"91f16ad9-782b-42bd-80b2-02a30345fb67","resource":"node"},"33":{"uri":"https://radar.squat.net/api/1.1/node/dce96965-8fe0-4faf-b444-e95b8211a7b6","id":"dce96965-8fe0-4faf-b444-e95b8211a7b6","resource":"node"},"34":{"uri":"https://radar.squat.net/api/1.1/node/8f31ca47-89cb-4040-9cc9-8381fc34c427","id":"8f31ca47-89cb-4040-9cc9-8381fc34c427","resource":"node"},"35":{"uri":"https://radar.squat.net/api/1.1/node/f786a103-d470-4ab8-86f8-1d656bf021ff","id":"f786a103-d470-4ab8-86f8-1d656bf021ff","resource":"node"},"36":{"uri":"https://radar.squat.net/api/1.1/node/1905f47a-219d-47ab-8077-ddc277014a4f","id":"1905f47a-219d-47ab-8077-ddc277014a4f","resource":"node"},"37":{"uri":"https://radar.squat.net/api/1.1/node/eb6ec841-14cf-4ff3-9490-db1d8d811a34","id":"eb6ec841-14cf-4ff3-9490-db1d8d811a34","resource":"node"},"38":{"uri":"https://radar.squat.net/api/1.1/node/1d78f34f-75f6-4eb1-8712-9bdcde9c1a7d","id":"1d78f34f-75f6-4eb1-8712-9bdcde9c1a7d","resource":"node"},"39":{"uri":"https://radar.squat.net/api/1.1/node/d1b33d4a-7ba1-40d7-8df4-3f8ce9a7416e","id":"d1b33d4a-7ba1-40d7-8df4-3f8ce9a7416e","resource":"node"},"40":{"uri":"https://radar.squat.net/api/1.1/node/92e1ed31-1426-453e-945f-289b40c63bc0","id":"92e1ed31-1426-453e-945f-289b40c63bc0","resource":"node"},"41":{"uri":"https://radar.squat.net/api/1.1/node/e3b08fd0-f8a5-43e3-8a47-70fb0e267a57","id":"e3b08fd0-f8a5-43e3-8a47-70fb0e267a57","resource":"node"},"42":{"uri":"https://radar.squat.net/api/1.1/node/e36dd057-211a-4be3-affd-be354426843c","id":"e36dd057-211a-4be3-affd-be354426843c","resource":"node"},"43":{"uri":"https://radar.squat.net/api/1.1/node/3dd86ac6-9c80-4a9f-8bd9-813aff5cb864","id":"3dd86ac6-9c80-4a9f-8bd9-813aff5cb864","resource":"node"},"44":{"uri":"https://radar.squat.net/api/1.1/node/5327be07-84fd-4106-874f-e63aa57ed315","id":"5327be07-84fd-4106-874f-e63aa57ed315","resource":"node"},"45":{"uri":"https://radar.squat.net/api/1.1/node/8b73834c-0f68-4b81-8b42-96b3d64b7d23","id":"8b73834c-0f68-4b81-8b42-96b3d64b7d23","resource":"node"},"46":{"uri":"https://radar.squat.net/api/1.1/node/bdca8a0b-f8cf-4ccc-9ba4-3c17665cd4cd","id":"bdca8a0b-f8cf-4ccc-9ba4-3c17665cd4cd","resource":"node"},"47":{"uri":"https://radar.squat.net/api/1.1/node/ac98ee2c-ee5d-40a6-b11d-f4857d0eb7e4","id":"ac98ee2c-ee5d-40a6-b11d-f4857d0eb7e4","resource":"node"},"48":{"uri":"https://radar.squat.net/api/1.1/node/6966598b-bbf5-4237-8910-72ddcd079143","id":"6966598b-bbf5-4237-8910-72ddcd079143","resource":"node"},"49":{"uri":"https://radar.squat.net/api/1.1/node/58ce7e90-753f-4309-ac83-e6bf38e80e7f","id":"58ce7e90-753f-4309-ac83-e6bf38e80e7f","resource":"node"},"50":{"uri":"https://radar.squat.net/api/1.1/node/5604e631-b4b0-4be6-a1f2-db853aed3e70","id":"5604e631-b4b0-4be6-a1f2-db853aed3e70","resource":"node"},"51":{"uri":"https://radar.squat.net/api/1.1/node/6f80e977-c54d-4251-9756-8e3bd650a20e","id":"6f80e977-c54d-4251-9756-8e3bd650a20e","resource":"node"},"52":{"uri":"https://radar.squat.net/api/1.1/node/1759e832-527f-4635-aff2-97b4862ea5ca","id":"1759e832-527f-4635-aff2-97b4862ea5ca","resource":"node"},"53":{"uri":"https://radar.squat.net/api/1.1/node/ec485e0a-970b-4b71-a479-14680a1d0da2","id":"ec485e0a-970b-4b71-a479-14680a1d0da2","resource":"node"},"54":{"uri":"https://radar.squat.net/api/1.1/node/3ed0a76c-79dd-4d01-948d-0bedb0d1f0b8","id":"3ed0a76c-79dd-4d01-948d-0bedb0d1f0b8","resource":"node"},"55":{"uri":"https://radar.squat.net/api/1.1/node/1662899c-ea08-431b-8238-ad775e9ecea6","id":"1662899c-ea08-431b-8238-ad775e9ecea6","resource":"node"},"56":{"uri":"https://radar.squat.net/api/1.1/node/f5d3f47b-c826-4ade-91f0-b912597f72f5","id":"f5d3f47b-c826-4ade-91f0-b912597f72f5","resource":"node"},"57":{"uri":"https://radar.squat.net/api/1.1/node/aa9325d8-7e14-4f5e-a162-944d5e0a2632","id":"aa9325d8-7e14-4f5e-a162-944d5e0a2632","resource":"node"},"58":{"uri":"https://radar.squat.net/api/1.1/node/eee48e7e-95f5-4ff9-8b7e-c4b93b534e02","id":"eee48e7e-95f5-4ff9-8b7e-c4b93b534e02","resource":"node"},"59":{"uri":"https://radar.squat.net/api/1.1/node/dba9dbb2-aa6a-458e-83ea-4f8856773c47","id":"dba9dbb2-aa6a-458e-83ea-4f8856773c47","resource":"node"},"60":{"uri":"https://radar.squat.net/api/1.1/node/4c7ab8c9-f3c7-4d5f-9f9f-7fa64f0c41d8","id":"4c7ab8c9-f3c7-4d5f-9f9f-7fa64f0c41d8","resource":"node"},"61":{"uri":"https://radar.squat.net/api/1.1/node/23d338b5-291b-440b-8222-12f03f438480","id":"23d338b5-291b-440b-8222-12f03f438480","resource":"node"},"62":{"uri":"https://radar.squat.net/api/1.1/node/66742b55-0ecd-4030-87d6-975516e7be0c","id":"66742b55-0ecd-4030-87d6-975516e7be0c","resource":"node"},"63":{"uri":"https://radar.squat.net/api/1.1/node/00d2eecf-a4f9-4097-aead-9a2010df9a60","id":"00d2eecf-a4f9-4097-aead-9a2010df9a60","resource":"node"},"64":{"uri":"https://radar.squat.net/api/1.1/node/87ea3a3a-7061-48b7-a2ab-d33bec626fd3","id":"87ea3a3a-7061-48b7-a2ab-d33bec626fd3","resource":"node"},"65":{"uri":"https://radar.squat.net/api/1.1/node/0853ade6-9390-4634-88e0-345aed52ec24","id":"0853ade6-9390-4634-88e0-345aed52ec24","resource":"node"},"66":{"uri":"https://radar.squat.net/api/1.1/node/d7177db6-533a-4ba8-83b0-a608433e8e9d","id":"d7177db6-533a-4ba8-83b0-a608433e8e9d","resource":"node"},"68":{"uri":"https://radar.squat.net/api/1.1/node/19cdf192-2de9-435d-ba13-e7236d62ca06","id":"19cdf192-2de9-435d-ba13-e7236d62ca06","resource":"node"},"69":{"uri":"https://radar.squat.net/api/1.1/node/788ce0f5-e5d6-4f97-9e55-e3715205b90a","id":"788ce0f5-e5d6-4f97-9e55-e3715205b90a","resource":"node"},"70":{"uri":"https://radar.squat.net/api/1.1/node/88192058-a635-44f2-a8ff-d5c65ab6b319","id":"88192058-a635-44f2-a8ff-d5c65ab6b319","resource":"node"},"71":{"uri":"https://radar.squat.net/api/1.1/node/93dd1b42-8388-494d-b039-b3c1b2963299","id":"93dd1b42-8388-494d-b039-b3c1b2963299","resource":"node"},"72":{"uri":"https://radar.squat.net/api/1.1/node/002c6c7d-82d8-402e-ae71-1e66afc5ad81","id":"002c6c7d-82d8-402e-ae71-1e66afc5ad81","resource":"node"},"73":{"uri":"https://radar.squat.net/api/1.1/node/1c501be3-0332-4725-9b0f-b85e3f897795","id":"1c501be3-0332-4725-9b0f-b85e3f897795","resource":"node"},"74":{"uri":"https://radar.squat.net/api/1.1/node/d6264659-d299-4cce-9ad7-d7e315c9f4fc","id":"d6264659-d299-4cce-9ad7-d7e315c9f4fc","resource":"node"},"75":{"uri":"https://radar.squat.net/api/1.1/node/2715ad19-0424-462b-8b8c-153e8420716e","id":"2715ad19-0424-462b-8b8c-153e8420716e","resource":"node"},"76":{"uri":"https://radar.squat.net/api/1.1/node/29a4451c-d798-47ef-b3c4-eb492ccf5336","id":"29a4451c-d798-47ef-b3c4-eb492ccf5336","resource":"node"},"77":{"uri":"https://radar.squat.net/api/1.1/node/57123ebc-a50a-46d5-99cf-87bb87c3f55f","id":"57123ebc-a50a-46d5-99cf-87bb87c3f55f","resource":"node"}},"members":[],"members__1":[],"members__2":[],"members__3":[],"nid":"1599","vid":"8976","is_new":false,"type":"listings_group","title":"Stressfaktor","language":"de","url":"https://radar.squat.net/en/node/1599","edit_url":"https://radar.squat.net/en/node/1599/edit","status":"1","promote":"0","sticky":"0","created":"1415355772","changed":"1424428820","feed_nid":null,"flag_abuse_node_user":[],"flag_abuse_whitelist_node_user":[],"uuid":"9e43dac6-e1da-4f60-8428-de9f32ac9eb0","vuuid":"bf8e2d7e-3f35-44cf-aace-12aadba16948"} \ No newline at end of file diff --git a/vendor/events-radar/radar-api-php/tests/data/taxonomy_term b/vendor/events-radar/radar-api-php/tests/data/taxonomy_term index 3f5f1c8..f2cc64d 100644 --- a/vendor/events-radar/radar-api-php/tests/data/taxonomy_term +++ b/vendor/events-radar/radar-api-php/tests/data/taxonomy_term @@ -12,4 +12,4 @@ Content-Length: 360 Content-Type: application/json Strict-Transport-Security: max-age=15768000;includeSubDomains -{"tid":"7","name":"action/protest/camp","description":"","weight":"0","node_count":10,"url":"https://new-radar.squat.net/en/category/action-protest-camp","parent":[],"parents_all":[{"uri":"https://new-radar.squat.net/api/1.0/taxonomy_term/7","id":"7","resource":"taxonomy_term"}],"feed_nid":null,"type":"category","uuid":"e85a688d-03ac-4008-a3cb-1adb7e8f718a"} \ No newline at end of file +{"tid":"7","name":"action/protest/camp","description":"","weight":"0","node_count":10,"url":"https://radar.squat.net/en/category/action-protest-camp","parent":[],"parents_all":[{"uri":"https://radar.squat.net/api/1.1/taxonomy_term/7","id":"7","resource":"taxonomy_term"}],"feed_nid":null,"type":"category","uuid":"e85a688d-03ac-4008-a3cb-1adb7e8f718a"} \ No newline at end of file diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore b/vendor/symfony/event-dispatcher/.gitignore similarity index 100% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore rename to vendor/symfony/event-dispatcher/.gitignore diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md b/vendor/symfony/event-dispatcher/CHANGELOG.md similarity index 59% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md rename to vendor/symfony/event-dispatcher/CHANGELOG.md index bb42ee1..736bd84 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md +++ b/vendor/symfony/event-dispatcher/CHANGELOG.md @@ -1,6 +1,20 @@ CHANGELOG ========= +3.3.0 +----- + + * The ContainerAwareEventDispatcher class has been deprecated. Use EventDispatcher with closure factories instead. + +3.0.0 +----- + + * The method `getListenerPriority($eventName, $listener)` has been added to the + `EventDispatcherInterface`. + * The methods `Event::setDispatcher()`, `Event::getDispatcher()`, `Event::setName()` + and `Event::getName()` have been removed. + The event dispatcher and the event name are passed to the listener call. + 2.5.0 ----- diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php b/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php similarity index 77% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php rename to vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php index af0b6ce..fc7b30f 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php +++ b/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php @@ -20,6 +20,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * @author Fabien Potencier * @author Bernhard Schussek * @author Jordan Alliot + * + * @deprecated since 3.3, to be removed in 4.0. Use EventDispatcher with closure factories instead. */ class ContainerAwareEventDispatcher extends EventDispatcher { @@ -52,6 +54,14 @@ class ContainerAwareEventDispatcher extends EventDispatcher public function __construct(ContainerInterface $container) { $this->container = $container; + + $class = get_class($this); + if ($this instanceof \PHPUnit_Framework_MockObject_MockObject || $this instanceof \Prophecy\Doubler\DoubleInterface) { + $class = get_parent_class($class); + } + if (__CLASS__ !== $class) { + @trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED); + } } /** @@ -68,6 +78,8 @@ class ContainerAwareEventDispatcher extends EventDispatcher */ public function addListenerService($eventName, $callback, $priority = 0) { + @trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED); + if (!is_array($callback) || 2 !== count($callback)) { throw new \InvalidArgumentException('Expected an array("service", "method") argument'); } @@ -80,8 +92,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher $this->lazyLoad($eventName); if (isset($this->listenerIds[$eventName])) { - foreach ($this->listenerIds[$eventName] as $i => $args) { - list($serviceId, $method, $priority) = $args; + foreach ($this->listenerIds[$eventName] as $i => list($serviceId, $method, $priority)) { $key = $serviceId.'.'.$method; if (isset($this->listeners[$eventName][$key]) && $listener === array($this->listeners[$eventName][$key], $method)) { unset($this->listeners[$eventName][$key]); @@ -100,12 +111,12 @@ class ContainerAwareEventDispatcher extends EventDispatcher } /** - * @see EventDispatcherInterface::hasListeners() + * {@inheritdoc} */ public function hasListeners($eventName = null) { if (null === $eventName) { - return (bool) count($this->listenerIds) || (bool) count($this->listeners); + return $this->listenerIds || $this->listeners || parent::hasListeners(); } if (isset($this->listenerIds[$eventName])) { @@ -116,12 +127,12 @@ class ContainerAwareEventDispatcher extends EventDispatcher } /** - * @see EventDispatcherInterface::getListeners() + * {@inheritdoc} */ public function getListeners($eventName = null) { if (null === $eventName) { - foreach (array_keys($this->listenerIds) as $serviceEventName) { + foreach ($this->listenerIds as $serviceEventName => $args) { $this->lazyLoad($serviceEventName); } } else { @@ -131,6 +142,16 @@ class ContainerAwareEventDispatcher extends EventDispatcher return parent::getListeners($eventName); } + /** + * {@inheritdoc} + */ + public function getListenerPriority($eventName, $listener) + { + $this->lazyLoad($eventName); + + return parent::getListenerPriority($eventName, $listener); + } + /** * Adds a service as event subscriber. * @@ -139,6 +160,8 @@ class ContainerAwareEventDispatcher extends EventDispatcher */ public function addSubscriberService($serviceId, $class) { + @trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED); + foreach ($class::getSubscribedEvents() as $eventName => $params) { if (is_string($params)) { $this->listenerIds[$eventName][] = array($serviceId, $params, 0); @@ -152,23 +175,10 @@ class ContainerAwareEventDispatcher extends EventDispatcher } } - /** - * {@inheritdoc} - * - * Lazily loads listeners for this event from the dependency injection - * container. - * - * @throws \InvalidArgumentException if the service is not defined - */ - public function dispatch($eventName, Event $event = null) - { - $this->lazyLoad($eventName); - - return parent::dispatch($eventName, $event); - } - public function getContainer() { + @trigger_error('The '.__METHOD__.'() method is deprecated since version 3.3 as its class will be removed in 4.0. Inject the container or the services you need in your listeners/subscribers instead.', E_USER_DEPRECATED); + return $this->container; } @@ -183,8 +193,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher protected function lazyLoad($eventName) { if (isset($this->listenerIds[$eventName])) { - foreach ($this->listenerIds[$eventName] as $args) { - list($serviceId, $method, $priority) = $args; + foreach ($this->listenerIds[$eventName] as list($serviceId, $method, $priority)) { $listener = $this->container->get($serviceId); $key = $serviceId.'.'.$method; diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php similarity index 66% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php rename to vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php index 2119b81..988cf11 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php +++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php @@ -31,6 +31,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface private $called; private $dispatcher; + private $wrappedListeners; /** * Constructor. @@ -45,6 +46,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface $this->stopwatch = $stopwatch; $this->logger = $logger; $this->called = array(); + $this->wrappedListeners = array(); } /** @@ -68,6 +70,16 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface */ public function removeListener($eventName, $listener) { + if (isset($this->wrappedListeners[$eventName])) { + foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { + if ($wrappedListener->getWrappedListener() === $listener) { + $listener = $wrappedListener; + unset($this->wrappedListeners[$eventName][$index]); + break; + } + } + } + return $this->dispatcher->removeListener($eventName, $listener); } @@ -87,6 +99,24 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface return $this->dispatcher->getListeners($eventName); } + /** + * {@inheritdoc} + */ + public function getListenerPriority($eventName, $listener) + { + // we might have wrapped listeners for the event (if called while dispatching) + // in that case get the priority by wrapper + if (isset($this->wrappedListeners[$eventName])) { + foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { + if ($wrappedListener->getWrappedListener() === $listener) { + return $this->dispatcher->getListenerPriority($eventName, $wrappedListener); + } + } + } + + return $this->dispatcher->getListenerPriority($eventName, $listener); + } + /** * {@inheritdoc} */ @@ -104,6 +134,10 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface $event = new Event(); } + if (null !== $this->logger && $event->isPropagationStopped()) { + $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName)); + } + $this->preProcess($eventName); $this->preDispatch($eventName, $event); @@ -129,8 +163,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface $called = array(); foreach ($this->called as $eventName => $listeners) { foreach ($listeners as $listener) { - $info = $this->getListenerInfo($listener->getWrappedListener(), $eventName); - $called[$eventName.'.'.$info['pretty']] = $info; + $called[$eventName.'.'.$listener->getPretty()] = $listener->getInfo($eventName); } } @@ -146,7 +179,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface $allListeners = $this->getListeners(); } catch (\Exception $e) { if (null !== $this->logger) { - $this->logger->info(sprintf('An exception was thrown while getting the uncalled listeners (%s)', $e->getMessage()), array('exception' => $e)); + $this->logger->info('An exception was thrown while getting the uncalled listeners.', array('exception' => $e)); } // unable to retrieve the uncalled listeners @@ -168,12 +201,16 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface } if (!$called) { - $info = $this->getListenerInfo($listener, $eventName); - $notCalled[$eventName.'.'.$info['pretty']] = $info; + if (!$listener instanceof WrappedListener) { + $listener = new WrappedListener($listener, null, $this->stopwatch, $this); + } + $notCalled[$eventName.'.'.$listener->getPretty()] = $listener->getInfo($eventName); } } } + uasort($notCalled, array($this, 'sortListenersByPriority')); + return $notCalled; } @@ -213,28 +250,34 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface private function preProcess($eventName) { foreach ($this->dispatcher->getListeners($eventName) as $listener) { + $priority = $this->getListenerPriority($eventName, $listener); + $wrappedListener = new WrappedListener($listener, null, $this->stopwatch, $this); + $this->wrappedListeners[$eventName][] = $wrappedListener; $this->dispatcher->removeListener($eventName, $listener); - $info = $this->getListenerInfo($listener, $eventName); - $name = isset($info['class']) ? $info['class'] : $info['type']; - $this->dispatcher->addListener($eventName, new WrappedListener($listener, $name, $this->stopwatch, $this)); + $this->dispatcher->addListener($eventName, $wrappedListener, $priority); } } private function postProcess($eventName) { + unset($this->wrappedListeners[$eventName]); $skipped = false; foreach ($this->dispatcher->getListeners($eventName) as $listener) { if (!$listener instanceof WrappedListener) { // #12845: a new listener was added during dispatch. continue; } // Unwrap listener + $priority = $this->getListenerPriority($eventName, $listener); $this->dispatcher->removeListener($eventName, $listener); - $this->dispatcher->addListener($eventName, $listener->getWrappedListener()); + $this->dispatcher->addListener($eventName, $listener->getWrappedListener(), $priority); + + if (null !== $this->logger) { + $context = array('event' => $eventName, 'listener' => $listener->getPretty()); + } - $info = $this->getListenerInfo($listener->getWrappedListener(), $eventName); if ($listener->wasCalled()) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Notified event "%s" to listener "%s".', $eventName, $info['pretty'])); + $this->logger->debug('Notified event "{event}" to listener "{listener}".', $context); } if (!isset($this->called[$eventName])) { @@ -245,12 +288,12 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface } if (null !== $this->logger && $skipped) { - $this->logger->debug(sprintf('Listener "%s" was not called for event "%s".', $info['pretty'], $eventName)); + $this->logger->debug('Listener "{listener}" was not called for event "{event}".', $context); } if ($listener->stoppedPropagation()) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Listener "%s" stopped propagation of the event "%s".', $info['pretty'], $eventName)); + $this->logger->debug('Listener "{listener}" stopped propagation of the event "{event}".', $context); } $skipped = true; @@ -258,63 +301,24 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface } } - /** - * Returns information about the listener - * - * @param object $listener The listener - * @param string $eventName The event name - * - * @return array Information about the listener - */ - private function getListenerInfo($listener, $eventName) + private function sortListenersByPriority($a, $b) { - $info = array( - 'event' => $eventName, - ); - if ($listener instanceof \Closure) { - $info += array( - 'type' => 'Closure', - 'pretty' => 'closure', - ); - } elseif (is_string($listener)) { - try { - $r = new \ReflectionFunction($listener); - $file = $r->getFileName(); - $line = $r->getStartLine(); - } catch (\ReflectionException $e) { - $file = null; - $line = null; - } - $info += array( - 'type' => 'Function', - 'function' => $listener, - 'file' => $file, - 'line' => $line, - 'pretty' => $listener, - ); - } elseif (is_array($listener) || (is_object($listener) && is_callable($listener))) { - if (!is_array($listener)) { - $listener = array($listener, '__invoke'); - } - $class = is_object($listener[0]) ? get_class($listener[0]) : $listener[0]; - try { - $r = new \ReflectionMethod($class, $listener[1]); - $file = $r->getFileName(); - $line = $r->getStartLine(); - } catch (\ReflectionException $e) { - $file = null; - $line = null; - } - $info += array( - 'type' => 'Method', - 'class' => $class, - 'method' => $listener[1], - 'file' => $file, - 'line' => $line, - 'pretty' => $class.'::'.$listener[1], - ); + if (is_int($a['priority']) && !is_int($b['priority'])) { + return 1; } - return $info; + if (!is_int($a['priority']) && is_int($b['priority'])) { + return -1; + } + + if ($a['priority'] === $b['priority']) { + return 0; + } + + if ($a['priority'] > $b['priority']) { + return -1; + } + + return 1; } } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php similarity index 100% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php rename to vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/WrappedListener.php b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php similarity index 54% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/WrappedListener.php rename to vendor/symfony/event-dispatcher/Debug/WrappedListener.php index e16627d..4029883 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/WrappedListener.php +++ b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php @@ -14,6 +14,8 @@ namespace Symfony\Component\EventDispatcher\Debug; use Symfony\Component\Stopwatch\Stopwatch; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\VarDumper\Caster\ClassStub; +use Symfony\Component\VarDumper\Cloner\VarCloner; /** * @author Fabien Potencier @@ -26,6 +28,10 @@ class WrappedListener private $stoppedPropagation; private $stopwatch; private $dispatcher; + private $pretty; + private $stub; + + private static $cloner; public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) { @@ -35,6 +41,26 @@ class WrappedListener $this->dispatcher = $dispatcher; $this->called = false; $this->stoppedPropagation = false; + + if (is_array($listener)) { + $this->name = is_object($listener[0]) ? get_class($listener[0]) : $listener[0]; + $this->pretty = $this->name.'::'.$listener[1]; + } elseif ($listener instanceof \Closure) { + $this->pretty = $this->name = 'closure'; + } elseif (is_string($listener)) { + $this->pretty = $this->name = $listener; + } else { + $this->name = get_class($listener); + $this->pretty = $this->name.'::__invoke'; + } + + if (null !== $name) { + $this->name = $name; + } + + if (null === self::$cloner) { + self::$cloner = class_exists(ClassStub::class) ? new VarCloner() : false; + } } public function getWrappedListener() @@ -52,6 +78,25 @@ class WrappedListener return $this->stoppedPropagation; } + public function getPretty() + { + return $this->pretty; + } + + public function getInfo($eventName) + { + if (null === $this->stub) { + $this->stub = false === self::$cloner ? $this->pretty.'()' : new ClassStub($this->pretty.'()', $this->listener); + } + + return array( + 'event' => $eventName, + 'priority' => null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null, + 'pretty' => $this->pretty, + 'stub' => $this->stub, + ); + } + public function __invoke(Event $event, $eventName, EventDispatcherInterface $dispatcher) { $this->called = true; diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php similarity index 57% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php rename to vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php index 7e74a37..50e466a 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php +++ b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php @@ -11,8 +11,13 @@ namespace Symfony\Component\EventDispatcher\DependencyInjection; +use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * Compiler pass to register tagged services for an event dispatcher. @@ -56,21 +61,14 @@ class RegisterListenersPass implements CompilerPassInterface $definition = $container->findDefinition($this->dispatcherService); - foreach ($container->findTaggedServiceIds($this->listenerTag) as $id => $events) { + foreach ($container->findTaggedServiceIds($this->listenerTag, true) as $id => $events) { $def = $container->getDefinition($id); - if (!$def->isPublic()) { - throw new \InvalidArgumentException(sprintf('The service "%s" must be public as event listeners are lazy-loaded.', $id)); - } - - if ($def->isAbstract()) { - throw new \InvalidArgumentException(sprintf('The service "%s" must not be abstract as event listeners are lazy-loaded.', $id)); - } foreach ($events as $event) { $priority = isset($event['priority']) ? $event['priority'] : 0; if (!isset($event['event'])) { - throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag)); + throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag)); } if (!isset($event['method'])) { @@ -81,30 +79,57 @@ class RegisterListenersPass implements CompilerPassInterface $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); } - $definition->addMethodCall('addListenerService', array($event['event'], array($id, $event['method']), $priority)); + $definition->addMethodCall('addListener', array($event['event'], array(new ServiceClosureArgument(new Reference($id)), $event['method']), $priority)); } } - foreach ($container->findTaggedServiceIds($this->subscriberTag) as $id => $attributes) { - $def = $container->getDefinition($id); - if (!$def->isPublic()) { - throw new \InvalidArgumentException(sprintf('The service "%s" must be public as event subscribers are lazy-loaded.', $id)); - } + $extractingDispatcher = new ExtractingEventDispatcher(); - if ($def->isAbstract()) { - throw new \InvalidArgumentException(sprintf('The service "%s" must not be abstract as event subscribers are lazy-loaded.', $id)); - } + foreach ($container->findTaggedServiceIds($this->subscriberTag, true) as $id => $attributes) { + $def = $container->getDefinition($id); // We must assume that the class value has been correctly filled, even if the service is created by a factory $class = $container->getParameterBag()->resolveValue($def->getClass()); - - $refClass = new \ReflectionClass($class); $interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface'; - if (!$refClass->implementsInterface($interface)) { - throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface)); - } - $definition->addMethodCall('addSubscriberService', array($id, $class)); + if (!is_subclass_of($class, $interface)) { + if (!class_exists($class, false)) { + throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + } + + throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface)); + } + $container->addObjectResource($class); + + ExtractingEventDispatcher::$subscriber = $class; + $extractingDispatcher->addSubscriber($extractingDispatcher); + foreach ($extractingDispatcher->listeners as $args) { + $args[1] = array(new ServiceClosureArgument(new Reference($id)), $args[1]); + $definition->addMethodCall('addListener', $args); + } + $extractingDispatcher->listeners = array(); } } } + +/** + * @internal + */ +class ExtractingEventDispatcher extends EventDispatcher implements EventSubscriberInterface +{ + public $listeners = array(); + + public static $subscriber; + + public function addListener($eventName, $listener, $priority = 0) + { + $this->listeners[] = array($eventName, $listener[1], $priority); + } + + public static function getSubscribedEvents() + { + $callback = array(self::$subscriber, 'getSubscribedEvents'); + + return $callback(); + } +} diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php b/vendor/symfony/event-dispatcher/Event.php similarity index 50% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php rename to vendor/symfony/event-dispatcher/Event.php index dc39b05..9c56b2f 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php +++ b/vendor/symfony/event-dispatcher/Event.php @@ -24,8 +24,6 @@ namespace Symfony\Component\EventDispatcher; * @author Jonathan Wage * @author Roman Borschel * @author Bernhard Schussek - * - * @api */ class Event { @@ -34,24 +32,12 @@ class Event */ private $propagationStopped = false; - /** - * @var EventDispatcher Dispatcher that dispatched this event - */ - private $dispatcher; - - /** - * @var string This event's name - */ - private $name; - /** * Returns whether further event listeners should be triggered. * * @see Event::stopPropagation() * - * @return bool Whether propagation was already stopped for this event. - * - * @api + * @return bool Whether propagation was already stopped for this event */ public function isPropagationStopped() { @@ -64,67 +50,9 @@ class Event * If multiple event listeners are connected to the same event, no * further event listener will be triggered once any trigger calls * stopPropagation(). - * - * @api */ public function stopPropagation() { $this->propagationStopped = true; } - - /** - * Stores the EventDispatcher that dispatches this Event. - * - * @param EventDispatcherInterface $dispatcher - * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. - * - * @api - */ - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * Returns the EventDispatcher that dispatches this Event. - * - * @return EventDispatcherInterface - * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. - * - * @api - */ - public function getDispatcher() - { - return $this->dispatcher; - } - - /** - * Gets the event's name. - * - * @return string - * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call. - * - * @api - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the event's name property. - * - * @param string $name The event name. - * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call. - * - * @api - */ - public function setName($name) - { - $this->name = $name; - } } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php b/vendor/symfony/event-dispatcher/EventDispatcher.php similarity index 58% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php rename to vendor/symfony/event-dispatcher/EventDispatcher.php index 3b032fb..4630b01 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php +++ b/vendor/symfony/event-dispatcher/EventDispatcher.php @@ -24,8 +24,7 @@ namespace Symfony\Component\EventDispatcher; * @author Fabien Potencier * @author Jordi Boggiano * @author Jordan Alliot - * - * @api + * @author Nicolas Grekas */ class EventDispatcher implements EventDispatcherInterface { @@ -33,9 +32,7 @@ class EventDispatcher implements EventDispatcherInterface private $sorted = array(); /** - * @see EventDispatcherInterface::dispatch() - * - * @api + * {@inheritdoc} */ public function dispatch($eventName, Event $event = null) { @@ -43,24 +40,23 @@ class EventDispatcher implements EventDispatcherInterface $event = new Event(); } - $event->setDispatcher($this); - $event->setName($eventName); - - if (!isset($this->listeners[$eventName])) { - return $event; + if ($listeners = $this->getListeners($eventName)) { + $this->doDispatch($listeners, $eventName, $event); } - $this->doDispatch($this->getListeners($eventName), $eventName, $event); - return $event; } /** - * @see EventDispatcherInterface::getListeners() + * {@inheritdoc} */ public function getListeners($eventName = null) { if (null !== $eventName) { + if (empty($this->listeners[$eventName])) { + return array(); + } + if (!isset($this->sorted[$eventName])) { $this->sortListeners($eventName); } @@ -68,7 +64,7 @@ class EventDispatcher implements EventDispatcherInterface return $this->sorted[$eventName]; } - foreach (array_keys($this->listeners) as $eventName) { + foreach ($this->listeners as $eventName => $eventListeners) { if (!isset($this->sorted[$eventName])) { $this->sortListeners($eventName); } @@ -78,17 +74,51 @@ class EventDispatcher implements EventDispatcherInterface } /** - * @see EventDispatcherInterface::hasListeners() + * {@inheritdoc} */ - public function hasListeners($eventName = null) + public function getListenerPriority($eventName, $listener) { - return (bool) count($this->getListeners($eventName)); + if (empty($this->listeners[$eventName])) { + return; + } + + if (is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) { + $listener[0] = $listener[0](); + } + + foreach ($this->listeners[$eventName] as $priority => $listeners) { + foreach ($listeners as $k => $v) { + if ($v !== $listener && is_array($v) && isset($v[0]) && $v[0] instanceof \Closure) { + $v[0] = $v[0](); + $this->listeners[$eventName][$priority][$k] = $v; + } + if ($v === $listener) { + return $priority; + } + } + } } /** - * @see EventDispatcherInterface::addListener() - * - * @api + * {@inheritdoc} + */ + public function hasListeners($eventName = null) + { + if (null !== $eventName) { + return !empty($this->listeners[$eventName]); + } + + foreach ($this->listeners as $eventListeners) { + if ($eventListeners) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} */ public function addListener($eventName, $listener, $priority = 0) { @@ -97,25 +127,40 @@ class EventDispatcher implements EventDispatcherInterface } /** - * @see EventDispatcherInterface::removeListener() + * {@inheritdoc} */ public function removeListener($eventName, $listener) { - if (!isset($this->listeners[$eventName])) { + if (empty($this->listeners[$eventName])) { return; } + if (is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) { + $listener[0] = $listener[0](); + } + foreach ($this->listeners[$eventName] as $priority => $listeners) { - if (false !== ($key = array_search($listener, $listeners, true))) { - unset($this->listeners[$eventName][$priority][$key], $this->sorted[$eventName]); + foreach ($listeners as $k => $v) { + if ($v !== $listener && is_array($v) && isset($v[0]) && $v[0] instanceof \Closure) { + $v[0] = $v[0](); + } + if ($v === $listener) { + unset($listeners[$k], $this->sorted[$eventName]); + } else { + $listeners[$k] = $v; + } + } + + if ($listeners) { + $this->listeners[$eventName][$priority] = $listeners; + } else { + unset($this->listeners[$eventName][$priority]); } } } /** - * @see EventDispatcherInterface::addSubscriber() - * - * @api + * {@inheritdoc} */ public function addSubscriber(EventSubscriberInterface $subscriber) { @@ -133,7 +178,7 @@ class EventDispatcher implements EventDispatcherInterface } /** - * @see EventDispatcherInterface::removeSubscriber() + * {@inheritdoc} */ public function removeSubscriber(EventSubscriberInterface $subscriber) { @@ -154,32 +199,38 @@ class EventDispatcher implements EventDispatcherInterface * This method can be overridden to add functionality that is executed * for each listener. * - * @param callable[] $listeners The event listeners. - * @param string $eventName The name of the event to dispatch. - * @param Event $event The event object to pass to the event handlers/listeners. + * @param callable[] $listeners The event listeners + * @param string $eventName The name of the event to dispatch + * @param Event $event The event object to pass to the event handlers/listeners */ protected function doDispatch($listeners, $eventName, Event $event) { foreach ($listeners as $listener) { - call_user_func($listener, $event, $eventName, $this); if ($event->isPropagationStopped()) { break; } + call_user_func($listener, $event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. * - * @param string $eventName The name of the event. + * @param string $eventName The name of the event */ private function sortListeners($eventName) { + krsort($this->listeners[$eventName]); $this->sorted[$eventName] = array(); - if (isset($this->listeners[$eventName])) { - krsort($this->listeners[$eventName]); - $this->sorted[$eventName] = call_user_func_array('array_merge', $this->listeners[$eventName]); + foreach ($this->listeners[$eventName] as $priority => $listeners) { + foreach ($listeners as $k => $listener) { + if (is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) { + $listener[0] = $listener[0](); + $this->listeners[$eventName][$priority][$k] = $listener; + } + $this->sorted[$eventName][] = $listener; + } } } } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php similarity index 85% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php rename to vendor/symfony/event-dispatcher/EventDispatcherInterface.php index efb7c5b..08ebf34 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php +++ b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php @@ -17,8 +17,6 @@ namespace Symfony\Component\EventDispatcher; * manager. * * @author Bernhard Schussek - * - * @api */ interface EventDispatcherInterface { @@ -28,12 +26,10 @@ interface EventDispatcherInterface * @param string $eventName The name of the event to dispatch. The name of * the event is the name of the method that is * invoked on listeners. - * @param Event $event The event to pass to the event handlers/listeners. + * @param Event $event The event to pass to the event handlers/listeners * If not supplied, an empty Event instance is created. * * @return Event - * - * @api */ public function dispatch($eventName, Event $event = null); @@ -44,8 +40,6 @@ interface EventDispatcherInterface * @param callable $listener The listener * @param int $priority The higher this value, the earlier an event * listener will be triggered in the chain (defaults to 0) - * - * @api */ public function addListener($eventName, $listener, $priority = 0); @@ -55,9 +49,7 @@ interface EventDispatcherInterface * The subscriber is asked for all the events he is * interested in and added as a listener for these events. * - * @param EventSubscriberInterface $subscriber The subscriber. - * - * @api + * @param EventSubscriberInterface $subscriber The subscriber */ public function addSubscriber(EventSubscriberInterface $subscriber); @@ -77,7 +69,7 @@ interface EventDispatcherInterface public function removeSubscriber(EventSubscriberInterface $subscriber); /** - * Gets the listeners of a specific event or all listeners. + * Gets the listeners of a specific event or all listeners sorted by descending priority. * * @param string $eventName The name of the event * @@ -85,6 +77,18 @@ interface EventDispatcherInterface */ public function getListeners($eventName = null); + /** + * Gets the listener priority for a specific event. + * + * Returns null if the event or the listener does not exist. + * + * @param string $eventName The name of the event + * @param callable $listener The listener + * + * @return int|null The event listener priority + */ + public function getListenerPriority($eventName, $listener); + /** * Checks whether an event has any registered listeners. * diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php similarity index 96% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php rename to vendor/symfony/event-dispatcher/EventSubscriberInterface.php index ff7e305..8af7789 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php +++ b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php @@ -21,8 +21,6 @@ namespace Symfony\Component\EventDispatcher; * @author Jonathan Wage * @author Roman Borschel * @author Bernhard Schussek - * - * @api */ interface EventSubscriberInterface { @@ -40,11 +38,9 @@ interface EventSubscriberInterface * * * array('eventName' => 'methodName') * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) + * * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) * * @return array The event names to listen to - * - * @api */ public static function getSubscribedEvents(); } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php b/vendor/symfony/event-dispatcher/GenericEvent.php similarity index 81% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php rename to vendor/symfony/event-dispatcher/GenericEvent.php index a8955ca..e8e4cc0 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php +++ b/vendor/symfony/event-dispatcher/GenericEvent.php @@ -37,8 +37,8 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * Encapsulate an event with $subject and $args. * - * @param mixed $subject The subject of the event, usually an object. - * @param array $arguments Arguments to store in the event. + * @param mixed $subject The subject of the event, usually an object + * @param array $arguments Arguments to store in the event */ public function __construct($subject = null, array $arguments = array()) { @@ -49,7 +49,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * Getter for subject property. * - * @return mixed $subject The observer subject. + * @return mixed $subject The observer subject */ public function getSubject() { @@ -59,11 +59,11 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * Get argument by key. * - * @param string $key Key. + * @param string $key Key + * + * @return mixed Contents of array key * * @throws \InvalidArgumentException If key is not found. - * - * @return mixed Contents of array key. */ public function getArgument($key) { @@ -71,16 +71,16 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate return $this->arguments[$key]; } - throw new \InvalidArgumentException(sprintf('%s not found in %s', $key, $this->getName())); + throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key)); } /** * Add argument to event. * - * @param string $key Argument name. - * @param mixed $value Value. + * @param string $key Argument name + * @param mixed $value Value * - * @return GenericEvent + * @return $this */ public function setArgument($key, $value) { @@ -102,9 +102,9 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * Set args property. * - * @param array $args Arguments. + * @param array $args Arguments * - * @return GenericEvent + * @return $this */ public function setArguments(array $args = array()) { @@ -116,7 +116,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * Has argument. * - * @param string $key Key of arguments array. + * @param string $key Key of arguments array * * @return bool */ @@ -128,11 +128,11 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * ArrayAccess for argument getter. * - * @param string $key Array key. - * - * @throws \InvalidArgumentException If key does not exist in $this->args. + * @param string $key Array key * * @return mixed + * + * @throws \InvalidArgumentException If key does not exist in $this->args. */ public function offsetGet($key) { @@ -142,8 +142,8 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * ArrayAccess for argument setter. * - * @param string $key Array key to set. - * @param mixed $value Value. + * @param string $key Array key to set + * @param mixed $value Value */ public function offsetSet($key, $value) { @@ -153,7 +153,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * ArrayAccess for unset argument. * - * @param string $key Array key. + * @param string $key Array key */ public function offsetUnset($key) { @@ -165,7 +165,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate /** * ArrayAccess has argument. * - * @param string $key Array key. + * @param string $key Array key * * @return bool */ diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php b/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php similarity index 91% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php rename to vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php index 7ef9ece..7f2be8d 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php +++ b/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php @@ -28,7 +28,7 @@ class ImmutableEventDispatcher implements EventDispatcherInterface /** * Creates an unmodifiable proxy for an event dispatcher. * - * @param EventDispatcherInterface $dispatcher The proxied event dispatcher. + * @param EventDispatcherInterface $dispatcher The proxied event dispatcher */ public function __construct(EventDispatcherInterface $dispatcher) { @@ -83,6 +83,14 @@ class ImmutableEventDispatcher implements EventDispatcherInterface return $this->dispatcher->getListeners($eventName); } + /** + * {@inheritdoc} + */ + public function getListenerPriority($eventName, $listener) + { + return $this->dispatcher->getListenerPriority($eventName, $listener); + } + /** * {@inheritdoc} */ diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE b/vendor/symfony/event-dispatcher/LICENSE similarity index 96% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE rename to vendor/symfony/event-dispatcher/LICENSE index 43028bc..17d16a1 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE +++ b/vendor/symfony/event-dispatcher/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2015 Fabien Potencier +Copyright (c) 2004-2017 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/event-dispatcher/README.md b/vendor/symfony/event-dispatcher/README.md new file mode 100644 index 0000000..185c3fe --- /dev/null +++ b/vendor/symfony/event-dispatcher/README.md @@ -0,0 +1,15 @@ +EventDispatcher Component +========================= + +The EventDispatcher component provides tools that allow your application +components to communicate with each other by dispatching events and listening to +them. + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/event_dispatcher/index.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md deleted file mode 100644 index 8031f4d..0000000 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md +++ /dev/null @@ -1,27 +0,0 @@ -EventDispatcher Component -========================= - -The Symfony EventDispatcher component implements the Mediator pattern in a -simple and effective way to make your projects truly extensible. - -```php -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\EventDispatcher\Event; - -$dispatcher = new EventDispatcher(); - -$dispatcher->addListener('event_name', function (Event $event) { - // ... -}); - -$dispatcher->dispatch('event_name'); -``` - -Resources ---------- - -You can run the unit tests with the following command: - - $ cd path/to/Symfony/Component/EventDispatcher/ - $ composer install - $ phpunit diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php deleted file mode 100644 index 4bd2697..0000000 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\EventDispatcher\Tests; - -use Symfony\Component\EventDispatcher\Event; -use Symfony\Component\EventDispatcher\EventDispatcher; - -/** - * Test class for Event. - */ -class EventTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var \Symfony\Component\EventDispatcher\Event - */ - protected $event; - - /** - * @var \Symfony\Component\EventDispatcher\EventDispatcher - */ - protected $dispatcher; - - /** - * Sets up the fixture, for example, opens a network connection. - * This method is called before a test is executed. - */ - protected function setUp() - { - $this->event = new Event(); - $this->dispatcher = new EventDispatcher(); - } - - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown() - { - $this->event = null; - $this->dispatcher = null; - } - - public function testIsPropagationStopped() - { - $this->assertFalse($this->event->isPropagationStopped()); - } - - public function testStopPropagationAndIsPropagationStopped() - { - $this->event->stopPropagation(); - $this->assertTrue($this->event->isPropagationStopped()); - } - - /** - * @group legacy - */ - public function testLegacySetDispatcher() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->event->setDispatcher($this->dispatcher); - $this->assertSame($this->dispatcher, $this->event->getDispatcher()); - } - - /** - * @group legacy - */ - public function testLegacyGetDispatcher() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->assertNull($this->event->getDispatcher()); - } - - /** - * @group legacy - */ - public function testLegacyGetName() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->assertNull($this->event->getName()); - } - - /** - * @group legacy - */ - public function testLegacySetName() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->event->setName('foo'); - $this->assertEquals('foo', $this->event->getName()); - } -} diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php similarity index 77% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php rename to vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php index b9e4194..9443f21 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php +++ b/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php @@ -11,10 +11,12 @@ namespace Symfony\Component\EventDispatcher\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\Event; +use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase +abstract class AbstractEventDispatcherTest extends TestCase { /* Some pseudo events */ const preFoo = 'pre.foo'; @@ -54,6 +56,7 @@ abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase { $this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo')); $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo')); + $this->assertTrue($this->dispatcher->hasListeners()); $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); $this->assertTrue($this->dispatcher->hasListeners(self::postFoo)); $this->assertCount(1, $this->dispatcher->getListeners(self::preFoo)); @@ -107,6 +110,20 @@ abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertSame($expected, $this->dispatcher->getListeners()); } + public function testGetListenerPriority() + { + $listener1 = new TestEventListener(); + $listener2 = new TestEventListener(); + + $this->dispatcher->addListener('pre.foo', $listener1, -10); + $this->dispatcher->addListener('pre.foo', $listener2); + + $this->assertSame(-10, $this->dispatcher->getListenerPriority('pre.foo', $listener1)); + $this->assertSame(0, $this->dispatcher->getListenerPriority('pre.foo', $listener2)); + $this->assertNull($this->dispatcher->getListenerPriority('pre.bar', $listener2)); + $this->assertNull($this->dispatcher->getListenerPriority('pre.foo', function () {})); + } + public function testDispatch() { $this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo')); @@ -118,7 +135,6 @@ abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch(self::preFoo)); $event = new Event(); $return = $this->dispatcher->dispatch(self::preFoo, $event); - $this->assertEquals('pre.foo', $event->getName()); $this->assertSame($event, $return); } @@ -126,7 +142,7 @@ abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase { $invoked = 0; $listener = function () use (&$invoked) { - $invoked++; + ++$invoked; }; $this->dispatcher->addListener('pre.foo', $listener); $this->dispatcher->addListener('post.foo', $listener); @@ -239,16 +255,6 @@ abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertFalse($this->dispatcher->hasListeners(self::preFoo)); } - public function testEventReceivesTheDispatcherInstance() - { - $dispatcher = null; - $this->dispatcher->addListener('test', function ($event) use (&$dispatcher) { - $dispatcher = $event->getDispatcher(); - }); - $this->dispatcher->dispatch('test'); - $this->assertSame($this->dispatcher, $dispatcher); - } - public function testEventReceivesTheDispatcherInstanceAsArgument() { $listener = new TestWithDispatcher(); @@ -297,6 +303,73 @@ abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertFalse($this->dispatcher->hasListeners('foo')); $this->assertFalse($this->dispatcher->hasListeners()); } + + public function testHasListenersIsLazy() + { + $called = 0; + $listener = array(function () use (&$called) { ++$called; }, 'onFoo'); + $this->dispatcher->addListener('foo', $listener); + $this->assertTrue($this->dispatcher->hasListeners()); + $this->assertTrue($this->dispatcher->hasListeners('foo')); + $this->assertSame(0, $called); + } + + public function testDispatchLazyListener() + { + $called = 0; + $factory = function () use (&$called) { + ++$called; + + return new TestWithDispatcher(); + }; + $this->dispatcher->addListener('foo', array($factory, 'foo')); + $this->assertSame(0, $called); + $this->dispatcher->dispatch('foo', new Event()); + $this->dispatcher->dispatch('foo', new Event()); + $this->assertSame(1, $called); + } + + public function testRemoveFindsLazyListeners() + { + $test = new TestWithDispatcher(); + $factory = function () use ($test) { return $test; }; + + $this->dispatcher->addListener('foo', array($factory, 'foo')); + $this->assertTrue($this->dispatcher->hasListeners('foo')); + $this->dispatcher->removeListener('foo', array($test, 'foo')); + $this->assertFalse($this->dispatcher->hasListeners('foo')); + + $this->dispatcher->addListener('foo', array($test, 'foo')); + $this->assertTrue($this->dispatcher->hasListeners('foo')); + $this->dispatcher->removeListener('foo', array($factory, 'foo')); + $this->assertFalse($this->dispatcher->hasListeners('foo')); + } + + public function testPriorityFindsLazyListeners() + { + $test = new TestWithDispatcher(); + $factory = function () use ($test) { return $test; }; + + $this->dispatcher->addListener('foo', array($factory, 'foo'), 3); + $this->assertSame(3, $this->dispatcher->getListenerPriority('foo', array($test, 'foo'))); + $this->dispatcher->removeListener('foo', array($factory, 'foo')); + + $this->dispatcher->addListener('foo', array($test, 'foo'), 5); + $this->assertSame(5, $this->dispatcher->getListenerPriority('foo', array($factory, 'foo'))); + } + + public function testGetLazyListeners() + { + $test = new TestWithDispatcher(); + $factory = function () use ($test) { return $test; }; + + $this->dispatcher->addListener('foo', array($factory, 'foo'), 3); + $this->assertSame(array(array($test, 'foo')), $this->dispatcher->getListeners('foo')); + + $this->dispatcher->removeListener('foo', array($test, 'foo')); + $this->dispatcher->addListener('bar', array($factory, 'foo'), 3); + $this->assertSame(array('bar' => array(array($test, 'foo'))), $this->dispatcher->getListeners()); + } } class CallableClass diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/ContainerAwareEventDispatcherTest.php similarity index 66% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php rename to vendor/symfony/event-dispatcher/Tests/ContainerAwareEventDispatcherTest.php index 6f2fbcb..1805561 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php +++ b/vendor/symfony/event-dispatcher/Tests/ContainerAwareEventDispatcherTest.php @@ -12,11 +12,13 @@ namespace Symfony\Component\EventDispatcher\Tests; use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\Scope; use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +/** + * @group legacy + */ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest { protected function createEventDispatcher() @@ -30,7 +32,7 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest { $event = new Event(); - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); + $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock(); $service ->expects($this->once()) @@ -51,7 +53,7 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest { $event = new Event(); - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\SubscriberService'); + $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\SubscriberService')->getMock(); $service ->expects($this->once()) @@ -59,6 +61,18 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest ->with($event) ; + $service + ->expects($this->once()) + ->method('onEventWithPriority') + ->with($event) + ; + + $service + ->expects($this->once()) + ->method('onEventNested') + ->with($event) + ; + $container = new Container(); $container->set('service.subscriber', $service); @@ -66,13 +80,15 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest $dispatcher->addSubscriberService('service.subscriber', 'Symfony\Component\EventDispatcher\Tests\SubscriberService'); $dispatcher->dispatch('onEvent', $event); + $dispatcher->dispatch('onEventWithPriority', $event); + $dispatcher->dispatch('onEventNested', $event); } public function testPreventDuplicateListenerService() { $event = new Event(); - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); + $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock(); $service ->expects($this->once()) @@ -90,73 +106,11 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest $dispatcher->dispatch('onEvent', $event); } - /** - * @expectedException \InvalidArgumentException - */ - public function testTriggerAListenerServiceOutOfScope() - { - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); - - $scope = new Scope('scope'); - $container = new Container(); - $container->addScope($scope); - $container->enterScope('scope'); - - $container->set('service.listener', $service, 'scope'); - - $dispatcher = new ContainerAwareEventDispatcher($container); - $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent')); - - $container->leaveScope('scope'); - $dispatcher->dispatch('onEvent'); - } - - public function testReEnteringAScope() - { - $event = new Event(); - - $service1 = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); - - $service1 - ->expects($this->exactly(2)) - ->method('onEvent') - ->with($event) - ; - - $scope = new Scope('scope'); - $container = new Container(); - $container->addScope($scope); - $container->enterScope('scope'); - - $container->set('service.listener', $service1, 'scope'); - - $dispatcher = new ContainerAwareEventDispatcher($container); - $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent')); - $dispatcher->dispatch('onEvent', $event); - - $service2 = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); - - $service2 - ->expects($this->once()) - ->method('onEvent') - ->with($event) - ; - - $container->enterScope('scope'); - $container->set('service.listener', $service2, 'scope'); - - $dispatcher->dispatch('onEvent', $event); - - $container->leaveScope('scope'); - - $dispatcher->dispatch('onEvent'); - } - public function testHasListenersOnLazyLoad() { $event = new Event(); - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); + $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock(); $container = new Container(); $container->set('service.listener', $service); @@ -164,9 +118,6 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest $dispatcher = new ContainerAwareEventDispatcher($container); $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent')); - $event->setDispatcher($dispatcher); - $event->setName('onEvent'); - $service ->expects($this->once()) ->method('onEvent') @@ -182,7 +133,7 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest public function testGetListenersOnLazyLoad() { - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); + $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock(); $container = new Container(); $container->set('service.listener', $service); @@ -199,7 +150,7 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest public function testRemoveAfterDispatch() { - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); + $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock(); $container = new Container(); $container->set('service.listener', $service); @@ -214,7 +165,7 @@ class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest public function testRemoveBeforeDispatch() { - $service = $this->getMock('Symfony\Component\EventDispatcher\Tests\Service'); + $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock(); $container = new Container(); $container->set('service.listener', $service); @@ -239,11 +190,21 @@ class SubscriberService implements EventSubscriberInterface public static function getSubscribedEvents() { return array( - 'onEvent' => array('onEvent'), + 'onEvent' => 'onEvent', + 'onEventWithPriority' => array('onEventWithPriority', 10), + 'onEventNested' => array(array('onEventNested')), ); } public function onEvent(Event $e) { } + + public function onEventWithPriority(Event $e) + { + } + + public function onEventNested(Event $e) + { + } } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php similarity index 58% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php rename to vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php index 68b9523..a1cf670 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php +++ b/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php @@ -11,20 +11,22 @@ namespace Symfony\Component\EventDispatcher\Tests\Debug; +use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\Stopwatch\Stopwatch; -class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase +class TraceableEventDispatcherTest extends TestCase { public function testAddRemoveListener() { $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () {}); $listeners = $dispatcher->getListeners('foo'); $this->assertCount(1, $listeners); $this->assertSame($listener, $listeners[0]); @@ -38,7 +40,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () {}); $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo')); } @@ -50,11 +52,42 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertFalse($dispatcher->hasListeners('foo')); $this->assertFalse($tdispatcher->hasListeners('foo')); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () {}); $this->assertTrue($dispatcher->hasListeners('foo')); $this->assertTrue($tdispatcher->hasListeners('foo')); } + public function testGetListenerPriority() + { + $dispatcher = new EventDispatcher(); + $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); + + $tdispatcher->addListener('foo', function () {}, 123); + + $listeners = $dispatcher->getListeners('foo'); + $this->assertSame(123, $tdispatcher->getListenerPriority('foo', $listeners[0])); + + // Verify that priority is preserved when listener is removed and re-added + // in preProcess() and postProcess(). + $tdispatcher->dispatch('foo', new Event()); + $listeners = $dispatcher->getListeners('foo'); + $this->assertSame(123, $tdispatcher->getListenerPriority('foo', $listeners[0])); + } + + public function testGetListenerPriorityWhileDispatching() + { + $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); + $priorityWhileDispatching = null; + + $listener = function () use ($tdispatcher, &$priorityWhileDispatching, &$listener) { + $priorityWhileDispatching = $tdispatcher->getListenerPriority('bar', $listener); + }; + + $tdispatcher->addListener('bar', $listener, 5); + $tdispatcher->dispatch('bar'); + $this->assertSame(5, $priorityWhileDispatching); + } + public function testAddRemoveSubscriber() { $dispatcher = new EventDispatcher(); @@ -73,16 +106,21 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase public function testGetCalledListeners() { - $dispatcher = new EventDispatcher(); - $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); + $tdispatcher->addListener('foo', function () {}, 5); + $listeners = $tdispatcher->getNotCalledListeners(); + $this->assertArrayHasKey('stub', $listeners['foo.closure']); + unset($listeners['foo.closure']['stub']); $this->assertEquals(array(), $tdispatcher->getCalledListeners()); - $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'type' => 'Closure', 'pretty' => 'closure')), $tdispatcher->getNotCalledListeners()); + $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); $tdispatcher->dispatch('foo'); - $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'type' => 'Closure', 'pretty' => 'closure')), $tdispatcher->getCalledListeners()); + $listeners = $tdispatcher->getCalledListeners(); + $this->assertArrayHasKey('stub', $listeners['foo.closure']); + unset($listeners['foo.closure']['stub']); + $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); $this->assertEquals(array(), $tdispatcher->getNotCalledListeners()); } @@ -102,31 +140,31 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase public function testLogger() { - $logger = $this->getMock('Psr\Log\LoggerInterface'); + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); - $tdispatcher->addListener('foo', $listener1 = function () {; }); - $tdispatcher->addListener('foo', $listener2 = function () {; }); + $tdispatcher->addListener('foo', $listener1 = function () {}); + $tdispatcher->addListener('foo', $listener2 = function () {}); - $logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); - $logger->expects($this->at(1))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); + $logger->expects($this->at(0))->method('debug')->with('Notified event "{event}" to listener "{listener}".', array('event' => 'foo', 'listener' => 'closure')); + $logger->expects($this->at(1))->method('debug')->with('Notified event "{event}" to listener "{listener}".', array('event' => 'foo', 'listener' => 'closure')); $tdispatcher->dispatch('foo'); } public function testLoggerWithStoppedEvent() { - $logger = $this->getMock('Psr\Log\LoggerInterface'); + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); }); - $tdispatcher->addListener('foo', $listener2 = function () {; }); + $tdispatcher->addListener('foo', $listener2 = function () {}); - $logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); - $logger->expects($this->at(1))->method('debug')->with("Listener \"closure\" stopped propagation of the event \"foo\"."); - $logger->expects($this->at(2))->method('debug')->with("Listener \"closure\" was not called for event \"foo\"."); + $logger->expects($this->at(0))->method('debug')->with('Notified event "{event}" to listener "{listener}".', array('event' => 'foo', 'listener' => 'closure')); + $logger->expects($this->at(1))->method('debug')->with('Listener "{listener}" stopped propagation of the event "{event}".', array('event' => 'foo', 'listener' => 'closure')); + $logger->expects($this->at(2))->method('debug')->with('Listener "{listener}" was not called for event "{event}".', array('event' => 'foo', 'listener' => 'closure')); $tdispatcher->dispatch('foo'); } @@ -137,26 +175,32 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener1 = function () use (&$called) { $called[] = 'foo1'; }); - $tdispatcher->addListener('foo', $listener2 = function () use (&$called) { $called[] = 'foo2'; }); + $tdispatcher->addListener('foo', function () use (&$called) { $called[] = 'foo1'; }, 10); + $tdispatcher->addListener('foo', function () use (&$called) { $called[] = 'foo2'; }, 20); $tdispatcher->dispatch('foo'); - $this->assertEquals(array('foo1', 'foo2'), $called); + $this->assertSame(array('foo2', 'foo1'), $called); } public function testDispatchNested() { $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); $loop = 1; + $dispatchedEvents = 0; $dispatcher->addListener('foo', $listener1 = function () use ($dispatcher, &$loop) { ++$loop; if (2 == $loop) { $dispatcher->dispatch('foo'); } }); + $dispatcher->addListener('foo', function () use (&$dispatchedEvents) { + ++$dispatchedEvents; + }); $dispatcher->dispatch('foo'); + + $this->assertSame(2, $dispatchedEvents); } public function testDispatchReusedEventNested() @@ -174,6 +218,19 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher->dispatch('foo'); $this->assertTrue($nestedCall); } + + public function testListenerCanRemoveItselfWhenExecuted() + { + $eventDispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); + $listener1 = function ($event, $eventName, EventDispatcherInterface $dispatcher) use (&$listener1) { + $dispatcher->removeListener('foo', $listener1); + }; + $eventDispatcher->addListener('foo', $listener1); + $eventDispatcher->addListener('foo', function () {}); + $eventDispatcher->dispatch('foo'); + + $this->assertCount(1, $eventDispatcher->getListeners('foo'), 'expected listener1 to be removed'); + } } class EventSubscriber implements EventSubscriberInterface diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php b/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php similarity index 66% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php rename to vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php index 0fdd637..d46d8c5 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php +++ b/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php @@ -11,10 +11,13 @@ namespace Symfony\Component\EventDispatcher\Tests\DependencyInjection; +use PHPUnit\Framework\TestCase; +use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass; -class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase +class RegisterListenersPassTest extends TestCase { /** * Tests that event subscribers not implementing EventSubscriberInterface @@ -29,18 +32,12 @@ class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase 'my_event_subscriber' => array(0 => array()), ); - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $definition->expects($this->atLeastOnce()) - ->method('isPublic') - ->will($this->returnValue(true)); + $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock(); $definition->expects($this->atLeastOnce()) ->method('getClass') ->will($this->returnValue('stdClass')); - $builder = $this->getMock( - 'Symfony\Component\DependencyInjection\ContainerBuilder', - array('hasDefinition', 'findTaggedServiceIds', 'getDefinition') - ); + $builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock(); $builder->expects($this->any()) ->method('hasDefinition') ->will($this->returnValue(true)); @@ -64,18 +61,12 @@ class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase 'my_event_subscriber' => array(0 => array()), ); - $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); - $definition->expects($this->atLeastOnce()) - ->method('isPublic') - ->will($this->returnValue(true)); + $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock(); $definition->expects($this->atLeastOnce()) ->method('getClass') ->will($this->returnValue('Symfony\Component\EventDispatcher\Tests\DependencyInjection\SubscriberService')); - $builder = $this->getMock( - 'Symfony\Component\DependencyInjection\ContainerBuilder', - array('hasDefinition', 'findTaggedServiceIds', 'getDefinition', 'findDefinition') - ); + $builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition', 'findDefinition'))->getMock(); $builder->expects($this->any()) ->method('hasDefinition') ->will($this->returnValue(true)); @@ -99,35 +90,7 @@ class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase /** * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The service "foo" must be public as event listeners are lazy-loaded. - */ - public function testPrivateEventListener() - { - $container = new ContainerBuilder(); - $container->register('foo', 'stdClass')->setPublic(false)->addTag('kernel.event_listener', array()); - $container->register('event_dispatcher', 'stdClass'); - - $registerListenersPass = new RegisterListenersPass(); - $registerListenersPass->process($container); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The service "foo" must be public as event subscribers are lazy-loaded. - */ - public function testPrivateEventSubscriber() - { - $container = new ContainerBuilder(); - $container->register('foo', 'stdClass')->setPublic(false)->addTag('kernel.event_subscriber', array()); - $container->register('event_dispatcher', 'stdClass'); - - $registerListenersPass = new RegisterListenersPass(); - $registerListenersPass->process($container); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The service "foo" must not be abstract as event listeners are lazy-loaded. + * @expectedExceptionMessage The service "foo" tagged "kernel.event_listener" must not be abstract. */ public function testAbstractEventListener() { @@ -141,7 +104,7 @@ class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase /** * @expectedException \InvalidArgumentException - * @expectedExceptionMessage The service "foo" must not be abstract as event subscribers are lazy-loaded. + * @expectedExceptionMessage The service "foo" tagged "kernel.event_subscriber" must not be abstract. */ public function testAbstractEventSubscriber() { @@ -165,16 +128,17 @@ class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase $registerListenersPass->process($container); $definition = $container->getDefinition('event_dispatcher'); - $expected_calls = array( + $expectedCalls = array( array( - 'addSubscriberService', + 'addListener', array( - 'foo', - 'Symfony\Component\EventDispatcher\Tests\DependencyInjection\SubscriberService', + 'event', + array(new ServiceClosureArgument(new Reference('foo')), 'onEvent'), + 0, ), ), ); - $this->assertSame($expected_calls, $definition->getMethodCalls()); + $this->assertEquals($expectedCalls, $definition->getMethodCalls()); } /** @@ -196,5 +160,8 @@ class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubsc { public static function getSubscribedEvents() { + return array( + 'event' => 'onEvent', + ); } } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php similarity index 100% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php rename to vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php diff --git a/vendor/symfony/event-dispatcher/Tests/EventTest.php b/vendor/symfony/event-dispatcher/Tests/EventTest.php new file mode 100644 index 0000000..5be2ea0 --- /dev/null +++ b/vendor/symfony/event-dispatcher/Tests/EventTest.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\EventDispatcher\Tests; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\EventDispatcher\Event; + +/** + * Test class for Event. + */ +class EventTest extends TestCase +{ + /** + * @var \Symfony\Component\EventDispatcher\Event + */ + protected $event; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() + { + $this->event = new Event(); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + $this->event = null; + } + + public function testIsPropagationStopped() + { + $this->assertFalse($this->event->isPropagationStopped()); + } + + public function testStopPropagationAndIsPropagationStopped() + { + $this->event->stopPropagation(); + $this->assertTrue($this->event->isPropagationStopped()); + } +} diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php b/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php similarity index 94% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php rename to vendor/symfony/event-dispatcher/Tests/GenericEventTest.php index aebd82d..c84d3ac 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php +++ b/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php @@ -11,12 +11,13 @@ namespace Symfony\Component\EventDispatcher\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\GenericEvent; /** * Test class for Event. */ -class GenericEventTest extends \PHPUnit_Framework_TestCase +class GenericEventTest extends TestCase { /** * @var GenericEvent @@ -95,7 +96,7 @@ class GenericEventTest extends \PHPUnit_Framework_TestCase $this->assertEquals('Event', $this->event['name']); // test getting invalid arg - $this->setExpectedException('InvalidArgumentException'); + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException'); $this->assertFalse($this->event['nameNotExist']); } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ImmutableEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php similarity index 84% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ImmutableEventDispatcherTest.php rename to vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php index 80a7e43..04f2861 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ImmutableEventDispatcherTest.php +++ b/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php @@ -11,13 +11,14 @@ namespace Symfony\Component\EventDispatcher\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\ImmutableEventDispatcher; /** * @author Bernhard Schussek */ -class ImmutableEventDispatcherTest extends \PHPUnit_Framework_TestCase +class ImmutableEventDispatcherTest extends TestCase { /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -31,7 +32,7 @@ class ImmutableEventDispatcherTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->innerDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->innerDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock(); $this->dispatcher = new ImmutableEventDispatcher($this->innerDispatcher); } @@ -80,7 +81,7 @@ class ImmutableEventDispatcherTest extends \PHPUnit_Framework_TestCase */ public function testAddSubscriberDisallowed() { - $subscriber = $this->getMock('Symfony\Component\EventDispatcher\EventSubscriberInterface'); + $subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock(); $this->dispatcher->addSubscriber($subscriber); } @@ -98,7 +99,7 @@ class ImmutableEventDispatcherTest extends \PHPUnit_Framework_TestCase */ public function testRemoveSubscriberDisallowed() { - $subscriber = $this->getMock('Symfony\Component\EventDispatcher\EventSubscriberInterface'); + $subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock(); $this->dispatcher->removeSubscriber($subscriber); } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json b/vendor/symfony/event-dispatcher/composer.json similarity index 54% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json rename to vendor/symfony/event-dispatcher/composer.json index a516d46..faa0429 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json +++ b/vendor/symfony/event-dispatcher/composer.json @@ -3,7 +3,7 @@ "type": "library", "description": "Symfony EventDispatcher Component", "keywords": [], - "homepage": "http://symfony.com", + "homepage": "https://symfony.com", "license": "MIT", "authors": [ { @@ -12,32 +12,36 @@ }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.9" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/config": "~2.0,>=2.0.5", - "symfony/stopwatch": "~2.3", + "symfony/dependency-injection": "~3.3", + "symfony/expression-language": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0", "psr/log": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "suggest": { "symfony/dependency-injection": "", "symfony/http-kernel": "" }, "autoload": { - "psr-0": { "Symfony\\Component\\EventDispatcher\\": "" } + "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] }, - "target-dir": "Symfony/Component/EventDispatcher", "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "3.3-dev" } } } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist b/vendor/symfony/event-dispatcher/phpunit.xml.dist similarity index 93% rename from vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist rename to vendor/symfony/event-dispatcher/phpunit.xml.dist index b14fde5..b3ad1bd 100644 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist +++ b/vendor/symfony/event-dispatcher/phpunit.xml.dist @@ -5,10 +5,13 @@ backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" + failOnRisky="true" + failOnWarning="true" > + ./Tests/