GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#73)
by
unknown
14:32
created

AbstractProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
3
namespace Netgen\InformationCollection\Core\EmailDataProvider;
4
5
use eZ\Publish\Core\Helper\FieldHelper;
6
use eZ\Publish\Core\Helper\TranslationHelper;
7
use eZ\Publish\Core\MVC\ConfigResolverInterface;
8
use Netgen\InformationCollection\API\Action\EmailDataProviderInterface;
9
use Netgen\InformationCollection\Core\Action\EmailAction;
10
use Twig\Environment;
11
12
abstract class AbstractProvider implements EmailDataProviderInterface
13
{
14
    /**
15
     * @var array
16
     */
17
    protected $configResolver;
18
19
    /**
20
     * @var \eZ\Publish\Core\Helper\TranslationHelper
21
     */
22
    protected $translationHelper;
23
24
    /**
25
     * @var \eZ\Publish\Core\Helper\FieldHelper
26
     */
27
    protected $fieldHelper;
28
29
    /**
30
     * @var \Twig\Environment
31
     */
32
    protected $twig;
33
34
    /**
35
     * EmailDataFactory constructor.
36
     *
37
     * @param array $config
0 ignored issues
show
Documentation introduced by
There is no parameter named $config. Did you maybe mean $configResolver?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
38
     * @param \eZ\Publish\Core\Helper\TranslationHelper $translationHelper
39
     * @param \eZ\Publish\Core\Helper\FieldHelper $fieldHelper
40
     * @param \Twig\Environment $twig
41
     */
42 View Code Duplication
    public function __construct(
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
43
        ConfigResolverInterface $configResolver,
44
        TranslationHelper $translationHelper,
45
        FieldHelper $fieldHelper,
46
        Environment $twig
47
    ) {
48
        $this->configResolver = $configResolver;
0 ignored issues
show
Documentation Bug introduced by
It seems like $configResolver of type object<eZ\Publish\Core\M...onfigResolverInterface> is incompatible with the declared type array of property $configResolver.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
49
        $this->config = $this->configResolver->getParameter('action_config', 'netgen_information_collection')[EmailAction::$defaultName];
0 ignored issues
show
Bug introduced by
The property config does not seem to exist. Did you mean configResolver?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
50
        $this->translationHelper = $translationHelper;
51
        $this->fieldHelper = $fieldHelper;
52
        $this->twig = $twig;
53
    }
54
}
55