Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 1.2963 |
Changes | 0 |
1 | <?php |
||
31 | 1 | public function getCMSFields() |
|
32 | { |
||
33 | 1 | $this->beforeUpdateCMSFields(function ($fields) { |
|
34 | $fields->addFieldToTab( |
||
35 | 'Root.Main', |
||
36 | LinkField::create('BlockLinkID', 'Link') |
||
37 | ); |
||
38 | 1 | }); |
|
39 | |||
40 | 1 | $fields = parent::getCMSFields(); |
|
41 | |||
42 | $fields->removeByName([ |
||
43 | 'Title', |
||
44 | ]); |
||
45 | |||
46 | return $fields; |
||
47 | } |
||
48 | |||
55 | } |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: