Test Setup Failed
Branch master (1c631b)
by Scott
03:15
created

testing()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Ignored due to being intentionally bad
4
 * @codingStandardsIgnoreStart
5
 *
6
 * @SuppressWarnings(PHPMD)
7
 */
8
class A {
9
    /**
10
     * @param int $c
11
     */
12
    function B($c)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Unused Code introduced by
The parameter $c is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

12
    function B(/** @scrutinizer ignore-unused */ $c)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
    {
14
15
    }
16
}
17
18
$a = new A;
19
$a->B("C");
0 ignored issues
show
Bug introduced by
'C' of type string is incompatible with the type integer expected by parameter $c of A::B(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
$a->B(/** @scrutinizer ignore-type */ "C");
Loading history...
20
/**
21
 * @SuppressWarnings(PHPMD)
22
 */
23
function testing (int $a) {
0 ignored issues
show
Unused Code introduced by
The parameter $a is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

23
function testing (/** @scrutinizer ignore-unused */ int $a) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
}
25
26
if (false) {
27
    testing("hello");
0 ignored issues
show
Bug introduced by
'hello' of type string is incompatible with the type integer expected by parameter $a of testing(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

27
    testing(/** @scrutinizer ignore-type */ "hello");
Loading history...
28
}
29
30
// @codingStandardsIgnoreEnd
31