Completed
Push — master ( cfed93...a79400 )
by Phecho
03:52
created

UpdateProjectNamespaceCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4286
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 * 
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gitamin\Commands\ProjectNamespace;
13
14
use Gitamin\Models\ProjectNamespace;
15
16
final class UpdateProjectNamespaceCommand
17
{
18
    /**
19
     * The project team.
20
     *
21
     * @var \Gitamin\Models\ProjectTeam
22
     */
23
    public $team;
24
25
    /**
26
     * The project team name.
27
     *
28
     * @var string
29
     */
30
    public $name;
31
32
    /**
33
     * The project team slug.
34
     *
35
     * @var string
36
     */
37
    public $slug;
38
39
    /**
40
     * The project team order.
41
     *
42
     * @var int
43
     */
44
    public $order;
45
46
    /**
47
     * The validation rules.
48
     *
49
     * @var string[]
50
     */
51
    public $rules = [
52
        'name'  => 'string',
53
        'name'  => 'string',
54
        'order' => 'int',
55
    ];
56
57
    /**
58
     * Create a add project team command instance.
59
     *
60
     * @param \Gitamin\Models\ProjectTeam $team
61
     * @param string                      $name
62
     * @param string                      $slug
63
     * @param int                         $order
64
     *
65
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
66
     */
67
    public function __construct(ProjectTeam $team, $name, $slug, $order)
68
    {
69
        $this->team = $team;
0 ignored issues
show
Documentation Bug introduced by
It seems like $team of type object<Gitamin\Commands\...tNamespace\ProjectTeam> is incompatible with the declared type object<Gitamin\Models\ProjectTeam> of property $team.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
70
        $this->name = $name;
71
        $this->slug = $slug;
72
        $this->order = (int) $order;
73
    }
74
}
75