Strategy   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
__invoke() 0 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