Code Duplication    Length = 12-14 lines in 2 locations

src/Model/BlogPost.php 1 location

@@ 192-205 (lines=14) @@
189
     *
190
     * @return bool
191
     */
192
    public function isAuthor($member = null)
193
    {
194
        if (!$member || !$member->exists()) {
195
            return false;
196
        }
197
198
        $list = $this->Authors();
199
200
        if ($list instanceof UnsavedRelationList) {
201
            return in_array($member->ID, $list->getIDList());
202
        }
203
204
        return $list->byID($member->ID) !== null;
205
    }
206
207
    /**
208
     * {@inheritdoc}

src/Model/Blog.php 1 location

@@ 251-262 (lines=12) @@
248
     *
249
     * @return bool
250
     */
251
    protected function isMemberOf($member, $relation)
252
    {
253
        if (!$member || !$member->exists()) {
254
            return false;
255
        }
256
257
        if ($relation instanceof UnsavedRelationList) {
258
            return in_array($member->ID, $relation->getIDList());
259
        }
260
261
        return $relation->byID($member->ID) !== null;
262
    }
263
264
    /**
265
     * Determine the role of the given member.