Skip to main content

PHP SDKs Are Now PSR-2 Compliant

· One min read

APIMATIC's PHP SDKs are now compliant with the PSR-2 Coding Style Guide

  • PSR-2 compliance means that the PHP code generated is guaranteed to be of high-quality.
  • PHP SDKs are written in a industry-standard code style to allow for maximum interoperability.
  • PHP SDKs can be tested for code style violation using the PHP Code Sniffer.

Re-generate your PHP SDKs now for the new changes.

Details

This change does not introduce any breaking changes in the PHP SDKs.

Testing for Code Style using PHP Code Sniffer

First you need to get the PHP_CodeSniffer. You can either download the Phar file:

curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar

Or install it globally using Composer:

composer global require "squizlabs/php_codesniffer=*"

You can now test the SDK code for PSR-2 standard compliance using:

# try this if PHP_CodeSniffer is downloaded as a PHAR
php phpcs.phar --standard=PSR2 src/

# or this if it is installed globally
phpcs --standard=PSR2 src/

For more information on the PHP Code Sniffer, see detailed documentation.