maduser / argon-phinx
Phinx migration integration for the Argon runtime stack.
v1.0.0
2026-05-25 14:46 UTC
Requires
- php: ^8.2
- maduser/argon-console: ^1.0
- maduser/argon-container: ^1.0
- robmorgan/phinx: ^0.16
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.1
- phpunit/phpunit: ^11.5
- slevomat/coding-standard: ^8.24
- squizlabs/php_codesniffer: ^4.0
- vimeo/psalm: ^6.13
README
Phinx migration integration for the Argon runtime stack.
Installation
composer require maduser/argon-phinx
Service Providers
Register PhinxServiceProvider, then configure migrations from an application service provider.
use Maduser\Argon\Container\AbstractServiceProvider; use Maduser\Argon\Container\ArgonContainer; use Maduser\Argon\Phinx\Config\PhinxConfigRegistry; use Maduser\Argon\Phinx\Provider\PhinxServiceProvider; final class AppServiceProvider extends AbstractServiceProvider { #[\Override] public function register(ArgonContainer $container): void { $container->register(PhinxServiceProvider::class); $container->register(MigrationServiceProvider::class); } } final class MigrationServiceProvider extends AbstractServiceProvider { #[\Override] public function register(ArgonContainer $container): void { $basePath = $container->getParameters()->get('basePath'); assert(is_string($basePath)); $container->get(PhinxConfigRegistry::class) ->addMigrationPath($basePath . '/database/migrations') ->addEnvironment('default', [ 'adapter' => 'sqlite', 'name' => $basePath . '/storage/database/argon.sqlite', 'suffix' => '', ]) ->setDefaultEnvironment('default'); } }
For SQLite, Phinx appends .sqlite3 by default. Use 'suffix' => '' when the configured name is already the full database file path.
Console Commands
The provider exposes Phinx through the Argon console command tag:
php bin/console phinx:status php bin/console phinx:migrate php bin/console phinx:rollback php bin/console phinx:create CreateUsers
The command names are prefixed to avoid collisions with application commands.
Boundaries
- This package wires Phinx into Argon. It does not add a migration DSL.
- Applications own migration paths, seed paths, environments, and database credentials.
- Configuration is explicit service-provider code, not automatic file discovery.
- Multiple environments are supported through Phinx configuration arrays.
Quality Gates
composer check composer test:coverage composer psalm composer phpcs