for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LeKoala\DebugBar;
use DebugBar\OpenHandler;
use LeKoala\DebugBar\DebugBar;
use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;
/**
* A open handler controller for DebugBar
*
* @author Koala
*/
class DebugBarController extends Controller
{
public function index(HTTPRequest $request)
$request
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function index(/** @scrutinizer ignore-unused */ HTTPRequest $request)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if (!DebugBar::config()->get('enable_storage')) {
return $this->httpError(404, 'Storage not enabled');
}
$debugbar = DebugBar::getDebugBar();
if (!$debugbar) {
$debugbar
DebugBar\DebugBar
true
return $this->httpError(404, 'DebugBar not enabled');
$openHandler = new OpenHandler($debugbar);
$openHandler->handle();
exit(); // Handle will echo and set headers
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.