Passed
Push — master ( 1493f0...d7aea6 )
by Dmitry
07:28 queued 10s
created

I::describe()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace PHPKitchen\CodeSpecs\Actor;
4
5
use PHPKitchen\CodeSpecs\Directive\Wait;
6
use PHPKitchen\CodeSpecs\Expectation\Routing\Router;
7
8
class I {
9
    public static function describe(string $scenario) {
0 ignored issues
show
Unused Code introduced by
The parameter $scenario 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

9
    public static function describe(/** @scrutinizer ignore-unused */ string $scenario) {

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...
10
11
    }
12
13
    public static function verify(string $scenario,  callable $verificationSteps = null) {
0 ignored issues
show
Unused Code introduced by
The parameter $scenario 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

13
    public static function verify(/** @scrutinizer ignore-unused */ string $scenario,  callable $verificationSteps = null) {

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...
Unused Code introduced by
The parameter $verificationSteps 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

13
    public static function verify(string $scenario,  /** @scrutinizer ignore-unused */ callable $verificationSteps = null) {

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...
14
15
    }
16
17
    public static function expect(string $scenario,  callable $verificationSteps = null) {
0 ignored issues
show
Unused Code introduced by
The parameter $scenario 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

17
    public static function expect(/** @scrutinizer ignore-unused */ string $scenario,  callable $verificationSteps = null) {

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...
Unused Code introduced by
The parameter $verificationSteps 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

17
    public static function expect(string $scenario,  /** @scrutinizer ignore-unused */ callable $verificationSteps = null) {

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...
18
19
    }
20
21
    public static function match(string $variableName) {
0 ignored issues
show
Unused Code introduced by
The parameter $variableName 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

21
    public static function match(/** @scrutinizer ignore-unused */ string $variableName) {

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...
22
23
    }
24
25
    /**
26
     * Stops execution for specified number of units of time.
27
     *
28
     * @param int $numberOfTimeUnits number of units of time.
29
     * {@link Wait} specifies what unit should be used.
30
     *
31
     * @return Wait
32
     */
33
    public static function wait($numberOfTimeUnits): Wait {
0 ignored issues
show
Unused Code introduced by
The parameter $numberOfTimeUnits 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

33
    public static function wait(/** @scrutinizer ignore-unused */ $numberOfTimeUnits): Wait {

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...
34
35
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return PHPKitchen\CodeSpecs\Directive\Wait. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
36
37
    public static function lookAt(string $variableName): Router {
0 ignored issues
show
Unused Code introduced by
The parameter $variableName 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

37
    public static function lookAt(/** @scrutinizer ignore-unused */ string $variableName): Router {

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...
38
        return new Router();
39
    }
40
41
    public static function usePlugin($plugin) {
0 ignored issues
show
Unused Code introduced by
The parameter $plugin 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

41
    public static function usePlugin(/** @scrutinizer ignore-unused */ $plugin) {

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...
42
43
    }
44
}
45