Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function updateCMSFields(FieldList $fields): void |
||
24 | { |
||
25 | $owner = $this->owner; |
||
26 | |||
27 | $fields->addFieldsToTab('Root.JobData', [ |
||
28 | $jobDataPreview = TextareaField::create('SavedJobDataPreview', 'Job Data'), |
||
29 | ]); |
||
30 | |||
31 | if (strlen($owner->getMessagesRaw()) > 0) { |
||
32 | $fields->addFieldToTab( |
||
33 | 'Root.MessagesRaw', |
||
34 | $messagesRaw = LiteralField::create('MessagesRaw', $owner->getMessagesRaw()) |
||
|
|||
35 | ); |
||
36 | } |
||
37 | |||
38 | $jobDataPreview->setReadonly(true); |
||
39 | } |
||
40 | |||
71 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: