for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
require __DIR__ . '/vendor/autoload.php';
$logfile = new Logfile\Logfile('5d428582-7733-151c-4eaf-d23d0ebdca3b ');
$logfile->getSender()->setHost('localhost:3030');
$logfile->getSender()->setScheme('http');
$logfile->getConfig()->setUser(['id' => '4']);
$logfile->getConfig()->setTags([
'php_version' => phpversion(),
]);
$logfile->getConfig()->setRelease(exec('git log --pretty="%H" -n1 HEAD'));
$handler = new Logfile\MonologHandler($logfile);
$logger = new Monolog\Logger('debug');
$logger->pushProcessor(new Monolog\Processor\ProcessIdProcessor);
$logger->pushProcessor(new Monolog\Processor\MemoryUsageProcessor);
$logger->pushProcessor(new Monolog\Processor\MemoryPeakUsageProcessor);
$logger->pushHandler($handler);
// --------
set_exception_handler(function (Throwable $e) use($logfile, $logger) {
$logfile
This check looks for imports that have been defined, but are not used in the scope.
$logger->error($e->getMessage(), ['exception' => $e]);
});
function fail($how) {
$how
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
function fail(/** @scrutinizer ignore-unused */ $how) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
throw new ErrorException('whoops');
}
try {
fail('this');
} catch(ErrorException $e) {
throw new RuntimeException('doh!', 0, $e);
This check looks for imports that have been defined, but are not used in the scope.