protected function isOriginAllowed($origin) { if (!$origin) { throw new InvalidArgument('Origin cannot be empty.'); } if ($this->isAllOriginsAllowed()) { return true; } return in_array($origin, $this->allowOrigins); }