← All changes
|
vendor/wpfluent/framework/src/WPFluent/Foundation/ComponentBinder.php
+22
-1
2.1.1
→
2.5.0
View file →
| @@ -16,8 +16,9 @@ | ||
| 16 | 16 | use FluentBooking\Framework\Encryption\Encrypter; |
| 17 | 17 | use FluentBooking\Framework\Database\Orm\Model; |
| 18 | 18 | use FluentBooking\Framework\Validator\Validator; |
| 19 | 19 | use FluentBooking\Framework\Foundation\RequestGuard; |
| 20 | +use FluentBooking\Framework\Foundation\Exceptions\ExceptionHandler; | |
| 20 | 21 | use FluentBooking\Framework\Database\DatabaseManager; |
| 21 | 22 | use FluentBooking\Framework\Database\DatabaseTransactionsManager; |
| 22 | 23 | use FluentBooking\Framework\Database\ConnectionResolver; |
| 23 | 24 | use FluentBooking\Framework\Database\Query\WPDBConnection; |
| @@ -54,8 +55,9 @@ | ||
| 54 | 55 | 'Router', |
| 55 | 56 | 'Mail', |
| 56 | 57 | 'Paginator', |
| 57 | 58 | 'Pipeline', |
| 59 | + 'ExceptionHandler', | |
| 58 | 60 | ]; |
| 59 | 61 | |
| 60 | 62 | /** |
| 61 | 63 | * Construct the binder |
| @@ -342,9 +344,28 @@ | ||
| 342 | 344 | $this->app->bind(Pipeline::class, function ($app) { |
| 343 | 345 | return new Pipeline($app); |
| 344 | 346 | }); |
| 345 | 347 | |
| 346 | - $this->app->alias(Pipeline::class, 'pipeline'); | |
| 348 | + $this->app->alias(Pipeline::class, 'pipeline'); | |
| 349 | + } | |
| 350 | + | |
| 351 | + /** | |
| 352 | + * Bind the exception-handler registry into the container. | |
| 353 | + * | |
| 354 | + * Default is the bare `Foundation\Exceptions\ExceptionHandler` (no | |
| 355 | + * renderables registered). Plugins override by re-binding their own | |
| 356 | + * subclass to the same key from `boot/bindings.php` BEFORE the first | |
| 357 | + * request hits Route. | |
| 358 | + * | |
| 359 | + * @return null | |
| 360 | + */ | |
| 361 | + protected function bindExceptionHandler() | |
| 362 | + { | |
| 363 | + $this->app->singleton(ExceptionHandler::class, function ($app) { | |
| 364 | + return new ExceptionHandler(); | |
| 365 | + }); | |
| 366 | + | |
| 367 | + $this->app->alias(ExceptionHandler::class, 'exception.handler'); | |
| 347 | 368 | } |
| 348 | 369 | |
| 349 | 370 | /** |
| 350 | 371 | * Load other bindings the developers might |