Skip to content

Architecture

adumont-payplug edited this page Jul 6, 2026 · 2 revisions

Namespace & autoloading

PSR-4 autoloaded under the PayplugUnifiedCore\ namespace:

  • PayplugUnifiedCore\src/ (library code)
  • PayplugUnifiedCore\Tests\tests/ (dev-only, test code)

src/ layout

src/ is organized into four top-level categories. New code should land in the matching category rather than introducing new top-level directories:

Directory Purpose
Contracts/ Interfaces shared across consuming plugins
Exceptions/ Library-specific exception types
Models/ Data/domain models
Utilities/Helpers/ Stateless helper functions

Design constraints

  • Runtime target: PHP 7.1+. The shipped code is bundled directly into plugin marketplace ZIPs — there's no live vendor/ install on the merchant's server, and that server may run an older PrestaShop/PHP stack. No PHP 7.2+ syntax (typed properties, arrow functions, constructor property promotion, match, enum, ...) is allowed in src/ or tests/.
  • Tooling floor: PHP 7.4+. composer.json's require.php reflects what's needed to run Composer/static analysis/tests during development and CI — not the runtime constraint above. The two are intentionally different and enforced separately (see Home for local commands).

Toolchain

Tool Purpose
PHPStan (level 8, targeting phpVersion: 70100) Static analysis, reasoning about the code as PHP 7.1
PHP-CS-Fixer (@PSR12 + @PHP71Migration) Code style
PHPUnit Unit tests
CaptainHook Git hooks (e.g. code style check on commit)

CI

Two categories of checks run on pull requests:

  • Compatibility — lints every file in src/ and tests/ with php -l across PHP 7.1/7.4/8.0/8.1/8.2, directly against the checked-out source (no Composer install involved). Proves the code parses on every supported runtime.
  • Quality — static analysis, code style, and unit tests on PHP 7.4 (the dev/CI tooling baseline).

PayPlug

unified-plugin-core

Core foundations shared library for Payplug e-commerce plugins


Guides


Back to repository

Clone this wiki locally