Completed
Push — master ( 67d491...cb55a8 )
by Derek Stephen
05:32
created

FirewallPackage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addToContainer() 0 5 1
A addMiddleware() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace Bone\Firewall;
4
5
use Barnacle\Container;
6
use Barnacle\RegistrationInterface;
7
use Bone\Http\Middleware\Stack;
8
use Bone\Http\MiddlewareAwareInterface;
9
10
class FirewallPackage implements RegistrationInterface, MiddlewareAwareInterface
11
{
12
    /**
13 1
     * @param Container $c
14
     */
15 1
    public function addToContainer(Container $c)
16 1
    {
17 1
        $firewall = new RouteFirewall($c);
18
        $c[RouteFirewall::class] = $firewall;
19
    }
20
21
    /**
22
     * @param Stack $stack
23
     * @param Container $container
0 ignored issues
show
Bug introduced by
There is no parameter named $container. 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...
24
     */
25
    public function addMiddleware(Stack $stack, Container $c): void
26
    {
27
        $firewall = $c->get(RouteFirewall::class);
28
        $stack->addMiddleWare($firewall);
29
    }
30
}
31