Code Duplication    Length = 53-57 lines in 3 locations

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

@@ 24-80 (lines=57) @@
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
     * @return array
69
     */
70
    public function serialise()
71
    {
72
        return [
73
            'identity_id'         => $this->identityId,
74
            'institution'         => $this->institution,
75
            'role'                => $this->role,
76
            'location'            => $this->location,
77
            'contact_information' => $this->contactInformation
78
        ];
79
    }
80
}
81

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

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

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

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