PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.0.3
WindPress – Tailwind CSS integration for WordPress v3.0.3
3.2.90 3.2.89 3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 All 144 releases
windpress / vendor / symfony / property-info / PropertyWriteInfo.php

PropertyWriteInfo.php in WindPress – Tailwind CSS integration for WordPress 3.0.3, at vendor/symfony/property-info/PropertyWriteInfo.php

104 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 WindPressPackages\Symfony\Component\PropertyInfo;
12
13 /**
14 * The write mutator defines how a property can be written.
15 *
16 * @author Joel Wurtz <jwurtz@jolicode.com>
17 *
18 * @internal
19 */
20 final class PropertyWriteInfo
21 {
22 public const TYPE_NONE = 'none';
23 public const TYPE_METHOD = 'method';
24 public const TYPE_PROPERTY = 'property';
25 public const TYPE_ADDER_AND_REMOVER = 'adder_and_remover';
26 public const TYPE_CONSTRUCTOR = 'constructor';
27 public const VISIBILITY_PUBLIC = 'public';
28 public const VISIBILITY_PROTECTED = 'protected';
29 public const VISIBILITY_PRIVATE = 'private';
30 private $type;
31 private $name;
32 private $visibility;
33 private $static;
34 private $adderInfo;
35 private $removerInfo;
36 private $errors = [];
37 public function __construct(string $type = self::TYPE_NONE, ?string $name = null, ?string $visibility = null, ?bool $static = null)
38 {
39 $this->type = $type;
40 $this->name = $name;
41 $this->visibility = $visibility;
42 $this->static = $static;
43 }
44 public function getType() : string
45 {
46 return $this->type;
47 }
48 public function getName() : string
49 {
50 if (null === $this->name) {
51 throw new \LogicException("Calling getName() when having a mutator of type {$this->type} is not tolerated.");
52 }
53 return $this->name;
54 }
55 public function setAdderInfo(self $adderInfo) : void
56 {
57 $this->adderInfo = $adderInfo;
58 }
59 public function getAdderInfo() : self
60 {
61 if (null === $this->adderInfo) {
62 throw new \LogicException("Calling getAdderInfo() when having a mutator of type {$this->type} is not tolerated.");
63 }
64 return $this->adderInfo;
65 }
66 public function setRemoverInfo(self $removerInfo) : void
67 {
68 $this->removerInfo = $removerInfo;
69 }
70 public function getRemoverInfo() : self
71 {
72 if (null === $this->removerInfo) {
73 throw new \LogicException("Calling getRemoverInfo() when having a mutator of type {$this->type} is not tolerated.");
74 }
75 return $this->removerInfo;
76 }
77 public function getVisibility() : string
78 {
79 if (null === $this->visibility) {
80 throw new \LogicException("Calling getVisibility() when having a mutator of type {$this->type} is not tolerated.");
81 }
82 return $this->visibility;
83 }
84 public function isStatic() : bool
85 {
86 if (null === $this->static) {
87 throw new \LogicException("Calling isStatic() when having a mutator of type {$this->type} is not tolerated.");
88 }
89 return $this->static;
90 }
91 public function setErrors(array $errors) : void
92 {
93 $this->errors = $errors;
94 }
95 public function getErrors() : array
96 {
97 return $this->errors;
98 }
99 public function hasErrors() : bool
100 {
101 return (bool) \count($this->errors);
102 }
103 }
104