| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class PinyinServiceProvider extends ServiceProvider implements DeferrableProvider |
||
| 21 | { |
||
| 22 | public function register() |
||
| 23 | { |
||
| 24 | $this->mergeConfigFrom( |
||
| 25 | dirname(__DIR__) . '/../config/pinyin.php', 'pinyin' |
||
| 26 | ); |
||
| 27 | $this->app->singleton(Pinyin::class, function ($app) { |
||
| 28 | return new Pinyin($app->config['pinyin']); |
||
| 29 | }); |
||
| 30 | $this->app->alias(Pinyin::class, 'pinyin'); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function boot() |
||
| 34 | { |
||
| 35 | if (!file_exists(config_path('pinyin.php'))) { |
||
| 36 | $this->publishes([ |
||
| 37 | dirname(__DIR__) . '/../config/pinyin.php' => config_path('pinyin.php'), |
||
| 38 | ], 'config'); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | public function provides() |
||
| 45 | } |
||
| 46 | } |