1 | <?php |
||
23 | class MongodbMigrateCommand extends Command |
||
24 | { |
||
25 | /** |
||
26 | * @var ContainerInterface |
||
27 | */ |
||
28 | private $container; |
||
29 | |||
30 | /** |
||
31 | * @var Finder |
||
32 | */ |
||
33 | private $finder; |
||
34 | |||
35 | /** |
||
36 | * @var DocumentManagerHelper |
||
37 | */ |
||
38 | private $documentManager; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $databaseName; |
||
44 | |||
45 | /** |
||
46 | * @var array |
||
47 | */ |
||
48 | private $errors = []; |
||
49 | |||
50 | /** |
||
51 | * @param ContainerInterface $container container instance for injecting into aware migrations |
||
52 | * @param Finder $finder finder that finds configs |
||
53 | * @param DocumentManagerHelper $documentManager dm helper to get access to db in command |
||
54 | * @param string $databaseName name of database where data is found in |
||
55 | */ |
||
56 | 4 | public function __construct( |
|
69 | |||
70 | /** |
||
71 | * setup command |
||
72 | * |
||
73 | * @return void |
||
74 | */ |
||
75 | 4 | protected function configure() |
|
81 | |||
82 | /** |
||
83 | * call execute on found commands |
||
84 | * |
||
85 | * @param InputInterface $input user input |
||
86 | * @param OutputInterface $output command output |
||
87 | * |
||
88 | * @return void |
||
|
|||
89 | */ |
||
90 | public function execute(InputInterface $input, OutputInterface $output) |
||
148 | |||
149 | /** |
||
150 | * get configration object for migration script |
||
151 | * |
||
152 | * This is based on antromattr/mongodb-migartion code but extends it so we can inject |
||
153 | * non local stuff centrally. |
||
154 | * |
||
155 | * @param string $filepath path to configuration file |
||
156 | * @param Output $output ouput interface need by config parser to do stuff |
||
157 | * |
||
158 | * @return AntiMattr\MongoDB\Migrations\Configuration\Configuration |
||
159 | */ |
||
160 | private function getConfiguration($filepath, $output) |
||
182 | |||
183 | /** |
||
184 | * Injects the container to migrations aware of it |
||
185 | * |
||
186 | * @param ContainerInterface $container container to inject into container aware migrations |
||
187 | * @param array $versions versions that might need injecting a container |
||
188 | * |
||
189 | * @return void |
||
190 | */ |
||
191 | private static function injectContainerToMigrations(ContainerInterface $container, array $versions) |
||
200 | } |
||
201 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.