Code Duplication    Length = 34-41 lines in 2 locations

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

@@ 24-57 (lines=34) @@
21
use Surfnet\Stepup\Configuration\Value\Institution;
22
use Surfnet\Stepup\Configuration\Value\InstitutionConfigurationId;
23
24
class NewInstitutionConfigurationCreatedEvent
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(
45
            new InstitutionConfigurationId($data['institution_configuration_id']),
46
            new Institution($data['institution'])
47
        );
48
    }
49
50
    public function serialize()
51
    {
52
        return [
53
            'institution_configuration_id' => (string) $this->institutionConfigurationId,
54
            'institution'                  => (string) $this->institution,
55
        ];
56
    }
57
}
58

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
            new InstitutionConfigurationId($data['institution_configuration_id']),
54
            new RaLocationId($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