Passed
Push — develop ( 45600c...ff69f6 )
by Paul
03:16
created

VisibilityTrait::setVisibility()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace PhpUnitGen\Model\PropertyTrait;
4
5
use PhpUnitGen\Model\ModelInterface\VisibilityInterface;
0 ignored issues
show
Bug introduced by
The type PhpUnitGen\Model\ModelIn...ace\VisibilityInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
/**
8
 * Trait VisibilityTrait.
9
 *
10
 * @author     Paul Thébaud <[email protected]>.
11
 * @copyright  2017-2018 Paul Thébaud <[email protected]>.
12
 * @license    https://opensource.org/licenses/MIT The MIT license.
13
 * @link       https://github.com/paul-thebaud/phpunit-generator
14
 * @since      Class available since Release 2.0.0.
15
 */
16
trait VisibilityTrait
17
{
18
    /**
19
     * @var int|null $visibility The visibility as an integer constant.
20
     */
21
    protected $visibility = VisibilityInterface::UNKNOWN;
22
23
    /**
24
     * @param int|null $visibility The new visibility to set.
25
     */
26
    public function setVisibility(?int $visibility): void
27
    {
28
        $this->visibility = $visibility;
29
    }
30
31
    /**
32
     * @return int|null The current visibility.
33
     */
34
    public function getVisibility(): ?int
35
    {
36
        return $this->visibility;
37
    }
38
}
39