Quality

Minimum PHP Version

PHPLint

https://github.com/overtrue/phplint

xmllint

We use xmllint to lint XML files.

brew install xmlstarlet

ESLint

We use ESLint to lint JavaScript and JSON files.

JSON (JavaScript Object Notation)

A lot of payment providers use JSON driven API’s. Also in WordPress and the WordPress Pay library jSON is used very often. WordPress and PHP JSON functions are used very often. Since we increased the minimal PHP version to 5.6 (or higher) we also start to use JsonSerializable::jsonSerialize.

No ‘lock’ files in libraries

https://blog.martinhujer.cz/17-tips-for-using-composer-efficiently/

WordPress Coding Standards

https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards

Neutron PHP Standard

https://github.com/Automattic/phpcs-neutron-standard

Slevomat Coding Standard

https://github.com/slevomat/coding-standard

PHP – Name resolution rules – Fully Qualified names (FQN)

In the WordPress Pay library we will try to use Fully Qualified names (FQN) to take full advantage of PHP opcode. The “Slevomat Coding Standard” library can be used to check on this.

Symfony Security Check

Exclude non-essential files in .gitattributes.

Avoid too many static methods

PHPLOC

phploc is a tool for quickly measuring the size and analyzing the structure of a PHP project.

https://github.com/sebastianbergmann/phploc

Composer bin plugin — Isolate your bin dependencies

composer require --dev bamarni/composer-bin-plugin
composer bin phpstan require --dev phpstan/phpstan
composer bin psalm require --dev vimeo/psalm

.gitignore

# Composer bin plugin
/vendor-bin/**/vendor