1 | <?php |
||
34 | class MigrationsConfigurationFactory extends AbstractFactory |
||
35 | { |
||
36 | /** |
||
37 | * {@inheritDoc} |
||
38 | * |
||
39 | * @return \Doctrine\DBAL\Migrations\Configuration\Configuration |
||
40 | */ |
||
41 | 2 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
42 | { |
||
43 | 2 | $name = $this->getName(); |
|
44 | /* @var $connection \Doctrine\DBAL\Connection */ |
||
45 | 2 | $connection = $container->get('doctrine.connection.' . $name); |
|
46 | 2 | $appConfig = $container->get('Config'); |
|
47 | 2 | $migrationsConfig = $appConfig['doctrine']['migrations_configuration'][$name]; |
|
48 | 2 | $configuration = new Configuration($connection); |
|
49 | |||
50 | 2 | $configuration->setName($migrationsConfig['name']); |
|
51 | 2 | $configuration->setMigrationsDirectory($migrationsConfig['directory']); |
|
52 | 2 | $configuration->setMigrationsNamespace($migrationsConfig['namespace']); |
|
53 | 2 | $configuration->setMigrationsTableName($migrationsConfig['table']); |
|
54 | 2 | $configuration->registerMigrationsFromDirectory($migrationsConfig['directory']); |
|
55 | |||
56 | 2 | if (method_exists($configuration, 'setMigrationsColumnName')) { |
|
57 | 2 | $configuration->setMigrationsColumnName($migrationsConfig['column']); |
|
58 | 2 | } |
|
59 | |||
60 | 2 | return $configuration; |
|
61 | } |
||
62 | |||
63 | /** |
||
64 | * {@inheritDoc} |
||
65 | * |
||
66 | * @return \Doctrine\DBAL\Migrations\Configuration\Configuration |
||
67 | */ |
||
68 | 2 | public function createService(ServiceLocatorInterface $container) |
|
72 | |||
73 | /** |
||
74 | * {@inheritDoc} |
||
75 | */ |
||
76 | public function getOptionsClass() |
||
79 | } |
||
80 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.