PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 4.9.0
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v4.9.0
4.9.0 0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / vendor_prefixed / google / apiclient / src / Collection.php
wp-mail-smtp / vendor_prefixed / google / apiclient / src Last commit date
AccessToken 5 days ago AuthHandler 5 days ago Http 5 days ago Service 5 days ago Task 5 days ago Utils 5 days ago Client.php 5 days ago Collection.php 5 days ago Exception.php 5 days ago Model.php 5 days ago Service.php 5 days ago aliases.php 5 days ago
Collection.php
105 lines
1 <?php
2
3 namespace WPMailSMTP\Vendor\Google;
4
5 /**
6 * Extension to the regular Google\Model that automatically
7 * exposes the items array for iteration, so you can just
8 * iterate over the object rather than a reference inside.
9 */
10 class Collection extends Model implements \Iterator, \Countable
11 {
12 protected $collection_key = 'items';
13 /** @return void */
14 #[\ReturnTypeWillChange]
15 public function rewind()
16 {
17 if (isset($this->{$this->collection_key}) && \is_array($this->{$this->collection_key})) {
18 \reset($this->{$this->collection_key});
19 }
20 }
21 /** @return mixed */
22 #[\ReturnTypeWillChange]
23 public function current()
24 {
25 $this->coerceType($this->key());
26 if (\is_array($this->{$this->collection_key})) {
27 return \current($this->{$this->collection_key});
28 }
29 }
30 /** @return mixed */
31 #[\ReturnTypeWillChange]
32 public function key()
33 {
34 if (isset($this->{$this->collection_key}) && \is_array($this->{$this->collection_key})) {
35 return \key($this->{$this->collection_key});
36 }
37 }
38 /** @return mixed */
39 #[\ReturnTypeWillChange]
40 public function next()
41 {
42 return \next($this->{$this->collection_key});
43 }
44 /** @return bool */
45 #[\ReturnTypeWillChange]
46 public function valid()
47 {
48 $key = $this->key();
49 return $key !== null && $key !== \false;
50 }
51 /** @return int */
52 #[\ReturnTypeWillChange]
53 public function count()
54 {
55 if (!isset($this->{$this->collection_key})) {
56 return 0;
57 }
58 return \count($this->{$this->collection_key});
59 }
60 /** @return bool */
61 #[\ReturnTypeWillChange]
62 public function offsetExists($offset)
63 {
64 if (!\is_numeric($offset)) {
65 return parent::offsetExists($offset);
66 }
67 return isset($this->{$this->collection_key}[$offset]);
68 }
69 /** @return mixed */
70 #[\ReturnTypeWillChange]
71 public function offsetGet($offset)
72 {
73 if (!\is_numeric($offset)) {
74 return parent::offsetGet($offset);
75 }
76 $this->coerceType($offset);
77 return $this->{$this->collection_key}[$offset];
78 }
79 /** @return void */
80 #[\ReturnTypeWillChange]
81 public function offsetSet($offset, $value)
82 {
83 if (!\is_numeric($offset)) {
84 parent::offsetSet($offset, $value);
85 }
86 $this->{$this->collection_key}[$offset] = $value;
87 }
88 /** @return void */
89 #[\ReturnTypeWillChange]
90 public function offsetUnset($offset)
91 {
92 if (!\is_numeric($offset)) {
93 parent::offsetUnset($offset);
94 }
95 unset($this->{$this->collection_key}[$offset]);
96 }
97 private function coerceType($offset)
98 {
99 $keyType = $this->keyType($this->collection_key);
100 if ($keyType && !\is_object($this->{$this->collection_key}[$offset])) {
101 $this->{$this->collection_key}[$offset] = new $keyType($this->{$this->collection_key}[$offset]);
102 }
103 }
104 }
105