for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
include_once __DIR__ . '/../lib/xmlrpc.inc';
include_once __DIR__ . '/../lib/xmlrpcs.inc';
include_once __DIR__ . '/parse_args.php';
include_once __DIR__ . '/PolyfillTestCase.php';
use PHPUnit\Runner\BaseTestRunner;
abstract class PhpXmlRpc_LoggerAwareTestCase extends PhpXmlRpc_PolyfillTestCase
{
protected $args = array();
protected $buffer = '';
/**
* hide debug messages and errors unless we either are in debug mode or the test fails
* @return void
*/
protected function set_up()
$this->args = argParser::getArgs();
if ($this->args['DEBUG'] == 0) {
$this->debugBuffer = '';
debugBuffer
$this->errorBuffer = '';
errorBuffer
\PhpXmlRpc\PhpXmlRpc::setLogger($this);
}
protected function tear_down()
if ($this->args['DEBUG'] > 0) {
return;
// reset the logger to the default
\PhpXmlRpc\PhpXmlRpc::setLogger(\PhpXmlRpc\Helper\Logger::instance());
$status = $this->getStatus();
if ($status == BaseTestRunner::STATUS_ERROR
|| $status == BaseTestRunner::STATUS_FAILURE) {
echo $this->buffer;
// logger API
public function debug($message, $context = array())
$context
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function debug($message, /** @scrutinizer ignore-unused */ $context = array())
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->buffer .= $message . "\n";
public function error($message, $context = array())
public function error($message, /** @scrutinizer ignore-unused */ $context = array())