src/Transformer.php
private function prefixNamespace(string $targetFile)
    {
        $pattern = sprintf(
            '/%1$s\\s+(?!(%2$s)|(Composer(\\\\|;)))/',
            'namespace',
            $this->namespacePrefix
        );
        $replacement = sprintf('%1$s %2$s', 'namespace', $this->namespacePrefix);

        $this->replace($pattern, $replacement, $targetFile);
    }
private function prefixNamespace(string $targetFile)
    {
        $pattern = sprintf(
            '/%1$s\\s+(?!(%2$s)|(Composer(\\\\|;)))/',
            'namespace',
            $this->namespacePrefix
        );
        $replacement = sprintf('%1$s %2$s', 'namespace', $this->namespacePrefix);

        $this->replace($pattern, $replacement, $targetFile);
    }
Prefix namespace at the given path.

@param string $targetFile

@return void