hmazter / console-skeleton
Skeleton for a console application with DI-container and yaml-config
Installs: 63
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:project
pkg:composer/hmazter/console-skeleton
Requires
- php: ^8.4
- symfony/config: ^7.3
- symfony/console: ^7.3
- symfony/dependency-injection: ^7.3
- symfony/yaml: ^7.3
Requires (Dev)
- humbug/box: ^4.6
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^12.3
- symfony/var-dumper: ^7.3
This package is auto-updated.
Last update: 2025-09-19 14:37:54 UTC
README
Skeleton for a console application, including:
- DI-Container
- Services and commands autowired in yaml-config
- Example Command
- Example test
- Phar Builder
Getting started
This will create a new project with the skeleton for a console application:
composer create-project hmazter/console-skeleton the-new-app-name
cd the-new-app-name
The skeleton can then be executed with:
./app
Building distributable phar
A phar-file that can be distributed can be built with:
composer build
This will output the phar-file in the project root, named <project-directory-name>.phar
.
Running with docker
Build the app with:
docker-compose build
And run the app with docker with this command:
docker-compose run console ./app
Tests
Tests can be run with:
composer test
Static Code analyse
Code can be static analysed with PHPStan:
composer analyse
Continue building
Go ahead and:
- Edit/replace command in src/Commad/ExampleCommand
- Add more commands in src/Command
- Add additional classes that you need in src/
- Edit/replace the test in tests/Command/ExampleCommandTest