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

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-1.5.0RC2/CodeSniffer/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.inc

  • Committer: Package Import Robot
  • Author(s): David Prévot
  • Date: 2014-07-21 14:42:41 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20140721144241-g4orlcuk4jzn9mhs
Tags: 1.5.3-1
* Team upload
* Focus on stable release
* Update copyright
* Bump standards version to 3.9.5
* Update Homepage
* Use ${phppear:…} instead of hardcoding them
* Run tests in dh_auto_test
* Update patch with gbp pq
* Simplify configuration installation
* Edit package.xml to move script
* Add DEP-8 tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
 
3
 
function foo($a, $b) {
4
 
    return $a * 2;
5
 
}
6
 
 
7
 
function baz($a, $b) {
8
 
    echo "baz({$a});";
9
 
}
10
 
 
11
 
function bar($a, $b) {
12
 
    $x = $b;
13
 
    for ($i = 0; $i <$a; $i++) {
14
 
        $x += $a * $i;
15
 
    }
16
 
    return $x;
17
 
}
18
 
 
19
 
function foobar($a, &$b) {
20
 
    return (preg_match('/foo/', $a, $b) !== 0);
21
 
}
22
 
 
23
 
class Foo {
24
 
    function barfoo($a, $b) {
25
 
        // Empty body means interface method in many cases.
26
 
    }
27
 
 
28
 
    function fooBar($a, $b) {
29
 
        return;
30
 
    }
31
 
}
32
 
 
33
 
function foo($bar)
34
 
{
35
 
    print <<<BAZ
36
 
    $bar
37
 
BAZ
38
 
}
39
 
 
40
 
function foo( $parameter ) {
41
 
    $wango = <<<HERE
42
 
1 Must be a HEREdoc of at least one line
43
 
HERE;
44
 
    $x = $parameter; // This line must be immediately after the HERE; with no intervening blank lines.
45
 
    $tango = <<<HERE
46
 
1 Must be a HEREdoc
47
 
48
 
49
 
50
 
5   
51
 
6
52
 
7
53
 
54
 
9 at least 9 lines long
55
 
HERE;
56
 
}
57
 
 
58
 
function foo( $parameter ) {
59
 
    return <<<HTML
60
 
<?xml version="1.0"?>
61
 
<value>$parameter</value>
62
 
HTML;
63
 
}
64
 
 
65
 
print foo( 'PARAMETER' );
66
 
print "\n";
67
 
 
68
 
function foo($bar)
69
 
{
70
 
    print "${bar} things\n";
71
 
}
72
 
 
73
 
function bar($x)
74
 
{
75
 
    return 2 * ${x};
76
 
}
 
 
b'\\ No newline at end of file'