76c01e44df
對齊 A v3.2.0。型別強制會把隱式轉換變成 TypeError,所以一次全檔加入 並跑完整測試(unit 451 / integration 398 全綠,無迴歸)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
57 lines
1.1 KiB
PHP
57 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Migration phase: diagnose current entity state.
|
|
*
|
|
* @package TMDO
|
|
* @since 3.0.1
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Reads preflight metrics and records them in the job array.
|
|
*/
|
|
class TMDO_Phase_Diagnose extends TMDO_Migration_Phase_Base {
|
|
|
|
/**
|
|
* Returns the phase slug.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function name(): string {
|
|
return 'diagnose';
|
|
}
|
|
|
|
/**
|
|
* Executes the phase.
|
|
*
|
|
* @param array $job Job array (by reference).
|
|
* @return array{status: string, message?: string}
|
|
*/
|
|
public function execute( array &$job ): array {
|
|
$preflight = TMDO_Migration_Orchestrator::preflight();
|
|
$job['metrics']['eav_rows_now'] = $preflight['eav_rows'];
|
|
$job['metrics']['ratio_now'] = $preflight['ratio'];
|
|
|
|
$this->log(
|
|
$job,
|
|
sprintf(
|
|
'Diagnose: %d EAV residue rows, %d users, ratio %s, mode %s',
|
|
$preflight['eav_rows'],
|
|
$preflight['users'],
|
|
(string) $preflight['ratio'],
|
|
$preflight['mode']
|
|
)
|
|
);
|
|
|
|
return array(
|
|
'status' => 'ok',
|
|
'message' => 'Diagnose complete',
|
|
);
|
|
}
|
|
}
|