monthsData = $monthsData; } public function sheets(): array { $sheets = []; foreach ($this->monthsData as $monthName => $config) { // 传入 3 个参数,匹配子类新的构造函数 $sheets[] = new ManMonthlyWorkHourSheetExport( (string)$monthName, $config['data'] ?? [], (int)($config['days'] ?? 30), $config['company_name'] ); } return $sheets; } }