Skip to content

Commit 64e5210

Browse files
author
mbabjak
committed
ApiProblem::fromException use empty instead isset
1 parent 5ce879d commit 64e5210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ApiProblem/ApiProblem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function __construct($status, $detail, $title = '', $type = '', array $ad
128128
public static function fromException(Exception $exception, $title = '', $type = '', array $additionalDetails = [])
129129
{
130130
$eCode = $exception->getCode();
131-
$code = (isset($eCode) && is_int($eCode)) ? $eCode : 500;
131+
$code = (!empty($eCode) && is_int($eCode)) ? $eCode : 500;
132132

133133
if (0 === strlen($title) && 0 === strlen($type) && array_key_exists($code, self::$problemStatus)) {
134134
$title = (self::$problemStatus[$code]);

0 commit comments

Comments
 (0)