| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace Distilleries\Expendable; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | use Distilleries\Expendable\Layouts\LayoutManager; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | use Distilleries\Expendable\Models\User; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | use Distilleries\Expendable\States\StateDisplayer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | use Illuminate\Support\ServiceProvider; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | use Illuminate\Foundation\AliasLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | class ExpendableServiceProvider extends ServiceProvider | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |      * Indicates if loading of the provider is deferred. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |      * @var bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |     protected $defer = true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |      * Bootstrap the application events. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |      * @return void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 | 288 |  |     public function boot() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 | 288 |  |         $this->loadViewsFrom(__DIR__.'/../../views', 'expendable'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 | 288 |  |         $this->loadTranslationsFrom(__DIR__.'/../../lang', 'expendable'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 | 288 |  |         $this->loadMigrationsFrom(__DIR__.'/../../database/migrations/'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 | 288 |  |         $this->publishes([ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 | 288 |  |             __DIR__.'/../../config/config.php'    => config_path('expendable.php'), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 | 288 |  |             __DIR__.'/../../database/seeds/'      => base_path('/database/seeds'), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |         ]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 | 288 |  |         $this->publishes([ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 | 288 |  |             __DIR__.'/../../views' => base_path('resources/views/vendor/expendable'), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 | 288 |  |         ], 'views'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 | 288 |  |         $this->mergeConfigFrom( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 | 288 |  |             __DIR__.'/../../config/config.php', 'expendable' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 | 288 |  |         $autoLoaderListener = new \Distilleries\Expendable\Register\ListenerAutoLoader(config('expendable.listener')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 | 288 |  |         $autoLoaderListener->load(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |      * Register the service provider. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |      * @return void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 | 288 |  |     public function register() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |         $this->app->singleton('Distilleries\Expendable\Contracts\LockableContract', function($app) | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |         { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 | 4 |  |             return new User; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 | 288 |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |         $this->app->singleton('Distilleries\Expendable\Contracts\StateDisplayerContract', function($app) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |         { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 | 152 |  |             return new StateDisplayer($app['view'], $app['config']->get('expendable')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 | 288 |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |         $this->app->singleton('Distilleries\Expendable\Contracts\LayoutManagerContract', function($app) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |         { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 | 150 |  |             return new LayoutManager($app['config']->get('expendable'), $app['view'], $app['files'], app('Distilleries\Expendable\Contracts\StateDisplayerContract')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 | 288 |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 | 288 |  |         $this->alias(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 | 288 |  |         $this->registerCommands(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 | 288 |  |     protected function registerCommands() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 | 288 |  |         $file  = app('files'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 | 288 |  |         $files = $file->allFiles(__DIR__.'/Console/'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 | 288 |  |         foreach ($files as $file) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |         { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 | 288 |  |             if (strpos($file->getPathName(), 'Lib') === false) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |             { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 | 288 |  |                 $this->commands('Distilleries\Expendable\Console\\'.preg_replace('/\.php/i', '', $file->getFilename())); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 90 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 91 | 8 |  |     public function provides() | 
            
                                                                        
                            
            
                                    
            
            
                | 92 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 93 |  |  |         return [ | 
            
                                                                        
                            
            
                                    
            
            
                | 94 | 8 |  |             'Distilleries\Expendable\Contracts\StateDisplayerContract', | 
            
                                                                        
                            
            
                                    
            
            
                | 95 |  |  |             'Distilleries\Expendable\Contracts\LayoutManagerContract', | 
            
                                                                        
                            
            
                                    
            
            
                | 96 |  |  |             'Distilleries\Expendable\Contracts\ImportContract', | 
            
                                                                        
                            
            
                                    
            
            
                | 97 |  |  |             'Distilleries\Expendable\Contracts\ExportContract', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |         ]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 | 288 |  |     public function alias() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 | 288 |  |         AliasLoader::getInstance()->alias( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 | 288 |  |             'Excel', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 | 288 |  |             'Maatwebsite\Excel\Facades\Excel' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |         ); | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 109 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 110 |  |  | } | 
            
                        
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.