| Conditions | 6 |
| Paths | 9 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function forTemplate() |
||
| 17 | { |
||
| 18 | $grid = $this->tabulatorGrid; |
||
| 19 | $singleton = singleton($grid->getModelClass()); |
||
| 20 | $context = []; |
||
| 21 | if ($grid->getList() instanceof RelationList) { |
||
| 22 | $record = $grid->getForm()->getRecord(); |
||
| 23 | if ($record && $record instanceof DataObject) { |
||
| 24 | $context['Parent'] = $record; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | if (!$singleton->canCreate(null, $context)) { |
||
| 29 | return false; |
||
| 30 | } |
||
| 31 | |||
| 32 | if (!$this->buttonName) { |
||
| 33 | // provide a default button name, can be changed by calling {@link setButtonName()} on this component |
||
| 34 | $this->buttonName = _t('Tabulator.ExportRecords', 'Export'); |
||
| 35 | } |
||
| 36 | |||
| 37 | $data = new ArrayData([ |
||
| 38 | 'ButtonName' => $this->buttonName, |
||
| 39 | ]); |
||
| 40 | return $this->renderWith($this->getViewerTemplates(), $data); |
||
| 41 | } |
||
| 49 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths