protected function cleanSaveData(
        &$data
    ) {
        if (empty($data)) {
            return;
        }

        if (is_array($data)) {
            ksort($data);

            foreach ($data as &$arrayData) {
                $this->cleanSaveData($arrayData);
            }

            return;
        }

        if (is_string($data)) {
            $data = trim(
                str_replace(
                    [
                        "\n",
                        "\t",
                        "\r"
                    ],
                    "",
                    $data
                )
            );
        }

        return;
    }
protected function cleanSaveData(
        &$data
    ) {
        if (empty($data)) {
            return;
        }

        if (is_array($data)) {
            ksort($data);

            foreach ($data as &$arrayData) {
                $this->cleanSaveData($arrayData);
            }

            return;
        }

        if (is_string($data)) {
            $data = trim(
                str_replace(
                    [
                        "\n",
                        "\t",
                        "\r"
                    ],
                    "",
                    $data
                )
            );
        }

        return;
    }
protected function cleanSaveData ( & $ data ) { if ( empty ( $ data ) ) { return ; } if ( is_array ( $ data ) ) { ksort ( $ data ) ; foreach ( $ data as & $ arrayData ) { $ this -> cleanSaveData ( $ arrayData ) ; } return ; } if ( is_string ( $ data ) ) { $ data = trim ( str_replace ( [ "\n" , "\t" , "\r" ] , "" , $ data ) ) ; } return ; }
Save data clean up.

@param $data
Save data clean up .