Passed
Push — master ( b59ea0...ef0b76 )
by Simon
02:07
created

CanViewObject   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A canView() 0 7 2
1
<?php
2
3
4
namespace Firesphere\SolrSearch\Tests;
5
6
use SilverStripe\ORM\DataObject;
7
use SilverStripe\Security\Member;
8
9
class CanViewObject extends DataObject
10
{
11
12
    /**
13
     * @param null|Member $member
14
     * @param array $context
15
     * @return bool|mixed
16
     */
17
    public function canView($member = null, $context = [])
1 ignored issue
show
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    public function canView($member = null, /** @scrutinizer ignore-unused */ $context = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        if (!$member) {
20
            return false;
21
        }
22
23
        return $member->inGroup('administrators');
24
    }
25
}
26