protected function setAddonJsonNamespaces()
    {
        if (file_exists($this->addon->path('addon.json'))) {
            $currentNamespace = str_replace('\\', '\\\\', $this->currentNamespace);
            $newNamespace = str_replace('\\', '\\\\', $this->newNamespace);

            $search = [
                "\"namespace\": \"{$currentNamespace}\"",
                "\"{$currentNamespace}\\\\",
                "\\\\{$currentNamespace}\\\\",
            ];

            $replace = [
                "\"namespace\": \"{$newNamespace}\"",
                "\"{$newNamespace}\\\\",
                "\\\\{$newNamespace}\\\\",
            ];

            $this->replaceIn($this->addon->path('addon.json'), $search, $replace);
        }
    }
protected function setAddonJsonNamespaces()
    {
        if (file_exists($this->addon->path('addon.json'))) {
            $currentNamespace = str_replace('\\', '\\\\', $this->currentNamespace);
            $newNamespace = str_replace('\\', '\\\\', $this->newNamespace);

            $search = [
                "\"namespace\": \"{$currentNamespace}\"",
                "\"{$currentNamespace}\\\\",
                "\\\\{$currentNamespace}\\\\",
            ];

            $replace = [
                "\"namespace\": \"{$newNamespace}\"",
                "\"{$newNamespace}\\\\",
                "\\\\{$newNamespace}\\\\",
            ];

            $this->replaceIn($this->addon->path('addon.json'), $search, $replace);
        }
    }
protected function setAddonJsonNamespaces ( ) { if ( file_exists ( $ this -> addon -> path ( 'addon.json' ) ) ) { $ currentNamespace = str_replace ( '\\' , '\\\\' , $ this -> currentNamespace ) ; $ newNamespace = str_replace ( '\\' , '\\\\' , $ this -> newNamespace ) ; $ search = [ "\"namespace\": \"{$currentNamespace}\"" , "\"{$currentNamespace}\\\\" , "\\\\{$currentNamespace}\\\\" , ] ; $ replace = [ "\"namespace\": \"{$newNamespace}\"" , "\"{$newNamespace}\\\\" , "\\\\{$newNamespace}\\\\" , ] ; $ this -> replaceIn ( $ this -> addon -> path ( 'addon.json' ) , $ search , $ replace ) ; } }
Set the namespace in addon.json file.
Set the namespace in addon . json file .