public function offsetSet($offset, $value) { foreach ($this->items as $index => $item) { if ($item === $value) { $offset = $index; break; } } parent::offsetSet($offset, $value); }
public function offsetSet($offset, $value) { $this->validTypeThrow($value); return parent::offsetSet($offset, $value); }
/** * Adds the router. * @param mixed * @param IRouter * @return void */ public function offsetSet($index, $route) { if (!$route instanceof IRouter) { throw new InvalidArgumentException("Argument must be IRouter descendant."); } parent::offsetSet($index, $route); }
/** * Sets the value at the specified $index to $value. * * @param mixed $index * @param mixed $value * @return bool TRUE if the value has been set successfully */ public function offsetSet($index, $newval) { if (!$this->contains($newval, $this->strict)) { parent::offsetSet($index, $newval); return true; } return false; }