Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 59... Línea 59...
59
    ];
59
    ];
Línea 60... Línea 60...
60
 
60
 
61
    /**
61
    /**
62
     * @param callable $handler HTTP handler.
62
     * @param callable $handler HTTP handler.
63
     */
63
     */
64
    public function __construct(callable $handler = null)
64
    public function __construct(?callable $handler = null)
65
    {
65
    {
66
        $this->handler = $handler;
66
        $this->handler = $handler;
Línea 67... Línea 67...
67
    }
67
    }
Línea 114... Línea 114...
114
    {
114
    {
115
        return (bool) $this->handler;
115
        return (bool) $this->handler;
116
    }
116
    }
Línea 117... Línea 117...
117
 
117
 
-
 
118
    /**
-
 
119
     * Checks if a middleware exists. The middleware
-
 
120
     * should have been added with a name in order to
-
 
121
     * use this method.
-
 
122
     *
-
 
123
     * @param string $name
-
 
124
     *
-
 
125
     * @return bool
-
 
126
     */
-
 
127
    public function hasMiddleware(string $name): bool
-
 
128
    {
-
 
129
        return isset($this->named[$name]);
-
 
130
    }
-
 
131
 
118
    /**
132
    /**
119
     * Append a middleware to the init step.
133
     * Append a middleware to the init step.
120
     *
134
     *
121
     * @param callable $middleware Middleware function to add.
135
     * @param callable $middleware Middleware function to add.
122
     * @param string   $name       Name of the middleware.
136
     * @param string   $name       Name of the middleware.
Línea 275... Línea 289...
275
     * Aws\ResultInterface or rejected with an Aws\Exception\AwsException
289
     * Aws\ResultInterface or rejected with an Aws\Exception\AwsException
276
     * object.
290
     * object.
277
     *
291
     *
278
     * @param callable|null $fn Pass null to remove any previously set function
292
     * @param callable|null $fn Pass null to remove any previously set function
279
     */
293
     */
280
    public function interpose(callable $fn = null)
294
    public function interpose(?callable $fn = null)
281
    {
295
    {
282
        $this->sorted = null;
296
        $this->sorted = null;
283
        $this->interposeFn = $fn;
297
        $this->interposeFn = $fn;
284
    }
298
    }