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 4.8.6 4.8.7 4.8.8 4.8.9 4.9.0 4.9.1 4.9.10 4.9.11 4.9.12 4.9.13 4.9.14 4.9.15 4.9.16 4.9.17 4.9.18 4.9.19 4.9.2 4.9.20 4.9.21 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 4.9.8 4.9.9 trunk 1.1.5 1.2.1 1.2.3 1.2.4 1.2.5 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8
mailchimp-for-wp / includes / class-container.php
mailchimp-for-wp / includes Last commit date
admin 2 days ago api 4 weeks ago campaigns 2 days ago forms 2 days ago integrations 2 days ago views 1 week ago class-container.php 2 days ago class-debug-log-reader.php 2 days ago class-debug-log.php 2 days ago class-dynamic-content-tags.php 2 days ago class-field-formatter.php 1 year ago class-field-guesser.php 1 week ago class-list-data-mapper.php 4 months ago class-mailchimp-subscriber.php 2 months ago class-mailchimp.php 2 days ago class-personal-data-exporter.php 4 weeks ago class-plugin.php 1 year ago class-queue-job.php 4 weeks ago class-queue.php 1 year ago class-tools.php 1 year ago class-tracking-pixel.php 2 days ago default-actions.php 1 year ago default-filters.php 1 year ago deprecated-functions.php 3 years ago functions.php 2 days ago
class-container.php
130 lines
1 <?php
2
3 /**
4 * Class MC4WP_Service_Container
5 *
6 * @access private
7 * @ignore
8 */
9 class MC4WP_Container implements ArrayAccess
10 {
11 /**
12 * @var array
13 */
14 protected $services = [];
15
16 /**
17 * @var array
18 */
19 protected $resolved_services = [];
20
21 /**
22 * @param string $name
23 * @return boolean
24 */
25 public function has($name)
26 {
27 return isset($this->services[ $name ]);
28 }
29
30 /**
31 * @param string $name
32 *
33 * @return mixed
34 * @throws Exception
35 */
36 public function get($name)
37 {
38 if (! $this->has($name)) {
39 // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Exception text is not direct output and is escaped at render time.
40 throw new Exception(sprintf('No service named %s was registered.', $name));
41 }
42
43 $service = $this->services[ $name ];
44
45 // is this a resolvable service?
46 if (is_callable($service)) {
47 // resolve service if it's not resolved yet
48 if (! isset($this->resolved_services[ $name ])) {
49 $this->resolved_services[ $name ] = call_user_func($service);
50 }
51
52 return $this->resolved_services[ $name ];
53 }
54
55 return $this->services[ $name ];
56 }
57
58 /**
59 * (PHP 5 &gt;= 5.0.0)<br/>
60 * Whether a offset exists
61 * @link http://php.net/manual/en/arrayaccess.offsetexists.php
62 *
63 * @param mixed $offset <p>
64 * An offset to check for.
65 * </p>
66 *
67 * @return boolean true on success or false on failure.
68 * </p>
69 * <p>
70 * The return value will be casted to boolean if non-boolean was returned.
71 */
72 public function offsetExists($offset): bool
73 {
74 return $this->has($offset);
75 }
76
77 /**
78 * (PHP 5 &gt;= 5.0.0)<br/>
79 * Offset to retrieve
80 * @link http://php.net/manual/en/arrayaccess.offsetget.php
81 *
82 * @param mixed $offset <p>
83 * The offset to retrieve.
84 * </p>
85 *
86 * @return mixed Can return all value types.
87 */
88 // PHP 8.1 expects a mixed return type here, but the plugin still supports PHP 7.4.
89 #[\ReturnTypeWillChange]
90 public function offsetGet($offset)
91 {
92 return $this->get($offset);
93 }
94
95 /**
96 * (PHP 5 &gt;= 5.0.0)<br/>
97 * Offset to set
98 * @link http://php.net/manual/en/arrayaccess.offsetset.php
99 *
100 * @param mixed $offset <p>
101 * The offset to assign the value to.
102 * </p>
103 * @param mixed $value <p>
104 * The value to set.
105 * </p>
106 *
107 * @return void
108 */
109 public function offsetSet($offset, $value): void
110 {
111 $this->services[ $offset ] = $value;
112 }
113
114 /**
115 * (PHP 5 &gt;= 5.0.0)<br/>
116 * Offset to unset
117 * @link http://php.net/manual/en/arrayaccess.offsetunset.php
118 *
119 * @param mixed $offset <p>
120 * The offset to unset.
121 * </p>
122 *
123 * @return void
124 */
125 public function offsetUnset($offset): void
126 {
127 unset($this->services[ $offset ]);
128 }
129 }
130