我如何评论我正在从其他作者处修改的 PHP 类?
我正在修改另一个作者编写的一个类。我想知道在文档中添加我的修改的正确方法是什么,同时确保对原作者给予适当的认可。我应该重置版本控制还是继续?我应该添加到原始 PHPDoc 注释中还是应该创建自己的单独块?
There is a class that I am modifying that another author has written. I am wondering what is the right way add my modifications to the documentation while making sure that proper credit is given to the original author. Should I reset the versioning or continue it? Should I add to the original PHPDoc comments or should I create my own separate block?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用版本控制系统,例如 git、mercurial 或 subversion,并对代码执行任何需要的操作。提交中的日志条目将识别谁更改了什么。
除此之外,如果您仅更改内联文档,请在更改日志中添加一行以指示您所做的事情。您可能会更改版本号,但这是有争议的。
you should use a version control system such as git, mercurial or subversion, and do whatever is needed to the code. Log entries in your commits will identify who changed what.
Barring that, if you are changing only inline documentation, add a line to the changelog indicating what you did. You might bump the version number, but that's debatable.
在我看来,您好像在问应该如何更新文档块的信息值,而不是记录您所做的修改。如果是这样,则只需在文档块的描述中添加附加信息,并添加任何新的 @ 标签(如果适用)。
如果您仍然想突出作者身份,请使用 @author 标签来显示原文和您自己。
It sounds to me like you're asking how you should update the informational value of the docblock, rather than record that you've made modifications. If so, then just add your additional information in the docblock's description, and add any new @ tags if they apply.
If you are still wanting to highlight authorship, then use @author tags to show the original(s) and yourself.