已有數據庫,生成實體類
php bin/console doctrine:mapping:import “App\Entity” annotation --path=src/Entity
生成xml
php bin/console doctrine:mapping:import “App\Entity” xml --path=config/doctrine
添加getter和setter
php bin/console make:entity --regenerate App
建庫
php bin/console doctrine:database:create
打印sql
bin/console doctrine:schema:update --dump-sql
強制執行update
bin/console doctrine:schema:update --force
清緩存
php bin/console cache:clear --env=test
php bin/console cache:clear
單元測試
(依賴codeception/codeception)
vendor\bin\codecept run unit
單元測試覆蓋率 --html --coverage-html
vendor/bin/codecept run unit --coverage --coverage-text
vendor/bin/codecept run api --coverage --coverage-text
command執行
php bin/console --show database:run action1
代碼檢查
(依賴phpstan/phpstan-doctrine)
vendor/bin/phpstan analyse --level=3 -c phpstan.neon src
vendor/bin/phpstan analyse --level=3 -c phpstan.neon src --memory-limit=1G