Code Duplication    Length = 12-14 lines in 2 locations

src/Model/Blog.php 1 location

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

src/Model/BlogPost.php 1 location

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