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

modify() public method

public modify ( MethodEndpoint $endpoint, ReflectionMethod $method )
$endpoint Adamgoose\Routing\Annotations\MethodEndpoint
$method ReflectionMethod
    public function modify(MethodEndpoint $endpoint, ReflectionMethod $method)
    {
        if ($endpoint->hasPaths()) {
            foreach ($endpoint->getPaths() as $path) {
                $path->middleware = array_merge($path->middleware, (array) $this->value);
            }
        } else {
            $endpoint->middleware = array_merge($endpoint->middleware, (array) $this->value);
        }
    }