Issues (181)

Response/Builder/UsersResponseBuilder.php (13 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace SchulIT\IdpExchange\Response\Builder;
4
5
use SchulIT\IdpExchange\Response\UserResponse;
6
use SchulIT\IdpExchange\Response\UsersResponse;
7
8
class UsersResponseBuilder {
0 ignored issues
show
Missing doc comment for class UsersResponseBuilder
Loading history...
Opening brace of a class must be on the line after the definition
Loading history...
9
10
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
11
     * @var UserResponse[]
12
     */
13
    private $users = [ ];
0 ignored issues
show
Private member variable "users" must be prefixed with an underscore
Loading history...
14
15
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
16
     * @param UserResponse $userResponse
0 ignored issues
show
Missing parameter comment
Loading history...
Tag value for @param tag indented incorrectly; expected 2 spaces but found 1
Loading history...
17
     * @return UsersResponseBuilder
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
18
     */
19 1
    public function addUser(UserResponse $userResponse): UsersResponseBuilder {
0 ignored issues
show
Opening brace should be on a new line
Loading history...
20 1
        $this->users[] = $userResponse;
21 1
        return $this;
22
    }
23
24
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
25
     * @return UsersResponse
26
     */
27 1
    public function build(): UsersResponse {
0 ignored issues
show
Opening brace should be on a new line
Loading history...
28 1
        $response = new UsersResponse();
29
30 1
        foreach($this->users as $userResponse) {
0 ignored issues
show
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
31 1
            $response->users[] = clone $userResponse;
32
        }
33
34 1
        return $response;
35
    }
36
}