Skip to content

Commit b038788

Browse files
authored
Merge pull request #76 from Sammyjo20/feature/resolve-connector
Feature | Added new resolveConnector method
2 parents c7b2ace + 73b92d9 commit b038788

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Http/SaloonRequest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,18 @@ private function bootConnector(): void
107107
throw new SaloonInvalidConnectorException;
108108
}
109109

110-
$this->setConnector(new $this->connector);
110+
$this->setConnector($this->resolveConnector($this->connector));
111+
}
112+
113+
/**
114+
* Resolve the connector.
115+
*
116+
* @param string $connectorClass
117+
* @return SaloonConnector
118+
*/
119+
protected function resolveConnector(string $connectorClass): SaloonConnector
120+
{
121+
return new $connectorClass;
111122
}
112123

113124
/**

0 commit comments

Comments
 (0)