sms-counter-php icon indicating copy to clipboard operation
sms-counter-php copied to clipboard

Updates and PHP 8.1 compatibility

Open soundslocke opened this issue 3 years ago • 0 comments

First of all, thank you for publishing this library! It is helpful for handling SMS text content.

We created a fork and made some updates as a result of upgrading to PHP 8.1+ and seeing that this library dependency causes deprecation notices.

The following has been done:

  • Switch to PHP 8.1 method signatures.
  • Update required PHP version in composer.json file.
  • Update from switch to match expressions.
  • Replace array "get" methods with const arrays.
  • Add visibility to const values.
  • Remove redundant Gsm7bitExMap array.
  • Avoid juggling null in replaceNonGsmChars().

Additionally, we've pulled in the commits from PR https://github.com/instasent/sms-counter-php/pull/20 which seems like a worthwhile improvement to the library that we wanted for our fork. If you would rather merge that PR separately we can drop those commits from here.

If this PR gets merged you'll probably want to make a new major version release of the library since this does break backwards compatibility. Given this discussion about semver we would suggest a 1.0.0 release.

Resolves https://github.com/instasent/sms-counter-php/issues/23

soundslocke avatar Sep 04 '22 16:09 soundslocke