Example #1
0
 protected function replaceRecursive(ArrayOk $withThese, $default = false)
 {
     if ($default) {
         $this->constructRecursively(array_replace_recursive($this->toArray(), $withThese->toArray()));
     } else {
         $this->replaceRecursiveNumeric($withThese);
     }
 }
Example #2
0
 public static function json($data)
 {
     $data = new ArrayOk($data);
     // Wrap it as an ArrayOk object in case it's only a partial object
     return $data->toJson();
 }