/** * Set the domain on the endpoints. * * @param EndpointCollection $endpoints * @return void */ protected function setEndpointDomains(EndpointCollection $endpoints) { foreach ($endpoints->getAllPaths() as $path) { if (is_null($path->domain)) { $path->domain = $this->domain; } } }
/** * {@inheritdoc} */ public function modifyCollection(EndpointCollection $endpoints, ReflectionClass $class) { foreach ($endpoints->getAllPaths() as $path) { $path->where = array_merge($path->where, $this->value); } }
/** * Create a new endpoint in the collection. * * @param \Adamgoose\Routing\Annotations\EndpointCollection $endpoints * @param \ReflectionClass $class * @param string $method * @param array $annotations * @return void */ protected function addEndpoint(EndpointCollection $endpoints, ReflectionClass $class, $method, array $annotations) { $endpoints->push($endpoint = new MethodEndpoint(['reflection' => $class, 'method' => $method, 'uses' => $class->name . '@' . $method])); foreach ($annotations as $annotation) { $annotation->modify($endpoint, $class->getMethod($method)); } }
/** * {@inheritdoc} */ public function modifyCollection(EndpointCollection $endpoints, ReflectionClass $class) { $endpoints->push(new ResourceEndpoint(['reflection' => $class, 'name' => $this->value, 'names' => (array) $this->names, 'only' => (array) $this->only, 'except' => (array) $this->except, 'middleware' => $this->getMiddleware($endpoints)])); }