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

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-2.3.3/CodeSniffer/Standards/Generic/Docs/CodeAnalysis/UselessOverridingMethodStandard.xml

  • Committer: Package Import Robot
  • Author(s): David Prévot, Greg Sherwood
  • Date: 2015-06-24 13:41:36 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20150624134136-dv60dnl6s20tdxwr
Tags: 2.3.3-1
[ Greg Sherwood ]
Prepare for 2.3.3 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<documentation title="Useless Overriding Methods">
 
2
    <standard>
 
3
    <![CDATA[
 
4
    Methods should not be defined that only call the parent method.
 
5
    ]]>
 
6
    </standard>
 
7
    <code_comparison>
 
8
        <code title="Valid: A method that extends functionality on a parent method.">
 
9
        <![CDATA[
 
10
final class Foo
 
11
{
 
12
    public function bar()
 
13
    {
 
14
        parent::bar();
 
15
        <em>$this->doSomethingElse();</em>
 
16
    }
 
17
}
 
18
        ]]>
 
19
        </code>
 
20
        <code title="Invalid: An overriding method that only calls the parent.">
 
21
        <![CDATA[
 
22
final class Foo
 
23
{
 
24
    public function bar()
 
25
    {
 
26
        <em>parent::bar();</em>
 
27
    }
 
28
}
 
29
        ]]>
 
30
        </code>
 
31
    </code_comparison>
 
32
</documentation>