Skip to content

Commit c593016

Browse files
committed
Add simple constructor
1 parent 4a684c1 commit c593016

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/WmiScripting/Connection.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,39 @@ public function __construct(
5151
$this->security_flags = $security_flags;
5252
}
5353

54+
/**
55+
* @param string $server
56+
* @param string|null $user
57+
* @param string|null $password
58+
* @param mixed|null $locale
59+
* @param mixed|null $authority
60+
* @param mixed|null $security_flags
61+
*
62+
* @return Connection
63+
*/
5464
public static function defaultNamespace(
5565
string $server,
5666
string $user = null,
5767
string $password = null,
5868
$locale = null,
5969
$authority = null,
6070
$security_flags = null
61-
) {
71+
): self {
6272
return new self($server, self::DEFAULT_NAMESPACE, $user, $password, $locale, $authority, $security_flags);
6373
}
6474

75+
/**
76+
* @param string $server
77+
* @param string $user
78+
* @param string $password
79+
*
80+
* @return Connection
81+
*/
82+
public static function simple(string $server, string $user, string $password): self
83+
{
84+
return static::defaultNamespace($server, $user, $password);
85+
}
86+
6587
/**
6688
* @return Services
6789
*/

0 commit comments

Comments
 (0)