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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user