| Conditions | 4 |
| Paths | 3 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function getEditForm($ID = null, $Fields = null) |
||
| 20 | { |
||
| 21 | $form = parent::getEditForm($ID, $Fields); |
||
| 22 | $fields = $form->Fields(); |
||
| 23 | |||
| 24 | if ($this->modelClass == InstagramPost::class) { |
||
| 25 | $gridField = $fields->fieldByName($this->sanitiseClassName(InstagramPost::class)); |
||
| 26 | |||
| 27 | if ($gridField) { |
||
| 28 | $gridFieldConfig = $gridField->getConfig(); |
||
| 29 | |||
| 30 | $gridFieldConfig->getComponentByType(GridFieldDataColumns::class)->setFieldFormatting([ |
||
| 31 | 'ImageThumbnailURL' => function ($value, $item) { |
||
|
|
|||
| 32 | if ($value) { |
||
| 33 | return '<img src="' . $value . '" style="max-width: 100px;" />'; |
||
| 34 | } |
||
| 35 | }, |
||
| 36 | ]); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | return $form; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.