|
|
|
|
@ -20,7 +20,7 @@ class FakeTextProcessingProviderSync implements IProviderWithExpectedRuntime { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function process(string $prompt): string { |
|
|
|
|
return strrev($prompt) . ' (done with FakeTextProcessingProviderSync)'; |
|
|
|
|
return $this->mb_strrev($prompt) . ' (done with FakeTextProcessingProviderSync)'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getTaskType(): string { |
|
|
|
|
@ -30,4 +30,15 @@ class FakeTextProcessingProviderSync implements IProviderWithExpectedRuntime { |
|
|
|
|
public function getExpectedRuntime(): int { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Reverse a miltibyte string. |
|
|
|
|
* |
|
|
|
|
* @param string $string The string to be reversed. |
|
|
|
|
* @return string The reversed string |
|
|
|
|
*/ |
|
|
|
|
private function mb_strrev(string $string): string { |
|
|
|
|
$chars = mb_str_split($string, 1); |
|
|
|
|
return implode('', array_reverse($chars)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|