예제 #1
0
 public function test_convert_to_array__object__exception()
 {
     $mixed = new \Exception();
     $mixed->entry = 'a string';
     $array = \UArray::convertToArray($mixed);
     $this->assertEquals(array('entry' => 'a string'), $array);
 }
예제 #2
0
 public function set($map)
 {
     \UArray::convertToArray($map);
     $result = [];
     foreach ($map as $key => $item) {
         $validation = $this->formatItemSeed($item, $key);
         if ($validation) {
             $result[$key] = $item;
         }
     }
     $this->seed = json_encode($result);
     $this->map = $map;
     return $this;
 }
예제 #3
0
파일: UArray.php 프로젝트: pixel418/ubiq
 public static function doConvertToArray(&$mixed)
 {
     $mixed = \UArray::convertToArray($mixed);
 }
예제 #4
0
파일: _output.php 프로젝트: pixel418/iniliq
<?php

if (!isset($contents)) {
    $contents = \UArray::convertToArray($content);
}
echo PHP_EOL;
echo 'Files' . PHP_EOL;
echo '---------' . PHP_EOL;
foreach ($contents as $name => $content) {
    if (!is_numeric($name)) {
        echo '; ' . $name . PHP_EOL;
    }
    echo $content . PHP_EOL;
    echo PHP_EOL;
}
echo PHP_EOL;
echo 'Result parsing' . PHP_EOL;
echo '---------' . PHP_EOL;
print_r($result->toArray());
예제 #5
0
 public function getAsArray($index, $default = array())
 {
     $value = $this->get($index, $default);
     return \UArray::convertToArray($value);
 }