UserRequestBuilder::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 4
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace SchulIT\IdpExchange\Request\Builder;
4
5
use SchulIT\IdpExchange\Request\UserRequest;
6
7
class UserRequestBuilder {
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class UserRequestBuilder
Loading history...
Coding Style introduced by
Opening brace of a class must be on the line after the definition
Loading history...
8
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
9
     * @var string
10
     */
11
    private $username;
0 ignored issues
show
Coding Style introduced by
Private member variable "username" must be prefixed with an underscore
Loading history...
12
13
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
14
     * @param string $username
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value for @param tag indented incorrectly; expected 2 spaces but found 1
Loading history...
15
     * @return UserRequestBuilder
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
16
     */
17 1
    public function setUsername(string $username): UserRequestBuilder {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
18 1
        $this->username = $username;
19 1
        return $this;
20
    }
21
22
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
23
     * @return UserRequest
24
     */
25 1
    public function build(): UserRequest {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
26 1
        $request = new UserRequest();
27 1
        $request->username = $this->username;
28 1
        return $request;
29
    }
30
}