Strategy::__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
nc 1
1
<?php
2
3
namespace Mpociot\ApiDoc\Extracting\Strategies;
4
5
use Illuminate\Routing\Route;
6
use Mpociot\ApiDoc\Tools\DocumentationConfig;
7
use ReflectionClass;
8
use ReflectionMethod;
9
10
abstract class Strategy
11
{
12
    /**
13
     * @var DocumentationConfig The apidoc config
14
     */
15
    protected $config;
16
17
    /**
18
     * @var string The current stage of route processing
19
     */
20
    protected $stage;
21
22
    public function __construct(string $stage, DocumentationConfig $config)
23
    {
24
        $this->stage = $stage;
25
        $this->config = $config;
26
    }
27
28
    /**
29
     * @param Route $route
30
     * @param ReflectionClass $controller
31
     * @param ReflectionMethod $method
32
     * @param array $routeRules Array of rules for the ruleset which this route belongs to.
33
     * @param array $context Results from the previous stages
34
     *
35
     * @throws \Exception
36
     *
37
     * @return array|null
38
     */
39
    abstract public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $routeRules, array $context = []);
40
}
41