Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

Commit

Permalink
fix namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cnizzardini committed Aug 7, 2020
1 parent 4f9afe7 commit bbf7368
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Console/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ public static function composer($io, string $package, string $name): void
}

$pkg = 'mixerapi/' . $package;
$ns = "MixerApi\\\\$name\\\\";
$nsTest = "MixerApi\\\\$name\\\\Test\\\\";
$ns = '"MixerApi\\\\' . $name . '\\\\":';
$nsTest = '"MixerApi\\\\' . $name . '\\\\Test\\\\":';

$contents = file_get_contents('composer.json');
$contents = str_replace('mixerapi/plugin', $pkg, $contents);
$contents = str_replace('"MixerApi\\\\"', $ns, $contents);
$contents = str_replace('"MixerApi\\\\Test\\\\"', $ns, $contents);
$contents = str_replace('"MixerApi\\\\":', $ns, $contents);
$contents = str_replace('"MixerApi\\\\Test\\\\":', $nsTest, $contents);

if (!file_put_contents('composer.json', $contents)) {
$io->write("Unable to update contents of your composer.json, check permissions");
Expand Down

0 comments on commit bbf7368

Please sign in to comment.