{@inheritdoc}

@see \PhpCoveralls\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
424501
public function toArray()
    {
        $remotes = [];

        foreach ($this->remotes as $remote) {
            $remotes[] = $remote->toArray();
        }

        return [
            'branch' => $this->branch,
            'head' => $this->head->toArray(),
            'remotes' => $remotes,
        ];
    }
1350008
public function toArray() {
        $r = [
            'from' => $this->from,
            'where' => $this->where,
            'order' => $this->order,
            'limit' => $this->limit,
            'offset' => $this->offset
        ];

        return $r;
    }
1022683
public function toArray()
    {
        $arr = array
        (
            'container'         => $this->container,
            'format'            => $this->getDefaultFormat(),
            'types'             => $this->getTypes(),
            'notifications'     => $this->notifications->toArray()
        );

        return $arr;
    }
125320
public function toArray(): array
    {
        $result = [];
        foreach (static::getInstanceProperties() as $key) {
            $result[$key] = $this->$key;
        }

        return $result;
    }
70991
public function toArray()
    {
        $array = [
            'name'      => $this->getName(),
            'arguments' => $this->getArguments(),
            'children'  => array()
        ];

        foreach ($this->children as $child) {
            $array['children'][] = $child->toArray();
        }
        return $array;
    }
316560
public function toArray()
    {
        $arr = array();
        foreach ($this as $key => $value) {
            $method = 'get' . $key;
            if (method_exists($this, $method)) {
                $arr[$key] = $this->$method();
            }
        }

        return $arr;
    }
31066
public function toArray($entity)
    {
        $firstTime = !$this->entitiesGraph ? true : false;

        if (!in_array(get_class($this), $this->entitiesGraph)) {
            $this->entitiesGraph[] = get_class($this);
        }

        $toArray  = [];
        $newArray = [];

        $refl = new \ReflectionClass($entity);
        foreach ($refl->getProperties() as $property) {
            $property->setAccessible(true);

            $value = $property->getValue($entity);

            if (array_key_exists($property->getName(), $this->propertiesToArrayCallbacks)) {
                $value = call_user_func_array($this->propertiesToArrayCallbacks[$property->getName()], [$value]);
            }

            if (!is_null($value)) {
                $toArray[$property->getName()] = $value;
            }
        }

        foreach ($toArray as $propertyName => $propertyValue) {

            // Simple mappings
            if (
                in_array($propertyName, $this->columnsToProperties) &&
                !array_key_exists($propertyName, $this->propertiesToMappers)
            ) {
                $columnName = array_search($propertyName, $this->columnsToProperties);

                $result = $this->createArrayFromColumnName($columnName, $propertyValue);
                $newArray = array_merge_recursive($newArray, $result);
                continue;
            }

            // Via Classes
            if (array_key_exists($propertyName, $this->propertiesToClasses) && is_object($propertyValue)) {
                $subMapper = $this->propertiesToClasses[$propertyName];
                $subMapper->setEntitiesGraph($this->entitiesGraph);
                $value    = $subMapper->toArray($propertyValue);
                $newArray = array_merge_recursive($newArray, $value);
                continue;
            }

            // via Mappers
            if (array_key_exists($propertyName, $this->propertiesToMappers)) {
                $className = $this->propertiesToMappers[$propertyName];

                if (in_array($className, $this->entitiesGraph)) {
                    continue;
                }

                /** @var DoplioDataMapper $subMapper */
                $subMapper = $this->resolver->resolve($className);
                $subMapper->setEntitiesGraph($this->entitiesGraph);

                if ($subMapper->toArrayResultCallback) {
                    $method        = $subMapper->toArrayResultCallback;
                    $propertyValue = $method($propertyValue);

                    foreach ($propertyValue as $offset => $item) {
                        $value = $subMapper->toArray(
                            $item
                        );
                        $newArray[array_search($propertyName, $this->columnsToProperties)][$offset] = $value;
                    }
                } else {
                    $value = $subMapper->toArray(
                        $propertyValue
                    );
                    $newArray[array_search($propertyName, $this->columnsToProperties)] = $value;
                }

                $this->entitiesGraph = array_merge($this->entitiesGraph, $subMapper->entitiesGraph);
            }
        }

        if ($this->fromClassname) {
            $method = $this->fromClassname;
            $data = $method(get_class($entity));
            $newArray = array_merge_recursive($newArray, $data);
        }


        if ($firstTime) {
            $this->entitiesGraph = [];
        }
        return $newArray;
    }
1219912
public function toArray() {
        $ppts = get_object_vars($this);
        unset($ppts['_connection']);
        unset($ppts['_tableName']);
        unset($ppts['_by']);
        unset($ppts['_table']);
        unset($ppts['_content']);
        return $ppts;
    }
408046
public final function toArray(): ?array
    {
        $data = null;
        if (!empty($this->data)) {
            // no need to type-cast
            if (is_array($this->data[0])) {
                return $this->data;
            }
            $data = $this->data;
            foreach ($data as &$dat) {
                $dat = (array) $dat;
            }
        }

        return $data;
    }
408570
public function toArray()
    {
        $data = array();

        foreach ($this as $key => $value) {
            if (is_object($value)) {
                if (!is_callable(array($value, 'toArray'))) {
                    throw new RuntimeException('Object does not implement toArray() method on key: ' . $key);
                }
                $data[$key] = $value->toArray();
            } else {
                $data[$key] = $value;
            }
        }

        return $data;
    }
101006
private function toArrayInternal($data)
    {
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                if (is_array($value)) {
                    $data[$key] = $this->toArrayInternal($value);
                }

                if (is_object($value)) {
                    $data[$key] = ArrayHelper::toArray($value);
                }
            }

            return $data;
        }
        elseif (is_object($data)) {
            return ArrayHelper::toArray($data);
        }
        else {
            return [$data];
        }
    }
970231
public function __toArray()
    {
        $datas = [
            'id'   => (string)$this->id,
            'type' => (string)$this->type
        ];
        if ($this->attributes !== null) {
            $datas['attributes'] = $this->attributes->__toArray();
        }
        return $datas;
    }
130437
protected function castToArray($entity) {
		$value = [];
		foreach ($this->insertColumns as $column => $attr)
			$value[$column] = $this->getPropertyValue($this->entityProfile, $entity, $attr);		
		return $value;
	}
172261
private static function toArray($data) : array
    {
        if (($data instanceof ArrayObject)) {
            return $data->getArrayCopy();
        }
        if (is_null($data) || empty($data)) {
            return array();
        }

        return $data;
    }
31035
public function __toArray()
    {
        $data = array();

        foreach (static::schema() as $field => $options) {
            $data[$field] = $this->{$field};
        }

        return $data;
    }
206249
public function toArray(array $keys = [], $accessLevel = \ReflectionProperty::IS_PUBLIC, $underscoreKeys = false)
    {
        $collection = [];
        $reflection = new \ReflectionObject($this);
        
        foreach ($reflection->getProperties($accessLevel) as $property) {
            
            if (empty($keys) || in_array($property->getName(), $keys, true)) {
                
                $propertyValue = $property->getValue($this);
                $propertyName = $underscoreKeys ? Inflector::underscore($property->getName()) : $property->getName();
                
                $collection[$propertyName] = ($propertyValue instanceof EntityInterface)
                    ? $propertyValue->toArray([], $accessLevel) : $propertyValue;
                
            }
        }
        
        return $collection;
    }
1369062
public static function toArray()
    {
        $reflectionClass = new \ReflectionClass(get_called_class());
        $parentRelectionClass = $reflectionClass->getParentClass();

        return array_diff(
            $reflectionClass->getConstants(),
            $parentRelectionClass->getConstants()
        );
    }