~ubuntu-branches/ubuntu/wily/php-codesniffer/wily

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-2.3.1/CodeSniffer/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml

  • Committer: Package Import Robot
  • Author(s): David Prévot, Greg Sherwood
  • Date: 2015-04-30 18:14:08 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20150430181408-1lpm509oq0mo1mmi
Tags: 2.3.2-1
[ Greg Sherwood ]
Prepare for 2.3.2 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<documentation title="Doc Comment Throws Tag">
2
 
    <standard>
3
 
    <![CDATA[
4
 
    If a function throws any exceptions, they should be documented in a @throws tag.
5
 
    ]]>
6
 
    </standard>
7
 
    <code_comparison>
8
 
        <code title="Valid: @throws tag used.">
9
 
        <![CDATA[
10
 
/**
11
 
 * <em>@throws Exception all the time</em>
12
 
 * @return void
13
 
 */
14
 
function foo()
15
 
{
16
 
    throw new Exception('Danger!');
17
 
}
18
 
]]>
19
 
        </code>
20
 
        <code title="Invalid: No @throws tag used for throwing function.">
21
 
        <![CDATA[
22
 
/**
23
 
 * @return void
24
 
 */
25
 
function foo()
26
 
{
27
 
    throw new Exception('Danger!');
28
 
}
29
 
]]>
30
 
        </code>
31
 
    </code_comparison>
32
 
</documentation>