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