Open nathanczachur opened 3 years ago
First, thanks for a great package! This has saved me a lot of time!
I have found a bug with incorrect return types. I will look into it myself, but wanted to start the issue here.
File: src/Api/StichozaApiTranslate.php:30
StichozaApiTranslate->translate has a return type of string. But the GoogleTranslate->handle can return null or string (See method return type)
Also, the StichozaApiTranslate->translate returns false in the try catch. This will break at some point too.
Do you think we should go for: If a translation cannot be found for whatever reason, is the expected behaviour to return null instead of a string?
The specific translation I have is an empty string:
This is the only line that fails, which is likely why GoogleTranslate returned null instead of a string.
First, thanks for a great package! This has saved me a lot of time!
I have found a bug with incorrect return types. I will look into it myself, but wanted to start the issue here.
File: src/Api/StichozaApiTranslate.php:30
StichozaApiTranslate->translate has a return type of string. But the GoogleTranslate->handle can return null or string (See method return type)
Also, the StichozaApiTranslate->translate returns false in the try catch. This will break at some point too.
Do you think we should go for: If a translation cannot be found for whatever reason, is the expected behaviour to return null instead of a string?