@@ -199,36 +199,6 @@ public function __toString()
199
199
return $ this ->asJson ();
200
200
}
201
201
202
- /**
203
- * Iterates over an array and detects the types each node
204
- * should be cast to and returns all the fields as an array.
205
- *
206
- * @TODO Add auto-casting to AccessToken entities.
207
- *
208
- * @param array $data the array to iterate over
209
- *
210
- * @return array
211
- */
212
- public function castFields (array $ data )
213
- {
214
- $ fields = [];
215
-
216
- foreach ($ data as $ k => $ v ) {
217
- if ($ this ->shouldCastAsDateTime ($ k )
218
- && (is_numeric ($ v )
219
- || $ this ->isIso8601DateString ($ v ))
220
- ) {
221
- $ fields [$ k ] = $ this ->castToDateTime ($ v );
222
- } elseif ($ k === 'birthday ' ) {
223
- $ fields [$ k ] = $ this ->castToBirthday ($ v );
224
- } else {
225
- $ fields [$ k ] = $ v ;
226
- }
227
- }
228
-
229
- return $ fields ;
230
- }
231
-
232
202
/**
233
203
* Uncasts any auto-casted datatypes.
234
204
* Basically the reverse of castFields().
@@ -289,6 +259,36 @@ public static function getNodeMap()
289
259
return static ::$ graphNodeMap ;
290
260
}
291
261
262
+ /**
263
+ * Iterates over an array and detects the types each node
264
+ * should be cast to and returns all the fields as an array.
265
+ *
266
+ * @TODO Add auto-casting to AccessToken entities.
267
+ *
268
+ * @param array $data the array to iterate over
269
+ *
270
+ * @return array
271
+ */
272
+ private function castFields (array $ data )
273
+ {
274
+ $ fields = [];
275
+
276
+ foreach ($ data as $ k => $ v ) {
277
+ if ($ this ->shouldCastAsDateTime ($ k )
278
+ && (is_numeric ($ v )
279
+ || $ this ->isIso8601DateString ($ v ))
280
+ ) {
281
+ $ fields [$ k ] = $ this ->castToDateTime ($ v );
282
+ } elseif ($ k === 'birthday ' ) {
283
+ $ fields [$ k ] = $ this ->castToBirthday ($ v );
284
+ } else {
285
+ $ fields [$ k ] = $ v ;
286
+ }
287
+ }
288
+
289
+ return $ fields ;
290
+ }
291
+
292
292
/**
293
293
* Determines if a value from Graph should be cast to DateTime.
294
294
*
0 commit comments