Cast to an array

@return array
971067
public function toArray(): array
    {
        $data = $this->resourceToArray();

        if ($this->hasMetadata()) {
            $data['meta'] = $this->getMetadata();
        }

        return $data;
    }
1003045
public function toArray()
    {
        if ($this->rootElement instanceof CanConvertToArray) {
            return array(
                'currentTime' => $this->request_time,
                'cachedUntil' => $this->cached_until,
                'result' => $this->rootElement->toArray()
            );
        } else {
            return array();
        }
    }
1132034
public function __toArray()
    {
        $result = [];
        if ($this->status !== null) {
            $result['status'] = $this->status;
        }
        if ($this->code !== null) {
            $result['code'] = $this->code;
        }
        if ($this->title !== null) {
            $result['title'] = $this->title;
        }
        return $result;
    }
1063274
public function toArray()
	{
		$result = array();

		$cvars = get_class_vars(__CLASS__);

		foreach ($cvars as $key => $value)
		{
			if ($key{0} == '_')
			{
				continue;
			}

			$current = $this->__get($key);

			$result[$key] = $current;
		}

		return $result;
	}
644757
public function toArray()
    {
        $return = array();
        foreach ($this->myData as $key => $value) {
            $return[$key] = ($value instanceof CanConvertToArray) ? $value->toArray() : $value;
        }

        return $return;
    }
778341
public function toArray()
    {
        return array(

            'callableName'             => $this->callableName,
            'methodName'               => $this->methodName,
            'realCallableName'         => $this->realCallableName,
            'jobPrefix'                => $this->jobPrefix,
            'realCallableNameNoPrefix' => $this->realCallableNameNoPrefix,
            'description'              => $this->description,
            'iterations'               => $this->iterations,
            'minimumExecutionTime'     => $this->minimumExecutionTime,
            'timeout'                  => $this->timeout,
            'servers'                  => $this->servers,
            'defaultMethod'            => $this->defaultMethod,
        );
    }
1327190
public function toArray(): array
    {
        return [
            'type' => $this->type,
            'configuration' => $this->configuration,
            'weight' => $this->weight,
            'score_mode' => $this->scoreMode,
            'filter' => ($this->filter instanceof Filter
                ? $this
                    ->filter
                    ->toArray()
                : null),
        ];
    }
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;
    }
170897
public function toArray()
    {
        return [
            'key'      => $this->key(),
            'name'     => $this->name(),
            'script'   => $this->script(),
            'dir'      => $this->direction(),
            'native'   => $this->native(),
            'regional' => $this->regional(),
        ];
    }
190621
public function toArray()
    {
        $ret = array();
        foreach (array_keys($this->values) as $key) {
            $ret[$key] = $this->get($key);
        }

        return $ret;
    }
760128
public function toArray() : ?array
    {
        if (null === $this->stmt || false === $this->stmt) {
            return null;
        }
        return $this->stmt->toArray();
    }
659325
public function values()
    {
        if ($this->values) {
            return $this->values;
        }
        $cast_method = 'castTo' . ucwords($this->castTo);
        return array_map([$this, $cast_method], $this->defaultValue());
    }
169451
public function toArray()
    {
        $fieldValues = [];
        foreach ($this->fields as $group) {
            foreach ($group as $name => $field) {
                $fieldValues[$name] = $field->getValue();
            }
        }
        return $fieldValues;
    }
1336289
public function toArray() : array
    {
        $output = [];
        foreach ($this->data as $key => $val) {
            $output[$key] = $val instanceof ArraySerializable ? $val->toArray() : $val;
        }
        return $output;
    }
72913
public function toArray() {
        $result = [];
        $count  = count($this->elements);
        for ($i=0;$i<$count;$i++) {
            $result[] = $this->elements[$i];
        }
        return $result;
    }
833403
public function toArray()
    {
        $newItem = [];

        foreach ($this->items as $key => $val) {
            if ($val instanceof ArrayInterface) {
                $newItem[$key] = $val->items;
            } else {
                $newItem[$key] = $val;
            }
        }

        return $newItem;
    }
323713
public function __toArray() {
        $array = array();
        foreach ($this->__getSerialisablePropertyMap() as $key => $value) {
            if ($value instanceof SerialisableObject) {
                $array[$key] = $value->__toArray();
            } else if (is_array($value)) {
                $array[$key] = SerialisableArrayUtils::convertSerialisableObjectsToAssociativeArrays($value);
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }