style: auto-fix PHPCS violations via phpcbf
This commit is contained in:
@@ -107,7 +107,7 @@ class Peptide_News_Content_Filter_Rules {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( false !== strpos( $body_text, $keyword ) ) {
|
if ( false !== strpos( $body_text, $keyword ) ) {
|
||||||
$body_matches++;
|
++$body_matches;
|
||||||
$matched_keys[] = $keyword;
|
$matched_keys[] = $keyword;
|
||||||
$score += 15;
|
$score += 15;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class Peptide_News_Content_Filter {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ( 'promotional' === $result['verdict'] ) {
|
if ( 'promotional' === $result['verdict'] ) {
|
||||||
$removed++;
|
++$removed;
|
||||||
self::log( sprintf( 'Blocked (rule: %s, score: %d): %s', $result['rule'], $result['score'], $article['title'] ) );
|
self::log( sprintf( 'Blocked (rule: %s, score: %d): %s', $result['rule'], $result['score'], $article['title'] ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -87,10 +87,10 @@ class Peptide_News_Content_Filter {
|
|||||||
// Borderline articles go to LLM for a second opinion.
|
// Borderline articles go to LLM for a second opinion.
|
||||||
if ( 'borderline' === $result['verdict'] && self::is_llm_filter_enabled() ) {
|
if ( 'borderline' === $result['verdict'] && self::is_llm_filter_enabled() ) {
|
||||||
$llm_verdict = self::classify_with_llm( $article );
|
$llm_verdict = self::classify_with_llm( $article );
|
||||||
$llm_checked++;
|
++$llm_checked;
|
||||||
|
|
||||||
if ( 'promotional' === $llm_verdict ) {
|
if ( 'promotional' === $llm_verdict ) {
|
||||||
$removed++;
|
++$removed;
|
||||||
self::log( sprintf( 'Blocked (LLM confirmed borderline): %s', $article['title'] ) );
|
self::log( sprintf( 'Blocked (LLM confirmed borderline): %s', $article['title'] ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class Peptide_News_Fetcher {
|
|||||||
$stored = 0;
|
$stored = 0;
|
||||||
foreach ( $articles as $article ) {
|
foreach ( $articles as $article ) {
|
||||||
if ( $this->store_article( $article ) ) {
|
if ( $this->store_article( $article ) ) {
|
||||||
$stored++;
|
++$stored;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class Peptide_News_LLM_Client {
|
|||||||
$retry_after = wp_remote_retrieve_header( $response, 'retry-after' );
|
$retry_after = wp_remote_retrieve_header( $response, 'retry-after' );
|
||||||
$wait = $retry_after ? min( (int) $retry_after, 30 ) : $backoff;
|
$wait = $retry_after ? min( (int) $retry_after, 30 ) : $backoff;
|
||||||
sleep( $wait );
|
sleep( $wait );
|
||||||
$retries++;
|
++$retries;
|
||||||
$backoff *= 2;
|
$backoff *= 2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ class Peptide_News_LLM {
|
|||||||
$result = self::process_article( $article );
|
$result = self::process_article( $article );
|
||||||
|
|
||||||
if ( ! empty( $result['success'] ) ) {
|
if ( ! empty( $result['success'] ) ) {
|
||||||
$processed++;
|
++$processed;
|
||||||
}
|
}
|
||||||
if ( ! empty( $result['errors'] ) ) {
|
if ( ! empty( $result['errors'] ) ) {
|
||||||
$last_errors = $result['errors'];
|
$last_errors = $result['errors'];
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class Peptide_News_Source_Resolver {
|
|||||||
|
|
||||||
if ( ! empty( $new_source ) && $new_source !== $article->source ) {
|
if ( ! empty( $new_source ) && $new_source !== $article->source ) {
|
||||||
$wpdb->update( $table, array( 'source' => $new_source ), array( 'id' => $article->id ), array( '%s' ), array( '%d' ) );
|
$wpdb->update( $table, array( 'source' => $new_source ), array( 'id' => $article->id ), array( '%s' ), array( '%d' ) );
|
||||||
$updated++;
|
++$updated;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user