Ecodev /
my-ichtus
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | namespace Application\Acl\Assertion; |
||||
| 6 | |||||
| 7 | use Application\Model\Account; |
||||
| 8 | use Ecodev\Felix\Acl\Assertion\NamedAssertion; |
||||
| 9 | use Laminas\Permissions\Acl\Acl; |
||||
| 10 | use Laminas\Permissions\Acl\Resource\ResourceInterface; |
||||
| 11 | use Laminas\Permissions\Acl\Role\RoleInterface; |
||||
| 12 | |||||
| 13 | class AccountHasNoTransaction implements NamedAssertion |
||||
| 14 | { |
||||
| 15 | public function getName(): string |
||||
| 16 | { |
||||
| 17 | return "le compte et ses sous-comptes n'ont aucune écritures"; |
||||
| 18 | } |
||||
| 19 | |||||
| 20 | /** |
||||
| 21 | * Assert that the account, or any of its subaccounts, have no transaction at all. |
||||
| 22 | * |
||||
| 23 | * @param \Application\Acl\Acl $acl |
||||
| 24 | * @param string $privilege |
||||
| 25 | * |
||||
| 26 | * @return bool |
||||
| 27 | */ |
||||
| 28 | public function assert(Acl $acl, ?RoleInterface $role = null, ?ResourceInterface $resource = null, $privilege = null) |
||||
| 29 | { |
||||
| 30 | /** @var Account $account */ |
||||
| 31 | $account = $resource->getInstance(); |
||||
|
0 ignored issues
–
show
|
|||||
| 32 | |||||
| 33 | if (!_em()->getRepository(Account::class)->hasTransaction($account)) { |
||||
| 34 | return true; |
||||
| 35 | } |
||||
| 36 | |||||
| 37 | return $acl->reject('the account, or its sub-accounts, have transaction lines'); |
||||
|
0 ignored issues
–
show
The method
reject() does not exist on Laminas\Permissions\Acl\Acl. It seems like you code against a sub-type of Laminas\Permissions\Acl\Acl such as Ecodev\Felix\Acl\Acl.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 38 | } |
||||
| 39 | } |
||||
| 40 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.