Passed
Pull Request — master (#1002)
by
unknown
02:06
created

RefundShortcut   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPlugins() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Shortcut\Epay;
6
7
use Yansongda\Artful\Contract\ShortcutInterface;
8
use Yansongda\Artful\Plugin\ParserPlugin;
9
use Yansongda\Pay\Exception\InvalidParamsException;
0 ignored issues
show
Bug introduced by
The type Yansongda\Pay\Exception\InvalidParamsException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Yansongda\Pay\Plugin\Epay\AddPayloadSignPlugin;
11
use Yansongda\Pay\Plugin\Epay\AddRadarPlugin;
12
use Yansongda\Pay\Plugin\Epay\Pay\Scan\RefundPlugin;
13
use Yansongda\Pay\Plugin\Epay\ResponsePlugin;
14
use Yansongda\Pay\Plugin\Epay\StartPlugin;
15
use Yansongda\Pay\Plugin\Epay\VerifySignaturePlugin;
16
17
class RefundShortcut implements ShortcutInterface
18
{
19
    /**
20
     * @throws InvalidParamsException
21
     */
22
    public function getPlugins(array $params): array
23
    {
24
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(Yansongda\P...in\ParserPlugin::class) returns the type array<integer,string> which is incompatible with the return type mandated by Yansongda\Artful\Contrac...Interface::getPlugins() of Yansongda\Artful\Contract\PluginInterface[].

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
25
            StartPlugin::class,
26
            RefundPlugin::class,
27
            AddPayloadSignPlugin::class,
28
            AddRadarPlugin::class,
29
            VerifySignaturePlugin::class,
30
            ResponsePlugin::class,
31
            ParserPlugin::class,
32
        ];
33
    }
34
}
35