doumu6941 2013-09-19 22:13
浏览 66
已采纳

什么放在composer.json

I understand that the title is not the best, but come on.

We have several tools that help in developing an application with PHP, as PHPUnit, PHPMD, PHP Depend, PHP Doc, and so on.

For example, I know that PHPUnit is essential in the require-dev, but what puzzles me is, for example, PHPCPD is a simple tool that helps us verify repeated codes in the application. PHP Documentator is a tool that generates documentation for the application.

I wonder, is it really necessary clog the composer.json with all these tools or have to separate some with composer.json and the other with the pear?.

Thank you all.

  • 写回答

1条回答 默认 最新

  • duanhuanzhi6431 2013-09-19 22:42
    关注

    This is a question of how to create a development environment. This is also a question of how a software gets deployed. In fact, there are so many individual influences - there can be no single correct answer.

    Answer these:

    How does a new developer start into your project? How long will it take him to run your test suite on a new machine? Which decisions about the development environment do you want to make instead of the new developer?

    If you say that any new developer should install his IDE, webserver, tools on his own, and your project only provides the environment to be able to run PHPUnit (i.e. include the version that is compatible with your test classes) - and everything else, including code analysis etc. is sugar on top, but not necessary, then it is ok to not include these dependencies.

    But if you want to actually enforce coding style, good software architecture, and fight code duplication, you better make it easy for everyone to submit new code, and check for himself whether the new code is correctly written and not violating the rules.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 无源定位系统的时差估计误差标准差
  • ¥15 请问这个代码哪里有问题啊
  • ¥20 python--version在命令端输入结果Python is not defined怎么办?还有pip不是exe格式是不是没安装成功?
  • ¥15 通过GaussianView进行结构微调消除虚频
  • ¥15 调用transformers库
  • ¥15 由于导出的数据名字中带有/,导致Matlab打不开,怎么办?
  • ¥15 新硬盘安装的程序总是崩溃,提示遇到错误
  • ¥15 openpcdet自制数据集评估bev精度和3d精度相同
  • ¥15 excel 上下按钮 显示行
  • ¥20 云卓h12pro 数传问题