NullCallback   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 28
ccs 4
cts 6
cp 0.6667
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A afterStateChange() 0 2 1
A onFailure() 0 3 1
A beforeStateChange() 0 2 1
1
<?php declare(strict_types=1);
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "NullCallback.php" doesn't match the expected filename "nullcallback.php"
Loading history...
2
3
namespace Star\Component\State\Callbacks;
4
5
use Star\Component\State\InvalidStateTransitionException;
6
use Star\Component\State\StateMachine;
7
8
final class NullCallback implements TransitionCallback
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
9
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class NullCallback
Loading history...
10
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
11
     * @param mixed $context
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 8 spaces after parameter type; 1 found
Loading history...
12
     * @param StateMachine $machine
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
13
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
14 1
    public function beforeStateChange($context, StateMachine $machine): void
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
15
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
16 1
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end beforeStateChange()
Loading history...
17
18
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
19
     * @param mixed $context
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 8 spaces after parameter type; 1 found
Loading history...
20
     * @param StateMachine $machine
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
21
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
22
    public function afterStateChange($context, StateMachine $machine): void
23
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
24
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end afterStateChange()
Loading history...
25
26
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
27
     * @param InvalidStateTransitionException $exception
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
28
     * @param mixed $context
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 27 spaces after parameter type; 1 found
Loading history...
29
     * @param StateMachine $machine
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 20 spaces after parameter type; 1 found
Loading history...
30
     *
31
     * @return string
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
32
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
33 1
    public function onFailure(InvalidStateTransitionException $exception, $context, StateMachine $machine): string
34
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
35 1
        throw new \RuntimeException('Method ' . __METHOD__ . ' should never be called.');
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
36
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end onFailure()
Loading history...
37
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
38