Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
53 | public function getStaticHtml($value, ElementInterface $element): string |
||
54 | { |
||
55 | if (! ($value instanceof Query)) { |
||
56 | return ''; |
||
57 | } |
||
58 | $handle = $this->getPlugin()->getHandle(); |
||
59 | |||
60 | return \Craft::$app->getView()->renderTemplate( |
||
61 | $handle . '/_cp/fields/external-id', |
||
62 | [ |
||
63 | 'identities' => $value, |
||
64 | 'element' => $element, |
||
65 | 'baseProviderUrl' => UrlHelper::cpUrl( |
||
66 | $handle . '/metadata' |
||
67 | ), |
||
68 | ] |
||
69 | ); |
||
70 | } |
||
71 | } |
||
72 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):