程式規範
coding style
遵守 PSR2 規範,使用 phpcs 和 phpcbf 協助檢查
團隊成員應該學會怎樣使用這兩個工具
PHP_CodeSniffer 檢查程式碼標準 phpcs phpcbf
程式碼結構
使用 laravel + l5-repository
實現 MVC + repository 結構
手動維護 Service 層
減少參數數量時可以使用 Data Transfer Object
https://github.com/andersao/l5-repository
Static Analysis Tool
https://github.com/phpstan/phpstan
使用起來很簡易,但是背後卻有很多學問的工具
其他規範
參考 cleancode
資料庫
資料庫結構
資料庫正規化,研究到第三正規化
mongoDB
索引
API
使用 jwt-auth 實現 jwt 認證機制
https://github.com/tymondesigns/jwt-auth
API 文件
使用 swagger 進行維護
https://swagger.io/specification/
測試
使用 phpunit 進行測試,採取先做系統,之後針對 bug 補充測試的策略
Anti-Pattern 11 - Treating TDD as a religion
主機架構
使用 docker 維護
版本維護
使用 git flow
Git怎麼這麼難用?Git Flow + 好習慣 = 不再苦惱