for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace Venta\Framework\ErrorHandler;
use Psr\Log\{
LoggerInterface, LogLevel
};
use Whoops\Handler\Handler;
/**
* Class ErrorHandlerLogger
*
* @package Venta\ErrorHandler
*/
class ErrorHandlerLogger extends Handler
{
* Logger instance
* @var LoggerInterface
protected $logger;
* ErrorHandlerLogger constructor.
* @param LoggerInterface $logger
$logger
\Psr\Log\LoggerInterface
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
public function __construct(LoggerInterface $logger)
$this->logger = $logger;
object<Psr\Log\LoggerInterface>
object<LoggerInterface>
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* Logging exception
* @return int
public function handle()
$e = $this->getException();
$this->logger->log(
$e instanceof \Error ? LogLevel::CRITICAL : LogLevel::ERROR,
$e->getMessage(),
['exception' => $e]
);
return self::DONE;
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.