FooController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A foobarAction() 0 9 2
1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of the KleijnWeb\RestETagBundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\RestETagBundle\Tests\Functional\Foo\Controller;
10
11
use Symfony\Component\HttpFoundation\Request;
12
use Symfony\Component\HttpFoundation\Response;
13
14
/**
15
 * @author John Kleijn <[email protected]>
16
 */
17
class FooController
18
{
19
    /**
20
     * @var bool
21
     */
22
    private $invoked = false;
23
24
    /**
25
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
26
     * @param Request $request
27
     *
28
     * @return array
29
     */
30
    public function foobarAction(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
    {
32
        if ($this->invoked) {
33
            throw new \LogicException;
34
        }
35
        $this->invoked = true;
36
37
        return new Response();
38
    }
39
}
40