Code Duplication    Length = 53-66 lines in 3 locations

src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/AddRaLocationCommand.php 1 location

@@ 24-76 (lines=53) @@
21
use Surfnet\StepupMiddlewareClientBundle\Command\AbstractCommand;
22
use Symfony\Component\Validator\Constraints as Assert;
23
24
class AddRaLocationCommand extends AbstractCommand
25
{
26
    /**
27
     * @Assert\NotBlank()
28
     * @Assert\Type(type="string")
29
     *
30
     * @var string
31
     */
32
    public $id;
33
34
    /**
35
     * @Assert\NotBlank()
36
     * @Assert\Type(type="string")
37
     *
38
     * @var string
39
     */
40
    public $institution;
41
42
    /**
43
     * @Assert\NotBlank()
44
     * @Assert\Type(type="string")
45
     *
46
     * @var string
47
     */
48
    public $name;
49
50
    /**
51
     * @Assert\NotBlank()
52
     * @Assert\Type(type="string")
53
     *
54
     * @var string
55
     */
56
    public $location;
57
58
    /**
59
     * @Assert\NotBlank()
60
     * @Assert\Type(type="string")
61
     *
62
     * @var string
63
     */
64
    public $contactInformation;
65
66
    public function serialise()
67
    {
68
        return [
69
            'ra_location_id' => $this->id,
70
            'institution' => $this->institution,
71
            'ra_location_name' => $this->name,
72
            'location' => $this->location,
73
            'contact_information' => $this->contactInformation,
74
        ];
75
    }
76
}
77

src/Surfnet/StepupMiddlewareClientBundle/Configuration/Command/ChangeRaLocationCommand.php 1 location

@@ 24-76 (lines=53) @@
21
use Surfnet\StepupMiddlewareClientBundle\Command\AbstractCommand;
22
use Symfony\Component\Validator\Constraints as Assert;
23
24
class ChangeRaLocationCommand extends AbstractCommand
25
{
26
    /**
27
     * @Assert\NotBlank()
28
     * @Assert\Type(type="string")
29
     *
30
     * @var string
31
     */
32
    public $id;
33
34
    /**
35
     * @Assert\NotBlank()
36
     * @Assert\Type(type="string")
37
     *
38
     * @var string
39
     */
40
    public $institution;
41
42
    /**
43
     * @Assert\NotBlank()
44
     * @Assert\Type(type="string")
45
     *
46
     * @var string
47
     */
48
    public $name;
49
50
    /**
51
     * @Assert\NotBlank()
52
     * @Assert\Type(type="string")
53
     *
54
     * @var string
55
     */
56
    public $location;
57
58
    /**
59
     * @Assert\NotBlank()
60
     * @Assert\Type(type="string")
61
     *
62
     * @var string
63
     */
64
    public $contactInformation;
65
66
    public function serialise()
67
    {
68
        return [
69
            'ra_location_id' => $this->id,
70
            'institution' => $this->institution,
71
            'ra_location_name' => $this->name,
72
            'location' => $this->location,
73
            'contact_information' => $this->contactInformation,
74
        ];
75
    }
76
}
77

src/Surfnet/StepupMiddlewareClientBundle/Identity/Command/AccreditIdentityCommand.php 1 location

@@ 24-89 (lines=66) @@
21
use Surfnet\StepupMiddlewareClientBundle\Command\AbstractCommand;
22
use Symfony\Component\Validator\Constraints as Assert;
23
24
class AccreditIdentityCommand extends AbstractCommand
25
{
26
    /**
27
     * @Assert\NotBlank()
28
     * @Assert\Type(type="string")
29
     *
30
     * @var string
31
     */
32
    public $identityId;
33
34
    /**
35
     * @Assert\NotBlank()
36
     * @Assert\Type(type="string")
37
     *
38
     * @var string
39
     */
40
    public $institution;
41
42
    /**
43
     * @Assert\NotBlank()
44
     * @Assert\Type(type="string")
45
     * @Assert\Choice(choices={"ra", "raa"})
46
     *
47
     * @var string
48
     */
49
    public $role;
50
51
    /**
52
     * @Assert\NotBlank()
53
     * @Assert\Type(type="string")
54
     *
55
     * @var string
56
     */
57
    public $location;
58
59
    /**
60
     * @Assert\NotBlank()
61
     * @Assert\Type(type="string")
62
     *
63
     * @var string
64
     */
65
    public $contactInformation;
66
67
    /**
68
     * @Assert\NotBlank()
69
     * @Assert\Type(type="string")
70
     *
71
     * @var string
72
     */
73
    public $raInstitution;
74
75
    /**
76
     * @return array
77
     */
78
    public function serialise()
79
    {
80
        return [
81
            'institution'         => $this->institution,
82
            'identity_id'         => $this->identityId,
83
            'role'                => $this->role,
84
            'location'            => $this->location,
85
            'contact_information' => $this->contactInformation,
86
            'ra_institution'      => $this->raInstitution,
87
        ];
88
    }
89
}
90