fix: Argument #2 () cannot be null
This commit is contained in:
1007
composer.lock
generated
1007
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Bsr\Webservice;
|
||||
|
||||
use Bsr\Webservice\Exception\BugException;
|
||||
use Bsr\Webservice\Exception\WebException;
|
||||
use Bsr\Webservice\Formatter\Html;
|
||||
|
||||
@@ -16,7 +17,7 @@ class Help
|
||||
* @param mixed $ws
|
||||
* @param sting $func the function to be presented
|
||||
*/
|
||||
private static function func($ws, $func)
|
||||
private static function func($ws, string $func)
|
||||
{
|
||||
try {
|
||||
$rm = new \ReflectionMethod($ws, $func);
|
||||
|
||||
@@ -32,7 +32,7 @@ abstract class WebService
|
||||
Logger::start(array('version' => $this->version));
|
||||
|
||||
$rendererClass = Configuration::get('renderer.class', __NAMESPACE__ . '\Renderer');
|
||||
$renderer = new $rendererClass;
|
||||
$renderer = new $rendererClass;
|
||||
|
||||
$data = array();
|
||||
|
||||
@@ -51,7 +51,9 @@ abstract class WebService
|
||||
$data["error"]["reason"] = $e->getMessage();
|
||||
$data["error"]["name"] = $e->getName();
|
||||
|
||||
$data['extra'] = Help::exception($e, $this, $this->func);
|
||||
if ($this->func !== null) {
|
||||
$data['extra'] = Help::exception($e, $this, $this->func);
|
||||
}
|
||||
|
||||
$this->status = 400;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user