Code Duplication    Length = 31-41 lines in 2 locations

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

@@ 24-54 (lines=31) @@
21
use Surfnet\Stepup\Configuration\Value\Institution;
22
use Surfnet\Stepup\Configuration\Value\InstitutionConfigurationId;
23
24
class InstitutionConfigurationCreatedEvent
25
{
26
    /**
27
     * @var InstitutionConfigurationId
28
     */
29
    public $institutionConfigurationId;
30
31
    /**
32
     * @var Institution
33
     */
34
    public $institution;
35
36
    public function __construct(InstitutionConfigurationId $institutionConfigurationId, Institution $institution)
37
    {
38
        $this->institutionConfigurationId = $institutionConfigurationId;
39
        $this->institution                = $institution;
40
    }
41
42
    public static function deserialize(array $data)
43
    {
44
        return new self($data['institution_configuration_id'], $data['institution']);
45
    }
46
47
    public function serialize()
48
    {
49
        return [
50
            'institution_configuration_id' => (string) $this->institutionConfigurationId,
51
            'institution'                  => (string) $this->institution,
52
        ];
53
    }
54
}
55

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

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