@@ -41,7 +41,7 @@ class ReversedMap extends AbstractMap
4141 *
4242 * @since 1.0.0
4343 */
44- private $ map ;
44+ private $ mapInternal ;
4545
4646 /**
4747 * @var callable Comparator function
@@ -55,7 +55,7 @@ class ReversedMap extends AbstractMap
5555 *
5656 * @since 1.0.0
5757 */
58- private $ comparator ;
58+ private $ comparatorInternal ;
5959
6060 /**
6161 * Constructor
@@ -66,9 +66,9 @@ class ReversedMap extends AbstractMap
6666 */
6767 protected function __construct (SortedMap $ map )
6868 {
69- $ this ->map = $ map ;
70- $ this ->comparator = function ($ key1 , $ key2 ) {
71- return - call_user_func ($ this ->map ->comparator , $ key1 , $ key2 );
69+ $ this ->mapInternal = $ map ;
70+ $ this ->comparatorInternal = function ($ key1 , $ key2 ) {
71+ return - call_user_func ($ this ->mapInternal ->comparator , $ key1 , $ key2 );
7272 };
7373 }
7474
@@ -99,7 +99,7 @@ public function __get($property)
9999 {
100100 switch ($ property ) {
101101 case 'map ' :
102- return $ this ->map ;
102+ return $ this ->mapInternal ;
103103 default :
104104 return parent ::__get ($ property );
105105 }
@@ -114,7 +114,7 @@ public function __get($property)
114114 */
115115 public function comparator ()
116116 {
117- return $ this ->comparator ;
117+ return $ this ->comparatorInternal ;
118118 }
119119
120120 /**
@@ -128,7 +128,7 @@ public function comparator()
128128 */
129129 public function first ()
130130 {
131- return $ this ->map ->last ();
131+ return $ this ->mapInternal ->last ();
132132 }
133133
134134 /**
@@ -142,7 +142,7 @@ public function first()
142142 */
143143 public function last ()
144144 {
145- return $ this ->map ->first ();
145+ return $ this ->mapInternal ->first ();
146146 }
147147
148148 /**
@@ -158,7 +158,7 @@ public function last()
158158 */
159159 public function predecessor ($ element )
160160 {
161- return $ this ->map ->successor ($ element );
161+ return $ this ->mapInternal ->successor ($ element );
162162 }
163163
164164 /**
@@ -172,7 +172,7 @@ public function predecessor($element)
172172 */
173173 public function successor ($ element )
174174 {
175- return $ this ->map ->predecessor ($ element );
175+ return $ this ->mapInternal ->predecessor ($ element );
176176 }
177177
178178 /**
@@ -188,7 +188,7 @@ public function successor($element)
188188 */
189189 public function lower ($ key )
190190 {
191- return $ this ->map ->higher ($ key );
191+ return $ this ->mapInternal ->higher ($ key );
192192 }
193193
194194 /**
@@ -204,7 +204,7 @@ public function lower($key)
204204 */
205205 public function floor ($ key )
206206 {
207- return $ this ->map ->ceiling ($ key );
207+ return $ this ->mapInternal ->ceiling ($ key );
208208 }
209209
210210 /**
@@ -220,7 +220,7 @@ public function floor($key)
220220 */
221221 public function find ($ key )
222222 {
223- return $ this ->map ->find ($ key );
223+ return $ this ->mapInternal ->find ($ key );
224224 }
225225
226226 /**
@@ -236,7 +236,7 @@ public function find($key)
236236 */
237237 public function ceiling ($ key )
238238 {
239- return $ this ->map ->floor ($ key );
239+ return $ this ->mapInternal ->floor ($ key );
240240 }
241241
242242 /**
@@ -252,7 +252,7 @@ public function ceiling($key)
252252 */
253253 public function higher ($ key )
254254 {
255- return $ this ->map ->lower ($ key );
255+ return $ this ->mapInternal ->lower ($ key );
256256 }
257257
258258 /**
@@ -264,7 +264,7 @@ public function higher($key)
264264 */
265265 public function jsonSerialize (): array
266266 {
267- return array ('ReversedMap ' => $ this ->map ->jsonSerialize ());
267+ return array ('ReversedMap ' => $ this ->mapInternal ->jsonSerialize ());
268268 }
269269
270270 /**
@@ -276,6 +276,6 @@ public function jsonSerialize(): array
276276 */
277277 public function count (): int
278278 {
279- return $ this ->map ->count ();
279+ return $ this ->mapInternal ->count ();
280280 }
281281}
0 commit comments