Skip to content

1.0.0 - PHP 7 Support, Score spec alignment

Compare
Choose a tag to compare
@brianjmiller brianjmiller released this 21 Sep 17:30
· 13 commits to master since this release

tl;dr Other than specific uses of Score or specific features of 5.4 the public interface has not changed.

  • Adds support for PHP 7 and drops support of PHP 5.4.
  • Makes the Score object act more inline with intention of specification, particularly around the use of the scaled property. (See dbd8b3f)
  • Add handling of und as language key in LanguageMap for when a language is not matched but it is present.

The reason for the major version bump is that PHP 7 changes handling of return value for empty string or null arguments to json_decode which affects the public interface of the FromJSONTrait implementation. 5.4 can be supported by recognizing this fact and either removing the call to json_last_error_msg() in JSONParseErrorException or by stubbing in a replacement for it (probably based on the one in the PHP docs), having said that PHP 5.4 is EOLd by the core team so there is no reason to maintain support for it going forward, and because we try to minimize major version bumps and maintain backwards compatibility it makes sense to drop EOLd versions at those major version bump points. The JSONParseErrorException is wholly unnecessary to get to support of PHP 7, but because we were breaking compatibility of that interface anyways it makes sense as an implementation wrapper around the more generic InvalidArgumentException.

PHP 5.5 is EOLd as of 21 Jul 2016 (see http://php.net/eol.php) but still has enough installed user base at this time that we'll continue to support it within the 1.x series. Expect support to be removed from the next major version of TinCanPHP. (Where "support" means we'll stop testing and trying to maintain backwards compatibility, but we won't intentionally be trying to break it.)