Code Duplication    Length = 7-8 lines in 4 locations

src/Service/CfpFactory.php 4 locations

@@ 83-89 (lines=7) @@
80
        return $cfp;
81
    }
82
83
    public static function setName(Cfp $cfp, array $array)
84
    {
85
        if (! isset($array['name'])) {
86
            throw new \InvalidArgumentException('Name has to be specified');
87
        }
88
        $cfp->setName(filter_var($array['name'], FILTER_SANITIZE_STRING));
89
    }
90
91
    public static function setDateCfpStart(Cfp $cfp, array $array)
92
    {
@@ 107-113 (lines=7) @@
104
        $cfp->setDateCfpEnd(new DateTimeImmutable($array['dateCfpEnd']));
105
    }
106
107
    public static function setTimezone(Cfp $cfp, array $array)
108
    {
109
        if (! isset($array['timezone'])) {
110
            throw new \InvalidArgumentException('Timezone has to be specified');
111
        }
112
        $cfp->setTimezone(filter_var($array['timezone'], FILTER_SANITIZE_STRING));
113
    }
114
115
    public static function setUri(Cfp $cfp, array $array)
116
    {
@@ 160-167 (lines=8) @@
157
        $cfp->setIconUri(filter_var($array['iconUri'], FILTER_VALIDATE_URL));
158
    }
159
160
    public static function setDescription(Cfp $cfp, array $array)
161
    {
162
        if (! isset($array['description'])) {
163
            return;
164
        }
165
166
        $cfp->setDescription(filter_var($array['description'], FILTER_SANITIZE_STRING));
167
    }
168
169
    public static function setLocation(Cfp $cfp, array $array)
170
    {
@@ 169-176 (lines=8) @@
166
        $cfp->setDescription(filter_var($array['description'], FILTER_SANITIZE_STRING));
167
    }
168
169
    public static function setLocation(Cfp $cfp, array $array)
170
    {
171
        if (! isset($array['location'])) {
172
            return;
173
        }
174
175
        $cfp->setLocation(filter_var($array['location'], FILTER_SANITIZE_STRING));
176
    }
177
178
    public static function setGeolocation(Cfp $cfp, array $array)
179
    {