bantenprov /
passing-grade
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Bantenprov\PassingGrade; |
||
| 4 | |||
| 5 | use Illuminate\Support\ServiceProvider; |
||
| 6 | use Bantenprov\PassingGrade\Console\Commands\PassingGradeCommand; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * The PassingGradeServiceProvider class |
||
| 10 | * |
||
| 11 | * @package Bantenprov\PassingGrade |
||
| 12 | * @author bantenprov <[email protected]> |
||
| 13 | */ |
||
| 14 | class PassingGradeServiceProvider extends ServiceProvider |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Indicates if loading of the provider is deferred. |
||
| 18 | * |
||
| 19 | * @var bool |
||
| 20 | */ |
||
| 21 | protected $defer = false; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Bootstrap the application events. |
||
| 25 | * |
||
| 26 | * @return void |
||
| 27 | */ |
||
| 28 | public function boot() |
||
| 29 | { |
||
| 30 | $this->routeHandle(); |
||
| 31 | $this->configHandle(); |
||
| 32 | $this->langHandle(); |
||
| 33 | $this->viewHandle(); |
||
| 34 | $this->assetHandle(); |
||
| 35 | $this->migrationHandle(); |
||
| 36 | $this->publicHandle(); |
||
| 37 | $this->seedHandle(); |
||
| 38 | $this->publishHandle(); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Register the service provider. |
||
| 43 | * |
||
| 44 | * @return void |
||
| 45 | */ |
||
| 46 | public function register() |
||
| 47 | { |
||
| 48 | $this->app->singleton('passing-grade', function ($app) { |
||
|
0 ignored issues
–
show
|
|||
| 49 | return new PassingGrade; |
||
| 50 | }); |
||
| 51 | |||
| 52 | $this->app->singleton('command.passing-grade', function ($app) { |
||
|
0 ignored issues
–
show
|
|||
| 53 | return new PassingGradeCommand; |
||
| 54 | }); |
||
| 55 | |||
| 56 | $this->commands('command.passing-grade'); |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Get the services provided by the provider. |
||
| 61 | * |
||
| 62 | * @return array |
||
| 63 | */ |
||
| 64 | public function provides() |
||
| 65 | { |
||
| 66 | return [ |
||
| 67 | 'passing-grade', |
||
| 68 | 'command.passing-grade', |
||
| 69 | ]; |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Loading and publishing package's config |
||
| 74 | * |
||
| 75 | * @return void |
||
| 76 | */ |
||
| 77 | protected function configHandle($publish = '') |
||
| 78 | { |
||
| 79 | $packageConfigPath = __DIR__.'/config'; |
||
| 80 | $appConfigPath = config_path('bantenprov/passing-grade'); |
||
| 81 | |||
| 82 | $this->mergeConfigFrom($packageConfigPath.'/passing-grade.php', 'passing-grade'); |
||
| 83 | |||
| 84 | $this->publishes([ |
||
| 85 | $packageConfigPath.'/passing-grade.php' => $appConfigPath.'/passing-grade.php', |
||
| 86 | ], $publish ? $publish : 'passing-grade-config'); |
||
| 87 | } |
||
| 88 | |||
| 89 | /** |
||
| 90 | * Loading package routes |
||
| 91 | * |
||
| 92 | * @return void |
||
| 93 | */ |
||
| 94 | protected function routeHandle() |
||
| 95 | { |
||
| 96 | $this->loadRoutesFrom(__DIR__.'/routes/routes.php'); |
||
| 97 | } |
||
| 98 | |||
| 99 | /** |
||
| 100 | * Loading and publishing package's translations |
||
| 101 | * |
||
| 102 | * @return void |
||
| 103 | */ |
||
| 104 | View Code Duplication | protected function langHandle($publish = '') |
|
| 105 | { |
||
| 106 | $packageTranslationsPath = __DIR__.'/resources/lang'; |
||
| 107 | |||
| 108 | $this->loadTranslationsFrom($packageTranslationsPath, 'passing-grade'); |
||
| 109 | |||
| 110 | $this->publishes([ |
||
| 111 | $packageTranslationsPath => resource_path('lang/vendor/passing-grade'), |
||
| 112 | ], $publish ? $publish : 'passing-grade-lang'); |
||
| 113 | } |
||
| 114 | |||
| 115 | /** |
||
| 116 | * Loading and publishing package's views |
||
| 117 | * |
||
| 118 | * @return void |
||
| 119 | */ |
||
| 120 | View Code Duplication | protected function viewHandle($publish = '') |
|
| 121 | { |
||
| 122 | $packageViewsPath = __DIR__.'/resources/views'; |
||
| 123 | |||
| 124 | $this->loadViewsFrom($packageViewsPath, 'passing-grade'); |
||
| 125 | |||
| 126 | $this->publishes([ |
||
| 127 | $packageViewsPath => resource_path('views/vendor/passing-grade'), |
||
| 128 | ], $publish ? $publish : 'passing-grade-views'); |
||
| 129 | } |
||
| 130 | |||
| 131 | /** |
||
| 132 | * Publishing package's assets (JavaScript, CSS, images...) |
||
| 133 | * |
||
| 134 | * @return void |
||
| 135 | */ |
||
| 136 | protected function assetHandle($publish = '') |
||
| 137 | { |
||
| 138 | $packageAssetsPath = __DIR__.'/resources/assets'; |
||
| 139 | |||
| 140 | $this->publishes([ |
||
| 141 | $packageAssetsPath => resource_path('assets'), |
||
| 142 | ], $publish ? $publish : 'passing-grade-assets'); |
||
| 143 | } |
||
| 144 | |||
| 145 | /** |
||
| 146 | * Publishing package's migrations |
||
| 147 | * |
||
| 148 | * @return void |
||
| 149 | */ |
||
| 150 | protected function migrationHandle($publish = '') |
||
| 151 | { |
||
| 152 | $packageMigrationsPath = __DIR__.'/database/migrations'; |
||
| 153 | |||
| 154 | $this->loadMigrationsFrom($packageMigrationsPath); |
||
| 155 | |||
| 156 | $this->publishes([ |
||
| 157 | $packageMigrationsPath => database_path('migrations') |
||
| 158 | ], $publish ? $publish : 'passing-grade-migrations'); |
||
| 159 | } |
||
| 160 | |||
| 161 | /** |
||
| 162 | * Publishing package's publics (JavaScript, CSS, images...) |
||
| 163 | * |
||
| 164 | * @return void |
||
| 165 | */ |
||
| 166 | public function publicHandle($publish = '') |
||
| 167 | { |
||
| 168 | $packagePublicPath = __DIR__.'/public'; |
||
| 169 | |||
| 170 | $this->publishes([ |
||
| 171 | $packagePublicPath => base_path('public') |
||
| 172 | ], $publish ? $publish : 'passing-grade-public'); |
||
| 173 | } |
||
| 174 | |||
| 175 | /** |
||
| 176 | * Publishing package's seeds |
||
| 177 | * |
||
| 178 | * @return void |
||
| 179 | */ |
||
| 180 | public function seedHandle($publish = '') |
||
| 181 | { |
||
| 182 | $packageSeedPath = __DIR__.'/database/seeds'; |
||
| 183 | |||
| 184 | $this->publishes([ |
||
| 185 | $packageSeedPath => base_path('database/seeds') |
||
| 186 | ], $publish ? $publish : 'passing-grade-seeds'); |
||
| 187 | } |
||
| 188 | |||
| 189 | /** |
||
| 190 | * Publishing package's all files |
||
| 191 | * |
||
| 192 | * @return void |
||
| 193 | */ |
||
| 194 | public function publishHandle() |
||
| 195 | { |
||
| 196 | $publish = 'passing-grade-publish'; |
||
| 197 | |||
| 198 | $this->routeHandle($publish); |
||
| 199 | $this->configHandle($publish); |
||
| 200 | $this->langHandle($publish); |
||
| 201 | $this->viewHandle($publish); |
||
| 202 | $this->assetHandle($publish); |
||
| 203 | // $this->migrationHandle($publish); |
||
| 204 | $this->publicHandle($publish); |
||
| 205 | // $this->seedHandle($publish); |
||
| 206 | } |
||
| 207 | } |
||
| 208 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.