Permalink
Browse files

Making it easier to add event subscribers

  • Loading branch information...
1 parent 596783e commit fdd4d49bcad338e18bb7f50ee29b2a251b2c13c2 @mtdowling mtdowling committed Jun 3, 2012
Showing with 13 additions and 2 deletions.
  1. +13 −2 Message/Request.php
View
@@ -16,6 +16,7 @@
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* HTTP request class to send requests
@@ -274,7 +275,7 @@ public function setUrl($url)
* Send the request
*
* @return Response
- * @throws RequestException on a request error
+ * @throws RuntimeException if a client is not associated with the request
*/
public function send()
{
@@ -481,7 +482,6 @@ public function getPassword()
* @return Request
*
* @see http://www.ietf.org/rfc/rfc2617.txt
- * @throws RequestException
*/
public function setAuth($user, $password = '', $scheme = CURLAUTH_BASIC)
{
@@ -800,6 +800,17 @@ public function dispatch($eventName, array $context = array())
/**
* {@inheritdoc}
+ * @codeCoverageIgnore
+ */
+ public function addSubscriber(EventSubscriberInterface $subscriber)
+ {
+ $this->getEventDispatcher()->addSubscriber($subscriber);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
*/
protected function changedHeader($action, $header)
{

0 comments on commit fdd4d49

Please sign in to comment.