Code Duplication    Length = 23-23 lines in 2 locations

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Entity/InstitutionListing.php 1 location

@@ 28-50 (lines=23) @@
25
/**
26
 * @ORM\Entity(repositoryClass="Surfnet\StepupMiddleware\ApiBundle\Identity\Repository\InstitutionListingRepository")
27
 */
28
class InstitutionListing implements JsonSerializable
29
{
30
    /**
31
     * @ORM\Id
32
     * @ORM\Column(type="institution")
33
     *
34
     * @var \Surfnet\Stepup\Identity\Value\Institution
35
     */
36
    public $institution;
37
38
    public static function createFrom(Institution $institution)
39
    {
40
        $instance = new self();
41
        $instance->institution = $institution;
42
43
        return $instance;
44
    }
45
46
    public function jsonSerialize()
47
    {
48
        return ['name' => $this->institution];
49
    }
50
}
51

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Entity/WhitelistEntry.php 1 location

@@ 28-50 (lines=23) @@
25
/**
26
 * @ORM\Entity(repositoryClass="Surfnet\StepupMiddleware\ApiBundle\Identity\Repository\WhitelistEntryRepository")
27
 */
28
class WhitelistEntry implements JsonSerializable
29
{
30
    /**
31
     * @ORM\Id
32
     * @ORM\Column(type="institution")
33
     *
34
     * @var Institution
35
     */
36
    public $institution;
37
38
    public static function createFrom(Institution $institution)
39
    {
40
        $instance              = new self();
41
        $instance->institution = $institution;
42
43
        return $instance;
44
    }
45
46
    public function jsonSerialize()
47
    {
48
        return $this->institution;
49
    }
50
}
51