diff --git a/rector.php b/rector.php index b90d120a..db559491 100644 --- a/rector.php +++ b/rector.php @@ -5,6 +5,8 @@ declare(strict_types=1); use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; use Rector\Doctrine\Set\DoctrineSetList; +use Rector\PHPUnit\Set\PHPUnitLevelSetList; +use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\Symfony\Set\SymfonyLevelSetList; @@ -42,5 +44,10 @@ return static function (RectorConfig $rectorConfig): void { //Doctrine rules DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, DoctrineSetList::DOCTRINE_CODE_QUALITY, + + //PHPUnit rules + PHPUnitLevelSetList::UP_TO_PHPUNIT_90, + PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES, + PHPUnitSetList::PHPUNIT_CODE_QUALITY, ]); }; diff --git a/src/Controller/AdminPages/AttachmentTypeController.php b/src/Controller/AdminPages/AttachmentTypeController.php index 0b85f4a0..426e773c 100644 --- a/src/Controller/AdminPages/AttachmentTypeController.php +++ b/src/Controller/AdminPages/AttachmentTypeController.php @@ -36,6 +36,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\AttachmentTypeControllerTest + */ #[Route(path: '/attachment_type')] class AttachmentTypeController extends BaseAdminController { diff --git a/src/Controller/AdminPages/CategoryController.php b/src/Controller/AdminPages/CategoryController.php index 622de1eb..153d46f3 100644 --- a/src/Controller/AdminPages/CategoryController.php +++ b/src/Controller/AdminPages/CategoryController.php @@ -35,6 +35,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\CategoryControllerTest + */ #[Route(path: '/category')] class CategoryController extends BaseAdminController { diff --git a/src/Controller/AdminPages/FootprintController.php b/src/Controller/AdminPages/FootprintController.php index 8edd0b06..d1414d2a 100644 --- a/src/Controller/AdminPages/FootprintController.php +++ b/src/Controller/AdminPages/FootprintController.php @@ -36,6 +36,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\FootprintControllerTest + */ #[Route(path: '/footprint')] class FootprintController extends BaseAdminController { diff --git a/src/Controller/AdminPages/LabelProfileController.php b/src/Controller/AdminPages/LabelProfileController.php index b89858dd..ee754436 100644 --- a/src/Controller/AdminPages/LabelProfileController.php +++ b/src/Controller/AdminPages/LabelProfileController.php @@ -35,6 +35,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\LabelProfileControllerTest + */ #[Route(path: '/label_profile')] class LabelProfileController extends BaseAdminController { diff --git a/src/Controller/AdminPages/ManufacturerController.php b/src/Controller/AdminPages/ManufacturerController.php index c6db73ee..2a97d3f3 100644 --- a/src/Controller/AdminPages/ManufacturerController.php +++ b/src/Controller/AdminPages/ManufacturerController.php @@ -35,6 +35,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\ManufacturerControllerTest + */ #[Route(path: '/manufacturer')] class ManufacturerController extends BaseAdminController { diff --git a/src/Controller/AdminPages/MeasurementUnitController.php b/src/Controller/AdminPages/MeasurementUnitController.php index b8a566ec..993c5dad 100644 --- a/src/Controller/AdminPages/MeasurementUnitController.php +++ b/src/Controller/AdminPages/MeasurementUnitController.php @@ -36,6 +36,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\MeasurementUnitControllerTest + */ #[Route(path: '/measurement_unit')] class MeasurementUnitController extends BaseAdminController { diff --git a/src/Controller/AdminPages/StorelocationController.php b/src/Controller/AdminPages/StorelocationController.php index 36e8da34..7a9850ab 100644 --- a/src/Controller/AdminPages/StorelocationController.php +++ b/src/Controller/AdminPages/StorelocationController.php @@ -35,6 +35,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\StorelocationControllerTest + */ #[Route(path: '/store_location')] class StorelocationController extends BaseAdminController { diff --git a/src/Controller/AdminPages/SupplierController.php b/src/Controller/AdminPages/SupplierController.php index c28a114d..4cd5e46b 100644 --- a/src/Controller/AdminPages/SupplierController.php +++ b/src/Controller/AdminPages/SupplierController.php @@ -35,6 +35,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @see \App\Tests\Controller\AdminPages\SupplierControllerTest + */ #[Route(path: '/supplier')] class SupplierController extends BaseAdminController { diff --git a/src/Controller/PartListsController.php b/src/Controller/PartListsController.php index 322d2ebf..83d29ca6 100644 --- a/src/Controller/PartListsController.php +++ b/src/Controller/PartListsController.php @@ -97,7 +97,7 @@ class PartListsController extends AbstractController $attrs['disabled'] = $disabled; $parent = $form->getParent(); - if (!$parent instanceof \Symfony\Component\Form\FormInterface) { + if (!$parent instanceof FormInterface) { throw new \RuntimeException('This function can only be used on form fields that are children of another form!'); } diff --git a/src/Controller/RedirectController.php b/src/Controller/RedirectController.php index 16bed9ea..aef346d9 100644 --- a/src/Controller/RedirectController.php +++ b/src/Controller/RedirectController.php @@ -30,6 +30,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Contracts\Translation\TranslatorInterface; +/** + * @see \App\Tests\Controller\RedirectControllerTest + */ class RedirectController extends AbstractController { public function __construct(protected string $default_locale, protected TranslatorInterface $translator, protected bool $enforce_index_php) @@ -55,7 +58,7 @@ class RedirectController extends AbstractController //If either mod_rewrite is not enabled or the index.php version is enforced, add index.php to the string if (($this->enforce_index_php || !$this->checkIfModRewriteAvailable()) - && !str_contains($new_url, 'index.php')) { + && !str_contains((string) $new_url, 'index.php')) { //Like Request::getUriForPath only with index.php $new_url = $request->getSchemeAndHttpHost().$request->getBaseUrl().'/index.php/'.$locale.$request->getPathInfo(); } diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php index f2c6253e..ae701ccd 100644 --- a/src/Entity/Attachments/Attachment.php +++ b/src/Entity/Attachments/Attachment.php @@ -36,6 +36,7 @@ use LogicException; /** * Class Attachment. + * @see \App\Tests\Entity\Attachments\AttachmentTest */ #[ORM\Entity(repositoryClass: AttachmentRepository::class)] #[ORM\InheritanceType('SINGLE_TABLE')] diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index ed59a2da..9bff255a 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -34,6 +34,7 @@ use Symfony\Component\Validator\Constraints as Assert; /** * Class AttachmentType. + * @see \App\Tests\Entity\Attachments\AttachmentTypeTest */ #[ORM\Entity(repositoryClass: StructuralDBElementRepository::class)] #[ORM\Table(name: '`attachment_types`')] diff --git a/src/Entity/Base/AbstractStructuralDBElement.php b/src/Entity/Base/AbstractStructuralDBElement.php index a1dc80dd..6e82a47d 100644 --- a/src/Entity/Base/AbstractStructuralDBElement.php +++ b/src/Entity/Base/AbstractStructuralDBElement.php @@ -47,6 +47,7 @@ use Symfony\Component\Serializer\Annotation\Groups; * an attribute of a root element, you will get an exception! * * + * @see \App\Tests\Entity\Base\AbstractStructuralDBElementTest */ #[UniqueEntity(fields: ['name', 'parent'], ignoreNull: false, message: 'structural.entity.unique_name')] #[ORM\MappedSuperclass(repositoryClass: StructuralDBElementRepository::class)] diff --git a/src/Entity/LogSystem/AbstractLogEntry.php b/src/Entity/LogSystem/AbstractLogEntry.php index 7cc064b7..f6176e4f 100644 --- a/src/Entity/LogSystem/AbstractLogEntry.php +++ b/src/Entity/LogSystem/AbstractLogEntry.php @@ -51,6 +51,7 @@ use App\Repository\LogEntryRepository; /** * This entity describes an entry in the event log. + * @see \App\Tests\Entity\LogSystem\AbstractLogEntryTest */ #[ORM\Entity(repositoryClass: LogEntryRepository::class)] #[ORM\Table('log')] diff --git a/src/Entity/Parameters/PartParameter.php b/src/Entity/Parameters/PartParameter.php index 36fc71fb..6c150e6b 100644 --- a/src/Entity/Parameters/PartParameter.php +++ b/src/Entity/Parameters/PartParameter.php @@ -47,6 +47,9 @@ use App\Entity\Parts\Part; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; +/** + * @see \App\Tests\Entity\Parameters\PartParameterTest + */ #[UniqueEntity(fields: ['name', 'group', 'element'])] #[ORM\Entity(repositoryClass: ParameterRepository::class)] class PartParameter extends AbstractParameter diff --git a/src/Entity/Parts/Part.php b/src/Entity/Parts/Part.php index b8ff5abb..4fef18f2 100644 --- a/src/Entity/Parts/Part.php +++ b/src/Entity/Parts/Part.php @@ -49,6 +49,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; * * The class properties are split over various traits in directory PartTraits. * Otherwise, this class would be too big, to be maintained. + * @see \App\Tests\Entity\Parts\PartTest */ #[UniqueEntity(fields: ['ipn'], message: 'part.ipn.must_be_unique')] #[ORM\Entity(repositoryClass: PartRepository::class)] diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index 7bec9b9c..f6a9d404 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -42,6 +42,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; * It is the connection between a part and its store locations. * * @ValidPartLot() + * @see \App\Tests\Entity\Parts\PartLotTest */ #[ORM\Entity] #[ORM\HasLifecycleCallbacks] diff --git a/src/Entity/UserSystem/PermissionData.php b/src/Entity/UserSystem/PermissionData.php index 5c4e84c5..998dfead 100644 --- a/src/Entity/UserSystem/PermissionData.php +++ b/src/Entity/UserSystem/PermissionData.php @@ -26,6 +26,7 @@ use Doctrine\ORM\Mapping as ORM; /** * This class is used to store the permissions of a user. * This has to be an embeddable or otherwise doctrine could not track the changes of the underlying data array (which is serialized to JSON in the database) + * @see \App\Tests\Entity\UserSystem\PermissionDataTest */ #[ORM\Embeddable] final class PermissionData implements \JsonSerializable diff --git a/src/Entity/UserSystem/User.php b/src/Entity/UserSystem/User.php index c1cd9a26..98665781 100644 --- a/src/Entity/UserSystem/User.php +++ b/src/Entity/UserSystem/User.php @@ -57,6 +57,7 @@ use Jbtronics\TFAWebauthn\Model\TwoFactorInterface as WebauthnTwoFactorInterface /** * This entity represents a user, which can log in and have permissions. * Also, this entity is able to save some information about the user, like the names, email-address and other info. + * @see \App\Tests\Entity\UserSystem\UserTest */ #[UniqueEntity('name', message: 'validator.user.username_already_used')] #[ORM\Entity(repositoryClass: UserRepository::class)] diff --git a/src/Helpers/BBCodeToMarkdownConverter.php b/src/Helpers/BBCodeToMarkdownConverter.php index f800006b..922e6a7e 100644 --- a/src/Helpers/BBCodeToMarkdownConverter.php +++ b/src/Helpers/BBCodeToMarkdownConverter.php @@ -25,6 +25,9 @@ namespace App\Helpers; use League\HTMLToMarkdown\HtmlConverter; use s9e\TextFormatter\Bundles\Forum as TextFormatter; +/** + * @see \App\Tests\Helpers\BBCodeToMarkdownConverterTest + */ class BBCodeToMarkdownConverter { protected HtmlConverter $html_to_markdown; diff --git a/src/Helpers/Projects/ProjectBuildRequest.php b/src/Helpers/Projects/ProjectBuildRequest.php index f231c50f..29b5f14f 100644 --- a/src/Helpers/Projects/ProjectBuildRequest.php +++ b/src/Helpers/Projects/ProjectBuildRequest.php @@ -28,6 +28,7 @@ use App\Validator\Constraints\ProjectSystem\ValidProjectBuildRequest; /** * @ValidProjectBuildRequest() + * @see \App\Tests\Helpers\Projects\ProjectBuildRequestTest */ final class ProjectBuildRequest { diff --git a/src/Repository/NamedDBElementRepository.php b/src/Repository/NamedDBElementRepository.php index 8485d50a..2168d92d 100644 --- a/src/Repository/NamedDBElementRepository.php +++ b/src/Repository/NamedDBElementRepository.php @@ -26,6 +26,9 @@ use App\Entity\Base\AbstractNamedDBElement; use App\Entity\UserSystem\User; use App\Helpers\Trees\TreeViewNode; +/** + * @see \App\Tests\Repository\NamedDBElementRepositoryTest + */ class NamedDBElementRepository extends DBElementRepository { /** diff --git a/src/Repository/StructuralDBElementRepository.php b/src/Repository/StructuralDBElementRepository.php index 19143def..0f2dcdea 100644 --- a/src/Repository/StructuralDBElementRepository.php +++ b/src/Repository/StructuralDBElementRepository.php @@ -27,6 +27,9 @@ use App\Helpers\Trees\StructuralDBElementIterator; use App\Helpers\Trees\TreeViewNode; use RecursiveIteratorIterator; +/** + * @see \App\Tests\Repository\StructuralDBElementRepositoryTest + */ class StructuralDBElementRepository extends NamedDBElementRepository { /** diff --git a/src/Security/EnsureSAMLUserForSAMLLoginChecker.php b/src/Security/EnsureSAMLUserForSAMLLoginChecker.php index 0d80630d..674d7e26 100644 --- a/src/Security/EnsureSAMLUserForSAMLLoginChecker.php +++ b/src/Security/EnsureSAMLUserForSAMLLoginChecker.php @@ -27,6 +27,9 @@ use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent; use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException; use Symfony\Contracts\Translation\TranslatorInterface; +/** + * @see \App\Tests\Security\EnsureSAMLUserForSAMLLoginCheckerTest + */ class EnsureSAMLUserForSAMLLoginChecker implements EventSubscriberInterface { public function __construct(private readonly TranslatorInterface $translator) diff --git a/src/Security/SamlUserFactory.php b/src/Security/SamlUserFactory.php index 4bfefc88..924e4e5e 100644 --- a/src/Security/SamlUserFactory.php +++ b/src/Security/SamlUserFactory.php @@ -29,6 +29,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent; use Symfony\Component\Security\Core\User\UserInterface; +/** + * @see \App\Tests\Security\SamlUserFactoryTest + */ class SamlUserFactory implements SamlUserFactoryInterface, EventSubscriberInterface { private readonly array $saml_role_mapping; diff --git a/src/Security/UserChecker.php b/src/Security/UserChecker.php index 55fa3db3..fd53a295 100644 --- a/src/Security/UserChecker.php +++ b/src/Security/UserChecker.php @@ -29,6 +29,9 @@ use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Contracts\Translation\TranslatorInterface; +/** + * @see \App\Tests\Security\UserCheckerTest + */ final class UserChecker implements UserCheckerInterface { public function __construct(private readonly TranslatorInterface $translator) diff --git a/src/Serializer/BigNumberNormalizer.php b/src/Serializer/BigNumberNormalizer.php index 89826962..49477725 100644 --- a/src/Serializer/BigNumberNormalizer.php +++ b/src/Serializer/BigNumberNormalizer.php @@ -24,6 +24,9 @@ use Brick\Math\BigNumber; use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +/** + * @see \App\Tests\Serializer\BigNumberNormalizerTest + */ class BigNumberNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface { diff --git a/src/Serializer/PartNormalizer.php b/src/Serializer/PartNormalizer.php index 740d9861..58158cfe 100644 --- a/src/Serializer/PartNormalizer.php +++ b/src/Serializer/PartNormalizer.php @@ -32,6 +32,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; +/** + * @see \App\Tests\Serializer\PartNormalizerTest + */ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface { private const DENORMALIZE_KEY_MAPPING = [ diff --git a/src/Serializer/StructuralElementDenormalizer.php b/src/Serializer/StructuralElementDenormalizer.php index 8de72fde..4212fd5d 100644 --- a/src/Serializer/StructuralElementDenormalizer.php +++ b/src/Serializer/StructuralElementDenormalizer.php @@ -27,6 +27,9 @@ use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; +/** + * @see \App\Tests\Serializer\StructuralElementDenormalizerTest + */ class StructuralElementDenormalizer implements DenormalizerInterface, CacheableSupportsMethodInterface { diff --git a/src/Serializer/StructuralElementFromNameDenormalizer.php b/src/Serializer/StructuralElementFromNameDenormalizer.php index 9de31048..662e3afa 100644 --- a/src/Serializer/StructuralElementFromNameDenormalizer.php +++ b/src/Serializer/StructuralElementFromNameDenormalizer.php @@ -26,6 +26,9 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +/** + * @see \App\Tests\Serializer\StructuralElementFromNameDenormalizerTest + */ class StructuralElementFromNameDenormalizer implements DenormalizerInterface, CacheableSupportsMethodInterface { public function __construct(private readonly EntityManagerInterface $em) diff --git a/src/Serializer/StructuralElementNormalizer.php b/src/Serializer/StructuralElementNormalizer.php index fb6a42b1..aeae9aae 100644 --- a/src/Serializer/StructuralElementNormalizer.php +++ b/src/Serializer/StructuralElementNormalizer.php @@ -25,6 +25,9 @@ use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; +/** + * @see \App\Tests\Serializer\StructuralElementNormalizerTest + */ class StructuralElementNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface { public function __construct(private readonly ObjectNormalizer $normalizer) diff --git a/src/Services/Attachments/AttachmentPathResolver.php b/src/Services/Attachments/AttachmentPathResolver.php index 116072b5..0628a6a9 100644 --- a/src/Services/Attachments/AttachmentPathResolver.php +++ b/src/Services/Attachments/AttachmentPathResolver.php @@ -29,6 +29,7 @@ use Symfony\Component\Filesystem\Filesystem; /** * This service converts the relative pathes for attachments saved in database (like %MEDIA%/img.jpg) to real pathes * an vice versa. + * @see \App\Tests\Services\Attachments\AttachmentPathResolverTest */ class AttachmentPathResolver { diff --git a/src/Services/Attachments/AttachmentURLGenerator.php b/src/Services/Attachments/AttachmentURLGenerator.php index c2a3b433..0efbf1e6 100644 --- a/src/Services/Attachments/AttachmentURLGenerator.php +++ b/src/Services/Attachments/AttachmentURLGenerator.php @@ -31,6 +31,9 @@ use function strlen; use Symfony\Component\Asset\Packages; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +/** + * @see \App\Tests\Services\Attachments\AttachmentURLGeneratorTest + */ class AttachmentURLGenerator { protected string $public_path; diff --git a/src/Services/Attachments/BuiltinAttachmentsFinder.php b/src/Services/Attachments/BuiltinAttachmentsFinder.php index f3f8740f..21be0730 100644 --- a/src/Services/Attachments/BuiltinAttachmentsFinder.php +++ b/src/Services/Attachments/BuiltinAttachmentsFinder.php @@ -30,6 +30,7 @@ use Symfony\Contracts\Cache\CacheInterface; /** * This service is used to find builtin attachment ressources. + * @see \App\Tests\Services\Attachments\BuiltinAttachmentsFinderTest */ class BuiltinAttachmentsFinder { @@ -57,7 +58,7 @@ class BuiltinAttachmentsFinder foreach($finder as $file) { $folder = $file->getRelativePath(); //Normalize path (replace \ with /) - $folder = str_replace('\\', '/', $folder); + $folder = str_replace('\\', '/', (string) $folder); if(!isset($output[$folder])) { $output[$folder] = []; diff --git a/src/Services/Attachments/FileTypeFilterTools.php b/src/Services/Attachments/FileTypeFilterTools.php index 948b429b..c7ef3ab1 100644 --- a/src/Services/Attachments/FileTypeFilterTools.php +++ b/src/Services/Attachments/FileTypeFilterTools.php @@ -32,6 +32,7 @@ use Symfony\Contracts\Cache\ItemInterface; * A service that helps to work with filetype filters (based on the format accept uses). * See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers for * more details. + * @see \App\Tests\Services\Attachments\FileTypeFilterToolsTest */ class FileTypeFilterTools { diff --git a/src/Services/ElementTypeNameGenerator.php b/src/Services/ElementTypeNameGenerator.php index dc8c94a6..2fb81c1b 100644 --- a/src/Services/ElementTypeNameGenerator.php +++ b/src/Services/ElementTypeNameGenerator.php @@ -49,6 +49,9 @@ use Doctrine\ORM\Mapping\Entity; use function get_class; use Symfony\Contracts\Translation\TranslatorInterface; +/** + * @see \App\Tests\Services\ElementTypeNameGeneratorTest + */ class ElementTypeNameGenerator { protected array $mapping; @@ -127,7 +130,7 @@ class ElementTypeNameGenerator { $type = $this->getLocalizedTypeLabel($entity); if ($use_html) { - return ''.$type.': '.htmlspecialchars($entity->getName()); + return ''.$type.': '.htmlspecialchars((string) $entity->getName()); } return $type.': '.$entity->getName(); diff --git a/src/Services/Formatters/AmountFormatter.php b/src/Services/Formatters/AmountFormatter.php index d092f2cd..73d59113 100644 --- a/src/Services/Formatters/AmountFormatter.php +++ b/src/Services/Formatters/AmountFormatter.php @@ -29,6 +29,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; /** * This service formats a part amount using a Measurement Unit. + * @see \App\Tests\Services\Formatters\AmountFormatterTest */ class AmountFormatter { diff --git a/src/Services/Formatters/SIFormatter.php b/src/Services/Formatters/SIFormatter.php index a6d69d0b..a6325987 100644 --- a/src/Services/Formatters/SIFormatter.php +++ b/src/Services/Formatters/SIFormatter.php @@ -24,6 +24,7 @@ namespace App\Services\Formatters; /** * A service that helps you to format values using the SI prefixes. + * @see \App\Tests\Services\Formatters\SIFormatterTest */ class SIFormatter { diff --git a/src/Services/ImportExportSystem/BOMImporter.php b/src/Services/ImportExportSystem/BOMImporter.php index 72103436..7227c419 100644 --- a/src/Services/ImportExportSystem/BOMImporter.php +++ b/src/Services/ImportExportSystem/BOMImporter.php @@ -27,6 +27,9 @@ use League\Csv\Reader; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @see \App\Tests\Services\ImportExportSystem\BOMImporterTest + */ class BOMImporter { diff --git a/src/Services/ImportExportSystem/EntityExporter.php b/src/Services/ImportExportSystem/EntityExporter.php index 89b0e946..50b6b7cc 100644 --- a/src/Services/ImportExportSystem/EntityExporter.php +++ b/src/Services/ImportExportSystem/EntityExporter.php @@ -36,6 +36,7 @@ use function Symfony\Component\String\u; /** * Use this class to export an entity to multiple file formats. + * @see \App\Tests\Services\ImportExportSystem\EntityExporterTest */ class EntityExporter { diff --git a/src/Services/ImportExportSystem/EntityImporter.php b/src/Services/ImportExportSystem/EntityImporter.php index 60d064f3..1aa50db5 100644 --- a/src/Services/ImportExportSystem/EntityImporter.php +++ b/src/Services/ImportExportSystem/EntityImporter.php @@ -36,6 +36,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Serializer\SerializerInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; +/** + * @see \App\Tests\Services\ImportExportSystem\EntityImporterTest + */ class EntityImporter { public function __construct(protected SerializerInterface $serializer, protected EntityManagerInterface $em, protected ValidatorInterface $validator) diff --git a/src/Services/LabelSystem/BarcodeGenerator.php b/src/Services/LabelSystem/BarcodeGenerator.php index 90cbc5d7..b8ab099e 100644 --- a/src/Services/LabelSystem/BarcodeGenerator.php +++ b/src/Services/LabelSystem/BarcodeGenerator.php @@ -48,6 +48,9 @@ use App\Services\LabelSystem\Barcodes\BarcodeContentGenerator; use Com\Tecnick\Barcode\Barcode; use InvalidArgumentException; +/** + * @see \App\Tests\Services\LabelSystem\BarcodeGeneratorTest + */ final class BarcodeGenerator { public function __construct(private readonly BarcodeContentGenerator $barcodeContentGenerator) diff --git a/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php b/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php index 6930bd79..5acf98f1 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php @@ -48,6 +48,9 @@ use App\Entity\Parts\Storelocation; use InvalidArgumentException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +/** + * @see \App\Tests\Services\LabelSystem\Barcodes\BarcodeContentGeneratorTest + */ final class BarcodeContentGenerator { public const PREFIX_MAP = [ diff --git a/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php b/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php index 4e6d8cbd..a5b6cb5e 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeNormalizer.php @@ -43,6 +43,9 @@ namespace App\Services\LabelSystem\Barcodes; use InvalidArgumentException; +/** + * @see \App\Tests\Services\LabelSystem\Barcodes\BarcodeNormalizerTest + */ final class BarcodeNormalizer { private const PREFIX_TYPE_MAP = [ diff --git a/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php b/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php index ba425483..0eba0ed4 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php @@ -47,6 +47,9 @@ use Doctrine\ORM\EntityNotFoundException; use InvalidArgumentException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +/** + * @see \App\Tests\Services\LabelSystem\Barcodes\BarcodeRedirectorTest + */ final class BarcodeRedirector { public function __construct(private readonly UrlGeneratorInterface $urlGenerator, private readonly EntityManagerInterface $em) diff --git a/src/Services/LabelSystem/LabelGenerator.php b/src/Services/LabelSystem/LabelGenerator.php index d5ae2718..9f5d666b 100644 --- a/src/Services/LabelSystem/LabelGenerator.php +++ b/src/Services/LabelSystem/LabelGenerator.php @@ -48,6 +48,9 @@ use App\Entity\Parts\Storelocation; use Dompdf\Dompdf; use InvalidArgumentException; +/** + * @see \App\Tests\Services\LabelSystem\LabelGeneratorTest + */ final class LabelGenerator { public const CLASS_SUPPORT_MAPPING = [ diff --git a/src/Services/LabelSystem/LabelTextReplacer.php b/src/Services/LabelSystem/LabelTextReplacer.php index 3c0b5f92..e352729c 100644 --- a/src/Services/LabelSystem/LabelTextReplacer.php +++ b/src/Services/LabelSystem/LabelTextReplacer.php @@ -46,6 +46,7 @@ use App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface; /** * This service replaces the Placeholders of the user provided lines with the proper informations. * It uses the PlaceholderProviders provided by PlaceholderProviderInterface classes. + * @see \App\Tests\Services\LabelSystem\LabelTextReplacerTest */ final class LabelTextReplacer { diff --git a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php index 1678bda1..5a9b2294 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php +++ b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php @@ -50,6 +50,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** * Provides Placeholders for infos about global infos like Installation name or datetimes. + * @see \App\Tests\Services\LabelSystem\PlaceholderProviders\GlobalProvidersTest */ final class GlobalProviders implements PlaceholderProviderInterface { diff --git a/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php b/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php index fc5fedfe..d8d38120 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/NamedElementProvider.php @@ -43,6 +43,9 @@ namespace App\Services\LabelSystem\PlaceholderProviders; use App\Entity\Contracts\NamedElementInterface; +/** + * @see \App\Tests\Services\LabelSystem\PlaceholderProviders\NamedElementProviderTest + */ final class NamedElementProvider implements PlaceholderProviderInterface { public function replace(string $placeholder, object $label_target, array $options = []): ?string diff --git a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php index f7ff0b45..fb9447ba 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php @@ -49,6 +49,9 @@ use App\Services\LabelSystem\LabelTextReplacer; use IntlDateFormatter; use Locale; +/** + * @see \App\Tests\Services\LabelSystem\PlaceholderProviders\PartLotProviderTest + */ final class PartLotProvider implements PlaceholderProviderInterface { public function __construct(private readonly LabelTextReplacer $labelTextReplacer, private readonly AmountFormatter $amountFormatter) diff --git a/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php b/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php index dbbe6263..4174c623 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php @@ -49,6 +49,9 @@ use App\Services\Formatters\SIFormatter; use Parsedown; use Symfony\Contracts\Translation\TranslatorInterface; +/** + * @see \App\Tests\Services\LabelSystem\PlaceholderProviders\PartProviderTest + */ final class PartProvider implements PlaceholderProviderInterface { public function __construct(private readonly SIFormatter $siFormatter, private readonly TranslatorInterface $translator) diff --git a/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php b/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php index ef5967b2..8588e133 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/TimestampableElementProvider.php @@ -46,6 +46,9 @@ use DateTime; use IntlDateFormatter; use Locale; +/** + * @see \App\Tests\Services\LabelSystem\PlaceholderProviders\TimestampableElementProviderTest + */ final class TimestampableElementProvider implements PlaceholderProviderInterface { public function replace(string $placeholder, object $label_target, array $options = []): ?string diff --git a/src/Services/LabelSystem/SandboxedTwigProvider.php b/src/Services/LabelSystem/SandboxedTwigProvider.php index 39b47bfb..6c1bbce1 100644 --- a/src/Services/LabelSystem/SandboxedTwigProvider.php +++ b/src/Services/LabelSystem/SandboxedTwigProvider.php @@ -68,6 +68,9 @@ use Twig\Extra\Intl\IntlExtension; use Twig\Loader\ArrayLoader; use Twig\Sandbox\SecurityPolicyInterface; +/** + * @see \App\Tests\Services\LabelSystem\SandboxedTwigProviderTest + */ final class SandboxedTwigProvider { private const ALLOWED_TAGS = ['apply', 'autoescape', 'do', 'for', 'if', 'set', 'verbatim', 'with']; diff --git a/src/Services/LogSystem/EventCommentHelper.php b/src/Services/LogSystem/EventCommentHelper.php index cf06b724..45e95b2c 100644 --- a/src/Services/LogSystem/EventCommentHelper.php +++ b/src/Services/LogSystem/EventCommentHelper.php @@ -41,6 +41,9 @@ declare(strict_types=1); namespace App\Services\LogSystem; +/** + * @see \App\Tests\Services\LogSystem\EventCommentHelperTest + */ class EventCommentHelper { protected const MAX_MESSAGE_LENGTH = 255; diff --git a/src/Services/LogSystem/EventCommentNeededHelper.php b/src/Services/LogSystem/EventCommentNeededHelper.php index 23e22072..3738b330 100644 --- a/src/Services/LogSystem/EventCommentNeededHelper.php +++ b/src/Services/LogSystem/EventCommentNeededHelper.php @@ -23,6 +23,7 @@ namespace App\Services\LogSystem; /** * This service is used to check if a log change comment is needed for a given operation type. * It is configured using the "enforce_change_comments_for" config parameter. + * @see \App\Tests\Services\LogSystem\EventCommentNeededHelperTest */ class EventCommentNeededHelper { diff --git a/src/Services/LogSystem/EventLogger.php b/src/Services/LogSystem/EventLogger.php index 82e2df3a..909c5ab2 100644 --- a/src/Services/LogSystem/EventLogger.php +++ b/src/Services/LogSystem/EventLogger.php @@ -29,6 +29,9 @@ use App\Entity\UserSystem\User; use App\Services\Misc\ConsoleInfoHelper; use Doctrine\ORM\EntityManagerInterface; +/** + * @see \App\Tests\Services\LogSystem\EventLoggerTest + */ class EventLogger { public function __construct(protected int $minimum_log_level, protected array $blacklist, protected array $whitelist, protected EntityManagerInterface $em, protected Security $security, protected ConsoleInfoHelper $console_info_helper) diff --git a/src/Services/Misc/FAIconGenerator.php b/src/Services/Misc/FAIconGenerator.php index b8ee4481..997e9f39 100644 --- a/src/Services/Misc/FAIconGenerator.php +++ b/src/Services/Misc/FAIconGenerator.php @@ -26,6 +26,9 @@ use App\Entity\Attachments\Attachment; use function in_array; use InvalidArgumentException; +/** + * @see \App\Tests\Services\Misc\FAIconGeneratorTest + */ class FAIconGenerator { protected const EXT_MAPPING = [ diff --git a/src/Services/Misc/RangeParser.php b/src/Services/Misc/RangeParser.php index ddd4fd3b..2ff98477 100644 --- a/src/Services/Misc/RangeParser.php +++ b/src/Services/Misc/RangeParser.php @@ -45,6 +45,7 @@ use InvalidArgumentException; /** * This Parser allows to parse number ranges like 1-3, 4, 5. + * @see \App\Tests\Services\Misc\RangeParserTest */ class RangeParser { diff --git a/src/Services/Parameters/ParameterExtractor.php b/src/Services/Parameters/ParameterExtractor.php index 3257d96d..077101c8 100644 --- a/src/Services/Parameters/ParameterExtractor.php +++ b/src/Services/Parameters/ParameterExtractor.php @@ -47,6 +47,9 @@ use InvalidArgumentException; use function preg_match; +/** + * @see \App\Tests\Services\Parameters\ParameterExtractorTest + */ class ParameterExtractor { protected const ALLOWED_PARAM_SEPARATORS = [', ', "\n"]; diff --git a/src/Services/Parts/PartLotWithdrawAddHelper.php b/src/Services/Parts/PartLotWithdrawAddHelper.php index 9ffbbbe9..07f4bc04 100644 --- a/src/Services/Parts/PartLotWithdrawAddHelper.php +++ b/src/Services/Parts/PartLotWithdrawAddHelper.php @@ -8,6 +8,9 @@ use App\Entity\Parts\PartLot; use App\Services\LogSystem\EventCommentHelper; use App\Services\LogSystem\EventLogger; +/** + * @see \App\Tests\Services\Parts\PartLotWithdrawAddHelperTest + */ final class PartLotWithdrawAddHelper { public function __construct(private readonly EventLogger $eventLogger, private readonly EventCommentHelper $eventCommentHelper) diff --git a/src/Services/Parts/PricedetailHelper.php b/src/Services/Parts/PricedetailHelper.php index d989593d..092cc278 100644 --- a/src/Services/Parts/PricedetailHelper.php +++ b/src/Services/Parts/PricedetailHelper.php @@ -32,6 +32,9 @@ use Locale; use function count; +/** + * @see \App\Tests\Services\Parts\PricedetailHelperTest + */ class PricedetailHelper { protected string $locale; @@ -54,7 +57,7 @@ class PricedetailHelper foreach ($orderdetails as $orderdetail) { $pricedetails = $orderdetail->getPricedetails(); //The orderdetail must have pricedetails, otherwise this will not work! - if (0 === count($pricedetails)) { + if (0 === (is_countable($pricedetails) ? count($pricedetails) : 0)) { continue; } @@ -99,7 +102,7 @@ class PricedetailHelper foreach ($orderdetails as $orderdetail) { $pricedetails = $orderdetail->getPricedetails(); //The orderdetail must have pricedetails, otherwise this will not work! - if (0 === count($pricedetails)) { + if (0 === (is_countable($pricedetails) ? count($pricedetails) : 0)) { continue; } diff --git a/src/Services/ProjectSystem/ProjectBuildHelper.php b/src/Services/ProjectSystem/ProjectBuildHelper.php index 1ca2d0e8..b9ffc374 100644 --- a/src/Services/ProjectSystem/ProjectBuildHelper.php +++ b/src/Services/ProjectSystem/ProjectBuildHelper.php @@ -26,6 +26,9 @@ use App\Entity\ProjectSystem\ProjectBOMEntry; use App\Helpers\Projects\ProjectBuildRequest; use App\Services\Parts\PartLotWithdrawAddHelper; +/** + * @see \App\Tests\Services\ProjectSystem\ProjectBuildHelperTest + */ class ProjectBuildHelper { public function __construct(private readonly PartLotWithdrawAddHelper $withdraw_add_helper) diff --git a/src/Services/ProjectSystem/ProjectBuildPartHelper.php b/src/Services/ProjectSystem/ProjectBuildPartHelper.php index 80ab9395..446f5f55 100644 --- a/src/Services/ProjectSystem/ProjectBuildPartHelper.php +++ b/src/Services/ProjectSystem/ProjectBuildPartHelper.php @@ -5,6 +5,9 @@ namespace App\Services\ProjectSystem; use App\Entity\Parts\Part; use App\Entity\ProjectSystem\Project; +/** + * @see \App\Tests\Services\ProjectSystem\ProjectBuildPartHelperTest + */ class ProjectBuildPartHelper { /** diff --git a/src/Services/Trees/NodesListBuilder.php b/src/Services/Trees/NodesListBuilder.php index 0196b215..49c0aa6b 100644 --- a/src/Services/Trees/NodesListBuilder.php +++ b/src/Services/Trees/NodesListBuilder.php @@ -31,6 +31,7 @@ use Symfony\Contracts\Cache\TagAwareCacheInterface; /** * This service gives you a flat list containing all structured entities in the order of the structure. + * @see \App\Tests\Services\Trees\NodesListBuilderTest */ class NodesListBuilder { diff --git a/src/Services/Trees/TreeViewGenerator.php b/src/Services/Trees/TreeViewGenerator.php index 1ee0647b..dd2db178 100644 --- a/src/Services/Trees/TreeViewGenerator.php +++ b/src/Services/Trees/TreeViewGenerator.php @@ -45,6 +45,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; use function count; +/** + * @see \App\Tests\Services\Trees\TreeViewGeneratorTest + */ class TreeViewGenerator { public function __construct(protected EntityURLGenerator $urlGenerator, protected EntityManagerInterface $em, protected TagAwareCacheInterface $cache, protected UserCacheKeyGenerator $keyGenerator, protected TranslatorInterface $translator, protected bool $rootNodeExpandedByDefault, protected bool $rootNodeEnabled) @@ -130,43 +133,29 @@ class TreeViewGenerator protected function entityClassToRootNodeString(string $class): string { - switch ($class) { - case Category::class: - return $this->translator->trans('category.labelp'); - case Storelocation::class: - return $this->translator->trans('storelocation.labelp'); - case Footprint::class: - return $this->translator->trans('footprint.labelp'); - case Manufacturer::class: - return $this->translator->trans('manufacturer.labelp'); - case Supplier::class: - return $this->translator->trans('supplier.labelp'); - case Project::class: - return $this->translator->trans('project.labelp'); - default: - return $this->translator->trans('tree.root_node.text'); - } + return match ($class) { + Category::class => $this->translator->trans('category.labelp'), + Storelocation::class => $this->translator->trans('storelocation.labelp'), + Footprint::class => $this->translator->trans('footprint.labelp'), + Manufacturer::class => $this->translator->trans('manufacturer.labelp'), + Supplier::class => $this->translator->trans('supplier.labelp'), + Project::class => $this->translator->trans('project.labelp'), + default => $this->translator->trans('tree.root_node.text'), + }; } protected function entityClassToRootNodeIcon(string $class): ?string { $icon = "fa-fw fa-treeview fa-solid "; - switch ($class) { - case Category::class: - return $icon . 'fa-tags'; - case Storelocation::class: - return $icon . 'fa-cube'; - case Footprint::class: - return $icon . 'fa-microchip'; - case Manufacturer::class: - return $icon . 'fa-industry'; - case Supplier::class: - return $icon . 'fa-truck'; - case Project::class: - return $icon . 'fa-archive'; - default: - return null; - } + return match ($class) { + Category::class => $icon . 'fa-tags', + Storelocation::class => $icon . 'fa-cube', + Footprint::class => $icon . 'fa-microchip', + Manufacturer::class => $icon . 'fa-industry', + Supplier::class => $icon . 'fa-truck', + Project::class => $icon . 'fa-archive', + default => null, + }; } /** diff --git a/src/Services/UserSystem/PermissionManager.php b/src/Services/UserSystem/PermissionManager.php index ae3764d8..333e6168 100644 --- a/src/Services/UserSystem/PermissionManager.php +++ b/src/Services/UserSystem/PermissionManager.php @@ -37,6 +37,7 @@ use Symfony\Component\Yaml\Yaml; * This class manages the permissions of users and groups. * Permissions are defined in the config/permissions.yaml file, and are parsed and resolved by this class using the * user and hierachical group PermissionData information. + * @see \App\Tests\Services\UserSystem\PermissionManagerTest */ class PermissionManager { diff --git a/src/Services/UserSystem/PermissionSchemaUpdater.php b/src/Services/UserSystem/PermissionSchemaUpdater.php index 3c12d042..b939fa86 100644 --- a/src/Services/UserSystem/PermissionSchemaUpdater.php +++ b/src/Services/UserSystem/PermissionSchemaUpdater.php @@ -25,6 +25,9 @@ use App\Entity\UserSystem\PermissionData; use App\Entity\UserSystem\User; use App\Security\Interfaces\HasPermissionsInterface; +/** + * @see \App\Tests\Services\UserSystem\PermissionSchemaUpdaterTest + */ class PermissionSchemaUpdater { /** diff --git a/src/Services/UserSystem/TFA/BackupCodeGenerator.php b/src/Services/UserSystem/TFA/BackupCodeGenerator.php index 9beddf39..a13b9804 100644 --- a/src/Services/UserSystem/TFA/BackupCodeGenerator.php +++ b/src/Services/UserSystem/TFA/BackupCodeGenerator.php @@ -27,6 +27,7 @@ use RuntimeException; /** * This class generates random backup codes for two-factor authentication. + * @see \App\Tests\Services\UserSystem\TFA\BackupCodeGeneratorTest */ class BackupCodeGenerator { diff --git a/src/Services/UserSystem/TFA/BackupCodeManager.php b/src/Services/UserSystem/TFA/BackupCodeManager.php index 1fb572c6..70226946 100644 --- a/src/Services/UserSystem/TFA/BackupCodeManager.php +++ b/src/Services/UserSystem/TFA/BackupCodeManager.php @@ -26,6 +26,7 @@ use App\Entity\UserSystem\User; /** * This services offers methods to manage backup codes for two-factor authentication. + * @see \App\Tests\Services\UserSystem\TFA\BackupCodeManagerTest */ class BackupCodeManager { diff --git a/src/Twig/EntityExtension.php b/src/Twig/EntityExtension.php index 393c4040..92d69631 100644 --- a/src/Twig/EntityExtension.php +++ b/src/Twig/EntityExtension.php @@ -42,6 +42,9 @@ use Twig\Extension\AbstractExtension; use Twig\TwigFunction; use Twig\TwigTest; +/** + * @see \App\Tests\Twig\EntityExtensionTest + */ final class EntityExtension extends AbstractExtension { public function __construct(protected EntityURLGenerator $entityURLGenerator, protected TreeViewGenerator $treeBuilder, private readonly ElementTypeNameGenerator $nameGenerator) diff --git a/src/Twig/TwigCoreExtension.php b/src/Twig/TwigCoreExtension.php index dc63b2e1..d4b14c83 100644 --- a/src/Twig/TwigCoreExtension.php +++ b/src/Twig/TwigCoreExtension.php @@ -27,6 +27,7 @@ use Twig\TwigTest; /** * The functionalities here extend the Twig with some core functions, which are independently of Part-DB. + * @see \App\Tests\Twig\TwigCoreExtensionTest */ final class TwigCoreExtension extends AbstractExtension { diff --git a/src/Twig/UserExtension.php b/src/Twig/UserExtension.php index 012f975c..be5d3c41 100644 --- a/src/Twig/UserExtension.php +++ b/src/Twig/UserExtension.php @@ -50,6 +50,9 @@ use Twig\Extension\AbstractExtension; use Twig\TwigFilter; use Twig\TwigFunction; +/** + * @see \App\Tests\Twig\UserExtensionTest + */ final class UserExtension extends AbstractExtension { private readonly LogEntryRepository $repo;