1 | <?php namespace Nwidart\DbExporter; |
||
7 | class DbExportHandlerServiceProvider extends ServiceProvider |
||
8 | { |
||
9 | protected $defer = false; |
||
10 | |||
11 | /** |
||
12 | * @var DbMigrations $migrator |
||
13 | */ |
||
14 | protected $migrator; |
||
15 | |||
16 | /** |
||
17 | * @var DbSeeding $seeder |
||
18 | */ |
||
19 | protected $seeder; |
||
20 | /** |
||
21 | * @var DbExportHandler $handler |
||
22 | */ |
||
23 | protected $handler; |
||
24 | |||
25 | public function boot() |
||
29 | |||
30 | public function register() |
||
31 | { |
||
32 | // Load the classes |
||
33 | $this->loadClasses(); |
||
34 | |||
35 | // Register the base export handler class |
||
36 | $this->registerDbExportHandler(); |
||
37 | |||
38 | // Handle the artisan commands |
||
39 | $this->registerCommands(); |
||
40 | |||
41 | // Load the alias |
||
42 | $this->loadAlias(); |
||
43 | |||
44 | // Default config |
||
45 | $this->mergeConfigFrom( |
||
46 | __DIR__.'/../../config/config.php', 'db-exporter' |
||
47 | ); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Load to classes |
||
52 | */ |
||
53 | protected function loadClasses() |
||
54 | { |
||
55 | // Instatiate a new DbMigrations class to send to the handler |
||
56 | $this->migrator = new DbMigrations($this->getDatabaseName()); |
||
57 | |||
58 | // Instatiate a new DbSeeding class to send to the handler |
||
59 | $this->seeder = new DbSeeding($this->getDatabaseName()); |
||
60 | |||
61 | // Instantiate the handler |
||
62 | $this->handler = new DbExportHandler($this->migrator, $this->seeder); |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Get the database name from the app/config/database.php file |
||
67 | * @return String |
||
68 | */ |
||
69 | private function getDatabaseName() |
||
70 | { |
||
71 | $connType = config('database.default'); |
||
72 | $database = config('database.connections.' .$connType ); |
||
73 | |||
74 | return $database['database']; |
||
75 | } |
||
76 | |||
77 | public function provides() |
||
81 | |||
82 | /** |
||
83 | * Register the needed commands |
||
84 | */ |
||
85 | public function registerCommands() |
||
96 | |||
97 | /** |
||
98 | * Register the migrations command |
||
99 | */ |
||
100 | protected function registerMigrationsCommand() |
||
107 | |||
108 | /** |
||
109 | * Register the seeds command |
||
110 | */ |
||
111 | protected function registerSeedsCommand() |
||
118 | |||
119 | protected function registerRemoteCommand() |
||
126 | |||
127 | /** |
||
128 | * Register the Export handler class |
||
129 | */ |
||
130 | protected function registerDbExportHandler() |
||
137 | |||
138 | /** |
||
139 | * Load the alias = One less install step for the user |
||
140 | */ |
||
141 | protected function loadAlias() |
||
154 | |||
155 | } |
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.