GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — 3.x (#2206)
by
unknown
02:17
created

App::link()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
/**
3
 * Slim Framework (https://slimframework.com)
4
 *
5
 * @link      https://github.com/slimphp/Slim
6
 * @copyright Copyright (c) 2011-2017 Josh Lockhart
7
 * @license   https://github.com/slimphp/Slim/blob/3.x/LICENSE.md (MIT License)
8
 */
9
namespace Slim;
10
11
use Exception;
12
use Slim\Exception\InvalidMethodException;
13
use Slim\Http\Response;
14
use Throwable;
15
use Closure;
16
use InvalidArgumentException;
17
use Psr\Http\Message\RequestInterface;
18
use Psr\Http\Message\ServerRequestInterface;
19
use Psr\Http\Message\ResponseInterface;
20
use Psr\Container\ContainerInterface;
21
use FastRoute\Dispatcher;
22
use Slim\Exception\SlimException;
23
use Slim\Exception\MethodNotAllowedException;
24
use Slim\Exception\NotFoundException;
25
use Slim\Http\Uri;
26
use Slim\Http\Headers;
27
use Slim\Http\Body;
28
use Slim\Http\Request;
29
use Slim\Interfaces\Http\EnvironmentInterface;
30
use Slim\Interfaces\RouteGroupInterface;
31
use Slim\Interfaces\RouteInterface;
32
use Slim\Interfaces\RouterInterface;
33
34
/**
35
 * App
36
 *
37
 * This is the primary class with which you instantiate,
38
 * configure, and run a Slim Framework application.
39
 * The \Slim\App class also accepts Slim Framework middleware.
40
 *
41
 * @property-read callable $errorHandler
42
 * @property-read callable $phpErrorHandler
43
 * @property-read callable $notFoundHandler function($request, $response)
44
 * @property-read callable $notAllowedHandler function($request, $response, $allowedHttpMethods)
45
 */
46
class App
47
{
48
    use MiddlewareAwareTrait;
49
50
    /**
51
     * Current version
52
     *
53
     * @var string
54
     */
55
    const VERSION = '3.9.0-dev';
56
57
    /**
58
     * Container
59
     *
60
     * @var ContainerInterface
61
     */
62
    private $container;
63
64
    /********************************************************************************
65
     * Constructor
66
     *******************************************************************************/
67
68
    /**
69
     * Create new application
70
     *
71
     * @param ContainerInterface|array $container Either a ContainerInterface or an associative array of app settings
72
     * @throws InvalidArgumentException when no container is provided that implements ContainerInterface
73
     */
74
    public function __construct($container = [])
75
    {
76
        if (is_array($container)) {
77
            $container = new Container($container);
78
        }
79
        if (!$container instanceof ContainerInterface) {
80
            throw new InvalidArgumentException('Expected a ContainerInterface');
81
        }
82
        $this->container = $container;
83
    }
84
85
    /**
86
     * Enable access to the DI container by consumers of $app
87
     *
88
     * @return ContainerInterface
89
     */
90
    public function getContainer()
91
    {
92
        return $this->container;
93
    }
94
95
    /**
96
     * Add middleware
97
     *
98
     * This method prepends new middleware to the app's middleware stack.
99
     *
100
     * @param  callable|string    $callable The callback routine
101
     *
102
     * @return static
103
     */
104
    public function add($callable)
105
    {
106
        return $this->addMiddleware(new DeferredCallable($callable, $this->container));
107
    }
108
109
    /**
110
     * Calling a non-existant method on App checks to see if there's an item
111
     * in the container that is callable and if so, calls it.
112
     *
113
     * @param  string $method
114
     * @param  array $args
115
     * @return mixed
116
     */
117
    public function __call($method, $args)
118
    {
119
        if ($this->container->has($method)) {
120
            $obj = $this->container->get($method);
121
            if (is_callable($obj)) {
122
                return call_user_func_array($obj, $args);
123
            }
124
        }
125
126
        throw new \BadMethodCallException("Method $method is not a valid method");
127
    }
128
129
    /********************************************************************************
130
     * Router proxy methods
131
     *******************************************************************************/
132
133
    /**
134
     * Add GET route
135
     *
136
     * @param  string $pattern  The route URI pattern
137
     * @param  callable|string  $callable The route callback routine
138
     *
139
     * @return \Slim\Interfaces\RouteInterface
140
     */
141
    public function get($pattern, $callable)
142
    {
143
        return $this->map(['GET'], $pattern, $callable);
144
    }
145
146
    /**
147
     * Add POST route
148
     *
149
     * @param  string $pattern  The route URI pattern
150
     * @param  callable|string  $callable The route callback routine
151
     *
152
     * @return \Slim\Interfaces\RouteInterface
153
     */
154
    public function post($pattern, $callable)
155
    {
156
        return $this->map(['POST'], $pattern, $callable);
157
    }
158
159
    /**
160
     * Add PUT route
161
     *
162
     * @param  string $pattern  The route URI pattern
163
     * @param  callable|string  $callable The route callback routine
164
     *
165
     * @return \Slim\Interfaces\RouteInterface
166
     */
167
    public function put($pattern, $callable)
168
    {
169
        return $this->map(['PUT'], $pattern, $callable);
170
    }
171
172
    /**
173
     * Add PATCH route
174
     *
175
     * @param  string $pattern  The route URI pattern
176
     * @param  callable|string  $callable The route callback routine
177
     *
178
     * @return \Slim\Interfaces\RouteInterface
179
     */
180
    public function patch($pattern, $callable)
181
    {
182
        return $this->map(['PATCH'], $pattern, $callable);
183
    }
184
185
    /**
186
     * Add DELETE route
187
     *
188
     * @param  string $pattern  The route URI pattern
189
     * @param  callable|string  $callable The route callback routine
190
     *
191
     * @return \Slim\Interfaces\RouteInterface
192
     */
193
    public function delete($pattern, $callable)
194
    {
195
        return $this->map(['DELETE'], $pattern, $callable);
196
    }
197
198
    /**
199
     * Add OPTIONS route
200
     *
201
     * @param  string $pattern  The route URI pattern
202
     * @param  callable|string  $callable The route callback routine
203
     *
204
     * @return \Slim\Interfaces\RouteInterface
205
     */
206
    public function options($pattern, $callable)
207
    {
208
        return $this->map(['OPTIONS'], $pattern, $callable);
209
    }
210
211
    /**
212
     * Add LINK route
213
     *
214
     * @param  string $pattern  The route URI pattern
215
     * @param  callable|string  $callable The route callback routine
216
     *
217
     * @return \Slim\Interfaces\RouteInterface
218
     */
219
    public function link($pattern, $callable)
220
    {
221
        return $this->map(['LINK'], $pattern, $callable);
222
    }
223
    
224
    /**
225
     * Add UNLINK route
226
     *
227
     * @param  string $pattern  The route URI pattern
228
     * @param  callable|string  $callable The route callback routine
229
     *
230
     * @return \Slim\Interfaces\RouteInterface
231
     */
232
    public function unlink($pattern, $callable)
233
    {
234
        return $this->map(['UNLINK'], $pattern, $callable);
235
    }
236
    
237
    /**
238
     * Add route for any HTTP method
239
     *
240
     * @param  string $pattern  The route URI pattern
241
     * @param  callable|string  $callable The route callback routine
242
     *
243
     * @return \Slim\Interfaces\RouteInterface
244
     */
245
    public function any($pattern, $callable)
246
    {
247
        return $this->map(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS', 'LINK', 'UNLINK'], $pattern, $callable);
248
    }
249
250
    /**
251
     * Add route with multiple methods
252
     *
253
     * @param  string[] $methods  Numeric array of HTTP method names
254
     * @param  string   $pattern  The route URI pattern
255
     * @param  callable|string    $callable The route callback routine
256
     *
257
     * @return RouteInterface
258
     */
259
    public function map(array $methods, $pattern, $callable)
260
    {
261
        if ($callable instanceof Closure) {
262
            $callable = $callable->bindTo($this->container);
263
        }
264
265
        $route = $this->container->get('router')->map($methods, $pattern, $callable);
266
        if (is_callable([$route, 'setContainer'])) {
267
            $route->setContainer($this->container);
268
        }
269
270
        if (is_callable([$route, 'setOutputBuffering'])) {
271
            $route->setOutputBuffering($this->container->get('settings')['outputBuffering']);
272
        }
273
274
        return $route;
275
    }
276
277
    /**
278
     * Route Groups
279
     *
280
     * This method accepts a route pattern and a callback. All route
281
     * declarations in the callback will be prepended by the group(s)
282
     * that it is in.
283
     *
284
     * @param string   $pattern
285
     * @param callable $callable
286
     *
287
     * @return RouteGroupInterface
288
     */
289
    public function group($pattern, $callable)
290
    {
291
        /** @var RouteGroup $group */
292
        $group = $this->container->get('router')->pushGroup($pattern, $callable);
293
        $group->setContainer($this->container);
294
        $group($this);
295
        $this->container->get('router')->popGroup();
296
        return $group;
297
    }
298
299
    /********************************************************************************
300
     * Runner
301
     *******************************************************************************/
302
303
    /**
304
     * Run application
305
     *
306
     * This method traverses the application middleware stack and then sends the
307
     * resultant Response object to the HTTP client.
308
     *
309
     * @param bool|false $silent
310
     * @return ResponseInterface
311
     *
312
     * @throws Exception
313
     * @throws MethodNotAllowedException
314
     * @throws NotFoundException
315
     */
316
    public function run($silent = false)
317
    {
318
        $response = $this->container->get('response');
319
320
        try {
321
            $response = $this->process($this->container->get('request'), $response);
322
        } catch (InvalidMethodException $e) {
323
            $response = $this->processInvalidMethod($e->getRequest(), $response);
324
        }
325
326
        if (!$silent) {
327
            $this->respond($response);
328
        }
329
330
        return $response;
331
    }
332
333
    /**
334
     * Pull route info for a request with a bad method to decide whether to
335
     * return a not-found error (default) or a bad-method error, then run
336
     * the handler for that error, returning the resulting response.
337
     *
338
     * Used for cases where an incoming request has an unrecognized method,
339
     * rather than throwing an exception and not catching it all the way up.
340
     *
341
     * @param ServerRequestInterface $request
342
     * @param ResponseInterface $response
343
     * @return ResponseInterface
344
     */
345
    protected function processInvalidMethod(ServerRequestInterface $request, ResponseInterface $response)
346
    {
347
        $router = $this->container->get('router');
348 View Code Duplication
        if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
349
            $router->setBasePath($request->getUri()->getBasePath());
350
        }
351
352
        $request = $this->dispatchRouterAndPrepareRoute($request, $router);
353
        $routeInfo = $request->getAttribute('routeInfo', [RouterInterface::DISPATCH_STATUS => Dispatcher::NOT_FOUND]);
354
355
        if ($routeInfo[RouterInterface::DISPATCH_STATUS] === Dispatcher::METHOD_NOT_ALLOWED) {
356
            return $this->handleException(
357
                new MethodNotAllowedException($request, $response, $routeInfo[RouterInterface::ALLOWED_METHODS]),
358
                $request,
359
                $response
360
            );
361
        }
362
363
        return $this->handleException(new NotFoundException($request, $response), $request, $response);
364
    }
365
366
    /**
367
     * Process a request
368
     *
369
     * This method traverses the application middleware stack and then returns the
370
     * resultant Response object.
371
     *
372
     * @param ServerRequestInterface $request
373
     * @param ResponseInterface $response
374
     * @return ResponseInterface
375
     *
376
     * @throws Exception
377
     * @throws MethodNotAllowedException
378
     * @throws NotFoundException
379
     */
380
    public function process(ServerRequestInterface $request, ResponseInterface $response)
381
    {
382
        // Ensure basePath is set
383
        $router = $this->container->get('router');
384 View Code Duplication
        if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
385
            $router->setBasePath($request->getUri()->getBasePath());
386
        }
387
388
        // Dispatch the Router first if the setting for this is on
389
        if ($this->container->get('settings')['determineRouteBeforeAppMiddleware'] === true) {
390
            // Dispatch router (note: you won't be able to alter routes after this)
391
            $request = $this->dispatchRouterAndPrepareRoute($request, $router);
392
        }
393
394
        // Traverse middleware stack
395
        try {
396
            $response = $this->callMiddlewareStack($request, $response);
397
        } catch (Exception $e) {
398
            $response = $this->handleException($e, $request, $response);
399
        } catch (Throwable $e) {
0 ignored issues
show
Bug introduced by
The class Throwable does not exist. Is this class maybe located in a folder that is not analyzed, or in a newer version of your dependencies than listed in your composer.lock/composer.json?
Loading history...
400
            $response = $this->handlePhpError($e, $request, $response);
401
        }
402
403
        $response = $this->finalize($response);
404
405
        return $response;
406
    }
407
408
    /**
409
     * Send the response the client
410
     *
411
     * @param ResponseInterface $response
412
     */
413
    public function respond(ResponseInterface $response)
414
    {
415
        // Send response
416
        if (!headers_sent()) {
417
            // Status
418
            header(sprintf(
419
                'HTTP/%s %s %s',
420
                $response->getProtocolVersion(),
421
                $response->getStatusCode(),
422
                $response->getReasonPhrase()
423
            ));
424
425
            // Headers
426
            foreach ($response->getHeaders() as $name => $values) {
427
                foreach ($values as $value) {
428
                    header(sprintf('%s: %s', $name, $value), false);
429
                }
430
            }
431
        }
432
433
        // Body
434
        if (!$this->isEmptyResponse($response)) {
435
            $body = $response->getBody();
436
            if ($body->isSeekable()) {
437
                $body->rewind();
438
            }
439
            $settings       = $this->container->get('settings');
440
            $chunkSize      = $settings['responseChunkSize'];
441
442
            $contentLength  = $response->getHeaderLine('Content-Length');
443
            if (!$contentLength) {
444
                $contentLength = $body->getSize();
445
            }
446
447
448
            if (isset($contentLength)) {
449
                $amountToRead = $contentLength;
450
                while ($amountToRead > 0 && !$body->eof()) {
451
                    $data = $body->read(min($chunkSize, $amountToRead));
452
                    echo $data;
453
454
                    $amountToRead -= strlen($data);
455
456
                    if (connection_status() != CONNECTION_NORMAL) {
457
                        break;
458
                    }
459
                }
460
            } else {
461
                while (!$body->eof()) {
462
                    echo $body->read($chunkSize);
463
                    if (connection_status() != CONNECTION_NORMAL) {
464
                        break;
465
                    }
466
                }
467
            }
468
        }
469
    }
470
471
    /**
472
     * Invoke application
473
     *
474
     * This method implements the middleware interface. It receives
475
     * Request and Response objects, and it returns a Response object
476
     * after compiling the routes registered in the Router and dispatching
477
     * the Request object to the appropriate Route callback routine.
478
     *
479
     * @param  ServerRequestInterface $request  The most recent Request object
480
     * @param  ResponseInterface      $response The most recent Response object
481
     *
482
     * @return ResponseInterface
483
     * @throws MethodNotAllowedException
484
     * @throws NotFoundException
485
     */
486
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response)
487
    {
488
        // Get the route info
489
        $routeInfo = $request->getAttribute('routeInfo');
490
491
        /** @var \Slim\Interfaces\RouterInterface $router */
492
        $router = $this->container->get('router');
493
494
        // If router hasn't been dispatched or the URI changed then dispatch
495
        if (null === $routeInfo || ($routeInfo['request'] !== [$request->getMethod(), (string) $request->getUri()])) {
496
            $request = $this->dispatchRouterAndPrepareRoute($request, $router);
497
            $routeInfo = $request->getAttribute('routeInfo');
498
        }
499
500
        if ($routeInfo[0] === Dispatcher::FOUND) {
501
            $route = $router->lookupRoute($routeInfo[1]);
502
            return $route->run($request, $response);
503
        } elseif ($routeInfo[0] === Dispatcher::METHOD_NOT_ALLOWED) {
504
            if (!$this->container->has('notAllowedHandler')) {
505
                throw new MethodNotAllowedException($request, $response, $routeInfo[1]);
506
            }
507
            /** @var callable $notAllowedHandler */
508
            $notAllowedHandler = $this->container->get('notAllowedHandler');
509
            return $notAllowedHandler($request, $response, $routeInfo[1]);
510
        }
511
512
        if (!$this->container->has('notFoundHandler')) {
513
            throw new NotFoundException($request, $response);
514
        }
515
        /** @var callable $notFoundHandler */
516
        $notFoundHandler = $this->container->get('notFoundHandler');
517
        return $notFoundHandler($request, $response);
518
    }
519
520
    /**
521
     * Perform a sub-request from within an application route
522
     *
523
     * This method allows you to prepare and initiate a sub-request, run within
524
     * the context of the current request. This WILL NOT issue a remote HTTP
525
     * request. Instead, it will route the provided URL, method, headers,
526
     * cookies, body, and server variables against the set of registered
527
     * application routes. The result response object is returned.
528
     *
529
     * @param  string            $method      The request method (e.g., GET, POST, PUT, etc.)
530
     * @param  string            $path        The request URI path
531
     * @param  string            $query       The request URI query string
532
     * @param  array             $headers     The request headers (key-value array)
533
     * @param  array             $cookies     The request cookies (key-value array)
534
     * @param  string            $bodyContent The request body
535
     * @param  ResponseInterface $response     The response object (optional)
536
     * @return ResponseInterface
537
     */
538
    public function subRequest(
539
        $method,
540
        $path,
541
        $query = '',
542
        array $headers = [],
543
        array $cookies = [],
544
        $bodyContent = '',
545
        ResponseInterface $response = null
546
    ) {
547
        $env = $this->container->get('environment');
548
        $uri = Uri::createFromEnvironment($env)->withPath($path)->withQuery($query);
549
        $headers = new Headers($headers);
550
        $serverParams = $env->all();
551
        $body = new Body(fopen('php://temp', 'r+'));
552
        $body->write($bodyContent);
553
        $body->rewind();
554
        $request = new Request($method, $uri, $headers, $cookies, $serverParams, $body);
555
556
        if (!$response) {
557
            $response = $this->container->get('response');
558
        }
559
560
        return $this($request, $response);
561
    }
562
563
    /**
564
     * Dispatch the router to find the route. Prepare the route for use.
565
     *
566
     * @param ServerRequestInterface $request
567
     * @param RouterInterface        $router
568
     * @return ServerRequestInterface
569
     */
570
    protected function dispatchRouterAndPrepareRoute(ServerRequestInterface $request, RouterInterface $router)
571
    {
572
        $routeInfo = $router->dispatch($request);
573
574
        if ($routeInfo[0] === Dispatcher::FOUND) {
575
            $routeArguments = [];
576
            foreach ($routeInfo[2] as $k => $v) {
577
                $routeArguments[$k] = urldecode($v);
578
            }
579
580
            $route = $router->lookupRoute($routeInfo[1]);
581
            $route->prepare($request, $routeArguments);
582
583
            // add route to the request's attributes in case a middleware or handler needs access to the route
584
            $request = $request->withAttribute('route', $route);
585
        }
586
587
        $routeInfo['request'] = [$request->getMethod(), (string) $request->getUri()];
588
589
        return $request->withAttribute('routeInfo', $routeInfo);
590
    }
591
592
    /**
593
     * Finalize response
594
     *
595
     * @param ResponseInterface $response
596
     * @return ResponseInterface
597
     */
598
    protected function finalize(ResponseInterface $response)
599
    {
600
        // stop PHP sending a Content-Type automatically
601
        ini_set('default_mimetype', '');
602
603
        if ($this->isEmptyResponse($response)) {
604
            return $response->withoutHeader('Content-Type')->withoutHeader('Content-Length');
605
        }
606
607
        // Add Content-Length header if `addContentLengthHeader` setting is set
608
        if (isset($this->container->get('settings')['addContentLengthHeader']) &&
609
            $this->container->get('settings')['addContentLengthHeader'] == true) {
610
            if (ob_get_length() > 0) {
611
                throw new \RuntimeException("Unexpected data in output buffer. " .
612
                    "Maybe you have characters before an opening <?php tag?");
613
            }
614
            $size = $response->getBody()->getSize();
615
            if ($size !== null && !$response->hasHeader('Content-Length')) {
616
                $response = $response->withHeader('Content-Length', (string) $size);
617
            }
618
        }
619
620
        return $response;
621
    }
622
623
    /**
624
     * Helper method, which returns true if the provided response must not output a body and false
625
     * if the response could have a body.
626
     *
627
     * @see https://tools.ietf.org/html/rfc7231
628
     *
629
     * @param ResponseInterface $response
630
     * @return bool
631
     */
632
    protected function isEmptyResponse(ResponseInterface $response)
633
    {
634
        if (method_exists($response, 'isEmpty')) {
635
            return $response->isEmpty();
636
        }
637
638
        return in_array($response->getStatusCode(), [204, 205, 304]);
639
    }
640
641
    /**
642
     * Call relevant handler from the Container if needed. If it doesn't exist,
643
     * then just re-throw.
644
     *
645
     * @param  Exception $e
646
     * @param  ServerRequestInterface $request
647
     * @param  ResponseInterface $response
648
     *
649
     * @return ResponseInterface
650
     * @throws Exception if a handler is needed and not found
651
     */
652
    protected function handleException(Exception $e, ServerRequestInterface $request, ResponseInterface $response)
653
    {
654
        if ($e instanceof MethodNotAllowedException) {
655
            $handler = 'notAllowedHandler';
656
            $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()];
657
        } elseif ($e instanceof NotFoundException) {
658
            $handler = 'notFoundHandler';
659
            $params = [$e->getRequest(), $e->getResponse(), $e];
660
        } elseif ($e instanceof SlimException) {
661
            // This is a Stop exception and contains the response
662
            return $e->getResponse();
663
        } else {
664
            // Other exception, use $request and $response params
665
            $handler = 'errorHandler';
666
            $params = [$request, $response, $e];
667
        }
668
669 View Code Duplication
        if ($this->container->has($handler)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
670
            $callable = $this->container->get($handler);
671
            // Call the registered handler
672
            return call_user_func_array($callable, $params);
673
        }
674
675
        // No handlers found, so just throw the exception
676
        throw $e;
677
    }
678
679
    /**
680
     * Call relevant handler from the Container if needed. If it doesn't exist,
681
     * then just re-throw.
682
     *
683
     * @param  Throwable $e
684
     * @param  ServerRequestInterface $request
685
     * @param  ResponseInterface $response
686
     * @return ResponseInterface
687
     * @throws Throwable
688
     */
689
    protected function handlePhpError(Throwable $e, ServerRequestInterface $request, ResponseInterface $response)
690
    {
691
        $handler = 'phpErrorHandler';
692
        $params = [$request, $response, $e];
693
694 View Code Duplication
        if ($this->container->has($handler)) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
695
            $callable = $this->container->get($handler);
696
            // Call the registered handler
697
            return call_user_func_array($callable, $params);
698
        }
699
700
        // No handlers found, so just throw the exception
701
        throw $e;
702
    }
703
}
704