Adamgoose\Routing\Annotations\Annotations\Middleware::modifyCollection PHP Method

modifyCollection() public method

public modifyCollection ( EndpointCollection $endpoints, ReflectionClass $class )
$endpoints Adamgoose\Routing\Annotations\EndpointCollection
$class ReflectionClass
    public function modifyCollection(EndpointCollection $endpoints, ReflectionClass $class)
    {
        foreach ($endpoints as $endpoint) {
            foreach ((array) $this->value as $middleware) {
                $endpoint->classMiddleware[] = ['name' => $middleware, 'only' => (array) $this->only, 'except' => (array) $this->except];
            }
        }
    }