This commit is contained in:
James Cole
2021-02-23 17:43:34 +01:00
parent aa4695bbbf
commit fd0dc3d289
6 changed files with 85 additions and 75 deletions

View File

@@ -40,14 +40,10 @@ class ReportNewJournalsMail extends Mailable
{
use Queueable, SerializesModels;
/** @var string Email address of the user */
public $email;
/** @var Collection A collection of groups */
public $groups;
/** @var string IP address of user (if known) */
public $ipAddress;
/** @var array All groups, transformed to array. */
public $transformed;
public string $email;
public Collection $groups;
public string $ipAddress;
public array $transformed;
/**
* ConfirmEmailChangeMail constructor.

View File

@@ -50,6 +50,7 @@ class General extends AbstractExtension
$this->formatFilesize(),
$this->mimeIcon(),
$this->markdown(),
$this->floatval(),
];
}
@@ -297,6 +298,19 @@ class General extends AbstractExtension
);
}
/**
* @return TwigFilter
*/
protected function floatval(): TwigFilter
{
return new TwigFilter(
'floatval',
static function ($value): float {
return (float)$value;
}
);
}
/**
* Show icon with attachment.
*