1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
17 | class RouteTracker extends AbstractTracker implements RouteTrackerContract |
||
18 | { |
||
19 | /* ------------------------------------------------------------------------------------------------ |
||
20 | | Getters and Setters |
||
21 | | ------------------------------------------------------------------------------------------------ |
||
22 | */ |
||
23 | /** |
||
24 | * Get the model. |
||
25 | * |
||
26 | * @return \Arcanedev\LaravelTracker\Models\Route |
||
27 | */ |
||
28 | 12 | protected function getModel() |
|
32 | |||
33 | /* ------------------------------------------------------------------------------------------------ |
||
34 | | Main Functions |
||
35 | | ------------------------------------------------------------------------------------------------ |
||
36 | */ |
||
37 | /** |
||
38 | * Check if the route is trackable. |
||
39 | * |
||
40 | * @param \Illuminate\Routing\Route $route |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | 18 | public function isTrackable($route) |
|
49 | |||
50 | /** |
||
51 | * Track the matched route. |
||
52 | * |
||
53 | * @param \Illuminate\Routing\Route $route |
||
54 | * @param \Illuminate\Http\Request $request |
||
55 | * |
||
56 | * @return int |
||
57 | */ |
||
58 | 12 | public function track(Route $route, Request $request) |
|
64 | |||
65 | /* ------------------------------------------------------------------------------------------------ |
||
66 | | Other Functions |
||
67 | | ------------------------------------------------------------------------------------------------ |
||
68 | */ |
||
69 | /** |
||
70 | * Track the current route. |
||
71 | * |
||
72 | * @param \Illuminate\Routing\Route $route |
||
73 | * |
||
74 | * @return int |
||
75 | */ |
||
76 | 12 | private function trackRoute(Route $route) |
|
84 | |||
85 | /** |
||
86 | * Check if the route is ignored by a route pattern. |
||
87 | * |
||
88 | * @param \Illuminate\Routing\Route $route |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | 18 | private function isInIgnoredRouteNames($route) |
|
99 | |||
100 | /** |
||
101 | * Check if the route is ignored by a route pattern. |
||
102 | * |
||
103 | * @param \Illuminate\Routing\Route $route |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | 18 | private function isInIgnoredUris($route) |
|
114 | |||
115 | /** |
||
116 | * Check if the value match the given patterns. |
||
117 | * |
||
118 | * @param string|null $value |
||
119 | * @param array $patterns |
||
120 | * |
||
121 | * @return bool |
||
122 | */ |
||
123 | 18 | private function checkPatterns($value, array $patterns) |
|
133 | |||
134 | /** |
||
135 | * Get the route name. |
||
136 | * |
||
137 | * @param \Illuminate\Routing\Route $route |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | 12 | private function getRouteName(Route $route) |
|
151 | |||
152 | /** |
||
153 | * Track the route path. |
||
154 | * |
||
155 | * @param \Illuminate\Routing\Route $route |
||
156 | * @param \Illuminate\Http\Request $request |
||
157 | * @param int $routeId |
||
158 | * |
||
159 | * @return int |
||
160 | */ |
||
161 | 12 | private function trackRoutePath(Route $route, Request $request, $routeId) |
|
174 | |||
175 | /** |
||
176 | * Track the route path parameters. |
||
177 | * |
||
178 | * @param \Illuminate\Routing\Route $route |
||
179 | * @param \Arcanedev\LaravelTracker\Models\RoutePath $routePath |
||
180 | */ |
||
181 | 12 | private function trackRoutePathParameters(Route $route, Models\RoutePath $routePath) |
|
196 | |||
197 | /** |
||
198 | * Check if the value is an eloquent model. |
||
199 | * |
||
200 | * @param mixed $value |
||
201 | * |
||
202 | * @return mixed |
||
203 | */ |
||
204 | 6 | private function checkIfValueIsEloquentModel($value) |
|
219 | } |
||
220 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.