Code Duplication    Length = 12-14 lines in 2 locations

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.

src/Model/BlogPost.php 1 location

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