diff --git a/src/Controller/AdminPages/BaseAdminController.php b/src/Controller/AdminPages/BaseAdminController.php index 3e7f546c..366842eb 100644 --- a/src/Controller/AdminPages/BaseAdminController.php +++ b/src/Controller/AdminPages/BaseAdminController.php @@ -56,7 +56,7 @@ use App\Form\AdminPages\MassCreationForm; use App\Services\Attachments\AttachmentSubmitHandler; use App\Services\EntityExporter; use App\Services\EntityImporter; -use App\Services\LabelSystem\BarcodeExampleElementsGenerator; +use App\Services\LabelSystem\Barcodes\BarcodeExampleElementsGenerator; use App\Services\LabelSystem\LabelGenerator; use App\Services\LogSystem\EventCommentHelper; use App\Services\LogSystem\HistoryHelper; diff --git a/src/Services/LabelSystem/BarcodeGenerator.php b/src/Services/LabelSystem/BarcodeGenerator.php index 507abce6..70f68d27 100644 --- a/src/Services/LabelSystem/BarcodeGenerator.php +++ b/src/Services/LabelSystem/BarcodeGenerator.php @@ -24,9 +24,9 @@ use App\Entity\LabelSystem\LabelOptions; use App\Services\LabelSystem\Barcodes\BarcodeContentGenerator; use Com\Tecnick\Barcode\Barcode; -class BarcodeGenerator +final class BarcodeGenerator { - protected $barcodeContentGenerator; + private $barcodeContentGenerator; public function __construct(BarcodeContentGenerator $barcodeContentGenerator) { diff --git a/src/Services/LabelSystem/BarcodeParser.php b/src/Services/LabelSystem/BarcodeParser.php index ab8243c8..12fb66c8 100644 --- a/src/Services/LabelSystem/BarcodeParser.php +++ b/src/Services/LabelSystem/BarcodeParser.php @@ -26,10 +26,10 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityNotFoundException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -class BarcodeParser +final class BarcodeParser { - protected $urlGenerator; - protected $em; + private $urlGenerator; + private $em; public function __construct(UrlGeneratorInterface $urlGenerator, EntityManagerInterface $entityManager) diff --git a/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php b/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php index 7645523c..83a056f0 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php @@ -30,9 +30,9 @@ use App\Entity\Parts\Supplier; use App\Exceptions\EntityNotSupportedException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -class BarcodeContentGenerator +final class BarcodeContentGenerator { - protected $urlGenerator; + private $urlGenerator; public const PREFIX_MAP = [ Part::class => 'P', @@ -40,7 +40,7 @@ class BarcodeContentGenerator Storelocation::class => 'S' ]; - protected const URL_MAP = [ + private const URL_MAP = [ Part::class => 'part', PartLot::class => 'lot', Storelocation::class => 'location', @@ -80,7 +80,7 @@ class BarcodeContentGenerator return $prefix . $id; } - protected function classToString(array $map, object $target): string + private function classToString(array $map, object $target): string { $class = get_class($target); if (isset($map[$class])) { diff --git a/src/Services/LabelSystem/BarcodeExampleElementsGenerator.php b/src/Services/LabelSystem/Barcodes/BarcodeExampleElementsGenerator.php similarity index 94% rename from src/Services/LabelSystem/BarcodeExampleElementsGenerator.php rename to src/Services/LabelSystem/Barcodes/BarcodeExampleElementsGenerator.php index c78e1fb9..96644960 100644 --- a/src/Services/LabelSystem/BarcodeExampleElementsGenerator.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeExampleElementsGenerator.php @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -namespace App\Services\LabelSystem; +namespace App\Services\LabelSystem\Barcodes; use App\Entity\Base\AbstractStructuralDBElement; use App\Entity\Parts\Category; @@ -28,7 +28,7 @@ use App\Entity\Parts\Part; use App\Entity\Parts\PartLot; use App\Entity\Parts\Storelocation; -class BarcodeExampleElementsGenerator +final class BarcodeExampleElementsGenerator { public function getElement(string $type): object { @@ -44,7 +44,7 @@ class BarcodeExampleElementsGenerator } } - protected function getStorelocation(): Storelocation + private function getStorelocation(): Storelocation { $storelocation = new Storelocation(); $storelocation->setName('Location 1'); @@ -59,7 +59,7 @@ class BarcodeExampleElementsGenerator return $storelocation; } - protected function getStructuralData(string $class): AbstractStructuralDBElement + private function getStructuralData(string $class): AbstractStructuralDBElement { if (!is_a($class, AbstractStructuralDBElement::class, true)) { throw new \InvalidArgumentException('$class must be an child of AbstractStructuralDBElement'); diff --git a/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php b/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php index aad138bb..2170bcaf 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php @@ -21,9 +21,9 @@ namespace App\Services\LabelSystem\Barcodes; -class BarcodeNormalizer +final class BarcodeNormalizer { - protected const PREFIX_TYPE_MAP = [ + private const PREFIX_TYPE_MAP = [ 'L' => 'lot', 'P' => 'part', 'S' => 'location', diff --git a/src/Services/LabelSystem/LabelGenerator.php b/src/Services/LabelSystem/LabelGenerator.php index e3bcf1f0..2c8aa08c 100644 --- a/src/Services/LabelSystem/LabelGenerator.php +++ b/src/Services/LabelSystem/LabelGenerator.php @@ -30,7 +30,7 @@ use App\Services\ElementTypeNameGenerator; use Dompdf\Dompdf; use Twig\Environment; -class LabelGenerator +final class LabelGenerator { public const CLASS_SUPPORT_MAPPING = [ 'part' => Part::class, @@ -40,7 +40,7 @@ class LabelGenerator public const MM_TO_POINTS_FACTOR = 2.83465; - protected $labelHTMLGenerator; + private $labelHTMLGenerator; public function __construct(LabelHTMLGenerator $labelHTMLGenerator) { diff --git a/src/Services/LabelSystem/LabelHTMLGenerator.php b/src/Services/LabelSystem/LabelHTMLGenerator.php index 7cf91292..ef161940 100644 --- a/src/Services/LabelSystem/LabelHTMLGenerator.php +++ b/src/Services/LabelSystem/LabelHTMLGenerator.php @@ -32,13 +32,13 @@ use Twig\Error\SyntaxError; final class LabelHTMLGenerator { - protected $twig; - protected $elementTypeNameGenerator; - protected $replacer; - protected $barcodeGenerator; - protected $sandboxedTwigProvider; - protected $partdb_title; - protected $security; + private $twig; + private $elementTypeNameGenerator; + private $replacer; + private $barcodeGenerator; + private $sandboxedTwigProvider; + private $partdb_title; + private $security; public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, LabelTextReplacer $replacer, Environment $twig, BarcodeGenerator $barcodeGenerator, SandboxedTwigProvider $sandboxedTwigProvider, Security $security, string $partdb_title) diff --git a/src/Services/LabelSystem/LabelProfileDropdownHelper.php b/src/Services/LabelSystem/LabelProfileDropdownHelper.php index eb295065..21c33592 100644 --- a/src/Services/LabelSystem/LabelProfileDropdownHelper.php +++ b/src/Services/LabelSystem/LabelProfileDropdownHelper.php @@ -28,7 +28,7 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Contracts\Cache\ItemInterface; use Symfony\Contracts\Cache\TagAwareCacheInterface; -class LabelProfileDropdownHelper +final class LabelProfileDropdownHelper { private $cache; private $entityManager; diff --git a/src/Services/LabelSystem/LabelTextReplacer.php b/src/Services/LabelSystem/LabelTextReplacer.php index 3ebbb0e2..abf4c401 100644 --- a/src/Services/LabelSystem/LabelTextReplacer.php +++ b/src/Services/LabelSystem/LabelTextReplacer.php @@ -27,9 +27,9 @@ use App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface; * It uses the PlaceholderProviders provided by PlaceholderProviderInterface classes. * @package App\Services\LabelSystem */ -class LabelTextReplacer +final class LabelTextReplacer { - protected $providers; + private $providers; public function __construct(iterable $providers) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php b/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php index 8fb2017e..1b60dfd3 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php @@ -24,9 +24,9 @@ namespace App\Services\LabelSystem\PlaceholderProviders; use App\Entity\Base\AbstractDBElement; use App\Services\ElementTypeNameGenerator; -class AbstractDBElementProvider implements PlaceholderProviderInterface +final class AbstractDBElementProvider implements PlaceholderProviderInterface { - protected $elementTypeNameGenerator; + private $elementTypeNameGenerator; public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php index d3844b75..3b6093e0 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php +++ b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php @@ -30,11 +30,11 @@ use Symfony\Component\Security\Core\Security; * Provides Placeholders for infos about global infos like Installation name or datetimes. * @package App\Services\LabelSystem\PlaceholderProviders */ -class GlobalProviders implements PlaceholderProviderInterface +final class GlobalProviders implements PlaceholderProviderInterface { - protected $partdb_title; - protected $security; + private $partdb_title; + private $security; public function __construct(string $partdb_title, Security $security) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php b/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php index c4861cf4..fdaf6031 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php @@ -23,7 +23,7 @@ namespace App\Services\LabelSystem\PlaceholderProviders; use App\Entity\Contracts\NamedElementInterface; -class NamedElementProvider implements PlaceholderProviderInterface +final class NamedElementProvider implements PlaceholderProviderInterface { /** diff --git a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php index 4c3bd641..0635a91c 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php @@ -27,10 +27,10 @@ use App\Services\LabelSystem\LabelTextReplacer; use IntlDateFormatter; use Locale; -class PartLotProvider implements PlaceholderProviderInterface +final class PartLotProvider implements PlaceholderProviderInterface { - protected $labelTextReplacer; - protected $amountFormatter; + private $labelTextReplacer; + private $amountFormatter; public function __construct(LabelTextReplacer $labelTextReplacer, AmountFormatter $amountFormatter) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php b/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php index e1b9d555..b6fb5e02 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php @@ -25,11 +25,11 @@ use App\Entity\Parts\Part; use App\Services\SIFormatter; use Symfony\Contracts\Translation\TranslatorInterface; -class PartProvider implements PlaceholderProviderInterface +final class PartProvider implements PlaceholderProviderInterface { - protected $siFormatter; - protected $translator; + private $siFormatter; + private $translator; public function __construct(SIFormatter $SIFormatter, TranslatorInterface $translator) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/StructuralDBElementProvider.php b/src/Services/LabelSystem/PlaceholderProviders/StructuralDBElementProvider.php index f4fc50b8..6a643c64 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/StructuralDBElementProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/StructuralDBElementProvider.php @@ -24,7 +24,7 @@ namespace App\Services\LabelSystem\PlaceholderProviders; use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractStructuralDBElement; -class StructuralDBElementProvider implements PlaceholderProviderInterface +final class StructuralDBElementProvider implements PlaceholderProviderInterface { public function replace(string $placeholder, object $label_target, array $options = []): ?string diff --git a/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php b/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php index 5ddc0011..4cb295cb 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php @@ -24,7 +24,7 @@ use App\Entity\Contracts\TimeStampableInterface; use IntlDateFormatter; use Locale; -class TimestampableElementProvider implements PlaceholderProviderInterface +final class TimestampableElementProvider implements PlaceholderProviderInterface { /** diff --git a/src/Services/LabelSystem/SandboxedTwigProvider.php b/src/Services/LabelSystem/SandboxedTwigProvider.php index 86103ca9..630820fe 100644 --- a/src/Services/LabelSystem/SandboxedTwigProvider.php +++ b/src/Services/LabelSystem/SandboxedTwigProvider.php @@ -48,10 +48,10 @@ use Twig\Extra\Intl\IntlExtension; use Twig\Sandbox\SecurityPolicy; use Twig\Sandbox\SecurityPolicyInterface; -class SandboxedTwigProvider +final class SandboxedTwigProvider { - protected const ALLOWED_TAGS = ['apply', 'autoescape', 'do', 'for', 'if', 'set', 'verbatim', 'with']; - protected const ALLOWED_FILTERS = ['abs', 'batch', 'capitalize', 'column', 'country_name', + private const ALLOWED_TAGS = ['apply', 'autoescape', 'do', 'for', 'if', 'set', 'verbatim', 'with']; + private const ALLOWED_FILTERS = ['abs', 'batch', 'capitalize', 'column', 'country_name', 'currency_name', 'currency_symbol', 'date', 'date_modify', 'default', 'escape', 'filter', 'first', 'format', 'format_currency', 'format_date', 'format_datetime', 'format_number', 'format_time', 'join', 'keys', 'language_name', 'last', 'length', 'locale_name', 'lower', 'map', 'merge', 'nl2br', 'raw', 'number_format', @@ -60,9 +60,9 @@ class SandboxedTwigProvider //Part-DB specific filters: 'moneyFormat', 'siFormat', 'amountFormat']; - protected const ALLOWED_FUNCTIONS = ['date', 'html_classes', 'max', 'min', 'random', 'range']; + private const ALLOWED_FUNCTIONS = ['date', 'html_classes', 'max', 'min', 'random', 'range']; - protected const ALLOWED_METHODS = [ + private const ALLOWED_METHODS = [ NamedElementInterface::class => ['getName'], AbstractDBElement::class => ['getID', '__toString'], TimeStampableInterface::class => ['getLastModified', 'getAddedDate'], @@ -93,7 +93,7 @@ class SandboxedTwigProvider 'getDepartment', 'getEmail'] ]; - protected const ALLOWED_PROPERTIES = []; + private const ALLOWED_PROPERTIES = []; private $appExtension;