Skip to content

Commit

Permalink
Fix a few failing checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Jan 31, 2025
1 parent 7c01036 commit 8ea8e81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions includes/Classifai/Features/ImageTagsGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ImageTagsGenerator extends Feature {
*/
const ID = 'feature_image_tags_generator';

// phpcs:disable Squiz.PHP.Heredoc.NotAllowed
/**
* Prompt for generating tags.
*
Expand All @@ -34,6 +35,7 @@ class ImageTagsGenerator extends Feature {
- Another tag
- ...
EOD;
// phpcs:enable Squiz.PHP.Heredoc.NotAllowed

/**
* Constructor.
Expand Down
8 changes: 3 additions & 5 deletions includes/Classifai/Providers/Localhost/OllamaEmbeddings.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function register() {
* @return array
*/
public function modify_default_feature_settings( array $settings, $feature_instance ): array {
remove_filter( 'classifai_feature_classification_get_default_settings', [ $this, 'modify_default_feature_settings' ], 10, 2 );
remove_filter( 'classifai_feature_classification_get_default_settings', [ $this, 'modify_default_feature_settings' ], 10 );

if ( $feature_instance->get_settings( 'provider' ) !== static::ID ) {
return $settings;
Expand Down Expand Up @@ -410,10 +410,8 @@ public function regenerate_embeddings() {

/**
* Get the data to preview terms.
*
* @return array
*/
public function get_post_classifier_embeddings_preview_data(): array {
public function get_post_classifier_embeddings_preview_data() {
$nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : false;

if ( ! $nonce || ! wp_verify_nonce( $nonce, 'classifai-previewer-action' ) ) {
Expand All @@ -434,7 +432,7 @@ public function get_post_classifier_embeddings_preview_data(): array {
}
}

return wp_send_json_success( $embeddings_terms );
wp_send_json_success( $embeddings_terms );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public function generate_image_tags( string $image_url, int $attachment_id ) {
* @param int $attachment_id The attachment ID we're processing.
* @param string $route_to_call The name of the route we're going to be processing.
* @param array $args Optional arguments to pass to the route.
* @return array|string|WP_Error
* @return array|string|WP_Error|null
*/
public function rest_endpoint_callback( $attachment_id, string $route_to_call = '', array $args = [] ) {
// Check to be sure the post both exists and is an attachment.
Expand Down

0 comments on commit 8ea8e81

Please sign in to comment.