protected function setClassNamespace()
    {
        $classDirectories = $this->addon->config('addon.directories', []);

        if (count($this->addon->config('addon.directories', [])) === 0) {
            return;
        }

        $files = Finder::create();

        foreach ($classDirectories as $path) {
            $files->in($this->addon->path($path));
        }

        $files->name('*.php');

        $search = [
            $this->currentNamespace.'\\',
            'namespace '.$this->currentNamespace.';',
        ];

        $replace = [
            $this->newNamespace.'\\',
            'namespace '.$this->newNamespace.';',
        ];

        foreach ($files as $file) {
            $this->replaceIn($file, $search, $replace);
        }
    }
protected function setClassNamespace()
    {
        $classDirectories = $this->addon->config('addon.directories', []);

        if (count($this->addon->config('addon.directories', [])) === 0) {
            return;
        }

        $files = Finder::create();

        foreach ($classDirectories as $path) {
            $files->in($this->addon->path($path));
        }

        $files->name('*.php');

        $search = [
            $this->currentNamespace.'\\',
            'namespace '.$this->currentNamespace.';',
        ];

        $replace = [
            $this->newNamespace.'\\',
            'namespace '.$this->newNamespace.';',
        ];

        foreach ($files as $file) {
            $this->replaceIn($file, $search, $replace);
        }
    }
protected function setClassNamespace ( ) { $ classDirectories = $ this -> addon -> config ( 'addon.directories' , [ ] ) ; if ( count ( $ this -> addon -> config ( 'addon.directories' , [ ] ) ) === 0 ) { return ; } $ files = Finder :: create ( ) ; foreach ( $ classDirectories as $ path ) { $ files -> in ( $ this -> addon -> path ( $ path ) ) ; } $ files -> name ( '*.php' ) ; $ search = [ $ this -> currentNamespace . '\\' , 'namespace ' . $ this -> currentNamespace . ';' , ] ; $ replace = [ $ this -> newNamespace . '\\' , 'namespace ' . $ this -> newNamespace . ';' , ] ; foreach ( $ files as $ file ) { $ this -> replaceIn ( $ file , $ search , $ replace ) ; } }
Set the namespace on the files in the class directory.
Set the namespace on the files in the class directory .