mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 02:14:31 +02:00
Use typed properties
This commit is contained in:
parent
548ec2ea50
commit
51e05a8669
216 changed files with 603 additions and 698 deletions
|
@ -9,8 +9,8 @@ use Twig\TwigFunction;
|
|||
|
||||
final class AttachmentExtension extends AbstractExtension
|
||||
{
|
||||
protected $attachmentURLGenerator;
|
||||
protected $FAIconGenerator;
|
||||
protected AttachmentURLGenerator $attachmentURLGenerator;
|
||||
protected FAIconGenerator $FAIconGenerator;
|
||||
|
||||
public function __construct(AttachmentURLGenerator $attachmentURLGenerator, FAIconGenerator $FAIconGenerator)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ final class AttachmentExtension extends AbstractExtension
|
|||
$this->FAIconGenerator = $FAIconGenerator;
|
||||
}
|
||||
|
||||
public function getFunctions()
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
/* Returns the URL to a thumbnail of the given attachment */
|
||||
|
|
|
@ -27,7 +27,7 @@ use Twig\TwigFunction;
|
|||
|
||||
final class BarcodeExtension extends AbstractExtension
|
||||
{
|
||||
public function getFunctions()
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
/* Generates a barcode with the given Type and Data and returns it as an SVG represenation */
|
||||
|
|
|
@ -25,9 +25,9 @@ use Twig\TwigTest;
|
|||
|
||||
final class EntityExtension extends AbstractExtension
|
||||
{
|
||||
protected $entityURLGenerator;
|
||||
protected $treeBuilder;
|
||||
private $nameGenerator;
|
||||
protected EntityURLGenerator $entityURLGenerator;
|
||||
protected TreeViewGenerator $treeBuilder;
|
||||
private ElementTypeNameGenerator $nameGenerator;
|
||||
|
||||
public function __construct(EntityURLGenerator $entityURLGenerator, TreeViewGenerator $treeBuilder, ElementTypeNameGenerator $elementTypeNameGenerator)
|
||||
{
|
||||
|
|
|
@ -77,10 +77,10 @@ use function get_class;
|
|||
|
||||
final class FormatExtension extends AbstractExtension
|
||||
{
|
||||
protected $markdownParser;
|
||||
protected $moneyFormatter;
|
||||
protected $siformatter;
|
||||
protected $amountFormatter;
|
||||
protected MarkdownParser $markdownParser;
|
||||
protected MoneyFormatter $moneyFormatter;
|
||||
protected SIFormatter $siformatter;
|
||||
protected AmountFormatter $amountFormatter;
|
||||
|
||||
|
||||
public function __construct(MarkdownParser $markdownParser, MoneyFormatter $moneyFormatter,
|
||||
|
|
|
@ -35,11 +35,11 @@ use function is_array;
|
|||
*/
|
||||
final class InheritanceSecurityPolicy implements SecurityPolicyInterface
|
||||
{
|
||||
private $allowedTags;
|
||||
private $allowedFilters;
|
||||
private $allowedMethods;
|
||||
private $allowedProperties;
|
||||
private $allowedFunctions;
|
||||
private array $allowedTags;
|
||||
private array $allowedFilters;
|
||||
private array $allowedMethods;
|
||||
private array $allowedProperties;
|
||||
private array $allowedFunctions;
|
||||
|
||||
public function __construct(array $allowedTags = [], array $allowedFilters = [], array $allowedMethods = [], array $allowedProperties = [], array $allowedFunctions = [])
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ use Twig\TwigTest;
|
|||
*/
|
||||
final class TwigCoreExtension extends AbstractExtension
|
||||
{
|
||||
protected $objectNormalizer;
|
||||
protected ObjectNormalizer $objectNormalizer;
|
||||
|
||||
public function __construct(ObjectNormalizer $objectNormalizer)
|
||||
{
|
||||
|
|
|
@ -32,8 +32,7 @@ use Twig\TwigFunction;
|
|||
|
||||
final class UserExtension extends AbstractExtension
|
||||
{
|
||||
/** @var LogEntryRepository */
|
||||
private $repo;
|
||||
private LogEntryRepository $repo;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue