diff --git a/src/goals/ComposerGoal.php b/src/goals/ComposerGoal.php index 90d571d..5252cb8 100644 --- a/src/goals/ComposerGoal.php +++ b/src/goals/ComposerGoal.php @@ -30,6 +30,7 @@ public function init() public function getNamespace() { $this->config->get('composer.json')->actionLoad(); + return @trim(key($this->config->get('composer.json')->getFile()->get('autoload')['psr-4']), '\\'); } } diff --git a/src/goals/ComposerJsonGoal.php b/src/goals/ComposerJsonGoal.php index 5ec2c08..e251619 100644 --- a/src/goals/ComposerJsonGoal.php +++ b/src/goals/ComposerJsonGoal.php @@ -82,7 +82,7 @@ public function getAuthors() public function getAutoload() { - $autoload = $this->rawItem('autoload'); + $autoload = $this->rawItem('autoload'); $autoload['psr-4'] = [ $this->package->namespace . '\\' => $this->package->src, ]; diff --git a/src/goals/InitGoal.php b/src/goals/InitGoal.php index f59815c..6608a77 100644 --- a/src/goals/InitGoal.php +++ b/src/goals/InitGoal.php @@ -11,7 +11,6 @@ namespace hidev\goals; -use hidev\helpers\Helper; use yii\base\InvalidParamException; /** diff --git a/src/goals/VendorGoal.php b/src/goals/VendorGoal.php index c6999f5..50f3b22 100644 --- a/src/goals/VendorGoal.php +++ b/src/goals/VendorGoal.php @@ -11,7 +11,6 @@ namespace hidev\goals; -use Yii; use hidev\helpers\Helper; /**