Debian Codegraph @

lib/3rdParty/composer/symfony/property-info/PropertyReadInfo.php

raw symbols SCIP
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
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 Symfony\Component\PropertyInfo;
13
14 /**
15 * The property read info tells how a property can be read.
16 *
17 * @author Joel Wurtz <[email protected]>
18 */
19 final class PropertyReadInfo
20 {
21 public const TYPE_METHOD = 'method';
22 public const TYPE_PROPERTY = 'property';
23
24 public const VISIBILITY_PUBLIC = 'public';
25 public const VISIBILITY_PROTECTED = 'protected';
26 public const VISIBILITY_PRIVATE = 'private';
27
28 public function __construct(
29 private readonly string $type,
30 private readonly string $name,
31 private readonly string $visibility,
32 private readonly bool $static,
33 private readonly bool $byRef,
34 ) {
35 }
36
37 /**
38 * Get type of access.
39 */
40 public function getType(): string
41 {
42 return $this->type;
43 }
44
45 /**
46 * Get name of the access, which can be a method name or a property name, depending on the type.
47 */
48 public function getName(): string
49 {
50 return $this->name;
51 }
52
53 public function getVisibility(): string
54 {
55 return $this->visibility;
56 }
57
58 public function isStatic(): bool
59 {
60 return $this->static;
61 }
62
63 /**
64 * Whether this accessor can be accessed by reference.
65 */
66 public function canBeReference(): bool
67 {
68 return $this->byRef;
69 }
70 }