Passed
Push — master ( ccd743...0e7290 )
by Petr
11:48
created

AmbassadorRepository::findOneByFormData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace AppBundle\Entity\Infrasctucture;
4
5
use AppBundle\Entity\User;
6
use AppBundle\Form\AbstractFormType;
7
use AppBundle\Form\Ambassador\AmbassadorFormType;
8
9
/**
10
 * @author Vehsamrak
11
 */
12
class AmbassadorRepository extends AbstractRepository
13
{
14
15
    /**
16
     * @return Ambassador|object|null
17
     */
18
    public function findOneByName(string $name)
19
    {
20
        return $this->findOneBy(
21
            [
22
                'name' => $name,
23
            ]
24
        );
25
    }
26
27
    /**
28
     * @param AmbassadorFormType $formType
29
     * @param User $creator
0 ignored issues
show
Bug introduced by
There is no parameter named $creator. 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...
30
     * @return Ambassador|null|object
31
     */
32
    public function findOneByFormData(AbstractFormType $formType)
33
    {
34
        $ambassadorName = $formType->name;
0 ignored issues
show
Bug introduced by
The property name does not seem to exist in AppBundle\Form\AbstractFormType.

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...
35
        $ambassador = $this->findOneByName($ambassadorName);
36
37
        return $ambassador;
38
    }
39
}
40