@@ -87,7 +87,7 @@ |
||
| 87 | 87 | /** |
| 88 | 88 | * @return LoggerInterface |
| 89 | 89 | */ |
| 90 | - public function getLogger(): ?LoggerInterface |
|
| 90 | + public function getLogger(): ? LoggerInterface |
|
| 91 | 91 | { |
| 92 | 92 | return $this->configuration->getLogger(); |
| 93 | 93 | } |
@@ -19,103 +19,103 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class AlteredConfiguration implements ConfigurationInterface |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * @var ConfigurationInterface |
|
| 24 | - */ |
|
| 25 | - private $configuration; |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * @var LoggerInterface |
|
| 29 | - */ |
|
| 30 | - private $logger; |
|
| 31 | - |
|
| 32 | - public function __construct(ConfigurationInterface $configuration) |
|
| 33 | - { |
|
| 34 | - $this->configuration = $configuration; |
|
| 35 | - $this->logger = $configuration->getLogger(); |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @return string |
|
| 41 | - */ |
|
| 42 | - public function getBeanNamespace(): string |
|
| 43 | - { |
|
| 44 | - return $this->configuration->getBeanNamespace(); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * @return string |
|
| 49 | - */ |
|
| 50 | - public function getDaoNamespace(): string |
|
| 51 | - { |
|
| 52 | - return $this->configuration->getDaoNamespace(); |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * @return Connection |
|
| 57 | - */ |
|
| 58 | - public function getConnection(): Connection |
|
| 59 | - { |
|
| 60 | - return $this->configuration->getConnection(); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * @return Cache |
|
| 65 | - */ |
|
| 66 | - public function getCache(): Cache |
|
| 67 | - { |
|
| 68 | - return $this->configuration->getCache(); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - /** |
|
| 72 | - * @return NamingStrategyInterface |
|
| 73 | - */ |
|
| 74 | - public function getNamingStrategy(): NamingStrategyInterface |
|
| 75 | - { |
|
| 76 | - return $this->configuration->getNamingStrategy(); |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @return SchemaAnalyzer |
|
| 81 | - */ |
|
| 82 | - public function getSchemaAnalyzer(): SchemaAnalyzer |
|
| 83 | - { |
|
| 84 | - return $this->configuration->getSchemaAnalyzer(); |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * @return LoggerInterface |
|
| 89 | - */ |
|
| 90 | - public function getLogger(): ?LoggerInterface |
|
| 91 | - { |
|
| 92 | - return $this->configuration->getLogger(); |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * @return GeneratorListenerInterface |
|
| 97 | - */ |
|
| 98 | - public function getGeneratorEventDispatcher(): GeneratorListenerInterface |
|
| 99 | - { |
|
| 100 | - return $this->configuration->getGeneratorEventDispatcher(); |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * @param LoggerInterface $logger |
|
| 105 | - */ |
|
| 106 | - public function setLogger(LoggerInterface $logger) |
|
| 107 | - { |
|
| 108 | - $this->logger = $logger; |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * Get the Composer file used to detect the path where files should be written. |
|
| 113 | - * Path is relative to the root directory (this function will typically return 'composer.json' unless you want to write the beans and DAOs in a package). |
|
| 114 | - * |
|
| 115 | - * @return null|string |
|
| 116 | - */ |
|
| 117 | - public function getComposerFile(): string |
|
| 118 | - { |
|
| 119 | - return $this->configuration->getComposerFile(); |
|
| 120 | - } |
|
| 22 | + /** |
|
| 23 | + * @var ConfigurationInterface |
|
| 24 | + */ |
|
| 25 | + private $configuration; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @var LoggerInterface |
|
| 29 | + */ |
|
| 30 | + private $logger; |
|
| 31 | + |
|
| 32 | + public function __construct(ConfigurationInterface $configuration) |
|
| 33 | + { |
|
| 34 | + $this->configuration = $configuration; |
|
| 35 | + $this->logger = $configuration->getLogger(); |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @return string |
|
| 41 | + */ |
|
| 42 | + public function getBeanNamespace(): string |
|
| 43 | + { |
|
| 44 | + return $this->configuration->getBeanNamespace(); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * @return string |
|
| 49 | + */ |
|
| 50 | + public function getDaoNamespace(): string |
|
| 51 | + { |
|
| 52 | + return $this->configuration->getDaoNamespace(); |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * @return Connection |
|
| 57 | + */ |
|
| 58 | + public function getConnection(): Connection |
|
| 59 | + { |
|
| 60 | + return $this->configuration->getConnection(); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * @return Cache |
|
| 65 | + */ |
|
| 66 | + public function getCache(): Cache |
|
| 67 | + { |
|
| 68 | + return $this->configuration->getCache(); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + /** |
|
| 72 | + * @return NamingStrategyInterface |
|
| 73 | + */ |
|
| 74 | + public function getNamingStrategy(): NamingStrategyInterface |
|
| 75 | + { |
|
| 76 | + return $this->configuration->getNamingStrategy(); |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @return SchemaAnalyzer |
|
| 81 | + */ |
|
| 82 | + public function getSchemaAnalyzer(): SchemaAnalyzer |
|
| 83 | + { |
|
| 84 | + return $this->configuration->getSchemaAnalyzer(); |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @return LoggerInterface |
|
| 89 | + */ |
|
| 90 | + public function getLogger(): ?LoggerInterface |
|
| 91 | + { |
|
| 92 | + return $this->configuration->getLogger(); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * @return GeneratorListenerInterface |
|
| 97 | + */ |
|
| 98 | + public function getGeneratorEventDispatcher(): GeneratorListenerInterface |
|
| 99 | + { |
|
| 100 | + return $this->configuration->getGeneratorEventDispatcher(); |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * @param LoggerInterface $logger |
|
| 105 | + */ |
|
| 106 | + public function setLogger(LoggerInterface $logger) |
|
| 107 | + { |
|
| 108 | + $this->logger = $logger; |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * Get the Composer file used to detect the path where files should be written. |
|
| 113 | + * Path is relative to the root directory (this function will typically return 'composer.json' unless you want to write the beans and DAOs in a package). |
|
| 114 | + * |
|
| 115 | + * @return null|string |
|
| 116 | + */ |
|
| 117 | + public function getComposerFile(): string |
|
| 118 | + { |
|
| 119 | + return $this->configuration->getComposerFile(); |
|
| 120 | + } |
|
| 121 | 121 | } |
| 122 | 122 | \ No newline at end of file |
@@ -13,48 +13,48 @@ |
||
| 13 | 13 | class GenerateCommand extends Command |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @var TDBMService |
|
| 18 | - */ |
|
| 19 | - private $configuration; |
|
| 16 | + /** |
|
| 17 | + * @var TDBMService |
|
| 18 | + */ |
|
| 19 | + private $configuration; |
|
| 20 | 20 | |
| 21 | - public function __construct(ConfigurationInterface $configuration) |
|
| 22 | - { |
|
| 23 | - parent::__construct(); |
|
| 24 | - $this->configuration = $configuration; |
|
| 25 | - } |
|
| 21 | + public function __construct(ConfigurationInterface $configuration) |
|
| 22 | + { |
|
| 23 | + parent::__construct(); |
|
| 24 | + $this->configuration = $configuration; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - protected function configure() |
|
| 28 | - { |
|
| 29 | - $this->setName('tdbm:generate') |
|
| 30 | - ->setDescription('Generates DAOs and beans.') |
|
| 31 | - ->setHelp('Use this command to generate or regenerate the DAOs and beans for your project.') |
|
| 32 | - ; |
|
| 33 | - } |
|
| 27 | + protected function configure() |
|
| 28 | + { |
|
| 29 | + $this->setName('tdbm:generate') |
|
| 30 | + ->setDescription('Generates DAOs and beans.') |
|
| 31 | + ->setHelp('Use this command to generate or regenerate the DAOs and beans for your project.') |
|
| 32 | + ; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 36 | - { |
|
| 37 | - // TODO: externalize composer.json file for autoloading (no more parameters for generateAllDaosAndBeans) |
|
| 35 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 36 | + { |
|
| 37 | + // TODO: externalize composer.json file for autoloading (no more parameters for generateAllDaosAndBeans) |
|
| 38 | 38 | |
| 39 | - $alteredConf = new AlteredConfiguration($this->configuration); |
|
| 39 | + $alteredConf = new AlteredConfiguration($this->configuration); |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | - $loggers = [ new ConsoleLogger($output) ]; |
|
| 42 | + $loggers = [ new ConsoleLogger($output) ]; |
|
| 43 | 43 | |
| 44 | - $logger = $alteredConf->getLogger(); |
|
| 45 | - if ($logger) { |
|
| 46 | - $loggers[] = $logger; |
|
| 47 | - } |
|
| 44 | + $logger = $alteredConf->getLogger(); |
|
| 45 | + if ($logger) { |
|
| 46 | + $loggers[] = $logger; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - $multiLogger = new MultiLogger($loggers); |
|
| 49 | + $multiLogger = new MultiLogger($loggers); |
|
| 50 | 50 | |
| 51 | - $alteredConf->setLogger($multiLogger); |
|
| 51 | + $alteredConf->setLogger($multiLogger); |
|
| 52 | 52 | |
| 53 | - $multiLogger->notice('Starting regenerating DAOs and beans'); |
|
| 53 | + $multiLogger->notice('Starting regenerating DAOs and beans'); |
|
| 54 | 54 | |
| 55 | - $tdbmService = new TDBMService($this->configuration); |
|
| 56 | - $tdbmService->generateAllDaosAndBeans(); |
|
| 55 | + $tdbmService = new TDBMService($this->configuration); |
|
| 56 | + $tdbmService->generateAllDaosAndBeans(); |
|
| 57 | 57 | |
| 58 | - $multiLogger->notice('Finished regenerating DAOs and beans'); |
|
| 59 | - } |
|
| 58 | + $multiLogger->notice('Finished regenerating DAOs and beans'); |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $alteredConf = new AlteredConfiguration($this->configuration); |
| 40 | 40 | |
| 41 | 41 | |
| 42 | - $loggers = [ new ConsoleLogger($output) ]; |
|
| 42 | + $loggers = [new ConsoleLogger($output)]; |
|
| 43 | 43 | |
| 44 | 44 | $logger = $alteredConf->getLogger(); |
| 45 | 45 | if ($logger) { |
@@ -15,166 +15,166 @@ |
||
| 15 | 15 | class Configuration implements ConfigurationInterface |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @var string |
|
| 20 | - */ |
|
| 21 | - private $beanNamespace; |
|
| 22 | - /** |
|
| 23 | - * @var string |
|
| 24 | - */ |
|
| 25 | - private $daoNamespace; |
|
| 26 | - /** |
|
| 27 | - * @var Connection |
|
| 28 | - */ |
|
| 29 | - private $connection; |
|
| 30 | - /** |
|
| 31 | - * @var Cache |
|
| 32 | - */ |
|
| 33 | - private $cache; |
|
| 34 | - /** |
|
| 35 | - * @var SchemaAnalyzer |
|
| 36 | - */ |
|
| 37 | - private $schemaAnalyzer; |
|
| 38 | - /** |
|
| 39 | - * @var LoggerInterface |
|
| 40 | - */ |
|
| 41 | - private $logger; |
|
| 42 | - /** |
|
| 43 | - * @var GeneratorListenerInterface |
|
| 44 | - */ |
|
| 45 | - private $generatorEventDispatcher; |
|
| 46 | - /** |
|
| 47 | - * @var NamingStrategyInterface |
|
| 48 | - */ |
|
| 49 | - private $namingStrategy; |
|
| 50 | - /** |
|
| 51 | - * The Composer file used to detect the path where files should be written. |
|
| 52 | - * |
|
| 53 | - * @var string |
|
| 54 | - */ |
|
| 55 | - private $composerFile; |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * @param string $beanNamespace The namespace hosting the beans |
|
| 59 | - * @param string $daoNamespace The namespace hosting the DAOs |
|
| 60 | - * @param Connection $connection The connection to the database |
|
| 61 | - * @param Cache|null $cache The Doctrine cache to store database metadata |
|
| 62 | - * @param SchemaAnalyzer|null $schemaAnalyzer The schema analyzer that will be used to find shortest paths... Will be automatically created if not passed |
|
| 63 | - * @param LoggerInterface|null $logger The logger |
|
| 64 | - * @param GeneratorListenerInterface[] $generatorListeners A list of listeners that will be triggered when beans/daos are generated |
|
| 65 | - */ |
|
| 66 | - public function __construct(string $beanNamespace, string $daoNamespace, Connection $connection, NamingStrategyInterface $namingStrategy, Cache $cache = null, SchemaAnalyzer $schemaAnalyzer = null, LoggerInterface $logger = null, array $generatorListeners = []) |
|
| 67 | - { |
|
| 68 | - $this->beanNamespace = rtrim($beanNamespace, '\\'); |
|
| 69 | - $this->daoNamespace = rtrim($daoNamespace, '\\'); |
|
| 70 | - $this->connection = $connection; |
|
| 71 | - $this->namingStrategy = $namingStrategy; |
|
| 72 | - if ($cache !== null) { |
|
| 73 | - $this->cache = $cache; |
|
| 74 | - } else { |
|
| 75 | - $this->cache = new VoidCache(); |
|
| 76 | - } |
|
| 77 | - if ($schemaAnalyzer !== null) { |
|
| 78 | - $this->schemaAnalyzer = $schemaAnalyzer; |
|
| 79 | - } else { |
|
| 80 | - $this->schemaAnalyzer = new SchemaAnalyzer($this->connection->getSchemaManager(), $this->cache, $this->getConnectionUniqueId()); |
|
| 81 | - } |
|
| 82 | - $this->logger = $logger; |
|
| 83 | - $this->generatorEventDispatcher = new GeneratorEventDispatcher($generatorListeners); |
|
| 84 | - $this->composerFile = 'composer.json'; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * @return string |
|
| 89 | - */ |
|
| 90 | - public function getBeanNamespace(): string |
|
| 91 | - { |
|
| 92 | - return $this->beanNamespace; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * @return string |
|
| 97 | - */ |
|
| 98 | - public function getDaoNamespace(): string |
|
| 99 | - { |
|
| 100 | - return $this->daoNamespace; |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * @return Connection |
|
| 105 | - */ |
|
| 106 | - public function getConnection(): Connection |
|
| 107 | - { |
|
| 108 | - return $this->connection; |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * @return NamingStrategyInterface |
|
| 113 | - */ |
|
| 114 | - public function getNamingStrategy(): NamingStrategyInterface |
|
| 115 | - { |
|
| 116 | - return $this->namingStrategy; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * @return Cache |
|
| 121 | - */ |
|
| 122 | - public function getCache(): Cache |
|
| 123 | - { |
|
| 124 | - return $this->cache; |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - /** |
|
| 128 | - * @return SchemaAnalyzer |
|
| 129 | - */ |
|
| 130 | - public function getSchemaAnalyzer(): SchemaAnalyzer |
|
| 131 | - { |
|
| 132 | - return $this->schemaAnalyzer; |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - /** |
|
| 136 | - * @return LoggerInterface |
|
| 137 | - */ |
|
| 138 | - public function getLogger(): ?LoggerInterface |
|
| 139 | - { |
|
| 140 | - return $this->logger; |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - /** |
|
| 144 | - * @return GeneratorListenerInterface |
|
| 145 | - */ |
|
| 146 | - public function getGeneratorEventDispatcher(): GeneratorListenerInterface |
|
| 147 | - { |
|
| 148 | - return $this->generatorEventDispatcher; |
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * Creates a unique cache key for the current connection. |
|
| 155 | - * |
|
| 156 | - * @return string |
|
| 157 | - */ |
|
| 158 | - private function getConnectionUniqueId(): string |
|
| 159 | - { |
|
| 160 | - return hash('md4', $this->connection->getHost().'-'.$this->connection->getPort().'-'.$this->connection->getDatabase().'-'.$this->connection->getDriver()->getName()); |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - /** |
|
| 164 | - * @return null|string |
|
| 165 | - */ |
|
| 166 | - public function getComposerFile() : string |
|
| 167 | - { |
|
| 168 | - return $this->composerFile; |
|
| 169 | - } |
|
| 170 | - |
|
| 171 | - /** |
|
| 172 | - * Sets the Composer file used to detect the path where files should be written. |
|
| 173 | - * |
|
| 174 | - * @param null|string $composerFile |
|
| 175 | - */ |
|
| 176 | - public function setComposerFile(string $composerFile) |
|
| 177 | - { |
|
| 178 | - $this->composerFile = $composerFile; |
|
| 179 | - } |
|
| 18 | + /** |
|
| 19 | + * @var string |
|
| 20 | + */ |
|
| 21 | + private $beanNamespace; |
|
| 22 | + /** |
|
| 23 | + * @var string |
|
| 24 | + */ |
|
| 25 | + private $daoNamespace; |
|
| 26 | + /** |
|
| 27 | + * @var Connection |
|
| 28 | + */ |
|
| 29 | + private $connection; |
|
| 30 | + /** |
|
| 31 | + * @var Cache |
|
| 32 | + */ |
|
| 33 | + private $cache; |
|
| 34 | + /** |
|
| 35 | + * @var SchemaAnalyzer |
|
| 36 | + */ |
|
| 37 | + private $schemaAnalyzer; |
|
| 38 | + /** |
|
| 39 | + * @var LoggerInterface |
|
| 40 | + */ |
|
| 41 | + private $logger; |
|
| 42 | + /** |
|
| 43 | + * @var GeneratorListenerInterface |
|
| 44 | + */ |
|
| 45 | + private $generatorEventDispatcher; |
|
| 46 | + /** |
|
| 47 | + * @var NamingStrategyInterface |
|
| 48 | + */ |
|
| 49 | + private $namingStrategy; |
|
| 50 | + /** |
|
| 51 | + * The Composer file used to detect the path where files should be written. |
|
| 52 | + * |
|
| 53 | + * @var string |
|
| 54 | + */ |
|
| 55 | + private $composerFile; |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * @param string $beanNamespace The namespace hosting the beans |
|
| 59 | + * @param string $daoNamespace The namespace hosting the DAOs |
|
| 60 | + * @param Connection $connection The connection to the database |
|
| 61 | + * @param Cache|null $cache The Doctrine cache to store database metadata |
|
| 62 | + * @param SchemaAnalyzer|null $schemaAnalyzer The schema analyzer that will be used to find shortest paths... Will be automatically created if not passed |
|
| 63 | + * @param LoggerInterface|null $logger The logger |
|
| 64 | + * @param GeneratorListenerInterface[] $generatorListeners A list of listeners that will be triggered when beans/daos are generated |
|
| 65 | + */ |
|
| 66 | + public function __construct(string $beanNamespace, string $daoNamespace, Connection $connection, NamingStrategyInterface $namingStrategy, Cache $cache = null, SchemaAnalyzer $schemaAnalyzer = null, LoggerInterface $logger = null, array $generatorListeners = []) |
|
| 67 | + { |
|
| 68 | + $this->beanNamespace = rtrim($beanNamespace, '\\'); |
|
| 69 | + $this->daoNamespace = rtrim($daoNamespace, '\\'); |
|
| 70 | + $this->connection = $connection; |
|
| 71 | + $this->namingStrategy = $namingStrategy; |
|
| 72 | + if ($cache !== null) { |
|
| 73 | + $this->cache = $cache; |
|
| 74 | + } else { |
|
| 75 | + $this->cache = new VoidCache(); |
|
| 76 | + } |
|
| 77 | + if ($schemaAnalyzer !== null) { |
|
| 78 | + $this->schemaAnalyzer = $schemaAnalyzer; |
|
| 79 | + } else { |
|
| 80 | + $this->schemaAnalyzer = new SchemaAnalyzer($this->connection->getSchemaManager(), $this->cache, $this->getConnectionUniqueId()); |
|
| 81 | + } |
|
| 82 | + $this->logger = $logger; |
|
| 83 | + $this->generatorEventDispatcher = new GeneratorEventDispatcher($generatorListeners); |
|
| 84 | + $this->composerFile = 'composer.json'; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @return string |
|
| 89 | + */ |
|
| 90 | + public function getBeanNamespace(): string |
|
| 91 | + { |
|
| 92 | + return $this->beanNamespace; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * @return string |
|
| 97 | + */ |
|
| 98 | + public function getDaoNamespace(): string |
|
| 99 | + { |
|
| 100 | + return $this->daoNamespace; |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * @return Connection |
|
| 105 | + */ |
|
| 106 | + public function getConnection(): Connection |
|
| 107 | + { |
|
| 108 | + return $this->connection; |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * @return NamingStrategyInterface |
|
| 113 | + */ |
|
| 114 | + public function getNamingStrategy(): NamingStrategyInterface |
|
| 115 | + { |
|
| 116 | + return $this->namingStrategy; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * @return Cache |
|
| 121 | + */ |
|
| 122 | + public function getCache(): Cache |
|
| 123 | + { |
|
| 124 | + return $this->cache; |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + /** |
|
| 128 | + * @return SchemaAnalyzer |
|
| 129 | + */ |
|
| 130 | + public function getSchemaAnalyzer(): SchemaAnalyzer |
|
| 131 | + { |
|
| 132 | + return $this->schemaAnalyzer; |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + /** |
|
| 136 | + * @return LoggerInterface |
|
| 137 | + */ |
|
| 138 | + public function getLogger(): ?LoggerInterface |
|
| 139 | + { |
|
| 140 | + return $this->logger; |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + /** |
|
| 144 | + * @return GeneratorListenerInterface |
|
| 145 | + */ |
|
| 146 | + public function getGeneratorEventDispatcher(): GeneratorListenerInterface |
|
| 147 | + { |
|
| 148 | + return $this->generatorEventDispatcher; |
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * Creates a unique cache key for the current connection. |
|
| 155 | + * |
|
| 156 | + * @return string |
|
| 157 | + */ |
|
| 158 | + private function getConnectionUniqueId(): string |
|
| 159 | + { |
|
| 160 | + return hash('md4', $this->connection->getHost().'-'.$this->connection->getPort().'-'.$this->connection->getDatabase().'-'.$this->connection->getDriver()->getName()); |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + /** |
|
| 164 | + * @return null|string |
|
| 165 | + */ |
|
| 166 | + public function getComposerFile() : string |
|
| 167 | + { |
|
| 168 | + return $this->composerFile; |
|
| 169 | + } |
|
| 170 | + |
|
| 171 | + /** |
|
| 172 | + * Sets the Composer file used to detect the path where files should be written. |
|
| 173 | + * |
|
| 174 | + * @param null|string $composerFile |
|
| 175 | + */ |
|
| 176 | + public function setComposerFile(string $composerFile) |
|
| 177 | + { |
|
| 178 | + $this->composerFile = $composerFile; |
|
| 179 | + } |
|
| 180 | 180 | } |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | /** |
| 136 | 136 | * @return LoggerInterface |
| 137 | 137 | */ |
| 138 | - public function getLogger(): ?LoggerInterface |
|
| 138 | + public function getLogger(): ? LoggerInterface |
|
| 139 | 139 | { |
| 140 | 140 | return $this->logger; |
| 141 | 141 | } |