/** * Return specified Feed instance if exists. * * @param string $feedName * * @throws \InvalidArgumentException * * @return Feed */ public function get($feedName) { if (!$this->has($feedName)) { throw new \InvalidArgumentException(sprintf("Specified feed '%s' is not defined in your configuration.", $feedName)); } if (!isset($this->feeds[$feedName])) { $feed = new Feed($this->config['feeds'][$feedName], $this->formatters); $feed->setRouter($this->router); $this->feeds[$feedName] = $feed; } return $this->feeds[$feedName]; }