A   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
dl 0
loc 6
rs 10
c 1
b 0
f 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A B() 0 2 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 8 and the first side effect is on line 18.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
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