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

FirewallPackage::addMiddleware()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
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