category = $category; $this->score = max( 0, min( 100, $score ) ); $this->issues = array_values( array_map( 'strval', $issues ) ); $this->recommendations = array_values( array_map( 'strval', $recommendations ) ); } /** * Serialize to the REST-response shape. * * @return array{category:string, score:int, issues:string[], recommendations:string[]} */ public function to_array(): array { return array( 'category' => $this->category, 'score' => $this->score, 'issues' => $this->issues, 'recommendations' => $this->recommendations, ); } }