FolderExtension::canView()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\ORM\DataExtension;
7
8
class FolderExtension extends DataExtension implements TestOnly
9
{
10
    public function canView($member = null, $context = array())
0 ignored issues
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

10
    public function canView($member = null, /** @scrutinizer ignore-unused */ $context = array())

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...
Unused Code introduced by
The parameter $member 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

10
    public function canView(/** @scrutinizer ignore-unused */ $member = null, $context = array())

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...
11
    {
12
        if ($this->owner->Name === 'disallowCanView') {
13
            return false;
14
        }
15
    }
16
17
    public function canEdit($member = null, $context = array())
0 ignored issues
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 canEdit($member = null, /** @scrutinizer ignore-unused */ $context = array())

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 ($this->owner->Name === 'disallowCanEdit') {
20
            return false;
21
        }
22
    }
23
24
    public function canDelete($member = null, $context = array())
0 ignored issues
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

24
    public function canDelete($member = null, /** @scrutinizer ignore-unused */ $context = array())

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...
25
    {
26
        if ($this->owner->Name === 'disallowCanDelete') {
27
            return false;
28
        }
29
    }
30
31
    public function canCreate($member = null, $context = array())
32
    {
33
        if (isset($context['Name']) && $context['Name'] === 'disallowCanCreate') {
34
            return false;
35
        }
36
    }
37
}
38