Code Duplication    Length = 45-45 lines in 3 locations

src/Surfnet/Stepup/Configuration/Event/RaLocationContactInformationChangedEvent.php 1 location

@@ 25-69 (lines=45) @@
22
use Surfnet\Stepup\Configuration\Value\InstitutionConfigurationId;
23
use Surfnet\Stepup\Configuration\Value\RaLocationId;
24
25
class RaLocationContactInformationChangedEvent
26
{
27
    /**
28
     * @var InstitutionConfigurationId
29
     */
30
    public $institutionConfigurationId;
31
32
    /**
33
     * @var RaLocationId
34
     */
35
    public $raLocationId;
36
37
    /**
38
     * @var ContactInformation
39
     */
40
    public $contactInformation;
41
42
    public function __construct(
43
        InstitutionConfigurationId $institutionConfigurationId,
44
        RaLocationId $raLocationId,
45
        ContactInformation $contactInformation
46
    ) {
47
        $this->institutionConfigurationId = $institutionConfigurationId;
48
        $this->raLocationId               = $raLocationId;
49
        $this->contactInformation         = $contactInformation;
50
    }
51
52
    public static function deserialize(array $data)
53
    {
54
        return new self(
55
            $data['institution_configuration_id'],
56
            $data['ra_location_id'],
57
            $data['contact_information']
58
        );
59
    }
60
61
    public function serialize()
62
    {
63
        return [
64
            'institution_configuration_id' => (string) $this->institutionConfigurationId,
65
            'ra_location_id'               => (string) $this->raLocationId,
66
            'contact_information'          => (string) $this->contactInformation,
67
        ];
68
    }
69
}
70

src/Surfnet/Stepup/Configuration/Event/RaLocationRelocatedEvent.php 1 location

@@ 25-69 (lines=45) @@
22
use Surfnet\Stepup\Configuration\Value\Location;
23
use Surfnet\Stepup\Configuration\Value\RaLocationId;
24
25
class RaLocationRelocatedEvent
26
{
27
    /**
28
     * @var InstitutionConfigurationId
29
     */
30
    public $institutionConfigurationId;
31
32
    /**
33
     * @var RaLocationId
34
     */
35
    public $raLocationId;
36
37
    /**
38
     * @var Location
39
     */
40
    public $location;
41
42
    public function __construct(
43
        InstitutionConfigurationId $institutionConfigurationId,
44
        RaLocationId $raLocationId,
45
        Location $location
46
    ) {
47
        $this->institutionConfigurationId = $institutionConfigurationId;
48
        $this->raLocationId               = $raLocationId;
49
        $this->location                   = $location;
50
    }
51
52
    public static function deserialize(array $data)
53
    {
54
        return new self(
55
            $data['institution_configuration_id'],
56
            $data['ra_location_id'],
57
            $data['location']
58
        );
59
    }
60
61
    public function serialize()
62
    {
63
        return [
64
            'institution_configuration_id' => (string) $this->institutionConfigurationId,
65
            'ra_location_id'               => (string) $this->raLocationId,
66
            'location'                     => (string) $this->location,
67
        ];
68
    }
69
}
70

src/Surfnet/Stepup/Configuration/Event/RaLocationRenamedEvent.php 1 location

@@ 25-69 (lines=45) @@
22
use Surfnet\Stepup\Configuration\Value\RaLocationId;
23
use Surfnet\Stepup\Configuration\Value\RaLocationName;
24
25
class RaLocationRenamedEvent
26
{
27
    /**
28
     * @var InstitutionConfigurationId
29
     */
30
    public $institutionConfigurationId;
31
32
    /**
33
     * @var RaLocationId
34
     */
35
    public $raLocationId;
36
37
    /**
38
     * @var RaLocationName
39
     */
40
    public $raLocationName;
41
42
    public function __construct(
43
        InstitutionConfigurationId $institutionConfigurationId,
44
        RaLocationId $raLocationId,
45
        RaLocationName $raLocationName
46
    ) {
47
        $this->institutionConfigurationId = $institutionConfigurationId;
48
        $this->raLocationId               = $raLocationId;
49
        $this->raLocationName             = $raLocationName;
50
    }
51
52
    public static function deserialize(array $data)
53
    {
54
        return new self(
55
            $data['institution_configuration_id'],
56
            $data['ra_location_id'],
57
            $data['ra_location_name']
58
        );
59
    }
60
61
    public function serialize()
62
    {
63
        return [
64
            'institution_configuration_id' => (string) $this->institutionConfigurationId,
65
            'ra_location_id'               => (string) $this->raLocationId,
66
            'ra_location_name'             => (string) $this->raLocationName,
67
        ];
68
    }
69
}
70