1
0
mirror of https://github.com/xPaw/PHP-Source-Query.git synced 2026-06-10 23:03:15 +02:00

Create a factory for easy setup.

Update README.md.
This commit is contained in:
Anthony Birkett
2021-05-31 14:53:28 +01:00
parent ca9edb41c3
commit 780ebba6a2
6 changed files with 49 additions and 27 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ final class SourceQuery
*
* @return bool Previous value
*/
public function SetUseOldGetChallengeMethod(bool $value): bool
public function setUseOldGetChallengeMethod(bool $value): bool
{
$previous = $this->useOldGetChallengeMethod;
+21
View File
@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace xPaw\SourceQuery;
use xPaw\SourceQuery\Socket\GoldSourceSocket;
use xPaw\SourceQuery\Socket\SourceSocket;
final class SourceQueryFactory
{
public static function createGoldSourceQuery(): SourceQuery
{
return new SourceQuery(new SourceSocket());
}
public static function createSourceQuery(): SourceQuery
{
return new SourceQuery(new GoldSourceSocket());
}
}