Skip to content

Commit 7be39b3

Browse files
committed
Always read the schema from the lock file
1 parent 76242ee commit 7be39b3

11 files changed

+604
-84
lines changed

phpstan.neon

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ parameters:
1515
- "#Method TheCodingMachine\\\\TDBM\\\\Schema\\\\ForeignKey::.*() should return .* but returns array<string>|string.#"
1616
- '#Method TheCodingMachine\\TDBM\\NativeWeakrefObjectStorage::get\(\) should return TheCodingMachine\\TDBM\\DbRow\|null but returns object\|null.#'
1717
-
18-
message: '#WeakRef#'
19-
path: src/WeakrefObjectStorage.php
18+
message: '#WeakRef#'
19+
path: src/WeakrefObjectStorage.php
2020
-
2121
message: '#Result of && is always false.#'
2222
path: src/Test/Dao/Bean/Generated/ArticleBaseBean.php
23+
-
24+
message: '#TheCodingMachine\\TDBM\\Schema\\LockFileSchemaManager::__construct\(\) does not call parent constructor from Doctrine\\DBAL\\Schema\\AbstractSchemaManager.#'
25+
path: src/Schema/LockFileSchemaManager.php
2326
#reportUnmatchedIgnoredErrors: false
2427
includes:
2528
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon

src/Configuration.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,18 @@ public function __construct(
118118
} else {
119119
$this->cache = new VoidCache();
120120
}
121+
$lockFileSchemaManager = $this->connection->getSchemaManager();
121122
if ($schemaAnalyzer !== null) {
122123
$this->schemaAnalyzer = $schemaAnalyzer;
123124
} else {
124-
$this->schemaAnalyzer = new SchemaAnalyzer($this->connection->getSchemaManager(), $this->cache, $this->getConnectionUniqueId());
125+
$this->schemaAnalyzer = new SchemaAnalyzer($lockFileSchemaManager, $this->cache, $this->getConnectionUniqueId());
125126
}
126127
$this->logger = $logger;
127128
$this->generatorEventDispatcher = new GeneratorEventDispatcher($generatorListeners);
128129
$this->pathFinder = new PathFinder();
129130
$this->annotationParser = $annotationParser ?: AnnotationParser::buildWithDefaultAnnotations([]);
130131
$this->codeGeneratorListener = new CodeGeneratorEventDispatcher($codeGeneratorListeners);
131-
$this->namingStrategy = $namingStrategy ?: new DefaultNamingStrategy($this->annotationParser, $this->connection->getSchemaManager());
132+
$this->namingStrategy = $namingStrategy ?: new DefaultNamingStrategy($this->annotationParser, $lockFileSchemaManager);
132133
$this->lockFilePath = $lockFilePath;
133134
}
134135

0 commit comments

Comments
 (0)