foundry
foundry copied to clipboard
docs: Improve initial Setup to contribute on this Bundle
Maybe its a good idea so write somewhere how to setup/use this repo in an easy way to prevent searching all whats needed.
Running tests
locally i installed phpunit instead of running php vendor/bin/simple-phpunit
Problem Step by step Debugging in PHPStorm IDE which uses per default normal phpunit and its more handy then using the CLI.
Solution
composer require phpunit/phpunit --dev
Then you can run php vendor/bin/phpunit which also fixes running unit tests in PHPStorm via the small icons
Setup
Problem Needs time to setup this here to start contribute
Solution Add some dockerized files that we can fast start working.
CSFixer
Problem Missing binary in bin folder
Solution composer require friendsofphp/php-cs-fixer --dev then you can run php vendor/bin/php-cs-fixer fix ..
Running migration
Problem How to generate new migrations?
Solution Not found yet run php vendor/bin/doctrine-migrations migrations:generate didnt work -> missing configuration.
edit
I have to closer look into this issue, first steps works now 💪

Thanks for jotting down your issues. Yes, I'd like to add a contributing section to the readme.
Running tests
I'd like to maintain the bridge to avoid dependency conflicts. For PhpStorm, there is a solution: https://stackoverflow.com/questions/47569173/how-to-configure-phpstorm-to-use-symfony-phpunit-bridge (happy to include a link to this)
Setup
I agree but have no/little experience with docker but create a PR with your setup and we can discuss further.
CSFixer
I'm planning to remove this as a PR check and just use an action to auto-commit fixes after merge. This shouldn't be a roadblock to contributing.
Running migration
I'd be happy to formalize these steps.
For the CSFixer i like Husky. Then you can setup a git pre-commit hook which can be commited to the repo. But its required npm..
https://github.com/typicode/husky
For docker, I feel something like https://github.com/nektos/act would be best (assuming it works as described). What would be nice about this solution is we wouldn't have to keep docker config and gh actions config in sync.
needs to test.
Hi @kbond
act does not work with reusable workflows... then it won't be possible to use it
Ah ok, I think just a docker compose file that provides mysql/postgres/sqlite/mongo?
I think this would do the trick. that's how I'm using it
but csfixer needs to be installed globally... can't we do the same trick than for psalm?
can't we do the same trick than for psalm
Yep, that'd be fine I think.
How to generate new migrations?
This would be very useful. Going to need to do this in #300.
Would be very helpful indeed
I have to closer look into this issue, first steps works now muscle
@benblub, how did you get the migrations running? (cc @nikophil)
good question 🤦
A good entry point https://www.doctrine-project.org/projects/migrations.html https://www.doctrine-project.org/projects/doctrine-migrations/en/3.5/reference/introduction.html#introduction https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/schema-representation.html https://github.com/mnapoli/dbal-schema
Unfortunately I don't have so much time at the moment, I have to see when I will find time for it. I really like that currently they are working on making the contribute easier 💪 💪 💪
Hi!
here are some hints about this:
Running tests
since we will soon have a docker stack, ~I'll provide xdebug in the php image. In my experience, there is actually no problem in using both xdebug and simple-phpunit~.
EDIT: I've added xdebug in the image, tested that we can indeed perform step by step xdebug session, and added a little bit of docs for making this work in phpstrom.
Setup
you may find your needs in https://github.com/zenstruck/foundry/pull/306 :) don't hesitate to comment out the PR.
CSFixer
This is provided by the mentioned PR. A make target is also present.
Running migration
I wrote some thoughts here: https://github.com/zenstruck/foundry/issues/308
I think this could be closed, follow up of the migrations stuff in #308