Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Attributes | Private Member Functions | List of all members
eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension Class Reference

Class FileSizeExtension. More...

Inheritance diagram for eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension:

## Public Member Functions
| __construct (TranslatorInterface $translator, array $suffixes, ConfigResolverInterface $configResolver, LocaleConverterInterface $localeConverter)
| getFilters ()
| Returns a list of filters to add to the existing list. More...
| sizeFilter ($number, $precision)
| Returns the binary file size, $precision will determine the decimal number precision, and the Locale will alter the format of the result by choosing between coma or point pattern. More...
| getName ()
| Returns the name of the extension. More...

## Protected Attributes
| $translator
| $suffixes
| $configResolver
| $localeConverter

## Private Member Functions
| getLocale ()

## Detailed Description

Class FileSizeExtension.

Definition at line 20 of file FileSizeExtension.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::__construct | ( | TranslatorInterface | $translator,
|  | array | $suffixes,
|  | ConfigResolverInterface | $configResolver,
|  | LocaleConverterInterface | $localeConverter
| ) |  |

Parameters

  TranslatorInterface | $translator |
  ConfigResolverInterface | $configResolver |
  LocaleConverterInterface | $localeConverter |
  array | $suffixes |

Definition at line 48 of file FileSizeExtension.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\$configResolver, eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\$localeConverter, eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\$suffixes, and eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\$translator.

## Member Function Documentation

## ◆ getFilters()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::getFilters | ( |  | ) |

Returns a list of filters to add to the existing list.

Returns
  array An array of filters

Definition at line 73 of file FileSizeExtension.php.

## ◆ getLocale()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::getLocale | ( |  | ) |
| private

Definition at line 56 of file FileSizeExtension.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\sizeFilter().

## ◆ getName()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::getName | ( |  | ) |

Returns the name of the extension.

Returns
  string The extension name

Definition at line 113 of file FileSizeExtension.php.

## ◆ sizeFilter()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::sizeFilter | ( |  | $number,
|  |  | $precision
| ) |  |

Returns the binary file size, $precision will determine the decimal number precision, and the Locale will alter the format of the result by choosing between coma or point pattern.

Parameters

  int | $number |
  int | $precision |

Returns
  string

Definition at line 89 of file FileSizeExtension.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\getLocale().

## Member Data Documentation

## ◆ $configResolver

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::$configResolver
| protected

Parameters

  ConfigResolverInterface | $configResolver |

Definition at line 35 of file FileSizeExtension.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\__construct().

## ◆ $localeConverter

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::$localeConverter
| protected

Parameters

  LocaleConverterInterface | $localeConverter |

Definition at line 40 of file FileSizeExtension.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\__construct().

## ◆ $suffixes

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::$suffixes
| protected

Parameters

  array | $suffixes |

Definition at line 30 of file FileSizeExtension.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\__construct().

## ◆ $translator

eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension::$translator
| protected

Parameters

  TranslatorInterface | $translator |

Definition at line 25 of file FileSizeExtension.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension\__construct().

The documentation for this class was generated from the following file:

- FileSizeExtension.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.