Completed
Push — master ( 69db4e...f5c0e9 )
by recca
04:00 queued 01:26
created

LaravelTracyController::bar()   A

Complexity

Conditions 3
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 8
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 12
ccs 9
cts 9
cp 1
crap 3
rs 9.4285
1
<?php
2
3
namespace Recca0120\LaravelTracy\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Routing\Controller;
7
use Recca0120\LaravelTracy\DebuggerManager;
8
use Illuminate\Contracts\Routing\ResponseFactory;
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
    public function bar(DebuggerManager $debuggerManager, Request $request, ResponseFactory $responseFactory)
22
    {
23 1
        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 1
                }
29 1
            }
30 1
            echo $content;
31 1
        }, 200);
32
    }
33
}
34