Browse Source

[EventDispatched] Event doesn't need to implement ArrayAccess

Jordi Boggiano 14 năm trước cách đây
mục cha
commit
bf1eb56a34
1 tập tin đã thay đổi với 1 bổ sung50 xóa
  1. 1 50
      src/Symfony/Component/EventDispatcher/Event.php

+ 1 - 50
src/Symfony/Component/EventDispatcher/Event.php

@@ -15,7 +15,7 @@ namespace Symfony\Component\EventDispatcher;
  *
  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  */
-class Event implements \ArrayAccess
+class Event
 {
     protected $value = null;
     protected $processed = false;
@@ -147,53 +147,4 @@ class Event implements \ArrayAccess
     {
         $this->parameters[$name] = $value;
     }
-
-    /**
-     * Returns true if the parameter exists (implements the ArrayAccess interface).
-     *
-     * @param  string  $name  The parameter name
-     *
-     * @return Boolean true if the parameter exists, false otherwise
-     */
-    public function offsetExists($name)
-    {
-        return array_key_exists($name, $this->parameters);
-    }
-
-    /**
-     * Returns a parameter value (implements the ArrayAccess interface).
-     *
-     * @param  string  $name  The parameter name
-     *
-     * @return mixed  The parameter value
-     */
-    public function offsetGet($name)
-    {
-        if (!array_key_exists($name, $this->parameters)) {
-            throw new \InvalidArgumentException(sprintf('The event "%s" has no "%s" parameter.', $this->name, $name));
-        }
-
-        return $this->parameters[$name];
-    }
-
-    /**
-     * Sets a parameter (implements the ArrayAccess interface).
-     *
-     * @param string  $name   The parameter name
-     * @param mixed   $value  The parameter value
-     */
-    public function offsetSet($name, $value)
-    {
-        $this->parameters[$name] = $value;
-    }
-
-    /**
-     * Removes a parameter (implements the ArrayAccess interface).
-     *
-     * @param string $name    The parameter name
-     */
-    public function offsetUnset($name)
-    {
-        unset($this->parameters[$name]);
-    }
 }