public function toArray($recursive = true)
    {
        $array = [];
        $data  = $this->data;

        /** @var self $value */
        foreach ($data as $key => $value) {
            if ($recursive && $value instanceof self) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
public function toArray($recursive = true)
    {
        $array = [];
        $data  = $this->data;

        /** @var self $value */
        foreach ($data as $key => $value) {
            if ($recursive && $value instanceof self) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
public function toArray ( $ recursive = true ) { $ array = [ ] ; $ data = $ this -> data ; /** @var self $value */ foreach ( $ data as $ key => $ value ) { if ( $ recursive && $ value instanceof self ) { $ array [ $ key ] = $ value -> toArray ( ) ; } else { $ array [ $ key ] = $ value ; } } return $ array ; }
Converts the instance to an array
@param bool $recursive Converts containing configurations recursive as well.
@return array
Converts the instance to an array