We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | public function run(): StepResult |
||
| 18 | { |
||
| 19 | $contents = $this->context()->readFile($this->relativePath); |
||
| 20 | |||
| 21 | if ($contents === null) { |
||
| 22 | return StepResult::skipped('show.php is not published, core defaults already use the new datagrid component.'); |
||
| 23 | } |
||
| 24 | |||
| 25 | if (! str_contains($contents, "'component'")) { |
||
| 26 | return StepResult::warning( |
||
| 27 | "Add the 'component' option to config/backpack/operations/show.php to pick between bp-datagrid and bp-datalist.", |
||
| 28 | ['Example: "component" => "bp-datagrid"'] |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | if (str_contains($contents, "'bp-datalist'")) { |
||
| 33 | return StepResult::success('Show operation will keep the classic bp-datalist component.'); |
||
| 34 | } |
||
| 35 | |||
| 36 | return StepResult::success('Show operation is configured to use the new component.'); |
||
| 37 | } |
||
| 39 |