/
PropertyReadInfo.php
82 lines (67 loc) · 1.68 KB
/
PropertyReadInfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\PropertyInfo;
/**
* The property read info tells how a property can be read.
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*
* @internal
*/
final class PropertyReadInfo
{
public const TYPE_METHOD = 'method';
public const TYPE_PROPERTY = 'property';
public const VISIBILITY_PUBLIC = 'public';
public const VISIBILITY_PROTECTED = 'protected';
public const VISIBILITY_PRIVATE = 'private';
private $type;
private $name;
private $visibility;
private $static;
private $byRef;
public function __construct(string $type, string $name, string $visibility, bool $static, bool $byRef)
{
$this->type = $type;
$this->name = $name;
$this->visibility = $visibility;
$this->static = $static;
$this->byRef = $byRef;
}
/**
* Get type of access.
*/
public function getType(): string
{
return $this->type;
}
/**
* Get name of the access, which can be a method name or a property name, depending on the type.
*/
public function getName(): string
{
return $this->name;
}
public function getVisibility(): string
{
return $this->visibility;
}
public function isStatic(): bool
{
return $this->static;
}
/**
* Whether this accessor can be accessed by reference.
*/
public function canBeReference(): bool
{
return $this->byRef;
}
}