mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix various code.
This commit is contained in:
@@ -39,6 +39,8 @@ use Twig\TwigFilter;
|
||||
use Twig\TwigFunction;
|
||||
use Override;
|
||||
|
||||
use function Safe\parse_url;
|
||||
|
||||
/**
|
||||
* Class TwigSupport.
|
||||
*/
|
||||
@@ -64,7 +66,7 @@ class General extends AbstractExtension
|
||||
return new TwigFilter(
|
||||
'balance',
|
||||
static function (?Account $account): string {
|
||||
if (null === $account) {
|
||||
if (!$account instanceof Account) {
|
||||
return '0';
|
||||
}
|
||||
|
||||
@@ -180,8 +182,8 @@ class General extends AbstractExtension
|
||||
return new TwigFilter(
|
||||
'phphost',
|
||||
static function (string $string): string {
|
||||
$proto = (string) \Safe\parse_url($string, PHP_URL_SCHEME);
|
||||
$host = (string) \Safe\parse_url($string, PHP_URL_HOST);
|
||||
$proto = (string) parse_url($string, PHP_URL_SCHEME);
|
||||
$host = (string) parse_url($string, PHP_URL_HOST);
|
||||
|
||||
return e(sprintf('%s://%s', $proto, $host));
|
||||
}
|
||||
|
Reference in New Issue
Block a user