LaravelTracyController::bar()   A
last analyzed

Complexity

Conditions 3
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
nc 1
nop 3
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
ccs 7
cts 7
cp 1
crap 3
1
<?php
2
3
namespace Recca0120\LaravelTracy\Http\Controllers;
4
5
use Illuminate\Contracts\Routing\ResponseFactory;
6
use Illuminate\Http\Request;
7
use Illuminate\Routing\Controller;
8
use Recca0120\LaravelTracy\DebuggerManager;
9
10
class LaravelTracyController extends Controller
11
{
12
    /**
13
     * bar.
14
     *
15
     * @param \Recca0120\LaravelTracy\DebuggerManager $debuggerManager
16
     * @param \Illuminate\Http\Request $request
17
     * @param \Illuminate\Contracts\Routing\ResponseFactory $responseFactory
18
     * @param string $type
0 ignored issues
show
Bug introduced by
There is no parameter named $type. 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...
19
     * @return \Illuminate\Http\Response
20
     */
21 1
    public function bar(DebuggerManager $debuggerManager, Request $request, ResponseFactory $responseFactory)
22
    {
23
        return $responseFactory->stream(function () use ($debuggerManager, $request) {
24 1
            list($headers, $content) = $debuggerManager->dispatchAssets($request->get('_tracy_bar'));
25 1
            if (headers_sent() === false) {
26 1
                foreach ($headers as $name => $value) {
27 1
                    header(sprintf('%s: %s', $name, $value), true, 200);
28
                }
29
            }
30 1
            echo $content;
31 1
        }, 200);
32
    }
33
}
34