A minimal project that allows you to quickly create a new project based on Symfony using useful tools: standard-version, php-cs-fixer, phpstan, phpunit, docker, xdebug and my own starting script. It is ready to support debugging with Visual Studio Code - just look into .env.local ;).
Because personally, every time I start a new project, or a library for it, I have to do all this manually. For this, I made application skeletons for different uses: cli, api, library, and bundle, to speed up and standardize my own work. These skeletons uses this project.
Create directory for your project, get in (cd {Your directory}) and run command:
composer create-project pbaszak/skeleton . --no-interaction(Everytime) Start local environment using this command:
bash start.shand remove CHANGELOG.md (because it's owned by skeleton project. Your project will be have generated CHANGELOG.md after first release):
rm CHANGELOG.mdand voila! Your local environment is ready to development basic php app with useful tools.
If You don't have node_modules directory run:
npm installFirst release:
npm run version:first-releaseMajor, Minor, Patch version update:
npm run version:major
# or
npm run version:minor
# or
npm run version:patchPush tags:
npm run version:release
# or
npm run releaseCheck package.json for understand what commands do.
Main command:
docker exec php composer code:analysebut, if You need to add errors to ignored:
docker exec php composer code:analyse:bdocker exec php composer code:fixCreate new file in Your project: .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for xDebug",
"type": "php",
"request": "launch",
"port": 5902,
"hostname": "0.0.0.0",
"pathMappings": {
"/app/": "${workspaceRoot}"
}
}
]
}Uncomment environments in .env.local:
XDEBUG_MODE=develop,debug
XDEBUG_CONFIG=" client_port=5902 idekey=VSCODE client_host=host.docker.internal discover_client_host=0 start_with_request=yes"Type Ctrl + Shift + D and run Listen for xDebug.