public final function toObject(): ?array
    {
        $data = null;
        if (!empty($this->data)) {
            // no need to type-cast
            if (is_object($this->data[0])) {
                return $this->data;
            }
            $data = $this->data;
            foreach ($data as &$dat) {
                $dat = (object) $dat;
            }
        }

        return $data;
    }
public final function toObject(): ?array
    {
        $data = null;
        if (!empty($this->data)) {
            // no need to type-cast
            if (is_object($this->data[0])) {
                return $this->data;
            }
            $data = $this->data;
            foreach ($data as &$dat) {
                $dat = (object) $dat;
            }
        }

        return $data;
    }
public final function toObject ( ) : ? array { $ data = null ; if ( ! empty ( $ this -> data ) ) { // no need to type-cast if ( is_object ( $ this -> data [ 0 ] ) ) { return $ this -> data ; } $ data = $ this -> data ; foreach ( $ data as & $ dat ) { $ dat = ( object ) $ dat ; } } return $ data ; }
To object.
@return ?array
To object .