1 | <?php |
||
14 | trait FormattingTrait |
||
15 | { |
||
16 | /** |
||
17 | * A cached copy of the URL root for the current request. |
||
18 | * |
||
19 | * @var string|null |
||
20 | */ |
||
21 | protected $cachedRoot; |
||
22 | |||
23 | /** |
||
24 | * A cached copy of the URL schema for the current request. |
||
25 | * |
||
26 | * @var string|null |
||
27 | */ |
||
28 | protected $cachedSchema; |
||
29 | |||
30 | /** |
||
31 | * The forced URL root. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $forcedRoot; |
||
36 | |||
37 | /** |
||
38 | * The forced schema for URLs. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $forceScheme; |
||
43 | |||
44 | /** |
||
45 | * The callback to use to format hosts. |
||
46 | * |
||
47 | * @var \Closure |
||
48 | */ |
||
49 | protected $formatHostUsing; |
||
50 | |||
51 | /** |
||
52 | * The callback to use to format paths. |
||
53 | * |
||
54 | * @var \Closure |
||
55 | */ |
||
56 | protected $formatPathUsing; |
||
57 | |||
58 | /** |
||
59 | * Format the array of URL parameters. |
||
60 | * |
||
61 | * @param mixed|array $parameters |
||
62 | * @return array |
||
63 | */ |
||
64 | public function formatParameters($parameters) |
||
74 | |||
75 | /** |
||
76 | * Get the base URL for the request. |
||
77 | * |
||
78 | * @param string $scheme |
||
79 | * @param string $root |
||
80 | * @return string |
||
81 | */ |
||
82 | public function formatRoot($scheme, $root = null) |
||
93 | |||
94 | /** |
||
95 | * Get the default scheme for a raw URL. |
||
96 | * |
||
97 | * @param bool|null $secure |
||
98 | * @return string |
||
99 | */ |
||
100 | public function formatScheme($secure) |
||
110 | /** |
||
111 | * Format the given URL segments into a single URL. |
||
112 | * |
||
113 | * @param string $root |
||
114 | * @param string $path |
||
115 | * @return string |
||
116 | */ |
||
117 | public function format($root, $path) |
||
128 | |||
129 | /** |
||
130 | * Remove the index.php file from a path. |
||
131 | * |
||
132 | * @param string $root |
||
133 | * @return string |
||
134 | */ |
||
135 | protected function removeIndex($root) |
||
140 | } |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.