Plugin::__invoke()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Minotaur
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
 * use this file except in compliance with the License. You may obtain a copy of
8
 * the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
 * License for the specific language governing permissions and limitations under
16
 * the License.
17
 *
18
 * @copyright 2015-2017 Appertly
19
 * @license   Apache-2.0
20
 */
21
namespace Minotaur\Route;
22
23
use Psr\Http\Message\ServerRequestInterface as Request;
24
use Psr\Http\Message\ResponseInterface as Response;
25
26
/**
27
 * Ability to influence front controller.
28
 */
29
interface Plugin
30
{
31
    /**
32
     * Gets the plugin priority; larger means first.
33
     *
34
     * @return int The plugin priority
35
     */
36
    public function getPriority(): int;
37
38
    /**
39
     * Middleware request–response handling.
40
     *
41
     * @param \Psr\Http\Message\ServerRequestInterface $request The server request
42
     * @param \Psr\Http\Message\ResponseInterface $response The response
43
     * @param callable $callable A function accepting a Request and a Response, returning a Response.
0 ignored issues
show
Bug introduced by
There is no parameter named $callable. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
44
     * @return \Psr\Http\Message\ResponseInterface The response
45
     */
46
    public function __invoke(Request $request, Response $response, callable $next): Response;
47
}
48