Skip to content

v2.0.0-beta: New specification-based interface (next to the human-friendly interface)

Pre-release
Pre-release

Choose a tag to compare

@lode lode released this 17 Feb 19:03
4700695

v2's main feature is having a strict specification-based interface for building documents. This is added next to keeping the human-friendly interface for people who don't know the spec, and don't want to get to know it.

Further php7 is supported next to php5, and unit tests and json-output tests are added for the whole library.

This release is breaking backwards compatibility with v1. However, most of the interface and output stayed the same. See the UPGRADE doc on how to upgrade.

The main reasons for the BC break are:

  • the jsonapi specification started to recommend CamelCase in their v1.1, thus all method names changed
  • php7 marks resource a reserved keyword, thus the main class name changed (php5 is still supported, however support for php5.4 and php5.5 is dropped)
  • the current implementation offers too little flexibility for future extensions of the spec

See the examples for more information.

Note: v2.0 of the library doesn't yet support v1.1 of the specification.