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:
peptiderepo
2026-04-23 02:42:48 +00:00
parent 7cd65b145f
commit f3eacd0d8d
75 changed files with 2148 additions and 1412 deletions

View File

@@ -51,7 +51,7 @@ class PRAutoBlogger_Source_Collector {
// Only fall back to reddit if the option is corrupt (non-JSON).
// An empty array '[]' is a valid choice — the user disabled all sources.
if ( ! is_array( $enabled ) ) {
$enabled = [ 'reddit' ];
$enabled = array( 'reddit' );
}
$total_inserted = 0;
@@ -64,9 +64,9 @@ class PRAutoBlogger_Source_Collector {
}
try {
$data = $provider->collect_data( $this->get_config_for_source( $source_type ) );
$inserted = $this->store_data( $data );
$refreshed = count( $data ) - $inserted;
$data = $provider->collect_data( $this->get_config_for_source( $source_type ) );
$inserted = $this->store_data( $data );
$refreshed = count( $data ) - $inserted;
$total_inserted += $inserted;
PRAutoBlogger_Logger::instance()->info(
@@ -117,10 +117,10 @@ class PRAutoBlogger_Source_Collector {
return null;
}
return [
return array(
'title' => $row['title'] ?? 'Reddit Discussion',
'selftext' => $row['content'] ?? '',
];
);
}
/**
@@ -175,7 +175,7 @@ class PRAutoBlogger_Source_Collector {
// ON DUPLICATE KEY UPDATE returns 2 for updates, 1 for inserts.
// Only count genuine inserts toward the "new" tally.
if ( false !== $result && 1 === (int) $result ) {
$inserted++;
++$inserted;
}
}
@@ -190,10 +190,10 @@ class PRAutoBlogger_Source_Collector {
* @return PRAutoBlogger_Source_Provider_Interface|null
*/
private function get_provider( string $source_type ): ?PRAutoBlogger_Source_Provider_Interface {
$providers = [
$providers = array(
'reddit' => PRAutoBlogger_Reddit_Provider::class,
'llm_research' => PRAutoBlogger_LLM_Research_Provider::class,
];
);
/**
* Filter the registered source providers.
@@ -230,20 +230,20 @@ class PRAutoBlogger_Source_Collector {
*/
private function get_config_for_source( string $source_type ): array {
if ( 'reddit' === $source_type ) {
return [
'subreddits' => json_decode( get_option( 'prautoblogger_target_subreddits', '[]' ), true ) ?: [],
return array(
'subreddits' => json_decode( get_option( 'prautoblogger_target_subreddits', '[]' ), true ) ?: array(),
'limit' => 25,
'time_filter' => 'day',
'include_comments' => true,
'comments_per_post' => 10,
];
);
}
if ( 'llm_research' === $source_type ) {
$config = [
$config = array(
'model' => get_option( 'prautoblogger_research_model', PRAUTOBLOGGER_DEFAULT_ANALYSIS_MODEL ),
'prompt' => get_option( 'prautoblogger_research_prompt', '' ),
];
);
// Pass the pipeline's cost tracker so research costs get tagged
// with the run_id for post-pipeline amortization across articles.
if ( null !== $this->cost_tracker ) {
@@ -252,6 +252,6 @@ class PRAutoBlogger_Source_Collector {
return $config;
}
return [];
return array();
}
}