일반적인 프로그래밍 질문으로 게시하고 싶습니다. 이유는 다른 문서 시스템이 태그를 다르게 처리하기 때문에 특정 언어에 대해 "옳은"또는 "잘못된"내용에 대한 자체 규칙을 적용하기 때문입니다.phpDocumentor/ApiGen @author 태그 위치
이제 해당 언어가 PHP입니다. 현재로서는 "표준"문서화 시스템이 없습니다. phpDocumentor가 있는데, 프로젝트가 구식이되는 것처럼 보입니다. ApiGen과 같은 현재 제품은 구문을 지원하기 위해 노력하는 것 같습니다.
하나의 태그 @author 태그는 어디에 넣을 지 잘 모릅니다. 나는 파일 수준의 문서 블록과 함께 배치하는 느낌. @copyright, @license, @package 및 @link와 함께 대신 클래스 수준의 의사 블록 안에. 일부 컨텍스트의 경우 : PHP 파일에는 각각 하나의 클래스 선언 만 있습니다.
그러나 나는이 사실을 받아 들일만한 표준으로지지하는 증거를 찾지 못했습니다. 실제로 어느 위치를 선호하는지 알 수있는 정보는 거의 없습니다. 그래서 아마도이 정보를 파일 수준의 문서 블록과 클래스 수준의 문서 블록에 모두 포함해야한다고 생각하게되었습니다.
몇 가지 예 : OpenEMR은 파일 수준 블록과 클래스 수준 1() 모두에서 @author를 사용하는 것을 선호합니다. 그러나 ApiGen (교리 ORM의 API에 의해 참조
/**
* library/sql_upgrade_fx.php Upgrading and patching functions of database.
*
* Functions to allow safe database modifications
* during upgrading and patches.
*
* Copyright (C) 2008-2012 Rod Roark <[email protected]>
*
* LICENSE: This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Rod Roark <[email protected]>
* @author Brady Miller <[email protected]>
* @link http://www.open-emr.org
*/
/**
* inline tags demonstration
*
* This class generates bars using the main algorithm, which also
* works heavily with {@link foo()} to rule the world. If I want
* to use the characters "{@link" in a docblock, I just use "{@}link." If
* I want the characters "{@*}" I use "{@}*}"
*
* @author ahobbit
* @copyright middleearth.org XVII
* @version 1.2.3
*/
class bar
{
}
두 가지 프로젝트 : 문서는이 파일이 클래스가 아니라 다수의 기능을 포함하지 않는 경우에만 동시에 발생하거나하도록 구성되어 있는지 여부를 지정하지 않습니다 및 Nette API)는 파일 수준 doc 블록에서 @author 태그를 사용하지 않고 클래스 수준 doc 블록과 만 사용합니다. 그렇지만 클래스 선언을 포함하여 어디에서 브라우징 할 때 나는 유일한 예제를 보았습니다. 또한 단지를 사용하는 동안,
/**
* Base contract for ORM queries. Base class for Query and NativeQuery.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <[email protected]>
* @author Guilherme Blanco <[email protected]>
* @author Jonathan Wage <[email protected]>
* @author Roman Borschel <[email protected]>
* @author Konsta Vesterinen <[email protected]>
*/
abstract class AbstractQuery
{ ... }
Nette :
교리는 클래스 수준의 문서 블록 (http://www.doctrine-project.org/api/orm/2.4/source-class-Doctrine.ORM.AbstractQuery.html#AbstractQuery) 안에, 내가 파일 수준의 문서 블록에 배치 생각했을 것이다, 다른 태그와 함께 @author 사용 @author 클래스/인터페이스 맥락에서 태그, 모든 @license의 @copyright 또는 @link를 사용하는 나타나지 않습니다
/**
* Translator adapter.
*
* @author David Grudl
*/
interface ITranslator
{...}
/**
* Component is the base class for all components.
*
* Components are objects implementing IComponent. They has parent component and own name.
*
* @author David Grudl
*
* @property-read string $name
* @property-read IContainer|NULL $parent
*/
abstract class Component extends Nette\Object implements IComponent
{...}
답장을 보내 주셔서 감사합니다. 파일 수준의 doc 블록과 클래스 수준 모두에서 가능하다는 것을 알고 있습니다. 나는 나의 예를 통해 그것을 보여주기를 희망했다. 내 질문은 어느 위치가 어떤 상황에 적합한 지 알아내는 것이 었습니다. 에서와 마찬가지로 @author 태그가 파일 수준 컨텍스트에서, 클래스 수준에서 컨텍스트에 있어야합니다. –
위의 편집을 참조하십시오. –
설명해 주셔서 대단히 감사합니다. 그것은 실제로 도움이되었습니다. 파일의 저자가 수업의 저자와 다른 것으로 생각되는 상황이 있습니까? 파일 레벨 블록에서 첫 번째 예에서 파일을 자동 생성 한 사람이 누구든 지 보관할 것이라는 것을 기대하지 않으십니까? 그렇다면 왜 관련성이 있습니까? 누가 레이아웃에 대한 초기 결정을했는지 확인할 수 있습니까? 이름과 이메일 주소만으로는 결론에 도달하기가 어려워야합니다. –