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
Push — master ( 36acbf )
by Mario
11:02
created

InformationCollectionMapper::configureOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\InformationCollection\Integration\RepositoryForms;
6
7
use eZ\Publish\API\Repository\Values\Content\Content;
8
use eZ\Publish\API\Repository\Values\ContentType\ContentType;
9
use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
10
use eZ\Publish\API\Repository\Values\ValueObject;
11
use Netgen\InformationCollection\API\Value\InformationCollectionStruct;
12
use Symfony\Component\OptionsResolver\OptionsResolver;
13
use EzSystems\EzPlatformContentForms\Data\Mapper\FormDataMapperInterface;
14
use EzSystems\EzPlatformContentForms\Data\Content\FieldData;
15
16
final class InformationCollectionMapper
17
{
18
    /**
19
     * Maps a ValueObject from eZ content repository to a data usable as underlying form data (e.g. create/update struct).
20
     *
21
     * @param \eZ\Publish\API\Repository\Values\Content\Content $contentDraft
0 ignored issues
show
Documentation introduced by
There is no parameter named $contentDraft. Did you maybe mean $content?

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...
22
     * @param array $params
0 ignored issues
show
Bug introduced by
There is no parameter named $params. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
23
     *
24
     * @return InformationCollectionStruct
25
     */
26
    public function mapToFormData(Content $content, ContentType $contentType)
27
    {
28
        $fields = $content->getFieldsByLanguage($content->contentInfo->mainLanguageCode);
29
30
        $informationCollectionFields = [];
31
32
        /** @var FieldDefinition $fieldDef */
33
        foreach ($contentType->fieldDefinitions as $fieldDef) {
34
            if ($fieldDef->isInfoCollector) {
35
                $field = $fields[$fieldDef->identifier];
36
37
                $fieldData = new FieldData(
38
                    [
39
                        'fieldDefinition' => $fieldDef,
40
                        'field' => $field,
41
                    ]
42
                );
43
44
                $informationCollectionFields[] = $fieldData;
45
            }
46
        }
47
48
        return new InformationCollectionStruct(
49
            $content,
50
            $contentType,
51
            $informationCollectionFields
52
        );
53
    }
54
}
55