Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do the TODOs + code cleanup. #317

Merged
merged 5 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions includes/Classifai/Command/ClassifaiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ public function post( $args = [], $opts = [] ) {
$output = $classifier->classify( $post_id, $opts );
$this->print( $output, $post_id );
}

$this->gc( $index );
}

$progress_bar->finish();
Expand Down Expand Up @@ -503,20 +501,6 @@ private function get_attachment_to_classify( $opts = [] ) {
return $images;
}

/**
* TODO: gc
*
* @param int $index The index.
*/
private function gc( $index ) {
if ( 0 === $index % 10 ) {
// TODO
return true;
} else {
return false;
}
}

/**
* Prints the output from the NLU API.
*
Expand Down
4 changes: 1 addition & 3 deletions includes/Classifai/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ public function init_services() {
];

foreach ( $this->services as $service ) {
if ( $service->can_register() ) {
$service->register();
}
$service->register();
}
}

Expand Down
83 changes: 0 additions & 83 deletions includes/Classifai/Providers/AWS/Comprehend.php

This file was deleted.

7 changes: 1 addition & 6 deletions includes/Classifai/Providers/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,8 @@ abstract public function setup_fields_sections();
* Sanitization
*
* @param array $settings The settings being saved.
*
* @return array|mixed
*/
public function sanitize_settings( $settings ) {
// TODO: Implement sanitize_settings() method.
return $settings;
}
abstract public function sanitize_settings( $settings );

/**
* Provides debug information related to the provider.
Expand Down
10 changes: 0 additions & 10 deletions includes/Classifai/Services/ServicesManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ public function __construct( $services = [] ) {
$this->get_menu_title();
}

/**
* The admin_support items require this method.
*
* @todo remove this requirement.
* @return bool
*/
public function can_register() {
return true;
}

/**
* Register the actions required for the settings page.
*/
Expand Down