Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| TwidLoggerServiceProvider | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| register | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| boot | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace twid\logger; |
| 4 | |
| 5 | use Illuminate\Support\ServiceProvider; |
| 6 | |
| 7 | /** |
| 8 | * TwidLoggerServiceProvider |
| 9 | * |
| 10 | * The service provider for the Twid Logger package. |
| 11 | * |
| 12 | * @package twid\logger |
| 13 | */ |
| 14 | class TwidLoggerServiceProvider extends ServiceProvider |
| 15 | { |
| 16 | /** |
| 17 | * Register the service provider. |
| 18 | * |
| 19 | * This method is called when the service provider is registered within the application. |
| 20 | * |
| 21 | * @return void |
| 22 | */ |
| 23 | public function register() |
| 24 | { |
| 25 | /** |
| 26 | * Bind 'twid.logger' to the application container. |
| 27 | * |
| 28 | * This binding allows resolving 'twid.logger' to an instance of the Logger class. |
| 29 | * |
| 30 | * @param \Illuminate\Contracts\Foundation\Application $app The application instance. |
| 31 | * @return \twid\logger\Logger An instance of the Logger class. |
| 32 | */ |
| 33 | $this->app->bind('twid.logger', function ($app) { |
| 34 | return new Logger(); |
| 35 | }); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Bootstrap any application services. |
| 40 | * |
| 41 | * This method is called after all other service providers have been registered. |
| 42 | * |
| 43 | * @return void |
| 44 | */ |
| 45 | public function boot() |
| 46 | { |
| 47 | /** |
| 48 | * Publish configuration file. |
| 49 | * |
| 50 | * This method publishes the 'publish.php' configuration file to the 'config' directory. |
| 51 | * The published file is named 'logging.php'. |
| 52 | * |
| 53 | * Usage: php artisan vendor:publish --tag=config |
| 54 | * |
| 55 | * @param array $paths The paths to publish. |
| 56 | * @param string $group The publish group. |
| 57 | * @return void |
| 58 | */ |
| 59 | $this->publishes([__DIR__ . '/config/publish.php' => dirname(__DIR__, 4) . '/config/logging.php'], 'config'); |
| 60 | } |
| 61 | } |