We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
5 | trait UniquePages |
||
6 | { |
||
7 | /* |
||
8 | |-------------------------------------------------------------------------- |
||
9 | | Unique pages for Backpack\PageManager |
||
10 | |-------------------------------------------------------------------------- |
||
11 | | |
||
12 | | Each unique page has its own method, that define what fields should show up using the Backpack\CRUD API. |
||
13 | | Use snake_case for naming and PageManager will generate the page on first edit |
||
14 | | |
||
15 | | Any fields defined here will show up after the standard page fields: |
||
16 | | - select template (hidden and fix) |
||
17 | | - page name (only seen by admins) (hidden and fix) |
||
18 | | - page title |
||
19 | | - page slug (hidden and fix, slug of method name) |
||
20 | */ |
||
21 | |||
22 | View Code Duplication | private function about_us() |
|
31 | |||
32 | View Code Duplication | private function some_thing() |
|
41 | } |
||
42 |