@@ -36,6 +36,7 @@ class ApiTester extends Extension
3636
3737 /**
3838 * ApiTester constructor.
39+ *
3940 * @param \Illuminate\Foundation\Application|null $app
4041 */
4142 public function __construct (\Illuminate \Foundation \Application $ app = null )
@@ -48,6 +49,7 @@ public function __construct(\Illuminate\Foundation\Application $app = null)
4849 * @param string $uri
4950 * @param array $parameters
5051 * @param string $userId
52+ *
5153 * @return \Symfony\Component\HttpFoundation\Response
5254 */
5355 public function call ($ method , $ uri , $ parameters = [], $ user = null )
@@ -109,6 +111,7 @@ protected function loginUsing($userId)
109111
110112 /**
111113 * @param Response $response
114+ *
112115 * @return array
113116 */
114117 public function parseResponse (Response $ response )
@@ -142,6 +145,7 @@ public function parseResponse(Response $response)
142145
143146 /**
144147 * @param Response $response
148+ *
145149 * @return string
146150 */
147151 protected function getStatusText (Response $ response )
@@ -156,7 +160,8 @@ protected function getStatusText(Response $response)
156160 /**
157161 * Filter the given array of files, removing any empty values.
158162 *
159- * @param array $files
163+ * @param array $files
164+ *
160165 * @return mixed
161166 */
162167 protected function filterFiles ($ files )
@@ -167,7 +172,7 @@ protected function filterFiles($files)
167172 }
168173
169174 if (is_array ($ file )) {
170- if (! isset ($ file ['name ' ])) {
175+ if (!isset ($ file ['name ' ])) {
171176 $ files [$ key ] = $ this ->filterFiles ($ files [$ key ]);
172177 } elseif (isset ($ files [$ key ]['error ' ]) && $ files [$ key ]['error ' ] !== 0 ) {
173178 unset($ files [$ key ]);
@@ -185,7 +190,8 @@ protected function filterFiles($files)
185190 /**
186191 * Turn the given URI into a fully qualified URL.
187192 *
188- * @param string $uri
193+ * @param string $uri
194+ *
189195 * @return string
190196 */
191197 protected function prepareUrlForRequest ($ uri )
@@ -194,7 +200,7 @@ protected function prepareUrlForRequest($uri)
194200 $ uri = substr ($ uri , 1 );
195201 }
196202
197- if (! Str::startsWith ($ uri , 'http ' )) {
203+ if (!Str::startsWith ($ uri , 'http ' )) {
198204 $ uri = config ('app.url ' ).'/ ' .$ uri ;
199205 }
200206
@@ -213,9 +219,7 @@ public function getRoutes()
213219 $ prefix = static ::config ('prefix ' );
214220
215221 $ routes = collect ($ routes )->filter (function ($ route ) use ($ prefix ) {
216-
217222 return Str::startsWith ($ route ->uri , static ::config ('prefix ' ));
218-
219223 })->map (function ($ route ) {
220224 return $ this ->getRouteInformation ($ route );
221225 })->all ();
@@ -239,6 +243,7 @@ public function getRoutes()
239243 * Get parameters info of route.
240244 *
241245 * @param $action
246+ *
242247 * @return array
243248 */
244249 protected function getRouteParameters ($ action )
@@ -247,12 +252,12 @@ protected function getRouteParameters($action)
247252 return [];
248253 }
249254
250- if (is_string ($ action ) && ! Str::contains ($ action , '@ ' )) {
255+ if (is_string ($ action ) && !Str::contains ($ action , '@ ' )) {
251256 list ($ class , $ method ) = static ::makeInvokable ($ action );
252257 } else {
253258 list ($ class , $ method ) = explode ('@ ' , $ action );
254259 }
255-
260+
256261 $ classReflector = new \ReflectionClass ($ class );
257262
258263 $ comment = $ classReflector ->getMethod ($ method )->getDocComment ();
@@ -263,7 +268,6 @@ protected function getRouteParameters($action)
263268 foreach (array_get ($ matches , 1 , []) as $ item ) {
264269 preg_match_all ('/(\w+)=[ \'"]?([^\r\n"]+)[ \'"]?,?\n/s ' , $ item , $ match );
265270 if (count ($ match ) == 3 ) {
266-
267271 $ match [2 ] = array_map (function ($ val ) {
268272 return trim ($ val , ', ' );
269273 }, $ match [2 ]);
@@ -280,11 +284,12 @@ protected function getRouteParameters($action)
280284
281285 /**
282286 * @param $action
287+ *
283288 * @return array
284289 */
285290 protected static function makeInvokable ($ action )
286291 {
287- if (! method_exists ($ action , '__invoke ' )) {
292+ if (!method_exists ($ action , '__invoke ' )) {
288293 throw new \UnexpectedValueException ("Invalid route action: [ {$ action }]. " );
289294 }
290295
@@ -294,7 +299,8 @@ protected static function makeInvokable($action)
294299 /**
295300 * Get the route information for a given route.
296301 *
297- * @param \Illuminate\Routing\Route $route
302+ * @param \Illuminate\Routing\Route $route
303+ *
298304 * @return array
299305 */
300306 protected function getRouteInformation (Route $ route )
@@ -312,8 +318,9 @@ protected function getRouteInformation(Route $route)
312318 /**
313319 * Sort the routes by a given element.
314320 *
315- * @param string $sort
316- * @param array $routes
321+ * @param string $sort
322+ * @param array $routes
323+ *
317324 * @return array
318325 */
319326 protected function sortRoutes ($ sort , $ routes )
@@ -326,7 +333,8 @@ protected function sortRoutes($sort, $routes)
326333 /**
327334 * Get before filters.
328335 *
329- * @param \Illuminate\Routing\Route $route
336+ * @param \Illuminate\Routing\Route $route
337+ *
330338 * @return string
331339 */
332340 protected function getRouteMiddleware ($ route )
@@ -335,4 +343,4 @@ protected function getRouteMiddleware($route)
335343 return $ middleware instanceof \Closure ? 'Closure ' : $ middleware ;
336344 });
337345 }
338- }
346+ }
0 commit comments