diff --git a/src/MultiAuthPlugin.php b/src/MultiAuthPlugin.php index b8ed608..7b9518e 100644 --- a/src/MultiAuthPlugin.php +++ b/src/MultiAuthPlugin.php @@ -21,13 +21,9 @@ class MultiAuthPlugin implements PluginInterface, EventSubscriberInterface, Capa protected IOInterface $io; protected AuthManager $authManager; protected RequestModifier $requestModifier; - - public function __construct( - protected Arr $arr, - protected Str $str, - protected Factory $factory - ) { - } + protected Factory $factory; + protected Arr $arr; + protected Str $str; /** * @inheritDoc @@ -36,8 +32,12 @@ public function activate(Composer $composer, IOInterface $io): void { $this->composer = $composer; $this->io = $io; + $this->factory = new Factory(); + $this->authManager = $this->factory->makeAuthManager($composer->getConfig()); $this->requestModifier = $this->factory->makeRequestModifier(); + $this->arr = $this->factory->makeArr(); + $this->str = $this->factory->makeStr(); } /** diff --git a/src/RequestModifier.php b/src/RequestModifier.php index 0025304..88c5e4b 100644 --- a/src/RequestModifier.php +++ b/src/RequestModifier.php @@ -6,10 +6,14 @@ class RequestModifier { - public function __construct( - protected Str $str - ) { + /** + * Create a new Request Modifier instance. + */ + public function __construct(protected Str $str) + { + // } + /** * Build HTTP headers from resolved credentials. * diff --git a/tests/MultiAuthPluginTest.php b/tests/MultiAuthPluginTest.php index 37e3411..57de90b 100644 --- a/tests/MultiAuthPluginTest.php +++ b/tests/MultiAuthPluginTest.php @@ -22,7 +22,7 @@ class MultiAuthPluginTest extends TestCase protected function getPlugin(): MultiAuthPlugin { - return new MultiAuthPlugin(new Arr(), new Str(), new Factory()); + return new MultiAuthPlugin(); } public function test_plugin_registers_events_and_commands(): void