cleared namespace of module

@return String
558763
public function getClear()
    {
        $return = str_replace(self::$namespacePrefix . '/', '', $this->name);
        $exists = array_where(self::$core, function($key) use($return) {
            return $return == $key;
        });
        if (!empty($exists)) {
            return self::$registeredForCore;
        }
        if ($return == 'app') {
            return 'content';
        }

        $name = ($return == 'app') ? self::frontendContentComponent : $return;

        return str_replace('antaresproject/', '', $name);
    }
165576
private static function getBaseNamespace()
    {
        // try to determine the namespace of the
        $composerFile = PSX_PATH_SRC . '/../composer.json';
        $composer = \json_decode(\file_get_contents($composerFile), true);

        if (isset($composer['autoload'])) {
            $paths = $composer['autoload']['psr-4'] ?? [];
            $base  = trim(key($paths), '\\');

            if (!empty($base)) {
                return $base;
            }
        }

        throw new \RuntimeException('Could not determine the base namespace');
    }
469483
protected function getInstalledPluginNamespaces()
    {
        $cache_item = $this->cache->getItem('plugins.installed');

        $project_root = ProjectX::projectRoot();
        $installed_file = "$project_root/vendor/composer/installed.json";

        if (!$cache_item->isHit()
            && file_exists($installed_file)) {
            $installed = json_decode(
                file_get_contents($installed_file),
                true
            );
            $namespaces = [];

            foreach ($installed as $info) {
                if (empty($info['autoload']) ||
                    $info['type'] !== 'project-x') {
                    continue;
                }

                if (isset($info['autoload']['psr-4'])) {
                    $namespaces[$info['name']] = key($info['autoload']['psr-4']);
                }
            }

            if (!empty($namespaces)) {
                $cache_item
                    ->set($namespaces)
                    ->expiresAfter(3600);

                $this->cache->save($cache_item);
            }
        }

        return $cache_item->get() ?: [];
    }
522488
public function getNamespace()
    {
        if (isset($this->properties[ 'namespace' ])) {
            return $this->properties[ 'namespace' ];
        }

        $dir = $this->getRealPath();
        $dirParts = explode('Widgets' . DIRECTORY_SEPARATOR, $dir);
        $namespace = loader()->getDirNamespace(reset($dirParts)) . 'Widgets\\' . str_replace(['/', DIRECTORY_SEPARATOR],
                '\\', end($dirParts));

        return $namespace;
    }
575541
private function getCurrentVendorAndModuleName()
	{
		$composerDotJson = json_decode( file_get_contents( base_path('composer.json') ) );
		$psr4Autoload = $composerDotJson->autoload->{'psr-4'};
		$name = null;
		foreach( $psr4Autoload as $nameSpace => $folder ) {
			if( $folder == 'app/' ) {
				$name = $nameSpace;
				break;
			}
		}
		if( is_null( $name ) ) {
			$this->error('Could not find namespace from composer.json');
		}
		if( ! preg_match( "#^([a-z0-9]+)\\\([a-z0-9]+)\\\\$#is", $name, $match ) ) {
			$this->error('Could not find namespace from composer.json');
		}
		return [
			'vendor' => $this->getComputerNameFromCamelCase($match[1]),
			'module' => $this->getComputerNameFromCamelCase($match[2]),
			'camelCasedVendor' => $match[1],
			'camelCasedModule' => $match[2]
		];
	}
653744
function getFormattedNamespaces() {
		$ns = $this->getNamespaces();
		foreach ( $ns as $k => $v ) {
			$ns[$k] = strtr( $v, '_', ' ' );
		}
		return $ns;
	}
128790
public function toString()
    {
        if (!$this->getPath()) {
            return '';
        }

        $path = preg_replace('/^\\\/', '', $this->getPath());

        $namespace = $this->getDocBlock()->setTabulation($this->getTabulation())->toString()
            . $this->getTabulationFormatted()
            . 'namespace '
            . $path
            . ';' . PHP_EOL;

        return $namespace;
    }
1128777
public function deactivateModule($namespace)
    {
        $namespace = Framework::prepareNamespace($namespace);

        // If the module isn't activated we have nothing to deactivate
        if (!isset($this->activatedModules[$namespace])) {
            return false;
        }
        
        // Load the module to deactivate it
        $namespace = Framework::prepareNamespace($namespace);
        $module = $this->getModule($namespace);

        // If the module isn't initialized it isn't active
        if ($module === false) {
            return false;
        }
        
        // Deactivate the module
        $module->deactivate();
        
        // Remove the module and save the module cache
        unset($this->activatedModules[$namespace]);
        unset($this->modules[$namespace]);
        $this->saveActivatedModules();
        
        return true;
    }
316172
public function getNamespaceDefinitions(): string
    {
        $script = 'var Frontend = {};';
        $script .= 'var App = { Controllers: {}, Components: {}, Lib: {} };';
        $tpl = 'App.Controllers.%s = {};';
        foreach ($this->_pluginJsNamespaces as $pluginName) {
            $script .= sprintf($tpl, $pluginName);
        }

        return $this->Html->scriptBlock($script);
    }
749230
private function cleanModuleJsonFile()
    {
        $path = $this->module->getModulePath($this->getName()) . 'module.json';

        $content = $this->filesystem->get($path);
        $namespace = $this->getModuleNamespaceReplacement();
        $studlyName = $this->getStudlyNameReplacement();

        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';

        $content = str_replace($provider, '', $content);

        $this->filesystem->put($path, $content);
    }
391439
public function clearNamespace($namespace)
    {
        $paths = $this->getNamespaceDefaultPaths($namespace);
        foreach ($paths as $path) {
            if ($this->files->isDirectory($path)) {
                $this->files->deleteDirectory($path);
            }
        }
    }
819544
public function getFileNamespace(): string
	{
		if($this->fileNamespace === null)
		{
			$this->fileNamespace = str_replace('/', '-', strtolower($this->packageName));
		}

		return $this->fileNamespace;
	}
1194172
public function getClassNameWithoutNamespace()
    {
        if ($this->classNameWithoutNamespace === null) {
            $class = explode('\\', get_class($this));
            $this->classNameWithoutNamespace = substr(end($class), 0, -10);
        }
        return $this->classNameWithoutNamespace;
    }
217288
protected function forgetChangedClasses()
    {
        $frozenNamespaces = [];
        /** @var $package Package */
        foreach ($this->packageManager->getAvailablePackages() as $packageKey => $package) {
            if ($this->packageManager->isPackageFrozen($packageKey)) {
                $frozenNamespaces = array_merge($frozenNamespaces, $package->getNamespaces());
            }
        }
        $frozenNamespaces = array_unique($frozenNamespaces);

        $classNames = array_keys($this->classReflectionData);
        foreach ($frozenNamespaces as $namespace) {
            $namespace .= '\\';
            foreach ($classNames as $index => $className) {
                if (strpos($className, $namespace) === 0) {
                    unset($classNames[$index]);
                }
            }
        }

        foreach ($classNames as $className) {
            if (!$this->statusCache->has($this->produceCacheIdentifierFromClassName($className))) {
                $this->forgetClass($className);
            }
        }
    }
995362
public function getNamespaceName()
    {
        $caller = get_called_class();
        $parts  = explode('\\', $caller);
        array_pop($parts);
        
        return join('\\', $parts);
    }
1158123
public function clearCompiled()
    {
        $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->getCompileDir()), \RecursiveIteratorIterator::SELF_FIRST);
        $count    = 0;
        foreach ($iterator as $file) {
            if ($file->isFile()) {
                $count += unlink($file->__toString()) ? 1 : 0;
            }
        }

        return $count;
    }
314408
protected function getAppNamespace()
    {
        $composer = json_decode(file_get_contents(base_path().'/composer.json'), true);

        foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
            foreach ((array) $path as $pathChoice) {
                if (realpath(app_path()) == realpath(base_path().'/'.$pathChoice)) {
                    return $namespace;
                }
            }
        }

        throw new \RuntimeException('Unable to detect application namespace.');
    }