示例#1
0
 protected function getValue($value)
 {
     if (GraphTraverser::isObject($value)) {
         return $this->lastObject;
     } elseif (GraphTraverser::isArray($value)) {
         return $this->lastArray;
     } else {
         return $this->newValue($value);
     }
 }
示例#2
0
 protected function getDataType($value)
 {
     if (GraphTraverser::isObject($value)) {
         return 'object';
     } elseif (GraphTraverser::isArray($value)) {
         return 'array';
     } elseif (is_int($value) || is_float($value)) {
         return 'number';
     } elseif (is_bool($value)) {
         return 'boolean';
     } elseif (is_null($value)) {
         return 'null';
     } else {
         return 'string';
     }
 }