PluginProbe ʕ •ᴥ•ʔ
Independent Analytics – WordPress Analytics Plugin / 2.2.0
Independent Analytics – WordPress Analytics Plugin v2.2.0
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 1.19.1 1.2 1.20.0 1.21.0 1.22.0 1.22.1 1.23.0 1.23.1 1.24.0 1.24.1 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.28.1 1.28.2 1.28.3 1.29.0 1.3 1.30.0 1.30.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0.0 2.0.1 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.10 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.13.1 2.13.2 2.13.5 2.13.6 2.14.0 2.14.1 2.14.2 2.14.4 2.14.6 2.14.7 2.14.8 2.14.9 2.2.0 2.2.1 2.3.1 2.3.2 2.4.2 2.4.3 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.1 2.7.2 2.7.3 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7
independent-analytics / vendor / illuminate / support / Fluent.php
independent-analytics / vendor / illuminate / support Last commit date
Facades 2 years ago Testing 2 years ago Traits 2 years ago AggregateServiceProvider.php 2 years ago Carbon.php 2 years ago Composer.php 2 years ago ConfigurationUrlParser.php 2 years ago DateFactory.php 2 years ago Env.php 2 years ago Fluent.php 2 years ago HigherOrderTapProxy.php 2 years ago HtmlString.php 2 years ago InteractsWithTime.php 2 years ago Js.php 2 years ago Manager.php 2 years ago MessageBag.php 2 years ago MultipleInstanceManager.php 2 years ago NamespacedItemResolver.php 2 years ago Optional.php 2 years ago Pluralizer.php 2 years ago ProcessUtils.php 2 years ago Reflector.php 2 years ago ServiceProvider.php 2 years ago Str.php 2 years ago Stringable.php 2 years ago Timebox.php 2 years ago ValidatedInput.php 2 years ago ViewErrorBag.php 2 years ago helpers.php 2 years ago
Fluent.php
181 lines
1 <?php
2
3 namespace IAWP_SCOPED\Illuminate\Support;
4
5 use ArrayAccess;
6 use IAWP_SCOPED\Illuminate\Contracts\Support\Arrayable;
7 use IAWP_SCOPED\Illuminate\Contracts\Support\Jsonable;
8 use JsonSerializable;
9 /** @internal */
10 class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable
11 {
12 /**
13 * All of the attributes set on the fluent instance.
14 *
15 * @var array
16 */
17 protected $attributes = [];
18 /**
19 * Create a new fluent instance.
20 *
21 * @param array|object $attributes
22 * @return void
23 */
24 public function __construct($attributes = [])
25 {
26 foreach ($attributes as $key => $value) {
27 $this->attributes[$key] = $value;
28 }
29 }
30 /**
31 * Get an attribute from the fluent instance.
32 *
33 * @param string $key
34 * @param mixed $default
35 * @return mixed
36 */
37 public function get($key, $default = null)
38 {
39 if (\array_key_exists($key, $this->attributes)) {
40 return $this->attributes[$key];
41 }
42 return \IAWP_SCOPED\value($default);
43 }
44 /**
45 * Get the attributes from the fluent instance.
46 *
47 * @return array
48 */
49 public function getAttributes()
50 {
51 return $this->attributes;
52 }
53 /**
54 * Convert the fluent instance to an array.
55 *
56 * @return array
57 */
58 public function toArray()
59 {
60 return $this->attributes;
61 }
62 /**
63 * Convert the object into something JSON serializable.
64 *
65 * @return array
66 */
67 #[\ReturnTypeWillChange]
68 public function jsonSerialize()
69 {
70 return $this->toArray();
71 }
72 /**
73 * Convert the fluent instance to JSON.
74 *
75 * @param int $options
76 * @return string
77 */
78 public function toJson($options = 0)
79 {
80 return \json_encode($this->jsonSerialize(), $options);
81 }
82 /**
83 * Determine if the given offset exists.
84 *
85 * @param string $offset
86 * @return bool
87 */
88 #[\ReturnTypeWillChange]
89 public function offsetExists($offset)
90 {
91 return isset($this->attributes[$offset]);
92 }
93 /**
94 * Get the value for a given offset.
95 *
96 * @param string $offset
97 * @return mixed
98 */
99 #[\ReturnTypeWillChange]
100 public function offsetGet($offset)
101 {
102 return $this->get($offset);
103 }
104 /**
105 * Set the value at the given offset.
106 *
107 * @param string $offset
108 * @param mixed $value
109 * @return void
110 */
111 #[\ReturnTypeWillChange]
112 public function offsetSet($offset, $value)
113 {
114 $this->attributes[$offset] = $value;
115 }
116 /**
117 * Unset the value at the given offset.
118 *
119 * @param string $offset
120 * @return void
121 */
122 #[\ReturnTypeWillChange]
123 public function offsetUnset($offset)
124 {
125 unset($this->attributes[$offset]);
126 }
127 /**
128 * Handle dynamic calls to the fluent instance to set attributes.
129 *
130 * @param string $method
131 * @param array $parameters
132 * @return $this
133 */
134 public function __call($method, $parameters)
135 {
136 $this->attributes[$method] = \count($parameters) > 0 ? $parameters[0] : \true;
137 return $this;
138 }
139 /**
140 * Dynamically retrieve the value of an attribute.
141 *
142 * @param string $key
143 * @return mixed
144 */
145 public function __get($key)
146 {
147 return $this->get($key);
148 }
149 /**
150 * Dynamically set the value of an attribute.
151 *
152 * @param string $key
153 * @param mixed $value
154 * @return void
155 */
156 public function __set($key, $value)
157 {
158 $this->offsetSet($key, $value);
159 }
160 /**
161 * Dynamically check if an attribute is set.
162 *
163 * @param string $key
164 * @return bool
165 */
166 public function __isset($key)
167 {
168 return $this->offsetExists($key);
169 }
170 /**
171 * Dynamically unset an attribute.
172 *
173 * @param string $key
174 * @return void
175 */
176 public function __unset($key)
177 {
178 $this->offsetUnset($key);
179 }
180 }
181