Returns an array containing stdClass objects.

@return ArrayObject
194373
public function toObjectArray()
  {
    $array = (func_num_args() > 1) ? $this->toArray(1) : $this->toArray();

    for($i = 0; $i < count($array); $i++)
    {
      $array[$i] = (object) $array[$i];
    }

    return $array;
  }
787527
public function asArray()
    {
        $array = [];
        $properties = (new \ReflectionClass($this))
            ->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $object) {
            $value = $object->getValue($this);
            if (!isset($value)) {
                continue;
            }
            $property = $object->getName();

            if (!empty($this->mappings)
                && isset($this->mappings[$property])) {
                $property = $this->mappings[$property];
            }

            $array[$property] = $value;
        }

        return new \ArrayIterator($array);
    }
293828
public function getSuccessors()
    {
        $returnValue = array();

        
    	$reflection = new ReflectionClass($this);
		foreach($reflection->getProperties() as $property){
			if(!$property->isStatic() && !$property->isPrivate()){
				$propertyName = $property->getName();
				$value = $this->$propertyName;
				if (is_array($value)) {
					foreach ($value as $key => $subvalue) {
						if (is_object($subvalue) && $subvalue instanceof self) {
								$returnValue[] = $subvalue;
						}
					}
				} elseif (is_object($value) && $value instanceof self) {
						$returnValue[] = $value;
					}
				}
		}
        

        return (array) $returnValue;
    }
813884
function jsonSerialize(): \stdClass {
    return (object) [
      'found' => $this->getFound(),
      'hit' => $this->getHit(),
      'data' => array_map(function(LineData $item) {
        return $item->jsonSerialize();
      }, $this->getData()->getArrayCopy())
    ];
  }
1222475
public function toArray()
    {
        $out = [];
        foreach ($this as $key => $value) {
            $getter = sprintf('get%s', $key);
            if (!is_object($value) && method_exists($this, $getter)) {
                $out[$key] = call_user_func([$this, $getter]);
            }
        }

        return $out;
    }
1063712
protected function objectToArray(stdClass $data = null)
    {
        if (null !== $data) {
            $data = (array) $data;
            foreach ($data as $key => $value) {
                if ($value instanceof stdClass) {
                    $data[$key] = $this->objectToArray($value);
                }
            }
        }

        return $data;
    }
43428
public function toArray()
    {
        $result = array();
        if($entity = $this->getIterator()->current()) {
            $result = $entity->toArray();
        }

        return $result;
    }
889134
public function jsonSerialize() {
        $data = new stdClass();
        $vars = get_object_vars($this);

        foreach ($vars as $property => $value) {
            if ($value === null) {
                continue;
            }

            $data->{$property} = $value;
        }

        return $data;
    }
513234
public function getData() : \stdClass
    {
        $output = new \stdClass();

        foreach ($this->data as $key => $property) {
            if ($this->options['lowercase']) {
                $key = strtolower($key);
            }

            $output->{$key} = $property;
        }

        return $output;
    }
856004
public function toArray()
	{
		$result = [];
		
		foreach (get_class_methods($this) as $method)
		{
			if (stripos($method, 'get') === 0)
			{
				$result[strtolower(substr($method, 3))] = $this->{$method}();
			}
		}
		
		return $result;
	}
27230
public function __toArray()
    {
        $dto = array();
        try {
            $reflectionClass = new \ReflectionClass($this);
            $properties = $reflectionClass->getProperties(\ReflectionProperty::IS_PUBLIC);
            if (count($properties) > 0) {
                /** @var \ReflectionProperty $property */
                foreach ($properties as $property) {
                    $value = $property->getValue($this);
                    if(is_object($value) && method_exists($value, 'toArray')) {
                        $dto[$property->getName()] = $value->toArray();
                    } elseif(is_array($value)) {
                        foreach($value as &$arrValue) {
                            if($arrValue instanceof Dto) {
                                $arrValue = $arrValue->toArray();
                            }
                        }
                        $dto[$property->getName()] = $value;
                    } else {
                        $dto[$property->getName()] = $property->getValue($this);
                    }
                }
            }
        } catch (\Exception $e) {
            Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR);
        }
        return $dto;
    }
988780
public function jsonSerialize(): stdClass
    {
        $object = (object)object_get_properties($this, $this instanceof DynamicEntity);

        /** @var Event\ToJson $event */
        $event = $this->dispatchEvent(new Event\ToJson($this, $object));
        $data = i\type_check($event->getPayload(), stdClass::class, new UnexpectedValueException());

        return $data;
    }
523019
public function jsonSerialize()
    {
        $result = new \stdClass();
        $schema = static::schema();
        foreach ($schema->getProperties()->getDataKeyMap() as $propertyName => $dataName) {
            $value = $this->$propertyName;
            if ((null !== $value) || array_key_exists($propertyName, $this->__arrayOfData)) {
                $result->$dataName = $value;
            }
        }
        foreach ($schema->getNestedPropertyNames() as $name) {
            /** @var ObjectItem $nested */
            $nested = $this->$name;
            if (null !== $nested) {
                foreach ((array)$nested->jsonSerialize() as $key => $value) {
                    $result->$key = $value;
                }
            }
        }

        return $result;
    }
452490
function jsonSerialize(): \stdClass {
    return (object) [
      'sourceFile' => $this->getSourceFile(),
      'branches' => ($branches = $this->getBranches()) ? $branches->jsonSerialize() : null,
      'functions' => ($functions = $this->getFunctions()) ? $functions->jsonSerialize() : null,
      'lines' => ($lines = $this->getLines()) ? $lines->jsonSerialize() : null
    ];
  }
827327
public function toArray()
    {
        $array = array();

        foreach($this->_data as $key=>$value)
            $array[$key] = ($value instanceof PropertyReference) ? $value->value() : $value;

        return $array;
    }
970231
public function __toArray()
    {
        $datas = [
            'id'   => (string)$this->id,
            'type' => (string)$this->type
        ];
        if ($this->attributes !== null) {
            $datas['attributes'] = $this->attributes->__toArray();
        }
        return $datas;
    }
23247
public function toArray() : array
    {
        return [
            'component'         => $this->name,
            'number_of_classes' => $this->getNumberOfClasses(),
            'methods'           => $this->getNumberOfMethods(),
            'methods_per_class' => $this->getNumberOfMethodsPerClass(),
            'lines'             => $this->getLines(),
            'loc'               => $this->getLinesOfCode(),
            'loc_per_method'    => $this->getLinesOfCodePerMethod(),
        ];
    }