DeepLcom / deepl-php

Official PHP library for the DeepL language translation API.
MIT License
202 stars 23 forks source link

Add phpstan-return annotation to translateText #41

Closed VincentLanglet closed 7 months ago

VincentLanglet commented 7 months ago

Hi @daniel-jones-deepl,

When using static analysis tool like PHPStan or Psalm, it is possible to explain that the return type of translateText

Cf https://phpstan.org/blog/phpstan-1-6-0-with-conditional-return-types#conditional-return-types

This would be helpful to help the tool understanding better the result type and avoid useless extra checks.

JanEbbing commented 7 months ago

Sure, we have this in python already. I'll review this today.

JanEbbing commented 7 months ago

LGTM

VincentLanglet commented 6 months ago

Thanks. Do you think a new tag would be possible ? Or is one planned soon ?

JanEbbing commented 6 months ago

Yes, I will make a new release, I had some issue with it on friday

JanEbbing commented 6 months ago

Hi @VincentLanglet , sorry I just noticed a new release would include release for Arabic in the new Version. Is this urgent or can it wait a few days?

VincentLanglet commented 6 months ago

Hi @VincentLanglet , sorry I just noticed a new release would include release for Arabic in the new Version. Is this urgent or can it wait a few days?

Hi @JanEbbing , it's not urgent.

Also maybe the new release could include a fix for https://github.com/DeepLcom/deepl-php/pull/43#issue-2146235966 if the issue is on this library side.

JanEbbing commented 6 months ago

I think that issue is API-side. I remember a case where a Dotnet user had the same problem for a different text - ill report it to the responsible team, but not sure this can be fixed quickly.

JanEbbing commented 6 months ago

@VincentLanglet released in v1.7.0 now