| Total Complexity | 11 |
| Total Lines | 92 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class HelperServiceProvider extends ServiceProvider |
||
| 10 | { |
||
| 11 | protected $HELPERS_PATH = 'Helpers/'; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Register services. |
||
| 15 | * |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | public function register() |
||
| 19 | { |
||
| 20 | $this->registerHelpers(); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Register helpers. |
||
| 25 | * |
||
| 26 | * @return void |
||
| 27 | */ |
||
| 28 | public function registerHelpers() |
||
| 29 | { |
||
| 30 | $helpers = glob($this->packagePath('/Helpers/*.php')); |
||
| 31 | foreach ($helpers as $helper) { |
||
| 32 | if (file_exists($helper)) { |
||
| 33 | require_once $helper; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Bootstrap services. |
||
| 40 | * |
||
| 41 | * @return void |
||
| 42 | */ |
||
| 43 | public function boot() |
||
| 44 | { |
||
| 45 | // load command files |
||
| 46 | $this->registerCommands(); |
||
| 47 | |||
| 48 | // load publisher files |
||
| 49 | $this->registerResources(); |
||
| 50 | } |
||
| 51 | |||
| 52 | |||
| 53 | /** |
||
| 54 | * Register commands. |
||
| 55 | * |
||
| 56 | * @return void |
||
| 57 | */ |
||
| 58 | private function registerCommands() |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Register resources. |
||
| 66 | * |
||
| 67 | * @return void |
||
| 68 | */ |
||
| 69 | public function registerResources() |
||
| 79 | ); |
||
| 80 | } |
||
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @param $path |
||
| 85 | * |
||
| 86 | * @return string |
||
| 87 | */ |
||
| 88 | private function packagePath($path) |
||
| 89 | { |
||
| 90 | return __DIR__."/$path"; |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Check if package is running under Lumen app. |
||
| 95 | * |
||
| 96 | * @return bool |
||
| 97 | */ |
||
| 98 | protected function isLumen() |
||
| 101 | } |
||
| 102 | } |
||
| 103 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.