Refactor: Probleme für PHP-Storm beseitigen
This commit is contained in:
@@ -31,7 +31,6 @@ class ErrorHandlerTest extends Unit
|
|||||||
protected function _before(): void
|
protected function _before(): void
|
||||||
{
|
{
|
||||||
parent::_before();
|
parent::_before();
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->app = $this->makeEmpty(App::class, [
|
$this->app = $this->makeEmpty(App::class, [
|
||||||
'getResponseFactory' => $this->makeEmpty(ResponseFactoryInterface::class, [
|
'getResponseFactory' => $this->makeEmpty(ResponseFactoryInterface::class, [
|
||||||
'createResponse' => $this->makeEmpty(ResponseInterface::class, [
|
'createResponse' => $this->makeEmpty(ResponseInterface::class, [
|
||||||
@@ -44,7 +43,6 @@ class ErrorHandlerTest extends Unit
|
|||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->request = $this->makeEmpty(ServerRequestInterface::class, [
|
$this->request = $this->makeEmpty(ServerRequestInterface::class, [
|
||||||
'getAttribute' => function ($name) {
|
'getAttribute' => function ($name) {
|
||||||
/** @noinspection PhpSwitchCanBeReplacedWithMatchExpressionInspection */
|
/** @noinspection PhpSwitchCanBeReplacedWithMatchExpressionInspection */
|
||||||
@@ -65,13 +63,11 @@ class ErrorHandlerTest extends Unit
|
|||||||
*/
|
*/
|
||||||
public function testUseWithLogger(): void
|
public function testUseWithLogger(): void
|
||||||
{
|
{
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->exception = $this->make(Exception::class, [
|
$this->exception = $this->make(Exception::class, [
|
||||||
'message' => '',
|
'message' => '',
|
||||||
'code' => 400,
|
'code' => 400,
|
||||||
'file' => '/path(to/file',
|
'file' => '/path(to/file',
|
||||||
]);
|
]);
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->logger = $this->makeEmpty(LoggerInterface::class, [
|
$this->logger = $this->makeEmpty(LoggerInterface::class, [
|
||||||
'error' => Expected::once(),
|
'error' => Expected::once(),
|
||||||
]);
|
]);
|
||||||
@@ -85,14 +81,12 @@ class ErrorHandlerTest extends Unit
|
|||||||
*/
|
*/
|
||||||
public function testUseWithHttpException(): void
|
public function testUseWithHttpException(): void
|
||||||
{
|
{
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->exception = $this->make(HttpException::class, [
|
$this->exception = $this->make(HttpException::class, [
|
||||||
'message' => '',
|
'message' => '',
|
||||||
'code' => 400,
|
'code' => 400,
|
||||||
'file' => '/path(to/file',
|
'file' => '/path(to/file',
|
||||||
'getTitle' => Expected::once('The Title'),
|
'getTitle' => Expected::once('The Title'),
|
||||||
]);
|
]);
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->logger = $this->makeEmpty(LoggerInterface::class, []);
|
$this->logger = $this->makeEmpty(LoggerInterface::class, []);
|
||||||
|
|
||||||
$middleWare = new ErrorHandler($this->app);
|
$middleWare = new ErrorHandler($this->app);
|
||||||
@@ -105,13 +99,11 @@ class ErrorHandlerTest extends Unit
|
|||||||
*/
|
*/
|
||||||
public function testUseWithGeneralException(): void
|
public function testUseWithGeneralException(): void
|
||||||
{
|
{
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->exception = $this->make(Exception::class, [
|
$this->exception = $this->make(Exception::class, [
|
||||||
'message' => '',
|
'message' => '',
|
||||||
'code' => 400,
|
'code' => 400,
|
||||||
'file' => '/path(to/file',
|
'file' => '/path(to/file',
|
||||||
]);
|
]);
|
||||||
/** @noinspection PhpFieldAssignmentTypeMismatchInspection */
|
|
||||||
$this->logger = $this->makeEmpty(LoggerInterface::class, []);
|
$this->logger = $this->makeEmpty(LoggerInterface::class, []);
|
||||||
|
|
||||||
$middleWare = new ErrorHandler($this->app);
|
$middleWare = new ErrorHandler($this->app);
|
||||||
|
|||||||
Reference in New Issue
Block a user