Passed
Push — master ( 1d30f9...202808 )
by Peter
04:48
created

ApiClient   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
dl 0
loc 38
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Http\Controllers\Admin\Grid;
6
7
use AbterPhp\Admin\Service\RepoGrid\ApiClient as RepoGrid;
8
use AbterPhp\Framework\Assets\AssetManager;
9
use AbterPhp\Framework\Http\Controllers\Admin\GridAbstract;
10
use AbterPhp\Framework\I18n\ITranslator;
11
use AbterPhp\Framework\Session\FlashService;
12
use Opulence\Events\Dispatchers\IEventDispatcher;
13
use Opulence\Routing\Urls\UrlGenerator;
14
use Psr\Log\LoggerInterface;
15
16
class ApiClient extends GridAbstract
17
{
18
    const ENTITY_SINGULAR = 'apiClient';
19
    const ENTITY_PLURAL   = 'apiClients';
20
21
    const ENTITY_TITLE_PLURAL = 'admin:apiClients';
22
23
    /** @var string */
24
    protected $resource = 'api_clients';
25
26
    /**
27
     * ApiClient constructor.
28
     *
29
     * @param FlashService     $flashService
30
     * @param ITranslator      $translator
31
     * @param UrlGenerator     $urlGenerator
32
     * @param LoggerInterface  $logger
33
     * @param AssetManager     $assets
34
     * @param RepoGrid         $repoGrid
35
     * @param IEventDispatcher $eventDispatcher
36
     */
37
    public function __construct(
38
        FlashService $flashService,
39
        ITranslator $translator,
40
        UrlGenerator $urlGenerator,
41
        LoggerInterface $logger,
42
        AssetManager $assets,
43
        RepoGrid $repoGrid,
44
        IEventDispatcher $eventDispatcher
45
    ) {
46
        parent::__construct(
47
            $flashService,
48
            $translator,
49
            $urlGenerator,
50
            $logger,
0 ignored issues
show
Bug introduced by
$logger of type Psr\Log\LoggerInterface is incompatible with the type AbterPhp\Framework\Assets\AssetManager expected by parameter $assets of AbterPhp\Framework\Http\...Abstract::__construct(). ( Ignorable by Annotation )

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

50
            /** @scrutinizer ignore-type */ $logger,
Loading history...
51
            $assets,
0 ignored issues
show
Bug introduced by
$assets of type AbterPhp\Framework\Assets\AssetManager is incompatible with the type AbterPhp\Framework\Http\Service\RepoGrid\IRepoGrid expected by parameter $repoGrid of AbterPhp\Framework\Http\...Abstract::__construct(). ( Ignorable by Annotation )

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

51
            /** @scrutinizer ignore-type */ $assets,
Loading history...
52
            $repoGrid,
0 ignored issues
show
Bug introduced by
$repoGrid of type AbterPhp\Admin\Service\RepoGrid\ApiClient is incompatible with the type Opulence\Events\Dispatchers\IEventDispatcher expected by parameter $eventDispatcher of AbterPhp\Framework\Http\...Abstract::__construct(). ( Ignorable by Annotation )

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

52
            /** @scrutinizer ignore-type */ $repoGrid,
Loading history...
53
            $eventDispatcher
0 ignored issues
show
Unused Code introduced by
The call to AbterPhp\Framework\Http\...Abstract::__construct() has too many arguments starting with $eventDispatcher. ( Ignorable by Annotation )

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

53
        parent::/** @scrutinizer ignore-call */ 
54
                __construct(

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
54
        );
55
    }
56
}
57