diff --git a/app/src/ViewFunctions/SizeForHumans.php b/app/src/ViewFunctions/SizeForHumans.php index a98cd93..24a2cdb 100644 --- a/app/src/ViewFunctions/SizeForHumans.php +++ b/app/src/ViewFunctions/SizeForHumans.php @@ -7,7 +7,7 @@ use Symfony\Component\Finder\SplFileInfo; class SizeForHumans extends ViewFunction { /** @var string The function name */ - protected $name = 'sizeForHumans'; + protected $name = 'size_for_humans'; /** * Get the human readable file size from a file object. diff --git a/app/views/components/file.twig b/app/views/components/file.twig index c30ae59..06a1bfc 100644 --- a/app/views/components/file.twig +++ b/app/views/components/file.twig @@ -31,7 +31,7 @@ {% if parentDir or file.isDir %} — {% else %} - {{ sizeForHumans(file) }} + {{ size_for_humans(file) }} {% endif %} diff --git a/tests/Factories/TwigFactoryTest.php b/tests/Factories/TwigFactoryTest.php index c49f59e..3b4e3ef 100644 --- a/tests/Factories/TwigFactoryTest.php +++ b/tests/Factories/TwigFactoryTest.php @@ -64,7 +64,7 @@ class TwigFactoryTest extends TestCase $this->assertInstanceOf( ViewFunctions\SizeForHumans::class, - $twig->getEnvironment()->getFunction('sizeForHumans')->getCallable() + $twig->getEnvironment()->getFunction('size_for_humans')->getCallable() ); $this->assertInstanceOf(