Issues (62)

Operation/InvalidCollectionOperationException.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LAG\AdminBundle\Exception\Operation;
6
7
use LAG\AdminBundle\Controller\Index;
8
use LAG\AdminBundle\Exception\Exception;
9
use LAG\AdminBundle\Metadata\CollectionOperationInterface;
10
use LAG\AdminBundle\Metadata\OperationInterface;
11
12
class InvalidCollectionOperationException extends Exception
13
{
14
    public function __construct(OperationInterface $operation)
15
    {
16
        parent::__construct(sprintf(
17
            'The operation "%s" of the resource "%s" is configured to use the "%s" controller but is not an instance of "%s"',
18
            $operation->getName(),
19
            $operation->getResourceName(),
0 ignored issues
show
The method getResourceName() does not exist on LAG\AdminBundle\Metadata\OperationInterface. Did you maybe mean getResource()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
            $operation->/** @scrutinizer ignore-call */ 
20
                        getResourceName(),

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.

Loading history...
20
            Index::class,
21
            CollectionOperationInterface::class,
22
        ));
23
    }
24
}
25