errorClassifier = new ABJ_404_Solution_DatabaseErrorClassifier($core, $functions, $logger); $this->repairPolicy = new ABJ_404_Solution_DatabaseRepairPolicy($core, $this->errorClassifier, $functions, $logger); $this->sqlErrorReporter = new ABJ_404_Solution_DatabaseSqlErrorReporter($core, $logger); $this->collationHelper = new ABJ_404_Solution_DatabaseCollationHelper( function (string $query, array $options) use ($core): array { return $core->queryAndGetResults($query, $options); }, function (string $tableName) use ($core): string { // Call through $core so test-stub subclass overrides of // getCreateTableDDL are honored, matching pre-extraction behavior. return $core->tableNameResolver()->getCreateTableDDL($tableName); }, function (string $key) use ($noticeState) { return $noticeState->getRuntimeFlag($key); }, function (string $key, $value, int $ttl) use ($noticeState): void { $noticeState->setRuntimeFlag($key, $value, $ttl); }, $logger ); $this->tableRepairer = new ABJ_404_Solution_DatabaseTableRepairer( function (string $query, array $options) use ($core): array { return $core->queryAndGetResults($query, $options); }, function (array &$result) use ($resultHarvester): void { $resultHarvester->harvestWpdbResult($result); }, function () use ($queryExecutor): string { return $queryExecutor->getCurrentResultType(); }, function (string $type, string $message, string $guidance, string $errorString) use ($noticeState): void { $noticeState->setPluginDbNotice($type, $message, $guidance, $errorString); }, function (string $errorText) use ($core): bool { return $core->connectionManager()->resetForRetry($errorText); }, $functions, $logger ); } /** @return ABJ_404_Solution_DatabaseErrorClassifier */ public function errorClassifier(): ABJ_404_Solution_DatabaseErrorClassifier { return $this->errorClassifier; } /** @return ABJ_404_Solution_DatabaseRepairPolicy */ public function repairPolicy(): ABJ_404_Solution_DatabaseRepairPolicy { return $this->repairPolicy; } /** @return ABJ_404_Solution_DatabaseSqlErrorReporter */ public function sqlErrorReporter(): ABJ_404_Solution_DatabaseSqlErrorReporter { return $this->sqlErrorReporter; } /** @return ABJ_404_Solution_DatabaseCollationHelper */ public function collationHelper(): ABJ_404_Solution_DatabaseCollationHelper { return $this->collationHelper; } /** @return ABJ_404_Solution_DatabaseTableRepairer */ public function tableRepairer(): ABJ_404_Solution_DatabaseTableRepairer { return $this->tableRepairer; } }