Updates and PHP 8.1 compatibility
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
switchtomatchexpressions. - Replace array "get" methods with const arrays.
- Add visibility to const values.
- Remove redundant
Gsm7bitExMaparray. - Avoid juggling
nullinreplaceNonGsmChars().
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