bredmor / comment-analyzer

Wrapper for the Google Perspective Comment Analyzer API
MIT License
8 stars 4 forks source link

Feature/managing array #11

Closed alessandro811020 closed 1 year ago

alessandro811020 commented 1 year ago

Hello,

Working with this library, we detect that removeLanguage functionality did not work, because unset() did not find $language as $this-languages[$language] as key value. Due to this, addLanguage creates an array with several languages and with array_unique allows have 'en.pt,es' as language when those values are used in buildApiData functionality-

Changes:

  1. change languages as key => value in addLanguage allowing associate language key with its respective value to be removed later
  2. strict in_array functionality to be remove as strue
  3. remove array_unique and use array_values to thet languages values when data has been built

test script were run and the result was: MicrosoftTeams-image (6)

Thanks

alessandro811020 commented 1 year ago

hello @bredmor

I create this PR because of a functionality issue found. If you may check it it would be great.

Thanks :)

hectorprats commented 1 year ago

nice

bredmor commented 1 year ago

Thank you for your contribution, I've merged it into the master branch and will tag a new release.

alessandro811020 commented 1 year ago

Thanks!