Issues (193)

src/Exception/RequestNotSupportedException.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace ByTIC\Payments\Exception;
4
5
use Omnipay\Common\AbstractGateway;
6
7
/**
8
 * Class RequestNotSupportedException
9
 * @package ByTIC\Payments\Exception
10
 */
11
class RequestNotSupportedException extends InvalidArgumentException
12
{
13
14
    /**
15
     * @param string $request
16
     * @param AbstractGateway|null $gateway
17
     * @return self
18
     */
19
    public static function create(string $request, AbstractGateway $gateway = null): self
20
    {
21
        return new self(
22
            sprintf(
23
                'Request %s is not supported for %s',
24
                $request,
25
                $gateway->getName()
0 ignored issues
show
The method getName() does not exist on null. ( Ignorable by Annotation )

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

25
                $gateway->/** @scrutinizer ignore-call */ 
26
                          getName()

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...
26
            )
27
        );
28
    }
29
}
30