1 | <?php |
||
2 | |||
3 | namespace SilverStripe\AssetAdmin\Tests\Controller\AssetAdminTest; |
||
4 | |||
5 | use SilverStripe\Dev\TestOnly; |
||
6 | use SilverStripe\ORM\DataExtension; |
||
7 | |||
8 | /** |
||
9 | * @skipUpgrade |
||
10 | */ |
||
11 | class FileExtension extends DataExtension implements TestOnly |
||
12 | { |
||
13 | public function canView($member = null) |
||
0 ignored issues
–
show
|
|||
14 | { |
||
15 | if ($this->owner->Name === 'disallowCanView.txt') { |
||
16 | return false; |
||
17 | } |
||
18 | } |
||
19 | |||
20 | public function canEdit($member = null) |
||
21 | { |
||
22 | if ($this->owner->Name === 'disallowCanEdit.txt') { |
||
23 | return false; |
||
24 | } |
||
25 | } |
||
26 | |||
27 | public function canDelete($member = null) |
||
28 | { |
||
29 | if ($this->owner->Name === 'disallowCanDelete.txt') { |
||
30 | return false; |
||
31 | } |
||
32 | } |
||
33 | |||
34 | public function canArchive($member = null) |
||
35 | { |
||
36 | if ($this->owner->Name === 'disallowCanDelete.txt') { |
||
37 | return false; |
||
38 | } |
||
39 | return $this->owner->canDelete($member); |
||
40 | } |
||
41 | |||
42 | |||
43 | public function canCreate($member = null, $context = []) |
||
44 | { |
||
45 | if (isset($context['Parent']) && $context['Parent']->Name === 'disallowCanAddChildren') { |
||
46 | return false; |
||
47 | } |
||
48 | if (isset($context['Upload']['name']) && $context['Upload']['name'] === 'disallowCanCreate.txt') { |
||
49 | return false; |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.