Skip to content

Commit f869a65

Browse files
jmikolakvwalker
authored andcommitted
Add doc blocks for disabled TypeMapArrayIterator methods
1 parent 16aea91 commit f869a65

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

src/Model/TypeMapArrayIterator.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,23 @@ public function __construct(array $documents = [], array $typeMap)
4747
$this->typeMap = $typeMap;
4848
}
4949

50+
/**
51+
* Not supported.
52+
*
53+
* @see http://php.net/arrayiterator.append
54+
* @throws BadMethodCallException
55+
*/
5056
public function append($value)
5157
{
5258
throw BadMethodCallException::classIsImmutable(__CLASS__);
5359
}
5460

61+
/**
62+
* Not supported.
63+
*
64+
* @see http://php.net/arrayiterator.asort
65+
* @throws BadMethodCallException
66+
*/
5567
public function asort()
5668
{
5769
throw BadMethodCallException::classIsImmutable(__CLASS__);
@@ -68,16 +80,34 @@ public function current()
6880
return \MongoDB\apply_type_map_to_document(parent::current(), $this->typeMap);
6981
}
7082

83+
/**
84+
* Not supported.
85+
*
86+
* @see http://php.net/arrayiterator.ksort
87+
* @throws BadMethodCallException
88+
*/
7189
public function ksort()
7290
{
7391
throw BadMethodCallException::classIsImmutable(__CLASS__);
7492
}
7593

94+
/**
95+
* Not supported.
96+
*
97+
* @see http://php.net/arrayiterator.natcasesort
98+
* @throws BadMethodCallException
99+
*/
76100
public function natcasesort()
77101
{
78102
throw BadMethodCallException::classIsImmutable(__CLASS__);
79103
}
80104

105+
/**
106+
* Not supported.
107+
*
108+
* @see http://php.net/arrayiterator.natsort
109+
* @throws BadMethodCallException
110+
*/
81111
public function natsort()
82112
{
83113
throw BadMethodCallException::classIsImmutable(__CLASS__);
@@ -87,28 +117,53 @@ public function natsort()
87117
* Return the value from the provided offset with the type map applied.
88118
*
89119
* @see http://php.net/arrayiterator.offsetget
120+
* @param mixed $offset
90121
* @return array|object
91122
*/
92123
public function offsetGet($offset)
93124
{
94125
return \MongoDB\apply_type_map_to_document(parent::offsetGet($offset), $this->typeMap);
95126
}
96127

128+
/**
129+
* Not supported.
130+
*
131+
* @see http://php.net/arrayiterator.offsetset
132+
* @throws BadMethodCallException
133+
*/
97134
public function offsetSet($index, $newval)
98135
{
99136
throw BadMethodCallException::classIsImmutable(__CLASS__);
100137
}
101138

139+
/**
140+
* Not supported.
141+
*
142+
* @see http://php.net/arrayiterator.offsetunset
143+
* @throws BadMethodCallException
144+
*/
102145
public function offsetUnset($index)
103146
{
104147
throw BadMethodCallException::classIsImmutable(__CLASS__);
105148
}
106149

150+
/**
151+
* Not supported.
152+
*
153+
* @see http://php.net/arrayiterator.uasort
154+
* @throws BadMethodCallException
155+
*/
107156
public function uasort($cmp_function)
108157
{
109158
throw BadMethodCallException::classIsImmutable(__CLASS__);
110159
}
111160

161+
/**
162+
* Not supported.
163+
*
164+
* @see http://php.net/arrayiterator.uksort
165+
* @throws BadMethodCallException
166+
*/
112167
public function uksort($cmp_function)
113168
{
114169
throw BadMethodCallException::classIsImmutable(__CLASS__);

0 commit comments

Comments
 (0)