| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class ParsehtmlServiceProvider extends ServiceProvider |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * delay to load service. |
||
| 15 | * |
||
| 16 | * @var bool |
||
| 17 | */ |
||
| 18 | protected $defer = true; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * boot a service. |
||
| 22 | * |
||
| 23 | * @author yansongda <[email protected]> |
||
| 24 | * |
||
| 25 | * @return void |
||
| 26 | */ |
||
| 27 | public function boot() |
||
| 28 | { |
||
| 29 | if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { |
||
| 30 | $this->publishes([ |
||
| 31 | dirname(__DIR__).'/config/markdown.php' => config_path('markdown.php'), |
||
| 32 | ], 'laravel-html-config'); |
||
| 33 | } elseif ($this->app instanceof LumenApplication) { |
||
| 34 | $this->app->configure('markdown'); |
||
| 35 | } |
||
| 36 | |||
| 37 | Blade::directive('parsehtml', function ($expression) { |
||
| 38 | return "<?php echo parsehtml($expression); ?>"; |
||
| 39 | }); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * registe the service. |
||
| 44 | * |
||
| 45 | * @return void |
||
| 46 | */ |
||
| 47 | public function register() |
||
| 48 | { |
||
| 49 | $this->mergeConfigFrom(dirname(__DIR__).'/config/markdown.php', 'markdown'); |
||
| 50 | |||
| 51 | $this->app->singleton(HtmlConverter::class, function ($app) { |
||
| 52 | return new HtmlConverter(config('markdown.parsehtml')); |
||
| 53 | }); |
||
| 54 | |||
| 55 | $this->app->alias(HtmlConverter::class, 'parsehtml'); |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * providers. |
||
| 60 | * |
||
| 61 | * @return array |
||
| 62 | */ |
||
| 63 | public function provides() |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths