From f8af2d3ba64548ef8178cd207a6bea3e8a2f87ff Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Fri, 6 Dec 2019 00:16:36 -0700 Subject: [PATCH] Minor fixes --- app/Bootstrap/ViewComposer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Bootstrap/ViewComposer.php b/app/Bootstrap/ViewComposer.php index 4a0d0aa..3cacc16 100644 --- a/app/Bootstrap/ViewComposer.php +++ b/app/Bootstrap/ViewComposer.php @@ -22,6 +22,7 @@ class ViewComposer * Create a new ViewComposer object. * * @param \PHLAK\Config\Config $config + * @param \Slim\Views\Twig $twig */ public function __construct(Config $config, Twig $twig) { @@ -65,7 +66,7 @@ class ViewComposer $this->twig->getEnvironment()->addFunction( new TwigFunction('sizeForHumans', function (int $bytes) { $sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; - $factor = (int) floor((strlen($bytes) - 1) / 3); + $factor = (int) floor((strlen((string) $bytes) - 1) / 3); return sprintf('%.2f', $bytes / pow(1024, $factor)) . $sizes[$factor]; })