Changeset 1098219
- Timestamp:
- 02/24/2015 03:33:12 PM (11 years ago)
- Location:
- mgrt/trunk
- Files:
-
- 1 added
- 6 deleted
- 45 edited
-
Mgrt/Wordpress/Sync/ImportSyncProcessor.php (modified) (2 diffs)
-
Mgrt/Wordpress/View/Start.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (3 diffs)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/composer/installed.json (modified) (7 diffs)
-
vendor/guzzle/guzzle/.gitignore (deleted)
-
vendor/guzzle/guzzle/.travis.yml (deleted)
-
vendor/mgrt/mgrt-php/.gitignore (deleted)
-
vendor/mgrt/mgrt-php/.travis.yml (deleted)
-
vendor/mgrt/mgrt-php/src/Mgrt/Model/WebhookCallInput.php (modified) (4 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore (deleted)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php (modified) (9 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php (modified) (4 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/WrappedListener.php (modified) (2 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php (modified) (5 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php (modified) (8 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php (modified) (2 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php (added)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php (modified) (2 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php (modified) (1 diff)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json (modified) (2 diffs)
-
vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/.gitignore (deleted)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php (modified) (2 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php (modified) (3 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php (modified) (5 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php (modified) (11 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php (modified) (23 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/README.md (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php (modified) (2 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml (modified) (3 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php (modified) (4 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php (modified) (3 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php (modified) (4 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php (modified) (2 diffs)
-
vendor/symfony/yaml/Symfony/Component/Yaml/composer.json (modified) (1 diff)
-
vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mgrt/trunk/Mgrt/Wordpress/Sync/ImportSyncProcessor.php
r988019 r1098219 70 70 } 71 71 72 if ($contact->getEmail() == 'alexandre@yzalis.com') {73 return $wp_id;74 }75 72 if ($wp_id == 0) { 76 73 return false; … … 97 94 $user_meta['basic']['ID'] = $wp_id; 98 95 99 foreach ($user_meta['custom'] as $meta_key => $meta_value) { 100 $this->getDataManager()->insertOrUpdateCustomField($wp_id, $meta_key, $meta_value); 96 if (!empty($user_meta['custom'])) { 97 foreach ($user_meta['custom'] as $meta_key => $meta_value) { 98 $this->getDataManager()->insertOrUpdateCustomField($wp_id, $meta_key, $meta_value); 99 } 101 100 } 102 101 -
mgrt/trunk/Mgrt/Wordpress/View/Start.php
r1014718 r1098219 141 141 { 142 142 $webhooks = $this->getDataManager()->makeApiCall('getWebhooks'); 143 $seek_url = site_url() . '/?webhook';143 $seek_url = get_home_url() . '/?webhook'; 144 144 $require_events = $this->getSyncManager()->getListenedEvents(); 145 145 $require_sources = $this->getSyncManager()->getListenedSources(); -
mgrt/trunk/readme.txt
r1014718 r1098219 27 27 28 28 == Changelog == 29 1.1.3 Fixed webhook url 30 29 31 1.1.2 Fixed problems with forced sync 30 32 -
mgrt/trunk/vendor/autoload.php
r1014718 r1098219 5 5 require_once __DIR__ . '/composer' . '/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 4b969deb73820b2beb3fdade65609360::getLoader();7 return ComposerAutoloaderInite21f9a30a804b41259f1bea07d031610::getLoader(); -
mgrt/trunk/vendor/composer/ClassLoader.php
r986149 r1098219 55 55 private $classMap = array(); 56 56 57 private $classMapAuthoritative = false; 58 57 59 public function getPrefixes() 58 60 { 59 return call_user_func_array('array_merge', $this->prefixesPsr0); 61 if (!empty($this->prefixesPsr0)) { 62 return call_user_func_array('array_merge', $this->prefixesPsr0); 63 } 64 65 return array(); 60 66 } 61 67 … … 246 252 247 253 /** 254 * Turns off searching the prefix and fallback directories for classes 255 * that have not been registered with the class map. 256 * 257 * @param bool $classMapAuthoritative 258 */ 259 public function setClassMapAuthoritative($classMapAuthoritative) 260 { 261 $this->classMapAuthoritative = $classMapAuthoritative; 262 } 263 264 /** 265 * Should class lookup fail if not found in the current class map? 266 * 267 * @return bool 268 */ 269 public function isClassMapAuthoritative() 270 { 271 return $this->classMapAuthoritative; 272 } 273 274 /** 248 275 * Registers this instance as an autoloader. 249 276 * … … 295 322 if (isset($this->classMap[$class])) { 296 323 return $this->classMap[$class]; 324 } 325 if ($this->classMapAuthoritative) { 326 return false; 297 327 } 298 328 -
mgrt/trunk/vendor/composer/autoload_real.php
r1014718 r1098219 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 4b969deb73820b2beb3fdade656093605 class ComposerAutoloaderInite21f9a30a804b41259f1bea07d031610 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit 4b969deb73820b2beb3fdade65609360', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInite21f9a30a804b41259f1bea07d031610', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit 4b969deb73820b2beb3fdade65609360', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInite21f9a30a804b41259f1bea07d031610', 'loadClassLoader')); 25 25 26 26 $map = require __DIR__ . '/autoload_namespaces.php'; … … 45 45 } 46 46 47 function composerRequire 4b969deb73820b2beb3fdade65609360($file)47 function composerRequiree21f9a30a804b41259f1bea07d031610($file) 48 48 { 49 49 require $file; -
mgrt/trunk/vendor/composer/installed.json
r1014718 r1098219 2 2 { 3 3 "name": "symfony/yaml", 4 "version": "v2. 5.6",5 "version_normalized": "2. 5.6.0",4 "version": "v2.6.4", 5 "version_normalized": "2.6.4.0", 6 6 "target-dir": "Symfony/Component/Yaml", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/symfony/Yaml.git", 10 "reference": " 2d9f527449cabfa8543dd7fa3a466d6ae83d6726"11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/symfony/Yaml/zipball/ 2d9f527449cabfa8543dd7fa3a466d6ae83d6726",15 "reference": " 2d9f527449cabfa8543dd7fa3a466d6ae83d6726",10 "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" 11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", 15 "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", 16 16 "shasum": "" 17 17 }, … … 19 19 "php": ">=5.3.3" 20 20 }, 21 "time": "201 4-10-01 05:50:18",21 "time": "2015-01-25 04:39:26", 22 22 "type": "library", 23 23 "extra": { 24 24 "branch-alias": { 25 "dev-master": "2. 5-dev"25 "dev-master": "2.6-dev" 26 26 } 27 27 }, … … 117 117 { 118 118 "name": "symfony/event-dispatcher", 119 "version": "v2. 5.6",120 "version_normalized": "2. 5.6.0",119 "version": "v2.6.4", 120 "version_normalized": "2.6.4.0", 121 121 "target-dir": "Symfony/Component/EventDispatcher", 122 122 "source": { 123 123 "type": "git", 124 124 "url": "https://github.com/symfony/EventDispatcher.git", 125 "reference": " 804eb28dbbfba9ffdab21fe2066744906cea2212"126 }, 127 "dist": { 128 "type": "zip", 129 "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/ 804eb28dbbfba9ffdab21fe2066744906cea2212",130 "reference": " 804eb28dbbfba9ffdab21fe2066744906cea2212",125 "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813" 126 }, 127 "dist": { 128 "type": "zip", 129 "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f75989f3ab2743a82fe0b03ded2598a2b1546813", 130 "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813", 131 131 "shasum": "" 132 132 }, … … 136 136 "require-dev": { 137 137 "psr/log": "~1.0", 138 "symfony/config": "~2.0", 139 "symfony/dependency-injection": "~2.0,<2.6.0", 140 "symfony/stopwatch": "~2.2" 138 "symfony/config": "~2.0,>=2.0.5", 139 "symfony/dependency-injection": "~2.6", 140 "symfony/expression-language": "~2.6", 141 "symfony/stopwatch": "~2.3" 141 142 }, 142 143 "suggest": { … … 144 145 "symfony/http-kernel": "" 145 146 }, 146 "time": "201 4-10-01 15:43:05",147 "time": "2015-02-01 16:10:57", 147 148 "type": "library", 148 149 "extra": { 149 150 "branch-alias": { 150 "dev-master": "2. 5-dev"151 "dev-master": "2.6-dev" 151 152 } 152 153 }, … … 270 271 { 271 272 "name": "mgrt/mgrt-php", 272 "version": "2.1. 0",273 "version_normalized": "2.1. 0.0",273 "version": "2.1.1", 274 "version_normalized": "2.1.1.0", 274 275 "source": { 275 276 "type": "git", 276 277 "url": "https://github.com/mgrt/mgrt-php.git", 277 "reference": " b2e9da3d5e6193d93ceedca2330cc6cf3d592fb5"278 }, 279 "dist": { 280 "type": "zip", 281 "url": "https://api.github.com/repos/mgrt/mgrt-php/zipball/ b2e9da3d5e6193d93ceedca2330cc6cf3d592fb5",282 "reference": " b2e9da3d5e6193d93ceedca2330cc6cf3d592fb5",278 "reference": "4cc755e42c854d4342980453e2a3d29117f0b06d" 279 }, 280 "dist": { 281 "type": "zip", 282 "url": "https://api.github.com/repos/mgrt/mgrt-php/zipball/4cc755e42c854d4342980453e2a3d29117f0b06d", 283 "reference": "4cc755e42c854d4342980453e2a3d29117f0b06d", 283 284 "shasum": "" 284 285 }, … … 289 290 "symfony/yaml": "~2.1" 290 291 }, 291 "time": "2014-1 0-02 14:33:25",292 "time": "2014-11-04 10:25:44", 292 293 "type": "library", 293 294 "extra": { -
mgrt/trunk/vendor/mgrt/mgrt-php/src/Mgrt/Model/WebhookCallInput.php
r986149 r1098219 13 13 protected $event; 14 14 protected $event_name; 15 protected $event_type; 15 16 protected $source; 16 17 protected $payload; 17 18 protected $valid; 18 19 protected $secret_key; 20 protected $is_test = false; 19 21 20 22 public function fromInputs($input = null) … … 42 44 if ($parsedBody['payload'] == 'Hello World!') { 43 45 // this request is a test call; exit now 44 exit(); 46 $is_test = true; 47 48 return $this->fromArray(compact('id', 'signature', 'valid', 'is_test')); 45 49 } 46 50 … … 54 58 $exp = explode('.', $event, 2); 55 59 60 $event_type = Inflector::camelize($exp[0]); 56 61 $event_name = Inflector::camelize('on_'.$exp[1]); 57 62 … … 61 66 $payload = $result->fromArrayWithObject($parsedBody['payload'], $objectName); 62 67 63 return $this->fromArray(compact('id', 'signature', 'event', 'event_ name', 'source', 'payload', 'valid'));68 return $this->fromArray(compact('id', 'signature', 'event', 'event_type', 'event_name', 'source', 'payload', 'valid')); 64 69 } 65 70 -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
r986149 r1098219 16 16 /** 17 17 * Lazily loads listeners and subscribers from the dependency injection 18 * container 18 * container. 19 19 * 20 20 * @author Fabien Potencier <fabien@symfony.com> … … 25 25 { 26 26 /** 27 * The container from where services are loaded 27 * The container from where services are loaded. 28 * 28 29 * @var ContainerInterface 29 30 */ … … 31 32 32 33 /** 33 * The service IDs of the event listeners and subscribers 34 * The service IDs of the event listeners and subscribers. 35 * 34 36 * @var array 35 37 */ … … 37 39 38 40 /** 39 * The services registered as listeners 41 * The services registered as listeners. 42 * 40 43 * @var array 41 44 */ … … 53 56 54 57 /** 55 * Adds a service as event listener 58 * Adds a service as event listener. 56 59 * 57 60 * @param string $eventName Event for which the listener is added 58 61 * @param array $callback The service ID of the listener service & the method 59 * name that has to be called60 * @param int $priorityThe higher this value, the earlier an event listener61 * will be triggered in the chain.62 * Defaults to 0.62 * name that has to be called 63 * @param int $priority The higher this value, the earlier an event listener 64 * will be triggered in the chain. 65 * Defaults to 0. 63 66 * 64 67 * @throws \InvalidArgumentException … … 77 80 $this->lazyLoad($eventName); 78 81 79 if (isset($this->listeners[$eventName])) { 80 foreach ($this->listeners[$eventName] as $key => $l) { 81 foreach ($this->listenerIds[$eventName] as $i => $args) { 82 list($serviceId, $method, $priority) = $args; 83 if ($key === $serviceId.'.'.$method) { 84 if ($listener === array($l, $method)) { 85 unset($this->listeners[$eventName][$key]); 86 if (empty($this->listeners[$eventName])) { 87 unset($this->listeners[$eventName]); 88 } 89 unset($this->listenerIds[$eventName][$i]); 90 if (empty($this->listenerIds[$eventName])) { 91 unset($this->listenerIds[$eventName]); 92 } 93 } 82 if (isset($this->listenerIds[$eventName])) { 83 foreach ($this->listenerIds[$eventName] as $i => $args) { 84 list($serviceId, $method, $priority) = $args; 85 $key = $serviceId.'.'.$method; 86 if (isset($this->listeners[$eventName][$key]) && $listener === array($this->listeners[$eventName][$key], $method)) { 87 unset($this->listeners[$eventName][$key]); 88 if (empty($this->listeners[$eventName])) { 89 unset($this->listeners[$eventName]); 90 } 91 unset($this->listenerIds[$eventName][$i]); 92 if (empty($this->listenerIds[$eventName])) { 93 unset($this->listenerIds[$eventName]); 94 94 } 95 95 } … … 101 101 102 102 /** 103 * @see EventDispatcherInterface::hasListeners 103 * @see EventDispatcherInterface::hasListeners() 104 104 */ 105 105 public function hasListeners($eventName = null) … … 117 117 118 118 /** 119 * @see EventDispatcherInterface::getListeners 119 * @see EventDispatcherInterface::getListeners() 120 120 */ 121 121 public function getListeners($eventName = null) … … 133 133 134 134 /** 135 * Adds a service as event subscriber 135 * Adds a service as event subscriber. 136 136 * 137 137 * @param string $serviceId The service ID of the subscriber service -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
r1000678 r1098219 217 217 $info = $this->getListenerInfo($listener, $eventName); 218 218 $name = isset($info['class']) ? $info['class'] : $info['type']; 219 $this->dispatcher->addListener($eventName, new WrappedListener($listener, $name, $this->stopwatch ));219 $this->dispatcher->addListener($eventName, new WrappedListener($listener, $name, $this->stopwatch, $this)); 220 220 } 221 221 } … … 225 225 $skipped = false; 226 226 foreach ($this->dispatcher->getListeners($eventName) as $listener) { 227 if (!$listener instanceof WrappedListener) { // #12845: a new listener was added during dispatch. 228 continue; 229 } 227 230 // Unwrap listener 228 231 $this->dispatcher->removeListener($eventName, $listener); … … 284 287 } 285 288 $info += array( 286 'type' => 'Function',289 'type' => 'Function', 287 290 'function' => $listener, 288 'file' => $file,289 'line' => $line,291 'file' => $file, 292 'line' => $line, 290 293 'pretty' => $listener, 291 294 ); … … 304 307 } 305 308 $info += array( 306 'type' => 'Method',309 'type' => 'Method', 307 310 'class' => $class, 308 311 'method' => $listener[1], 309 'file' => $file,310 'line' => $line,312 'file' => $file, 313 'line' => $line, 311 314 'pretty' => $class.'::'.$listener[1], 312 315 ); -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/WrappedListener.php
r986149 r1098219 26 26 private $stoppedPropagation; 27 27 private $stopwatch; 28 private $dispatcher; 28 29 29 public function __construct($listener, $name, Stopwatch $stopwatch )30 public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) 30 31 { 31 32 $this->listener = $listener; 32 33 $this->name = $name; 33 34 $this->stopwatch = $stopwatch; 35 $this->dispatcher = $dispatcher; 34 36 $this->called = false; 35 37 $this->stoppedPropagation = false; … … 57 59 $e = $this->stopwatch->start($this->name, 'event_listener'); 58 60 59 call_user_func($this->listener, $event, $eventName, $ dispatcher);61 call_user_func($this->listener, $event, $eventName, $this->dispatcher ?: $dispatcher); 60 62 61 63 if ($e->isStarted()) { -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php
r986149 r1098219 92 92 } 93 93 94 if ($def->isAbstract()) { 95 throw new \InvalidArgumentException(sprintf('The service "%s" must not be abstract as event subscribers are lazy-loaded.', $id)); 96 } 97 94 98 // We must assume that the class value has been correctly filled, even if the service is created by a factory 95 $class = $ def->getClass();99 $class = $container->getParameterBag()->resolveValue($def->getClass()); 96 100 97 101 $refClass = new \ReflectionClass($class); -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php
r986149 r1098219 21 21 * further listeners in your event listener. 22 22 * 23 * @author Guilherme Blanco <guilhermeblanco@hotmail.com>24 * @author Jonathan Wage <jonwage@gmail.com>25 * @author Roman Borschel <roman@code-factory.org>26 * @author Bernhard Schussek <bschussek@gmail.com>23 * @author Guilherme Blanco <guilhermeblanco@hotmail.com> 24 * @author Jonathan Wage <jonwage@gmail.com> 25 * @author Roman Borschel <roman@code-factory.org> 26 * @author Bernhard Schussek <bschussek@gmail.com> 27 27 * 28 28 * @api … … 31 31 { 32 32 /** 33 * @var bool Whether no further event listeners should be triggered33 * @var bool Whether no further event listeners should be triggered 34 34 */ 35 35 private $propagationStopped = false; … … 48 48 * Returns whether further event listeners should be triggered. 49 49 * 50 * @see Event::stopPropagation 51 * @return bool Whether propagation was already stopped for this event. 50 * @see Event::stopPropagation() 51 * 52 * @return bool Whether propagation was already stopped for this event. 52 53 * 53 54 * @api … … 73 74 74 75 /** 75 * Stores the EventDispatcher that dispatches this Event 76 * Stores the EventDispatcher that dispatches this Event. 76 77 * 77 78 * @param EventDispatcherInterface $dispatcher … … 87 88 88 89 /** 89 * Returns the EventDispatcher that dispatches this Event 90 * Returns the EventDispatcher that dispatches this Event. 90 91 * 91 92 * @return EventDispatcherInterface -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
r986149 r1098219 18 18 * manager. 19 19 * 20 * @author Guilherme Blanco <guilhermeblanco@hotmail.com>21 * @author Jonathan Wage <jonwage@gmail.com>22 * @author Roman Borschel <roman@code-factory.org>23 * @author Bernhard Schussek <bschussek@gmail.com>24 * @author Fabien Potencier <fabien@symfony.com>25 * @author Jordi Boggiano <j.boggiano@seld.be>26 * @author Jordan Alliot <jordan.alliot@gmail.com>20 * @author Guilherme Blanco <guilhermeblanco@hotmail.com> 21 * @author Jonathan Wage <jonwage@gmail.com> 22 * @author Roman Borschel <roman@code-factory.org> 23 * @author Bernhard Schussek <bschussek@gmail.com> 24 * @author Fabien Potencier <fabien@symfony.com> 25 * @author Jordi Boggiano <j.boggiano@seld.be> 26 * @author Jordan Alliot <jordan.alliot@gmail.com> 27 27 * 28 28 * @api … … 34 34 35 35 /** 36 * @see EventDispatcherInterface::dispatch 36 * @see EventDispatcherInterface::dispatch() 37 37 * 38 38 * @api … … 57 57 58 58 /** 59 * @see EventDispatcherInterface::getListeners 59 * @see EventDispatcherInterface::getListeners() 60 60 */ 61 61 public function getListeners($eventName = null) … … 79 79 80 80 /** 81 * @see EventDispatcherInterface::hasListeners 81 * @see EventDispatcherInterface::hasListeners() 82 82 */ 83 83 public function hasListeners($eventName = null) … … 87 87 88 88 /** 89 * @see EventDispatcherInterface::addListener 89 * @see EventDispatcherInterface::addListener() 90 90 * 91 91 * @api … … 98 98 99 99 /** 100 * @see EventDispatcherInterface::removeListener 100 * @see EventDispatcherInterface::removeListener() 101 101 */ 102 102 public function removeListener($eventName, $listener) … … 114 114 115 115 /** 116 * @see EventDispatcherInterface::addSubscriber 116 * @see EventDispatcherInterface::addSubscriber() 117 117 * 118 118 * @api … … 134 134 135 135 /** 136 * @see EventDispatcherInterface::removeSubscriber 136 * @see EventDispatcherInterface::removeSubscriber() 137 137 */ 138 138 public function removeSubscriber(EventSubscriberInterface $subscriber) -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcherInterface.php
r1014718 r1098219 29 29 * the event is the name of the method that is 30 30 * invoked on listeners. 31 * @param Event $eventThe event to pass to the event handlers/listeners.31 * @param Event $event The event to pass to the event handlers/listeners. 32 32 * If not supplied, an empty Event instance is created. 33 33 * … … 91 91 * @param string $eventName The name of the event 92 92 * 93 * @return bool true if the specified event has any listeners, false otherwise93 * @return bool true if the specified event has any listeners, false otherwise 94 94 */ 95 95 public function hasListeners($eventName = null); -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventSubscriberInterface.php
r986149 r1098219 18 18 * returned events. 19 19 * 20 * @author Guilherme Blanco <guilhermeblanco@hotmail.com>21 * @author Jonathan Wage <jonwage@gmail.com>22 * @author Roman Borschel <roman@code-factory.org>23 * @author Bernhard Schussek <bschussek@gmail.com>20 * @author Guilherme Blanco <guilhermeblanco@hotmail.com> 21 * @author Jonathan Wage <jonwage@gmail.com> 22 * @author Roman Borschel <roman@code-factory.org> 23 * @author Bernhard Schussek <bschussek@gmail.com> 24 24 * 25 25 * @api -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php
r986149 r1098219 176 176 177 177 /** 178 * IteratorAggregate for iterating over the object like an array 178 * IteratorAggregate for iterating over the object like an array. 179 179 * 180 180 * @return \ArrayIterator -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php
r986149 r1098219 21 21 /** 22 22 * The proxied dispatcher. 23 * 23 24 * @var EventDispatcherInterface 24 25 */ -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE
r986149 r1098219 1 Copyright (c) 2004-201 4Fabien Potencier1 Copyright (c) 2004-2015 Fabien Potencier 2 2 3 3 Permission is hereby granted, free of charge, to any person obtaining a copy -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md
r1014718 r1098219 2 2 ========================= 3 3 4 The Symfony 2EventDispatcher component implements the Mediator pattern in a4 The Symfony EventDispatcher component implements the Mediator pattern in a 5 5 simple and effective way to make your projects truly extensible. 6 6 -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php
r986149 r1098219 18 18 use Symfony\Component\EventDispatcher\EventSubscriberInterface; 19 19 20 class ContainerAwareEventDispatcherTest extends \PHPUnit_Framework_TestCase20 class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest 21 21 { 22 protected function createEventDispatcher() 23 { 24 $container = new Container(); 25 26 return new ContainerAwareEventDispatcher($container); 27 } 28 22 29 public function testAddAListenerService() 23 30 { … … 233 240 { 234 241 return array( 235 'onEvent' => 'onEvent',236 'onEvent' => array('onEvent', 10),237 242 'onEvent' => array('onEvent'), 238 243 ); -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php
r1000678 r1098219 87 87 } 88 88 89 public function testGetCalledListenersNested() 90 { 91 $tdispatcher = null; 92 $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); 93 $dispatcher->addListener('foo', function (Event $event, $eventName, $dispatcher) use (&$tdispatcher) { 94 $tdispatcher = $dispatcher; 95 $dispatcher->dispatch('bar'); 96 }); 97 $dispatcher->addListener('bar', function (Event $event) {}); 98 $dispatcher->dispatch('foo'); 99 $this->assertSame($dispatcher, $tdispatcher); 100 $this->assertCount(2, $dispatcher->getCalledListeners()); 101 } 102 89 103 public function testLogger() 90 104 { -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
r1014718 r1098219 139 139 $registerListenersPass->process($container); 140 140 } 141 142 /** 143 * @expectedException \InvalidArgumentException 144 * @expectedExceptionMessage The service "foo" must not be abstract as event subscribers are lazy-loaded. 145 */ 146 public function testAbstractEventSubscriber() 147 { 148 $container = new ContainerBuilder(); 149 $container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_subscriber', array()); 150 $container->register('event_dispatcher', 'stdClass'); 151 152 $registerListenersPass = new RegisterListenersPass(); 153 $registerListenersPass->process($container); 154 } 155 156 public function testEventSubscriberResolvableClassName() 157 { 158 $container = new ContainerBuilder(); 159 160 $container->setParameter('subscriber.class', 'Symfony\Component\EventDispatcher\Tests\DependencyInjection\SubscriberService'); 161 $container->register('foo', '%subscriber.class%')->addTag('kernel.event_subscriber', array()); 162 $container->register('event_dispatcher', 'stdClass'); 163 164 $registerListenersPass = new RegisterListenersPass(); 165 $registerListenersPass->process($container); 166 167 $definition = $container->getDefinition('event_dispatcher'); 168 $expected_calls = array( 169 array( 170 'addSubscriberService', 171 array( 172 'foo', 173 'Symfony\Component\EventDispatcher\Tests\DependencyInjection\SubscriberService', 174 ), 175 ), 176 ); 177 $this->assertSame($expected_calls, $definition->getMethodCalls()); 178 } 179 180 /** 181 * @expectedException \InvalidArgumentException 182 * @expectedExceptionMessage You have requested a non-existent parameter "subscriber.class" 183 */ 184 public function testEventSubscriberUnresolvableClassName() 185 { 186 $container = new ContainerBuilder(); 187 $container->register('foo', '%subscriber.class%')->addTag('kernel.event_subscriber', array()); 188 $container->register('event_dispatcher', 'stdClass'); 189 190 $registerListenersPass = new RegisterListenersPass(); 191 $registerListenersPass->process($container); 192 } 141 193 } 142 194 -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
r1000678 r1098219 12 12 namespace Symfony\Component\EventDispatcher\Tests; 13 13 14 use Symfony\Component\EventDispatcher\Event;15 14 use Symfony\Component\EventDispatcher\EventDispatcher; 16 use Symfony\Component\EventDispatcher\EventSubscriberInterface;17 15 18 class EventDispatcherTest extends \PHPUnit_Framework_TestCase16 class EventDispatcherTest extends AbstractEventDispatcherTest 19 17 { 20 /* Some pseudo events */ 21 const preFoo = 'pre.foo'; 22 const postFoo = 'post.foo'; 23 const preBar = 'pre.bar'; 24 const postBar = 'post.bar'; 25 26 /** 27 * @var EventDispatcher 28 */ 29 private $dispatcher; 30 31 private $listener; 32 33 protected function setUp() 18 protected function createEventDispatcher() 34 19 { 35 $this->dispatcher = new EventDispatcher(); 36 $this->listener = new TestEventListener(); 37 } 38 39 protected function tearDown() 40 { 41 $this->dispatcher = null; 42 $this->listener = null; 43 } 44 45 public function testInitialState() 46 { 47 $this->assertEquals(array(), $this->dispatcher->getListeners()); 48 $this->assertFalse($this->dispatcher->hasListeners(self::preFoo)); 49 $this->assertFalse($this->dispatcher->hasListeners(self::postFoo)); 50 } 51 52 public function testAddListener() 53 { 54 $this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo')); 55 $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo')); 56 $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); 57 $this->assertTrue($this->dispatcher->hasListeners(self::postFoo)); 58 $this->assertCount(1, $this->dispatcher->getListeners(self::preFoo)); 59 $this->assertCount(1, $this->dispatcher->getListeners(self::postFoo)); 60 $this->assertCount(2, $this->dispatcher->getListeners()); 61 } 62 63 public function testGetListenersSortsByPriority() 64 { 65 $listener1 = new TestEventListener(); 66 $listener2 = new TestEventListener(); 67 $listener3 = new TestEventListener(); 68 $listener1->name = '1'; 69 $listener2->name = '2'; 70 $listener3->name = '3'; 71 72 $this->dispatcher->addListener('pre.foo', array($listener1, 'preFoo'), -10); 73 $this->dispatcher->addListener('pre.foo', array($listener2, 'preFoo'), 10); 74 $this->dispatcher->addListener('pre.foo', array($listener3, 'preFoo')); 75 76 $expected = array( 77 array($listener2, 'preFoo'), 78 array($listener3, 'preFoo'), 79 array($listener1, 'preFoo'), 80 ); 81 82 $this->assertSame($expected, $this->dispatcher->getListeners('pre.foo')); 83 } 84 85 public function testGetAllListenersSortsByPriority() 86 { 87 $listener1 = new TestEventListener(); 88 $listener2 = new TestEventListener(); 89 $listener3 = new TestEventListener(); 90 $listener4 = new TestEventListener(); 91 $listener5 = new TestEventListener(); 92 $listener6 = new TestEventListener(); 93 94 $this->dispatcher->addListener('pre.foo', $listener1, -10); 95 $this->dispatcher->addListener('pre.foo', $listener2); 96 $this->dispatcher->addListener('pre.foo', $listener3, 10); 97 $this->dispatcher->addListener('post.foo', $listener4, -10); 98 $this->dispatcher->addListener('post.foo', $listener5); 99 $this->dispatcher->addListener('post.foo', $listener6, 10); 100 101 $expected = array( 102 'pre.foo' => array($listener3, $listener2, $listener1), 103 'post.foo' => array($listener6, $listener5, $listener4), 104 ); 105 106 $this->assertSame($expected, $this->dispatcher->getListeners()); 107 } 108 109 public function testDispatch() 110 { 111 $this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo')); 112 $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo')); 113 $this->dispatcher->dispatch(self::preFoo); 114 $this->assertTrue($this->listener->preFooInvoked); 115 $this->assertFalse($this->listener->postFooInvoked); 116 $this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch('noevent')); 117 $this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch(self::preFoo)); 118 $event = new Event(); 119 $return = $this->dispatcher->dispatch(self::preFoo, $event); 120 $this->assertEquals('pre.foo', $event->getName()); 121 $this->assertSame($event, $return); 122 } 123 124 public function testDispatchForClosure() 125 { 126 $invoked = 0; 127 $listener = function () use (&$invoked) { 128 $invoked++; 129 }; 130 $this->dispatcher->addListener('pre.foo', $listener); 131 $this->dispatcher->addListener('post.foo', $listener); 132 $this->dispatcher->dispatch(self::preFoo); 133 $this->assertEquals(1, $invoked); 134 } 135 136 public function testStopEventPropagation() 137 { 138 $otherListener = new TestEventListener(); 139 140 // postFoo() stops the propagation, so only one listener should 141 // be executed 142 // Manually set priority to enforce $this->listener to be called first 143 $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'), 10); 144 $this->dispatcher->addListener('post.foo', array($otherListener, 'preFoo')); 145 $this->dispatcher->dispatch(self::postFoo); 146 $this->assertTrue($this->listener->postFooInvoked); 147 $this->assertFalse($otherListener->postFooInvoked); 148 } 149 150 public function testDispatchByPriority() 151 { 152 $invoked = array(); 153 $listener1 = function () use (&$invoked) { 154 $invoked[] = '1'; 155 }; 156 $listener2 = function () use (&$invoked) { 157 $invoked[] = '2'; 158 }; 159 $listener3 = function () use (&$invoked) { 160 $invoked[] = '3'; 161 }; 162 $this->dispatcher->addListener('pre.foo', $listener1, -10); 163 $this->dispatcher->addListener('pre.foo', $listener2); 164 $this->dispatcher->addListener('pre.foo', $listener3, 10); 165 $this->dispatcher->dispatch(self::preFoo); 166 $this->assertEquals(array('3', '2', '1'), $invoked); 167 } 168 169 public function testRemoveListener() 170 { 171 $this->dispatcher->addListener('pre.bar', $this->listener); 172 $this->assertTrue($this->dispatcher->hasListeners(self::preBar)); 173 $this->dispatcher->removeListener('pre.bar', $this->listener); 174 $this->assertFalse($this->dispatcher->hasListeners(self::preBar)); 175 $this->dispatcher->removeListener('notExists', $this->listener); 176 } 177 178 public function testAddSubscriber() 179 { 180 $eventSubscriber = new TestEventSubscriber(); 181 $this->dispatcher->addSubscriber($eventSubscriber); 182 $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); 183 $this->assertTrue($this->dispatcher->hasListeners(self::postFoo)); 184 } 185 186 public function testAddSubscriberWithPriorities() 187 { 188 $eventSubscriber = new TestEventSubscriber(); 189 $this->dispatcher->addSubscriber($eventSubscriber); 190 191 $eventSubscriber = new TestEventSubscriberWithPriorities(); 192 $this->dispatcher->addSubscriber($eventSubscriber); 193 194 $listeners = $this->dispatcher->getListeners('pre.foo'); 195 $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); 196 $this->assertCount(2, $listeners); 197 $this->assertInstanceOf('Symfony\Component\EventDispatcher\Tests\TestEventSubscriberWithPriorities', $listeners[0][0]); 198 } 199 200 public function testAddSubscriberWithMultipleListeners() 201 { 202 $eventSubscriber = new TestEventSubscriberWithMultipleListeners(); 203 $this->dispatcher->addSubscriber($eventSubscriber); 204 205 $listeners = $this->dispatcher->getListeners('pre.foo'); 206 $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); 207 $this->assertCount(2, $listeners); 208 $this->assertEquals('preFoo2', $listeners[0][1]); 209 } 210 211 public function testRemoveSubscriber() 212 { 213 $eventSubscriber = new TestEventSubscriber(); 214 $this->dispatcher->addSubscriber($eventSubscriber); 215 $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); 216 $this->assertTrue($this->dispatcher->hasListeners(self::postFoo)); 217 $this->dispatcher->removeSubscriber($eventSubscriber); 218 $this->assertFalse($this->dispatcher->hasListeners(self::preFoo)); 219 $this->assertFalse($this->dispatcher->hasListeners(self::postFoo)); 220 } 221 222 public function testRemoveSubscriberWithPriorities() 223 { 224 $eventSubscriber = new TestEventSubscriberWithPriorities(); 225 $this->dispatcher->addSubscriber($eventSubscriber); 226 $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); 227 $this->dispatcher->removeSubscriber($eventSubscriber); 228 $this->assertFalse($this->dispatcher->hasListeners(self::preFoo)); 229 } 230 231 public function testRemoveSubscriberWithMultipleListeners() 232 { 233 $eventSubscriber = new TestEventSubscriberWithMultipleListeners(); 234 $this->dispatcher->addSubscriber($eventSubscriber); 235 $this->assertTrue($this->dispatcher->hasListeners(self::preFoo)); 236 $this->assertCount(2, $this->dispatcher->getListeners(self::preFoo)); 237 $this->dispatcher->removeSubscriber($eventSubscriber); 238 $this->assertFalse($this->dispatcher->hasListeners(self::preFoo)); 239 } 240 241 public function testEventReceivesTheDispatcherInstance() 242 { 243 $dispatcher = null; 244 $this->dispatcher->addListener('test', function ($event) use (&$dispatcher) { 245 $dispatcher = $event->getDispatcher(); 246 }); 247 $this->dispatcher->dispatch('test'); 248 $this->assertSame($this->dispatcher, $dispatcher); 249 } 250 251 public function testEventReceivesTheDispatcherInstanceAsArgument() 252 { 253 $listener = new TestWithDispatcher(); 254 $this->dispatcher->addListener('test', array($listener, 'foo')); 255 $this->assertNull($listener->name); 256 $this->assertNull($listener->dispatcher); 257 $this->dispatcher->dispatch('test'); 258 $this->assertEquals('test', $listener->name); 259 $this->assertSame($this->dispatcher, $listener->dispatcher); 260 } 261 262 /** 263 * @see https://bugs.php.net/bug.php?id=62976 264 * 265 * This bug affects: 266 * - The PHP 5.3 branch for versions < 5.3.18 267 * - The PHP 5.4 branch for versions < 5.4.8 268 * - The PHP 5.5 branch is not affected 269 */ 270 public function testWorkaroundForPhpBug62976() 271 { 272 $dispatcher = new EventDispatcher(); 273 $dispatcher->addListener('bug.62976', new CallableClass()); 274 $dispatcher->removeListener('bug.62976', function () {}); 275 $this->assertTrue($dispatcher->hasListeners('bug.62976')); 276 } 277 278 public function testHasListenersWhenAddedCallbackListenerIsRemoved() 279 { 280 $listener = function () {}; 281 $this->dispatcher->addListener('foo', $listener); 282 $this->dispatcher->removeListener('foo', $listener); 283 $this->assertFalse($this->dispatcher->hasListeners()); 284 } 285 286 public function testGetListenersWhenAddedCallbackListenerIsRemoved() 287 { 288 $listener = function () {}; 289 $this->dispatcher->addListener('foo', $listener); 290 $this->dispatcher->removeListener('foo', $listener); 291 $this->assertSame(array(), $this->dispatcher->getListeners()); 292 } 293 294 public function testHasListenersWithoutEventsReturnsFalseAfterHasListenersWithEventHasBeenCalled() 295 { 296 $this->assertFalse($this->dispatcher->hasListeners('foo')); 297 $this->assertFalse($this->dispatcher->hasListeners()); 20 return new EventDispatcher(); 298 21 } 299 22 } 300 301 class CallableClass302 {303 public function __invoke()304 {305 }306 }307 308 class TestEventListener309 {310 public $preFooInvoked = false;311 public $postFooInvoked = false;312 313 /* Listener methods */314 315 public function preFoo(Event $e)316 {317 $this->preFooInvoked = true;318 }319 320 public function postFoo(Event $e)321 {322 $this->postFooInvoked = true;323 324 $e->stopPropagation();325 }326 }327 328 class TestWithDispatcher329 {330 public $name;331 public $dispatcher;332 333 public function foo(Event $e, $name, $dispatcher)334 {335 $this->name = $name;336 $this->dispatcher = $dispatcher;337 }338 }339 340 class TestEventSubscriber implements EventSubscriberInterface341 {342 public static function getSubscribedEvents()343 {344 return array('pre.foo' => 'preFoo', 'post.foo' => 'postFoo');345 }346 }347 348 class TestEventSubscriberWithPriorities implements EventSubscriberInterface349 {350 public static function getSubscribedEvents()351 {352 return array(353 'pre.foo' => array('preFoo', 10),354 'post.foo' => array('postFoo'),355 );356 }357 }358 359 class TestEventSubscriberWithMultipleListeners implements EventSubscriberInterface360 {361 public static function getSubscribedEvents()362 {363 return array('pre.foo' => array(364 array('preFoo1'),365 array('preFoo2', 10),366 ));367 }368 } -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php
r986149 r1098219 61 61 } 62 62 63 public function test SetDispatcher()63 public function testLegacySetDispatcher() 64 64 { 65 $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); 65 66 $this->event->setDispatcher($this->dispatcher); 66 67 $this->assertSame($this->dispatcher, $this->event->getDispatcher()); 67 68 } 68 69 69 public function test GetDispatcher()70 public function testLegacyGetDispatcher() 70 71 { 72 $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); 71 73 $this->assertNull($this->event->getDispatcher()); 72 74 } 73 75 74 public function test GetName()76 public function testLegacyGetName() 75 77 { 78 $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); 76 79 $this->assertNull($this->event->getName()); 77 80 } 78 81 79 public function test SetName()82 public function testLegacySetName() 80 83 { 84 $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); 81 85 $this->event->setName('foo'); 82 86 $this->assertEquals('foo', $this->event->getName()); -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php
r1000678 r1098219 54 54 55 55 /** 56 * Tests Event->getArgs() 56 * Tests Event->getArgs(). 57 57 */ 58 58 public function testGetArguments() -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json
r1000678 r1098219 20 20 }, 21 21 "require-dev": { 22 "symfony/dependency-injection": "~2.0,<2.6.0", 23 "symfony/config": "~2.0", 24 "symfony/stopwatch": "~2.2", 22 "symfony/dependency-injection": "~2.6", 23 "symfony/expression-language": "~2.6", 24 "symfony/config": "~2.0,>=2.0.5", 25 "symfony/stopwatch": "~2.3", 25 26 "psr/log": "~1.0" 26 27 }, … … 36 37 "extra": { 37 38 "branch-alias": { 38 "dev-master": "2. 5-dev"39 "dev-master": "2.6-dev" 39 40 } 40 41 } -
mgrt/trunk/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist
r986149 r1098219 7 7 bootstrap="vendor/autoload.php" 8 8 > 9 <php> 10 <!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) --> 11 <ini name="error_reporting" value="-16385"/> 12 </php> 9 13 <testsuites> 10 14 <testsuite name="Symfony EventDispatcher Component Test Suite"> -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php
r986149 r1098219 29 29 * Sets the indentation. 30 30 * 31 * @param int $num The amount of spaces to use for indentation of nested nodes.31 * @param int $num The amount of spaces to use for indentation of nested nodes. 32 32 */ 33 33 public function setIndentation($num) … … 39 39 * Dumps a PHP value to YAML. 40 40 * 41 * @param mixed $input The PHP value42 * @param int $inline The level where you switch to inline YAML43 * @param int $indent The level of indentation (used internally)44 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise45 * @param bool $objectSupport true if object support is enabled, false otherwise41 * @param mixed $input The PHP value 42 * @param int $inline The level where you switch to inline YAML 43 * @param int $indent The level of indentation (used internally) 44 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 45 * @param bool $objectSupport true if object support is enabled, false otherwise 46 46 * 47 * @return string The YAML representation of the PHP value47 * @return string The YAML representation of the PHP value 48 48 */ 49 49 public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false) -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php
r1000678 r1098219 33 33 "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", 34 34 "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",); 35 private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',35 private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', 36 36 "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", 37 37 "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", … … 45 45 * @param string $value A PHP value 46 46 * 47 * @return bool True if the value would require double quotes.47 * @return bool True if the value would require double quotes. 48 48 */ 49 49 public static function requiresDoubleQuoting($value) … … 69 69 * @param string $value A PHP value 70 70 * 71 * @return bool True if the value would require single quotes.71 * @return bool True if the value would require single quotes. 72 72 */ 73 73 public static function requiresSingleQuoting($value) 74 74 { 75 // Determines if a PHP value is entirely composed of a value that would 76 // require single quoting in YAML. 77 if (in_array(strtolower($value), array('null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'))) { 78 return true; 79 } 80 81 // Determines if the PHP value contains any single characters that would 82 // cause it to require single quoting in YAML. 75 83 return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); 76 84 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php
r986149 r1098219 11 11 12 12 namespace Symfony\Component\Yaml\Exception; 13 14 if (!defined('JSON_UNESCAPED_UNICODE')) {15 define('JSON_UNESCAPED_SLASHES', 64);16 define('JSON_UNESCAPED_UNICODE', 256);17 }18 13 19 14 /** … … 34 29 * Constructor. 35 30 * 36 * @param string $message The error message37 * @param int $parsedLine The line where the error occurred38 * @param int $snippet The snippet of code near the problem39 * @param string $parsedFile The file name where the error occurred31 * @param string $message The error message 32 * @param int $parsedLine The line where the error occurred 33 * @param int $snippet The snippet of code near the problem 34 * @param string $parsedFile The file name where the error occurred 40 35 * @param \Exception $previous The previous exception 41 36 */ … … 101 96 * Gets the line where the error occurred. 102 97 * 103 * @return int The file line98 * @return int The file line 104 99 */ 105 100 public function getParsedLine() … … 111 106 * Sets the line where the error occurred. 112 107 * 113 * @param int $parsedLine The file line108 * @param int $parsedLine The file line 114 109 */ 115 110 public function setParsedLine($parsedLine) … … 131 126 132 127 if (null !== $this->parsedFile) { 133 $this->message .= sprintf(' in %s', json_encode($this->parsedFile, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); 128 if (PHP_VERSION_ID >= 50400) { 129 $jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; 130 } else { 131 $jsonOptions = 0; 132 } 133 $this->message .= sprintf(' in %s', json_encode($this->parsedFile, $jsonOptions)); 134 134 } 135 135 -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
r1000678 r1098219 26 26 private static $exceptionOnInvalidType = false; 27 27 private static $objectSupport = false; 28 private static $objectForMap = false; 28 29 29 30 /** 30 31 * Converts a YAML string to a PHP array. 31 32 * 32 * @param string $value A YAML string 33 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 34 * @param bool $objectSupport true if object support is enabled, false otherwise 35 * @param array $references Mapping of variable names to values 33 * @param string $value A YAML string 34 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 35 * @param bool $objectSupport true if object support is enabled, false otherwise 36 * @param bool $objectForMap true if maps should return a stdClass instead of array() 37 * @param array $references Mapping of variable names to values 36 38 * 37 39 * @return array A PHP array representing the YAML string … … 39 41 * @throws ParseException 40 42 */ 41 public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $ references = array())43 public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false, $references = array()) 42 44 { 43 45 self::$exceptionOnInvalidType = $exceptionOnInvalidType; 44 46 self::$objectSupport = $objectSupport; 47 self::$objectForMap = $objectForMap; 45 48 46 49 $value = trim($value); … … 84 87 * Dumps a given PHP variable to a YAML string. 85 88 * 86 * @param mixed $value The PHP variable to convert87 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise88 * @param bool $objectSupport true if object support is enabled, false otherwise89 * @param mixed $value The PHP variable to convert 90 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 91 * @param bool $objectSupport true if object support is enabled, false otherwise 89 92 * 90 93 * @return string The YAML string representing the PHP array … … 126 129 setlocale(LC_NUMERIC, 'C'); 127 130 } 128 $repr = is_string($value) ? "'$value'" : (is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : strval($value)); 129 131 if (is_float($value)) { 132 $repr = strval($value); 133 if (is_infinite($value)) { 134 $repr = str_ireplace('INF', '.Inf', $repr); 135 } elseif (floor($value) == $value && $repr == $value) { 136 // Preserve float data type since storing a whole number will result in integer value. 137 $repr = '!!float '.$repr; 138 } 139 } else { 140 $repr = is_string($value) ? "'$value'" : strval($value); 141 } 130 142 if (false !== $locale) { 131 143 setlocale(LC_NUMERIC, $locale); … … 133 145 134 146 return $repr; 147 case '' == $value: 148 return "''"; 135 149 case Escaper::requiresDoubleQuoting($value): 136 150 return Escaper::escapeWithDoubleQuotes($value); 137 151 case Escaper::requiresSingleQuoting($value): 152 case preg_match(self::getTimestampRegex(), $value): 138 153 return Escaper::escapeWithSingleQuotes($value); 139 case '' == $value:140 return "''";141 case preg_match(self::getTimestampRegex(), $value):142 case in_array(strtolower($value), array('null', '~', 'true', 'false')):143 return "'$value'";144 154 default: 145 155 return $value; … … 150 160 * Dumps a PHP array to a YAML string. 151 161 * 152 * @param array $value The PHP array to dump153 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise154 * @param bool $objectSupport true if object support is enabled, false otherwise162 * @param array $value The PHP array to dump 163 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 164 * @param bool $objectSupport true if object support is enabled, false otherwise 155 165 * 156 166 * @return string The YAML string representing the PHP array … … 183 193 * Parses a scalar to a YAML string. 184 194 * 185 * @param s calar$scalar195 * @param string $scalar 186 196 * @param string $delimiters 187 197 * @param array $stringDelimiters … … 235 245 * 236 246 * @param string $scalar 237 * @param int &$i247 * @param int &$i 238 248 * 239 249 * @return string A YAML string … … 345 355 continue 2; 346 356 case '}': 357 if (self::$objectForMap) { 358 return (object) $output; 359 } 360 347 361 return $output; 348 362 } … … 353 367 // value 354 368 $done = false; 369 355 370 while ($i < $len) { 356 371 switch ($mapping[$i]) { … … 463 478 464 479 return; 480 case 0 === strpos($scalar, '!!float '): 481 return (float) substr($scalar, 8); 465 482 case ctype_digit($scalar): 466 483 $raw = $scalar; -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE
r986149 r1098219 1 Copyright (c) 2004-201 4Fabien Potencier1 Copyright (c) 2004-2015 Fabien Potencier 2 2 3 3 Permission is hereby granted, free of charge, to any person obtaining a copy -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php
r1000678 r1098219 23 23 const FOLDED_SCALAR_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?'; 24 24 25 private $offset = 0;26 private $lines = array();27 private $currentLineNb = -1;28 private $currentLine = '';29 private $refs = array();30 31 /** 32 * Constructor 33 * 34 * @param int $offset The offset of YAML document (used for line numbers in error messages)25 private $offset = 0; 26 private $lines = array(); 27 private $currentLineNb = -1; 28 private $currentLine = ''; 29 private $refs = array(); 30 31 /** 32 * Constructor. 33 * 34 * @param int $offset The offset of YAML document (used for line numbers in error messages) 35 35 */ 36 36 public function __construct($offset = 0) … … 42 42 * Parses a YAML string to a PHP value. 43 43 * 44 * @param string $value A YAML string 45 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 46 * @param bool $objectSupport true if object support is enabled, false otherwise 47 * 48 * @return mixed A PHP value 44 * @param string $value A YAML string 45 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 46 * @param bool $objectSupport true if object support is enabled, false otherwise 47 * @param bool $objectForMap true if maps should return a stdClass instead of array() 48 * 49 * @return mixed A PHP value 49 50 * 50 51 * @throws ParseException If the YAML is not valid 51 52 */ 52 public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false )53 public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) 53 54 { 54 55 $this->currentLineNb = -1; … … 95 96 $parser = new Parser($c); 96 97 $parser->refs = & $this->refs; 97 $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport );98 $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); 98 99 } else { 99 100 if (isset($values['leadspaces']) 100 && ' ' == $values['leadspaces']101 101 && preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches) 102 102 ) { … … 108 108 $block = $values['value']; 109 109 if ($this->isNextLineIndented()) { 110 $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2);111 } 112 113 $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport );110 $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + strlen($values['leadspaces']) + 1); 111 } 112 113 $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport, $objectForMap); 114 114 } else { 115 $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport );115 $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport, $objectForMap); 116 116 } 117 117 } 118 } elseif (preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'")))) {118 } elseif (preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'")))) { 119 119 if ($context && 'sequence' == $context) { 120 120 throw new ParseException('You cannot define a mapping item when in a sequence'); … … 123 123 124 124 // force correct settings 125 Inline::parse(null, $exceptionOnInvalidType, $objectSupport, $ this->refs);125 Inline::parse(null, $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); 126 126 try { 127 127 $key = Inline::parseScalar($values['key']); … … 162 162 $parser = new Parser($c); 163 163 $parser->refs = & $this->refs; 164 $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport );164 $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap); 165 165 166 166 if (!is_array($parsed)) { … … 213 213 $parser = new Parser($c); 214 214 $parser->refs = & $this->refs; 215 $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport );215 $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); 216 216 // Spec: Keys MUST be unique; first one wins. 217 217 // But overwriting is allowed when a merge node is used in current block. … … 221 221 } 222 222 } else { 223 $value = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport );223 $value = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport, $objectForMap); 224 224 // Spec: Keys MUST be unique; first one wins. 225 225 // But overwriting is allowed when a merge node is used in current block. … … 229 229 } 230 230 } else { 231 // multiple documents are not supported 232 if ('---' === $this->currentLine) { 233 throw new ParseException('Multiple documents are not supported.'); 234 } 235 231 236 // 1-liner optionally followed by newline 232 237 $lineCount = count($this->lines); 233 238 if (1 === $lineCount || (2 === $lineCount && empty($this->lines[1]))) { 234 239 try { 235 $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport, $ this->refs);240 $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); 236 241 } catch (ParseException $e) { 237 242 $e->setParsedLine($this->getRealCurrentLineNb() + 1); … … 297 302 * Returns the current line number (takes the offset into account). 298 303 * 299 * @return int The current line number304 * @return int The current line number 300 305 */ 301 306 private function getRealCurrentLineNb() … … 307 312 * Returns the current line indentation. 308 313 * 309 * @return int The current line indentation314 * @return int The current line indentation 310 315 */ 311 316 private function getCurrentLineIndentation() … … 344 349 } 345 350 346 $data = array(substr($this->currentLine, $newIndent)); 351 $data = array(); 352 if ($this->getCurrentLineIndentation() >= $newIndent) { 353 $data[] = substr($this->currentLine, $newIndent); 354 } else { 355 $this->moveToPreviousLine(); 356 357 return; 358 } 347 359 348 360 if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) { … … 367 379 } 368 380 369 if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine) ) {381 if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine) && $newIndent === $indent) { 370 382 $this->moveToPreviousLine(); 371 383 break; … … 422 434 * Parses a YAML value. 423 435 * 424 * @param string $value A YAML value 425 * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise 426 * @param bool $objectSupport True if object support is enabled, false otherwise 427 * 428 * @return mixed A PHP value 436 * @param string $value A YAML value 437 * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise 438 * @param bool $objectSupport True if object support is enabled, false otherwise 439 * @param bool $objectForMap true if maps should return a stdClass instead of array() 440 * 441 * @return mixed A PHP value 429 442 * 430 443 * @throws ParseException When reference does not exist 431 444 */ 432 private function parseValue($value, $exceptionOnInvalidType, $objectSupport )445 private function parseValue($value, $exceptionOnInvalidType, $objectSupport, $objectForMap) 433 446 { 434 447 if (0 === strpos($value, '*')) { … … 453 466 454 467 try { 455 return Inline::parse($value, $exceptionOnInvalidType, $objectSupport, $ this->refs);468 return Inline::parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); 456 469 } catch (ParseException $e) { 457 470 $e->setParsedLine($this->getRealCurrentLineNb() + 1); … … 465 478 * Parses a folded scalar. 466 479 * 467 * @param string $separator The separator that was used to begin this folded scalar (| or >)468 * @param string $indicator The indicator that was used to begin this folded scalar (+ or -)469 * @param int $indentation The indentation that was used to begin this folded scalar470 * 471 * @return string The text value480 * @param string $separator The separator that was used to begin this folded scalar (| or >) 481 * @param string $indicator The indicator that was used to begin this folded scalar (+ or -) 482 * @param int $indentation The indentation that was used to begin this folded scalar 483 * 484 * @return string The text value 472 485 */ 473 486 private function parseFoldedScalar($separator, $indicator = '', $indentation = 0) … … 546 559 * Returns true if the next line is indented. 547 560 * 548 * @return bool Returns true if the next line is indented, false otherwise561 * @return bool Returns true if the next line is indented, false otherwise 549 562 */ 550 563 private function isNextLineIndented() … … 574 587 * Returns true if the current line is blank or if it is a comment line. 575 588 * 576 * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise589 * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise 577 590 */ 578 591 private function isCurrentLineEmpty() … … 584 597 * Returns true if the current line is blank. 585 598 * 586 * @return bool Returns true if the current line is blank, false otherwise599 * @return bool Returns true if the current line is blank, false otherwise 587 600 */ 588 601 private function isCurrentLineBlank() … … 594 607 * Returns true if the current line is a comment line. 595 608 * 596 * @return bool Returns true if the current line is a comment line, false otherwise609 * @return bool Returns true if the current line is a comment line, false otherwise 597 610 */ 598 611 private function isCurrentLineComment() … … 617 630 // strip YAML header 618 631 $count = 0; 619 $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n# su', '', $value, -1, $count);632 $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); 620 633 $this->offset += $count; 621 634 … … 643 656 644 657 /** 645 * Returns true if the next line starts unindented collection 646 * 647 * @return bool Returns true if the next line starts unindented collection, false otherwise658 * Returns true if the next line starts unindented collection. 659 * 660 * @return bool Returns true if the next line starts unindented collection, false otherwise 648 661 */ 649 662 private function isNextLineUnIndentedCollection() … … 675 688 676 689 /** 677 * Returns true if the string is un-indented collection item 678 * 679 * @return bool Returns true if the string is un-indented collection item, false otherwise690 * Returns true if the string is un-indented collection item. 691 * 692 * @return bool Returns true if the string is un-indented collection item, false otherwise 680 693 */ 681 694 private function isStringUnIndentedCollectionItem() -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/README.md
r1014718 r1098219 7 7 use Symfony\Component\Yaml\Yaml; 8 8 9 $array = Yaml::parse( $file);9 $array = Yaml::parse(file_get_contents(filename)); 10 10 11 11 print Yaml::dump($array); -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php
r1000678 r1098219 12 12 namespace Symfony\Component\Yaml\Tests; 13 13 14 use Symfony\Component\Yaml\Yaml;15 14 use Symfony\Component\Yaml\Parser; 16 15 use Symfony\Component\Yaml\Dumper; … … 97 96 } else { 98 97 eval('$expected = '.trim($test['php']).';'); 99 100 $this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']); 98 $this->assertSame($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']); 101 99 } 102 100 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml
r986149 r1098219 464 464 php: | 465 465 array( 466 'name' => 'Mark McGwire',466 'name' => 'Mark McGwire', 467 467 'accomplishment' => "Mark set a major league home run record in 1998.\n", 468 'stats' => "65 Home Runs\n0.278 Batting Average\n"468 'stats' => "65 Home Runs\n0.278 Batting Average\n" 469 469 ) 470 470 --- … … 530 530 negative infinity: -.inf 531 531 not a number: .NaN 532 float as whole number: !!float 1 532 533 php: | 533 534 array( … … 537 538 'negative infinity' => log(0), 538 539 'not a number' => -log(0), 540 'float as whole number' => (float) 1 539 541 ) 540 542 --- -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml
r986149 r1098219 61 61 php: | 62 62 array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar')) 63 --- 64 test: Shortcut Key after unindented collection 65 brief: > 66 Key/value after unindented collection 67 yaml: | 68 collection: 69 - key: foo 70 foo: bar 71 php: | 72 array('collection' => array(array('key' => 'foo', 'foo' => 'bar'))) 73 --- 74 test: Shortcut Key after unindented collection with custom spaces 75 brief: > 76 Key/value after unindented collection 77 yaml: | 78 collection: 79 - key: foo 80 foo: bar 81 php: | 82 array('collection' => array(array('key' => 'foo', 'foo' => 'bar'))) -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php
r1000678 r1098219 16 16 class InlineTest extends \PHPUnit_Framework_TestCase 17 17 { 18 public function testParse() 19 { 20 foreach ($this->getTestsForParse() as $yaml => $value) { 21 $this->assertSame($value, Inline::parse($yaml), sprintf('::parse() converts an inline YAML to a PHP structure (%s)', $yaml)); 22 } 23 } 24 25 public function testDump() 26 { 27 $testsForDump = $this->getTestsForDump(); 28 29 foreach ($testsForDump as $yaml => $value) { 30 $this->assertEquals($yaml, Inline::dump($value), sprintf('::dump() converts a PHP structure to an inline YAML (%s)', $yaml)); 31 } 32 33 foreach ($this->getTestsForParse() as $value) { 34 $this->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency'); 35 } 36 37 foreach ($testsForDump as $value) { 38 $this->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency'); 39 } 18 /** 19 * @dataProvider getTestsForParse 20 */ 21 public function testParse($yaml, $value) 22 { 23 $this->assertSame($value, Inline::parse($yaml), sprintf('::parse() converts an inline YAML to a PHP structure (%s)', $yaml)); 24 } 25 26 /** 27 * @dataProvider getTestsForParseWithMapObjects 28 */ 29 public function testParseWithMapObjects($yaml, $value) 30 { 31 $actual = Inline::parse($yaml, false, false, true); 32 33 $this->assertSame(serialize($value), serialize($actual)); 34 } 35 36 /** 37 * @dataProvider getTestsForDump 38 */ 39 public function testDump($yaml, $value) 40 { 41 $this->assertEquals($yaml, Inline::dump($value), sprintf('::dump() converts a PHP structure to an inline YAML (%s)', $yaml)); 42 43 $this->assertSame($value, Inline::parse(Inline::dump($value)), 'check consistency'); 40 44 } 41 45 … … 121 125 public function testParseReferences($yaml, $expected) 122 126 { 123 $this->assertSame($expected, Inline::parse($yaml, false, false, array('var' => 'var-value')));127 $this->assertSame($expected, Inline::parse($yaml, false, false, false, array('var' => 'var-value'))); 124 128 } 125 129 … … 145 149 'c' => 'Brian', 146 150 ); 147 $this->assertSame(array($foo), Inline::parse('[*foo]', false, false, array('foo' => $foo)));151 $this->assertSame(array($foo), Inline::parse('[*foo]', false, false, false, array('foo' => $foo))); 148 152 } 149 153 … … 166 170 } 167 171 168 p rotectedfunction getTestsForParse()172 public function getTestsForParse() 169 173 { 170 174 return array( 171 '' => '', 172 'null' => null, 173 'false' => false, 174 'true' => true, 175 '12' => 12, 176 '-12' => -12, 177 '"quoted string"' => 'quoted string', 178 "'quoted string'" => 'quoted string', 179 '12.30e+02' => 12.30e+02, 180 '0x4D2' => 0x4D2, 181 '02333' => 02333, 182 '.Inf' => -log(0), 183 '-.Inf' => log(0), 184 "'686e444'" => '686e444', 185 '686e444' => 646e444, 186 '123456789123456789123456789123456789' => '123456789123456789123456789123456789', 187 '"foo\r\nbar"' => "foo\r\nbar", 188 "'foo#bar'" => 'foo#bar', 189 "'foo # bar'" => 'foo # bar', 190 "'#cfcfcf'" => '#cfcfcf', 191 '::form_base.html.twig' => '::form_base.html.twig', 192 193 '2007-10-30' => mktime(0, 0, 0, 10, 30, 2007), 194 '2007-10-30T02:59:43Z' => gmmktime(2, 59, 43, 10, 30, 2007), 195 '2007-10-30 02:59:43 Z' => gmmktime(2, 59, 43, 10, 30, 2007), 196 '1960-10-30 02:59:43 Z' => gmmktime(2, 59, 43, 10, 30, 1960), 197 '1730-10-30T02:59:43Z' => gmmktime(2, 59, 43, 10, 30, 1730), 198 199 '"a \\"string\\" with \'quoted strings inside\'"' => 'a "string" with \'quoted strings inside\'', 200 "'a \"string\" with ''quoted strings inside'''" => 'a "string" with \'quoted strings inside\'', 175 array('', ''), 176 array('null', null), 177 array('false', false), 178 array('true', true), 179 array('12', 12), 180 array('-12', -12), 181 array('"quoted string"', 'quoted string'), 182 array("'quoted string'", 'quoted string'), 183 array('12.30e+02', 12.30e+02), 184 array('0x4D2', 0x4D2), 185 array('02333', 02333), 186 array('.Inf', -log(0)), 187 array('-.Inf', log(0)), 188 array("'686e444'", '686e444'), 189 array('686e444', 646e444), 190 array('123456789123456789123456789123456789', '123456789123456789123456789123456789'), 191 array('"foo\r\nbar"', "foo\r\nbar"), 192 array("'foo#bar'", 'foo#bar'), 193 array("'foo # bar'", 'foo # bar'), 194 array("'#cfcfcf'", '#cfcfcf'), 195 array('::form_base.html.twig', '::form_base.html.twig'), 196 197 // Pre-YAML-1.2 booleans 198 array("'y'", 'y'), 199 array("'n'", 'n'), 200 array("'yes'", 'yes'), 201 array("'no'", 'no'), 202 array("'on'", 'on'), 203 array("'off'", 'off'), 204 205 array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)), 206 array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)), 207 array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)), 208 array('1960-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 1960)), 209 array('1730-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 1730)), 210 211 array('"a \\"string\\" with \'quoted strings inside\'"', 'a "string" with \'quoted strings inside\''), 212 array("'a \"string\" with ''quoted strings inside'''", 'a "string" with \'quoted strings inside\''), 201 213 202 214 // sequences 203 215 // urls are no key value mapping. see #3609. Valid yaml "key: value" mappings require a space after the colon 204 '[foo, http://urls.are/no/mappings, false, null, 12]' => array('foo', 'http://urls.are/no/mappings', false, null, 12),205 '[ foo , bar , false , null , 12 ]' => array('foo', 'bar', false, null, 12),206 '[\'foo,bar\', \'foo bar\']' => array('foo,bar', 'foo bar'),216 array('[foo, http://urls.are/no/mappings, false, null, 12]', array('foo', 'http://urls.are/no/mappings', false, null, 12)), 217 array('[ foo , bar , false , null , 12 ]', array('foo', 'bar', false, null, 12)), 218 array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), 207 219 208 220 // mappings 209 '{foo:bar,bar:foo,false:false,null:null,integer:12}' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12),210 '{ foo : bar, bar : foo, false : false, null : null, integer : 12 }' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12),211 '{foo: \'bar\', bar: \'foo: bar\'}' => array('foo' => 'bar', 'bar' => 'foo: bar'),212 '{\'foo\': \'bar\', "bar": \'foo: bar\'}' => array('foo' => 'bar', 'bar' => 'foo: bar'),213 '{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}' => array('foo\'' => 'bar', "bar\"" => 'foo: bar'),214 '{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}' => array('foo: ' => 'bar', "bar: " => 'foo: bar'),221 array('{foo:bar,bar:foo,false:false,null:null,integer:12}', array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), 222 array('{ foo : bar, bar : foo, false : false, null : null, integer : 12 }', array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), 223 array('{foo: \'bar\', bar: \'foo: bar\'}', array('foo' => 'bar', 'bar' => 'foo: bar')), 224 array('{\'foo\': \'bar\', "bar": \'foo: bar\'}', array('foo' => 'bar', 'bar' => 'foo: bar')), 225 array('{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}', array('foo\'' => 'bar', "bar\"" => 'foo: bar')), 226 array('{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}', array('foo: ' => 'bar', "bar: " => 'foo: bar')), 215 227 216 228 // nested sequences and mappings 217 '[foo, [bar, foo]]' => array('foo', array('bar', 'foo')),218 '[foo, {bar: foo}]' => array('foo', array('bar' => 'foo')),219 '{ foo: {bar: foo} }' => array('foo' => array('bar' => 'foo')),220 '{ foo: [bar, foo] }' => array('foo' => array('bar', 'foo')),221 222 '[ foo, [ bar, foo ] ]' => array('foo', array('bar', 'foo')),223 224 '[{ foo: {bar: foo} }]' => array(array('foo' => array('bar' => 'foo'))),225 226 '[foo, [bar, [foo, [bar, foo]], foo]]' => array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo')),227 228 '[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))),229 230 '[foo, bar: { foo: bar }]' => array('foo', '1' => array('bar' => array('foo' => 'bar'))),231 '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container'),232 ); 233 } 234 235 p rotected function getTestsForDump()229 array('[foo, [bar, foo]]', array('foo', array('bar', 'foo'))), 230 array('[foo, {bar: foo}]', array('foo', array('bar' => 'foo'))), 231 array('{ foo: {bar: foo} }', array('foo' => array('bar' => 'foo'))), 232 array('{ foo: [bar, foo] }', array('foo' => array('bar', 'foo'))), 233 234 array('[ foo, [ bar, foo ] ]', array('foo', array('bar', 'foo'))), 235 236 array('[{ foo: {bar: foo} }]', array(array('foo' => array('bar' => 'foo')))), 237 238 array('[foo, [bar, [foo, [bar, foo]], foo]]', array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo'))), 239 240 array('[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]', array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo')))), 241 242 array('[foo, bar: { foo: bar }]', array('foo', '1' => array('bar' => array('foo' => 'bar')))), 243 array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), 244 ); 245 } 246 247 public function getTestsForParseWithMapObjects() 236 248 { 237 249 return array( 238 'null' => null, 239 'false' => false, 240 'true' => true, 241 '12' => 12, 242 "'quoted string'" => 'quoted string', 243 '12.30e+02' => 12.30e+02, 244 '1234' => 0x4D2, 245 '1243' => 02333, 246 '.Inf' => -log(0), 247 '-.Inf' => log(0), 248 "'686e444'" => '686e444', 249 '"foo\r\nbar"' => "foo\r\nbar", 250 "'foo#bar'" => 'foo#bar', 251 "'foo # bar'" => 'foo # bar', 252 "'#cfcfcf'" => '#cfcfcf', 253 254 "'a \"string\" with ''quoted strings inside'''" => 'a "string" with \'quoted strings inside\'', 255 256 "'-dash'" => '-dash', 257 "'-'" => '-', 250 array('', ''), 251 array('null', null), 252 array('false', false), 253 array('true', true), 254 array('12', 12), 255 array('-12', -12), 256 array('"quoted string"', 'quoted string'), 257 array("'quoted string'", 'quoted string'), 258 array('12.30e+02', 12.30e+02), 259 array('0x4D2', 0x4D2), 260 array('02333', 02333), 261 array('.Inf', -log(0)), 262 array('-.Inf', log(0)), 263 array("'686e444'", '686e444'), 264 array('686e444', 646e444), 265 array('123456789123456789123456789123456789', '123456789123456789123456789123456789'), 266 array('"foo\r\nbar"', "foo\r\nbar"), 267 array("'foo#bar'", 'foo#bar'), 268 array("'foo # bar'", 'foo # bar'), 269 array("'#cfcfcf'", '#cfcfcf'), 270 array('::form_base.html.twig', '::form_base.html.twig'), 271 272 array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)), 273 array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)), 274 array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)), 275 array('1960-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 1960)), 276 array('1730-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 1730)), 277 278 array('"a \\"string\\" with \'quoted strings inside\'"', 'a "string" with \'quoted strings inside\''), 279 array("'a \"string\" with ''quoted strings inside'''", 'a "string" with \'quoted strings inside\''), 258 280 259 281 // sequences 260 '[foo, bar, false, null, 12]' => array('foo', 'bar', false, null, 12), 261 '[\'foo,bar\', \'foo bar\']' => array('foo,bar', 'foo bar'), 282 // urls are no key value mapping. see #3609. Valid yaml "key: value" mappings require a space after the colon 283 array('[foo, http://urls.are/no/mappings, false, null, 12]', array('foo', 'http://urls.are/no/mappings', false, null, 12)), 284 array('[ foo , bar , false , null , 12 ]', array('foo', 'bar', false, null, 12)), 285 array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), 262 286 263 287 // mappings 264 '{ foo: bar, bar: foo, \'false\': false, \'null\': null, integer: 12 }' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12), 265 '{ foo: bar, bar: \'foo: bar\' }' => array('foo' => 'bar', 'bar' => 'foo: bar'), 288 array('{foo:bar,bar:foo,false:false,null:null,integer:12}', (object) array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), 289 array('{ foo : bar, bar : foo, false : false, null : null, integer : 12 }', (object) array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), 290 array('{foo: \'bar\', bar: \'foo: bar\'}', (object) array('foo' => 'bar', 'bar' => 'foo: bar')), 291 array('{\'foo\': \'bar\', "bar": \'foo: bar\'}', (object) array('foo' => 'bar', 'bar' => 'foo: bar')), 292 array('{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}', (object) array('foo\'' => 'bar', "bar\"" => 'foo: bar')), 293 array('{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}', (object) array('foo: ' => 'bar', "bar: " => 'foo: bar')), 266 294 267 295 // nested sequences and mappings 268 '[foo, [bar, foo]]' => array('foo', array('bar', 'foo')), 269 270 '[foo, [bar, [foo, [bar, foo]], foo]]' => array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo')), 271 272 '{ foo: { bar: foo } }' => array('foo' => array('bar' => 'foo')), 273 274 '[foo, { bar: foo }]' => array('foo', array('bar' => 'foo')), 275 276 '[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), 277 278 '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container'), 296 array('[foo, [bar, foo]]', array('foo', array('bar', 'foo'))), 297 array('[foo, {bar: foo}]', array('foo', (object) array('bar' => 'foo'))), 298 array('{ foo: {bar: foo} }', (object) array('foo' => (object) array('bar' => 'foo'))), 299 array('{ foo: [bar, foo] }', (object) array('foo' => array('bar', 'foo'))), 300 301 array('[ foo, [ bar, foo ] ]', array('foo', array('bar', 'foo'))), 302 303 array('[{ foo: {bar: foo} }]', array((object) array('foo' => (object) array('bar' => 'foo')))), 304 305 array('[foo, [bar, [foo, [bar, foo]], foo]]', array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo'))), 306 307 array('[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]', array('foo', (object) array('bar' => 'foo', 'foo' => array('foo', (object) array('bar' => 'foo'))), array('foo', (object) array('bar' => 'foo')))), 308 309 array('[foo, bar: { foo: bar }]', array('foo', '1' => (object) array('bar' => (object) array('foo' => 'bar')))), 310 array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', (object) array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), 311 312 array('{}', new \stdClass()), 313 array('{ foo : bar, bar : {} }', (object) array('foo' => 'bar', 'bar' => new \stdClass())), 314 array('{ foo : [], bar : {} }', (object) array('foo' => array(), 'bar' => new \stdClass())), 315 array('{foo: \'bar\', bar: {} }', (object) array('foo' => 'bar', 'bar' => new \stdClass())), 316 array('{\'foo\': \'bar\', "bar": {}}', (object) array('foo' => 'bar', 'bar' => new \stdClass())), 317 array('{\'foo\': \'bar\', "bar": \'{}\'}', (object) array('foo' => 'bar', 'bar' => '{}')), 318 319 array('[foo, [{}, {}]]', array('foo', array(new \stdClass(), new \stdClass()))), 320 array('[foo, [[], {}]]', array('foo', array(array(), new \stdClass()))), 321 array('[foo, [[{}, {}], {}]]', array('foo', array(array(new \stdClass(), new \stdClass()), new \stdClass()))), 322 array('[foo, {bar: {}}]', array('foo', '1' => (object) array('bar' => new \stdClass()))), 323 ); 324 } 325 326 public function getTestsForDump() 327 { 328 return array( 329 array('null', null), 330 array('false', false), 331 array('true', true), 332 array('12', 12), 333 array("'quoted string'", 'quoted string'), 334 array('!!float 1230', 12.30e+02), 335 array('1234', 0x4D2), 336 array('1243', 02333), 337 array('.Inf', -log(0)), 338 array('-.Inf', log(0)), 339 array("'686e444'", '686e444'), 340 array('"foo\r\nbar"', "foo\r\nbar"), 341 array("'foo#bar'", 'foo#bar'), 342 array("'foo # bar'", 'foo # bar'), 343 array("'#cfcfcf'", '#cfcfcf'), 344 345 array("'a \"string\" with ''quoted strings inside'''", 'a "string" with \'quoted strings inside\''), 346 347 array("'-dash'", '-dash'), 348 array("'-'", '-'), 349 350 // Pre-YAML-1.2 booleans 351 array("'y'", 'y'), 352 array("'n'", 'n'), 353 array("'yes'", 'yes'), 354 array("'no'", 'no'), 355 array("'on'", 'on'), 356 array("'off'", 'off'), 357 358 // sequences 359 array('[foo, bar, false, null, 12]', array('foo', 'bar', false, null, 12)), 360 array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), 361 362 // mappings 363 array('{ foo: bar, bar: foo, \'false\': false, \'null\': null, integer: 12 }', array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), 364 array('{ foo: bar, bar: \'foo: bar\' }', array('foo' => 'bar', 'bar' => 'foo: bar')), 365 366 // nested sequences and mappings 367 array('[foo, [bar, foo]]', array('foo', array('bar', 'foo'))), 368 369 array('[foo, [bar, [foo, [bar, foo]], foo]]', array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo'))), 370 371 array('{ foo: { bar: foo } }', array('foo' => array('bar' => 'foo'))), 372 373 array('[foo, { bar: foo }]', array('foo', array('bar' => 'foo'))), 374 375 array('[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]', array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo')))), 376 377 array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), 279 378 ); 280 379 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php
r986149 r1098219 13 13 14 14 use Symfony\Component\Yaml\Exception\ParseException; 15 use Symfony\Component\Yaml\Yaml;16 15 17 16 class ParseExceptionTest extends \PHPUnit_Framework_TestCase … … 20 19 { 21 20 $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml'); 22 if ( version_compare(PHP_VERSION, '5.4.0', '>=')) {21 if (PHP_VERSION_ID >= 50400) { 23 22 $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")'; 24 23 } else { … … 28 27 $this->assertEquals($message, $exception->getMessage()); 29 28 } 29 30 public function testGetMessageWithUnicodeInFilename() 31 { 32 $exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml'); 33 if (PHP_VERSION_ID >= 50400) { 34 $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")'; 35 } else { 36 $message = 'Error message in "\u00e4\u00f6\u00fc.yml" at line 42 (near "foo: bar")'; 37 } 38 39 $this->assertEquals($message, $exception->getMessage()); 40 } 30 41 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php
r1000678 r1098219 465 465 466 466 /** 467 *468 467 * @expectedException \Symfony\Component\Yaml\Exception\ParseException 469 *470 468 */ 471 469 public function testUnindentedCollectionException() … … 481 479 482 480 $this->parser->parse($yaml); 481 } 482 483 /** 484 * @expectedException \Symfony\Component\Yaml\Exception\ParseException 485 */ 486 public function testShortcutKeyUnindentedCollectionException() 487 { 488 $yaml = <<<EOF 489 490 collection: 491 - key: foo 492 foo: bar 493 494 EOF; 495 496 $this->parser->parse($yaml); 497 } 498 499 /** 500 * @expectedException \Symfony\Component\Yaml\Exception\ParseException 501 * @expectedExceptionMessage Multiple documents are not supported. 502 */ 503 public function testMultipleDocumentsNotSupportedException() 504 { 505 Yaml::parse(<<<EOL 506 # Ranking of 1998 home runs 507 --- 508 - Mark McGwire 509 - Sammy Sosa 510 - Ken Griffey 511 512 # Team ranking 513 --- 514 - Chicago Cubs 515 - St Louis Cardinals 516 EOL 517 ); 483 518 } 484 519 … … 625 660 { 626 661 $this->assertEquals(array(array( 627 'title' => 'some title',662 'title' => 'some title', 628 663 'content' => <<<EOT 629 664 # comment 1 … … 679 714 )); 680 715 } 716 717 public function testYamlDirective() 718 { 719 $yaml = <<<EOF 720 %YAML 1.2 721 --- 722 foo: 1 723 bar: 2 724 EOF; 725 $this->assertEquals(array('foo' => 1, 'bar' => 2), $this->parser->parse($yaml)); 726 } 681 727 } 682 728 -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php
r1000678 r1098219 60 60 61 61 /** 62 * Unescapes a character that was found in a double-quoted string 62 * Unescapes a character that was found in a double-quoted string. 63 63 * 64 64 * @param string $value An escaped character -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php
r986149 r1098219 39 39 * as an input is a deprecated feature and will be removed in 3.0. 40 40 * 41 * @param string $input Path to a YAML file or a string containing YAML42 * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise43 * @param bool $objectSupport True if object support is enabled, false otherwise41 * @param string $input Path to a YAML file or a string containing YAML 42 * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise 43 * @param bool $objectSupport True if object support is enabled, false otherwise 44 44 * 45 45 * @return array The YAML converted to a PHP array … … 81 81 * to convert the array into friendly YAML. 82 82 * 83 * @param array $array PHP array84 * @param int $inline The level where you switch to inline YAML85 * @param int $indent The amount of spaces to use for indentation of nested nodes.86 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise87 * @param bool $objectSupport true if object support is enabled, false otherwise83 * @param array $array PHP array 84 * @param int $inline The level where you switch to inline YAML 85 * @param int $indent The amount of spaces to use for indentation of nested nodes. 86 * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise 87 * @param bool $objectSupport true if object support is enabled, false otherwise 88 88 * 89 89 * @return string A YAML string representing the original PHP array -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json
r986149 r1098219 26 26 "extra": { 27 27 "branch-alias": { 28 "dev-master": "2. 5-dev"28 "dev-master": "2.6-dev" 29 29 } 30 30 } -
mgrt/trunk/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist
r986149 r1098219 7 7 bootstrap="vendor/autoload.php" 8 8 > 9 <php> 10 <!-- php -r 'echo -1 & ~E_USER_DEPRECATED;' --> 11 <ini name="error_reporting" value="-16385"/> 12 </php> 9 13 <testsuites> 10 14 <testsuite name="Symfony Yaml Component Test Suite">
Note: See TracChangeset
for help on using the changeset viewer.