diff --git a/src/Security/Voter/AttachmentVoter.php b/src/Security/Voter/AttachmentVoter.php index 85a7eb1f..3a576ff2 100644 --- a/src/Security/Voter/AttachmentVoter.php +++ b/src/Security/Voter/AttachmentVoter.php @@ -45,6 +45,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; use function in_array; +/** + * @phpstan-extends Voter + */ final class AttachmentVoter extends Voter { private const ALLOWED_ATTRIBUTES = ['read', 'view', 'edit', 'delete', 'create', 'show_private', 'show_history']; diff --git a/src/Security/Voter/BOMEntryVoter.php b/src/Security/Voter/BOMEntryVoter.php index f83e2eb3..121c8172 100644 --- a/src/Security/Voter/BOMEntryVoter.php +++ b/src/Security/Voter/BOMEntryVoter.php @@ -29,6 +29,9 @@ use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ class BOMEntryVoter extends Voter { diff --git a/src/Security/Voter/GroupVoter.php b/src/Security/Voter/GroupVoter.php index 96ae20d0..af6adeaa 100644 --- a/src/Security/Voter/GroupVoter.php +++ b/src/Security/Voter/GroupVoter.php @@ -28,6 +28,9 @@ use App\Services\UserSystem\VoterHelper; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ final class GroupVoter extends Voter { diff --git a/src/Security/Voter/HasAccessPermissionsVoter.php b/src/Security/Voter/HasAccessPermissionsVoter.php index 16639d2f..25a11cc8 100644 --- a/src/Security/Voter/HasAccessPermissionsVoter.php +++ b/src/Security/Voter/HasAccessPermissionsVoter.php @@ -32,6 +32,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; /** * This voter implements a virtual role, which can be used if the user has any permission set to allowed. * We use this to restrict access to the homepage. + * @phpstan-extends Voter */ final class HasAccessPermissionsVoter extends Voter { diff --git a/src/Security/Voter/ImpersonateUserVoter.php b/src/Security/Voter/ImpersonateUserVoter.php index eebcfcc3..bbfa0794 100644 --- a/src/Security/Voter/ImpersonateUserVoter.php +++ b/src/Security/Voter/ImpersonateUserVoter.php @@ -30,6 +30,11 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; use Symfony\Component\Security\Core\User\UserInterface; +/** + * This voter implements a virtual role, which can be used if the user has any permission set to allowed. + * We use this to restrict access to the homepage. + * @phpstan-extends Voter + */ final class ImpersonateUserVoter extends Voter { diff --git a/src/Security/Voter/LabelProfileVoter.php b/src/Security/Voter/LabelProfileVoter.php index acccd435..9abaa8bf 100644 --- a/src/Security/Voter/LabelProfileVoter.php +++ b/src/Security/Voter/LabelProfileVoter.php @@ -47,6 +47,9 @@ use App\Services\UserSystem\VoterHelper; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ final class LabelProfileVoter extends Voter { protected const MAPPING = [ diff --git a/src/Security/Voter/LogEntryVoter.php b/src/Security/Voter/LogEntryVoter.php index 6b6bbb42..bc898d2a 100644 --- a/src/Security/Voter/LogEntryVoter.php +++ b/src/Security/Voter/LogEntryVoter.php @@ -31,6 +31,9 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ final class LogEntryVoter extends Voter { final public const ALLOWED_OPS = ['read', 'show_details', 'delete']; diff --git a/src/Security/Voter/OrderdetailVoter.php b/src/Security/Voter/OrderdetailVoter.php index 6c16cf42..b260ec19 100644 --- a/src/Security/Voter/OrderdetailVoter.php +++ b/src/Security/Voter/OrderdetailVoter.php @@ -51,6 +51,9 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ final class OrderdetailVoter extends Voter { public function __construct(private readonly Security $security, private readonly VoterHelper $helper) diff --git a/src/Security/Voter/ParameterVoter.php b/src/Security/Voter/ParameterVoter.php index 6699b56f..02f97147 100644 --- a/src/Security/Voter/ParameterVoter.php +++ b/src/Security/Voter/ParameterVoter.php @@ -44,6 +44,9 @@ use RuntimeException; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ final class ParameterVoter extends Voter { diff --git a/src/Security/Voter/PartAssociationVoter.php b/src/Security/Voter/PartAssociationVoter.php index e6e6abdb..7678b67a 100644 --- a/src/Security/Voter/PartAssociationVoter.php +++ b/src/Security/Voter/PartAssociationVoter.php @@ -51,6 +51,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; /** * This voter handles permissions for part associations. * The permissions are inherited from the part. + * @phpstan-extends Voter */ final class PartAssociationVoter extends Voter { diff --git a/src/Security/Voter/PartLotVoter.php b/src/Security/Voter/PartLotVoter.php index e4bfeddd..9968fbd3 100644 --- a/src/Security/Voter/PartLotVoter.php +++ b/src/Security/Voter/PartLotVoter.php @@ -51,6 +51,9 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ final class PartLotVoter extends Voter { public function __construct(private readonly Security $security, private readonly VoterHelper $helper) diff --git a/src/Security/Voter/PartVoter.php b/src/Security/Voter/PartVoter.php index ec849bf4..87843135 100644 --- a/src/Security/Voter/PartVoter.php +++ b/src/Security/Voter/PartVoter.php @@ -32,6 +32,8 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; * A Voter that votes on Part entities. * * See parts permissions for valid operations. + * + * @phpstan-extends Voter */ final class PartVoter extends Voter { diff --git a/src/Security/Voter/PermissionVoter.php b/src/Security/Voter/PermissionVoter.php index f6613cfc..e7a1caed 100644 --- a/src/Security/Voter/PermissionVoter.php +++ b/src/Security/Voter/PermissionVoter.php @@ -31,6 +31,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; * This voter allows you to directly check permissions from the permission structure, without passing an object. * This use the syntax like "@permission.op" * However you should use the "normal" object based voters if possible, because they are needed for a future ACL system. + * @phpstan-extends Voter */ final class PermissionVoter extends Voter { diff --git a/src/Security/Voter/PricedetailVoter.php b/src/Security/Voter/PricedetailVoter.php index 3dc8fc41..6ee412c7 100644 --- a/src/Security/Voter/PricedetailVoter.php +++ b/src/Security/Voter/PricedetailVoter.php @@ -52,6 +52,9 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; +/** + * @phpstan-extends Voter + */ final class PricedetailVoter extends Voter { public function __construct(private readonly Security $security, private readonly VoterHelper $helper) diff --git a/src/Security/Voter/StructureVoter.php b/src/Security/Voter/StructureVoter.php index 7b68215f..24f4d04f 100644 --- a/src/Security/Voter/StructureVoter.php +++ b/src/Security/Voter/StructureVoter.php @@ -39,6 +39,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; use function get_class; use function is_object; +/** + * @phpstan-extends Voter + */ final class StructureVoter extends Voter { protected const OBJ_PERM_MAP = [ diff --git a/src/Security/Voter/UserVoter.php b/src/Security/Voter/UserVoter.php index a06f098c..e6bfd5fb 100644 --- a/src/Security/Voter/UserVoter.php +++ b/src/Security/Voter/UserVoter.php @@ -30,6 +30,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; use function in_array; +/** + * @phpstan-extends Voter + */ final class UserVoter extends Voter { public function __construct(private readonly VoterHelper $helper, private readonly PermissionManager $resolver)