Skip to content

Commit 9884711

Browse files
Exceptions with only file name (#94)
1 parent 6757ea2 commit 9884711

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Utilities/RequestParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class RequestParser
77
/** @return string */
88
public function getContentType()
99
{
10-
return $_SERVER['CONTENT_TYPE'];
10+
return $_SERVER['CONTENT_TYPE'] ?: '';
1111
}
1212

1313
/**

src/Utilities/TpayException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TpayException extends Exception
1313
*/
1414
public function __construct($message, $code = 0)
1515
{
16-
$message = sprintf('%s in file %s line: %s', $message, $this->getFile(), $this->getLine());
16+
$message = sprintf('%s in file %s line: %s', $message, basename($this->getFile()), $this->getLine());
1717
Logger::log(
1818
'TpayException',
1919
sprintf('%s %s%s%s', $message, PHP_EOL, PHP_EOL, $this->getTraceAsString()),

0 commit comments

Comments
 (0)