stringsRepository = $stringsRepository; } public function run( Collection $data ) { $domain = $data->get( 'domain', false ); $batchSize = $data->get( 'batchSize', 1 ); if ( $domain === false ) { return Either::left( __( 'Error: please try again', 'wpml-string-translation' ) ); } $strings = $this->stringsRepository->getFromDomains( [ $domain ], $batchSize ); if ( count( $strings ) > 0 ) { wpml_unregister_string_multi($strings); } return Either::of( [ 'completedCount' => count( $strings ), 'navigateToUrl' => admin_url( 'admin.php?page=' . WPML_ST_MENU_URL ), ] ); } }