style(phpcs): autofix WordPress-Core violations via phpcbf
Run phpcbf --standard=WordPress-Core across includes/, prautoblogger.php, and uninstall.php. Fixed 1,362 formatting violations in 75 files: - Short array syntax: [] → array() - Line breaking for long function calls - Consistent indentation - Function call parameter alignment No logic changes; purely mechanical formatting.
This commit is contained in:
@@ -43,7 +43,7 @@ class PRAutoBlogger_Analysis_Result {
|
||||
$this->summary = $data['summary'] ?? null;
|
||||
$this->frequency = (int) ( $data['frequency'] ?? 1 );
|
||||
$this->relevance_score = (float) ( $data['relevance_score'] ?? 0.0 );
|
||||
$this->source_ids = $data['source_ids'] ?? [];
|
||||
$this->source_ids = $data['source_ids'] ?? array();
|
||||
$this->analyzed_at = $data['analyzed_at'] ?? current_time( 'mysql' );
|
||||
$this->metadata = $data['metadata'] ?? null;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ class PRAutoBlogger_Analysis_Result {
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function to_db_row(): array {
|
||||
return [
|
||||
return array(
|
||||
'analysis_type' => $this->analysis_type,
|
||||
'topic' => $this->topic,
|
||||
'summary' => $this->summary,
|
||||
@@ -97,6 +97,6 @@ class PRAutoBlogger_Analysis_Result {
|
||||
'source_ids_json' => wp_json_encode( $this->source_ids ),
|
||||
'analyzed_at' => $this->analyzed_at,
|
||||
'metadata_json' => null !== $this->metadata ? wp_json_encode( $this->metadata ) : null,
|
||||
];
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,15 +38,15 @@ class PRAutoBlogger_Article_Idea {
|
||||
* } $data
|
||||
*/
|
||||
public function __construct( array $data ) {
|
||||
$this->topic = $data['topic'];
|
||||
$this->article_type = $data['article_type'];
|
||||
$this->suggested_title = $data['suggested_title'];
|
||||
$this->summary = $data['summary'];
|
||||
$this->score = (float) ( $data['score'] ?? 0.0 );
|
||||
$this->analysis_id = (int) ( $data['analysis_id'] ?? 0 );
|
||||
$this->source_ids = $data['source_ids'] ?? [];
|
||||
$this->key_points = $data['key_points'] ?? [];
|
||||
$this->target_keywords = $data['target_keywords'] ?? [];
|
||||
$this->topic = $data['topic'];
|
||||
$this->article_type = $data['article_type'];
|
||||
$this->suggested_title = $data['suggested_title'];
|
||||
$this->summary = $data['summary'];
|
||||
$this->score = (float) ( $data['score'] ?? 0.0 );
|
||||
$this->analysis_id = (int) ( $data['analysis_id'] ?? 0 );
|
||||
$this->source_ids = $data['source_ids'] ?? array();
|
||||
$this->key_points = $data['key_points'] ?? array();
|
||||
$this->target_keywords = $data['target_keywords'] ?? array();
|
||||
}
|
||||
|
||||
public function get_topic(): string {
|
||||
@@ -93,7 +93,7 @@ class PRAutoBlogger_Article_Idea {
|
||||
* @return array<string, mixed> Constructor-compatible array.
|
||||
*/
|
||||
public function to_array(): array {
|
||||
return [
|
||||
return array(
|
||||
'topic' => $this->topic,
|
||||
'article_type' => $this->article_type,
|
||||
'suggested_title' => $this->suggested_title,
|
||||
@@ -103,6 +103,6 @@ class PRAutoBlogger_Article_Idea {
|
||||
'source_ids' => $this->source_ids,
|
||||
'key_points' => $this->key_points,
|
||||
'target_keywords' => $this->target_keywords,
|
||||
];
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class PRAutoBlogger_Content_Request {
|
||||
int $min_word_count,
|
||||
int $max_word_count,
|
||||
string $niche_description,
|
||||
array $topic_exclusions = [],
|
||||
array $topic_exclusions = array(),
|
||||
string $writing_instructions = ''
|
||||
) {
|
||||
$this->idea = $idea;
|
||||
|
||||
@@ -37,21 +37,30 @@ class PRAutoBlogger_Content_Score {
|
||||
$this->measured_at = $data['measured_at'] ?? current_time( 'mysql' );
|
||||
}
|
||||
|
||||
public function get_id(): int { return $this->id; }
|
||||
public function get_post_id(): int { return $this->post_id; }
|
||||
public function get_pageviews(): int { return $this->pageviews; }
|
||||
public function get_avg_time_on_page(): float { return $this->avg_time_on_page; }
|
||||
public function get_bounce_rate(): float { return $this->bounce_rate; }
|
||||
public function get_comment_count(): int { return $this->comment_count; }
|
||||
public function get_composite_score(): float { return $this->composite_score; }
|
||||
public function get_score_factors(): ?array { return $this->score_factors; }
|
||||
public function get_measured_at(): string { return $this->measured_at; }
|
||||
public function get_id(): int {
|
||||
return $this->id; }
|
||||
public function get_post_id(): int {
|
||||
return $this->post_id; }
|
||||
public function get_pageviews(): int {
|
||||
return $this->pageviews; }
|
||||
public function get_avg_time_on_page(): float {
|
||||
return $this->avg_time_on_page; }
|
||||
public function get_bounce_rate(): float {
|
||||
return $this->bounce_rate; }
|
||||
public function get_comment_count(): int {
|
||||
return $this->comment_count; }
|
||||
public function get_composite_score(): float {
|
||||
return $this->composite_score; }
|
||||
public function get_score_factors(): ?array {
|
||||
return $this->score_factors; }
|
||||
public function get_measured_at(): string {
|
||||
return $this->measured_at; }
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function to_db_row(): array {
|
||||
return [
|
||||
return array(
|
||||
'post_id' => $this->post_id,
|
||||
'pageviews' => $this->pageviews,
|
||||
'avg_time_on_page' => $this->avg_time_on_page,
|
||||
@@ -60,6 +69,6 @@ class PRAutoBlogger_Content_Score {
|
||||
'composite_score' => $this->composite_score,
|
||||
'score_factors_json' => null !== $this->score_factors ? wp_json_encode( $this->score_factors ) : null,
|
||||
'measured_at' => $this->measured_at,
|
||||
];
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ class PRAutoBlogger_Editorial_Review {
|
||||
* } $data
|
||||
*/
|
||||
public function __construct( array $data ) {
|
||||
$this->verdict = $data['verdict']; // 'approved', 'revised', 'rejected'
|
||||
$this->notes = $data['notes'];
|
||||
$this->revised_content = $data['revised_content'] ?? null;
|
||||
$this->quality_score = (float) ( $data['quality_score'] ?? 0.0 );
|
||||
$this->seo_score = (float) ( $data['seo_score'] ?? 0.0 );
|
||||
$this->issues = $data['issues'] ?? [];
|
||||
$this->verdict = $data['verdict']; // 'approved', 'revised', 'rejected'
|
||||
$this->notes = $data['notes'];
|
||||
$this->revised_content = $data['revised_content'] ?? null;
|
||||
$this->quality_score = (float) ( $data['quality_score'] ?? 0.0 );
|
||||
$this->seo_score = (float) ( $data['seo_score'] ?? 0.0 );
|
||||
$this->issues = $data['issues'] ?? array();
|
||||
}
|
||||
|
||||
public function get_verdict(): string {
|
||||
|
||||
@@ -45,25 +45,38 @@ class PRAutoBlogger_Generation_Log {
|
||||
$this->created_at = $data['created_at'] ?? current_time( 'mysql' );
|
||||
}
|
||||
|
||||
public function get_id(): int { return $this->id; }
|
||||
public function get_post_id(): ?int { return $this->post_id; }
|
||||
public function get_run_id(): ?string { return $this->run_id; }
|
||||
public function get_stage(): string { return $this->stage; }
|
||||
public function get_provider(): string { return $this->provider; }
|
||||
public function get_model(): string { return $this->model; }
|
||||
public function get_prompt_tokens(): int { return $this->prompt_tokens; }
|
||||
public function get_completion_tokens(): int { return $this->completion_tokens; }
|
||||
public function get_estimated_cost(): float { return $this->estimated_cost; }
|
||||
public function get_request_json(): ?string { return $this->request_json; }
|
||||
public function get_response_status(): string { return $this->response_status; }
|
||||
public function get_error_message(): ?string { return $this->error_message; }
|
||||
public function get_created_at(): string { return $this->created_at; }
|
||||
public function get_id(): int {
|
||||
return $this->id; }
|
||||
public function get_post_id(): ?int {
|
||||
return $this->post_id; }
|
||||
public function get_run_id(): ?string {
|
||||
return $this->run_id; }
|
||||
public function get_stage(): string {
|
||||
return $this->stage; }
|
||||
public function get_provider(): string {
|
||||
return $this->provider; }
|
||||
public function get_model(): string {
|
||||
return $this->model; }
|
||||
public function get_prompt_tokens(): int {
|
||||
return $this->prompt_tokens; }
|
||||
public function get_completion_tokens(): int {
|
||||
return $this->completion_tokens; }
|
||||
public function get_estimated_cost(): float {
|
||||
return $this->estimated_cost; }
|
||||
public function get_request_json(): ?string {
|
||||
return $this->request_json; }
|
||||
public function get_response_status(): string {
|
||||
return $this->response_status; }
|
||||
public function get_error_message(): ?string {
|
||||
return $this->error_message; }
|
||||
public function get_created_at(): string {
|
||||
return $this->created_at; }
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function to_db_row(): array {
|
||||
return [
|
||||
return array(
|
||||
'post_id' => $this->post_id,
|
||||
'run_id' => $this->run_id,
|
||||
'stage' => $this->stage,
|
||||
@@ -76,6 +89,6 @@ class PRAutoBlogger_Generation_Log {
|
||||
'response_status' => $this->response_status,
|
||||
'error_message' => $this->error_message,
|
||||
'created_at' => $this->created_at,
|
||||
];
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class PRAutoBlogger_Source_Data {
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function to_db_row(): array {
|
||||
return [
|
||||
return array(
|
||||
'source_type' => $this->source_type,
|
||||
'source_id' => $this->source_id,
|
||||
'subreddit' => $this->subreddit,
|
||||
@@ -123,6 +123,6 @@ class PRAutoBlogger_Source_Data {
|
||||
'permalink' => $this->permalink,
|
||||
'collected_at' => $this->collected_at,
|
||||
'metadata_json' => null !== $this->metadata ? wp_json_encode( $this->metadata ) : null,
|
||||
];
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user