Skip to content

Commit

Permalink
fixed strict types in Voters
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLudvik committed Nov 25, 2024
1 parent a2b8cfd commit fd5b4d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Voter/AbstractB2bVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public function __construct(protected readonly Domain $domain)
/**
* @param string $attribute
* @param array $subject
* @return bool
*/
abstract protected function supports(string $attribute, $subject);
abstract protected function supports(string $attribute, $subject): bool;

/**
* @param string $attribute
Expand All @@ -36,8 +37,9 @@ abstract protected function checkAccess(string $attribute, ?Argument $argument,
* @param string $attribute
* @param mixed $subject
* @param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
* @return bool
*/
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token)
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool
{
if ($this->domain->isB2b() === false) {
return false;
Expand Down
3 changes: 2 additions & 1 deletion src/Voter/CompanyOwnerVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ public function __construct(
/**
* @param string $attribute
* @param mixed $subject
* @return bool
*/
protected function supports(string $attribute, $subject)
protected function supports(string $attribute, $subject): bool
{
return $attribute === 'is_company_owner_voter';
}
Expand Down

0 comments on commit fd5b4d5

Please sign in to comment.