borderManager = $locator; return $this; } /** * @return Manager */ public function getBorderManager() { if ($this->borderManager instanceof Manager) { return $this->borderManager; } if (null === $this->borderManager) { throw new \LogicException('DeliverDataInterface locator was not set'); } $instance = call_user_func($this->borderManager); if (!$instance instanceof Manager) { throw new \LogicException(sprintf( 'Expects locator to return instance of "%s", got "%s"', Manager::class, is_object($instance) ? get_class($instance) : gettype($instance) )); } $this->borderManager = $instance; return $this->borderManager; } }