We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 11 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait InteractsWithCrudControllers |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Filter a list of file paths to those that look like CrudControllers and optionally validate contents. |
||
| 14 | */ |
||
| 15 | protected function filterCrudControllerPaths(array $paths, ?callable $contentsValidator = null): array |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Build a short list of preview lines for the provided paths. |
||
| 46 | */ |
||
| 47 | protected function previewLines(array $paths, int $limit = 10, ?callable $formatter = null): array |
||
| 48 | { |
||
| 49 | if (empty($paths)) { |
||
| 50 | return []; |
||
| 51 | } |
||
| 52 | |||
| 53 | $formatter ??= static fn (string $path): string => "- {$path}"; |
||
| 54 | |||
| 55 | $preview = array_slice($paths, 0, $limit); |
||
| 56 | $details = array_map($formatter, $preview); |
||
| 57 | |||
| 58 | $remaining = count($paths) - count($preview); |
||
| 59 | |||
| 60 | if ($remaining > 0) { |
||
| 61 | $details[] = sprintf('… %d more occurrence(s) omitted.', $remaining); |
||
| 62 | } |
||
| 63 | |||
| 64 | return $details; |
||
| 65 | } |
||
| 66 | |||
| 67 | protected function isCrudControllerPath(string $path): bool |
||
| 70 | } |
||
| 71 | |||
| 72 | abstract protected function context(): UpgradeContext; |
||
| 73 | } |
||
| 74 |