@@ -13,6 +13,9 @@ class Scripting
1313 /** @var Config */
1414 protected $ config ;
1515
16+ /**
17+ * @param Config|array|null $config
18+ */
1619 public function __construct ($ config = null )
1720 {
1821 if (is_null ($ config )) {
@@ -38,15 +41,15 @@ public function __construct($config = null)
3841 *
3942 * @return FakeFactory
4043 */
41- public static function fake (TestCase $ testCase , Config $ config = null )
44+ public static function fake (TestCase $ testCase , Config $ config = null ): FakeFactory
4245 {
4346 return new FakeFactory ($ testCase , $ config ?? Config::testInstance ());
4447 }
4548
4649 /**
4750 * @return Config
4851 */
49- public function getConfig ()
52+ public function getConfig (): Config
5053 {
5154 return $ this ->config ;
5255 }
@@ -61,7 +64,15 @@ public function query($connection = null): WmiQueryFactory
6164 return new WmiQueryFactory ($ connection );
6265 }
6366
64- public function addConnection (string $ name , $ connection )
67+ /**
68+ * @param string $name
69+ * @param Connection|string|null $connection
70+ *
71+ * @throws InvalidConnectionException
72+ *
73+ * @return self
74+ */
75+ public function addConnection (string $ name , $ connection ): self
6576 {
6677 if ($ connection instanceof Connection) {
6778 $ this ->config ->addConnection ($ name , $ connection );
@@ -86,7 +97,15 @@ public function addConnection(string $name, $connection)
8697 throw new InvalidConnectionException ("Could not create connection ' {$ name }'. " );
8798 }
8899
89- public function setDefaultConnection (string $ name , $ connection = null )
100+ /**
101+ * @param string $name
102+ * @param Connection|string|null $connection
103+ *
104+ * @throws InvalidConnectionException
105+ *
106+ * @return self
107+ */
108+ public function setDefaultConnection (string $ name , $ connection = null ): self
90109 {
91110 if ($ connection ) {
92111 $ this ->addConnection ($ name , $ connection );
0 commit comments