mirror of
https://github.com/xPaw/PHP-Source-Query.git
synced 2026-06-08 02:56:00 +02:00
Pass in callable correctly
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
abstract public function Write( $Header, $String = '' );
|
abstract public function Write( $Header, $String = '' );
|
||||||
abstract public function Read( $Length = 1400 );
|
abstract public function Read( $Length = 1400 );
|
||||||
|
|
||||||
protected function ReadInternal( $Buffer, $SherlockFunction )
|
protected function ReadInternal( $Buffer, callable $SherlockFunction )
|
||||||
{
|
{
|
||||||
if( $Buffer->Remaining( ) === 0 )
|
if( $Buffer->Remaining( ) === 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
$Buffer = new Buffer( );
|
$Buffer = new Buffer( );
|
||||||
$Buffer->Set( FRead( $this->Socket, $Length ) );
|
$Buffer->Set( FRead( $this->Socket, $Length ) );
|
||||||
|
|
||||||
$this->ReadInternal( $Buffer, $this->Sherlock );
|
$this->ReadInternal( $Buffer, [ $this, 'Sherlock' ] );
|
||||||
|
|
||||||
return $Buffer;
|
return $Buffer;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
$this->NextOutput = '';
|
$this->NextOutput = '';
|
||||||
|
|
||||||
$this->ReadInternal( $Buffer, $this->Sherlock );
|
$this->ReadInternal( $Buffer, [ $this, 'Sherlock' ] );
|
||||||
|
|
||||||
return $Buffer;
|
return $Buffer;
|
||||||
}
|
}
|
||||||
@@ -97,9 +97,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException xPaw\SourceQuery\Exception\InvalidPacketException
|
* @expectedException xPaw\SourceQuery\Exception\InvalidPacketException
|
||||||
* @dataProvider BadInfoProvider
|
* @dataProvider BadInfoProvider
|
||||||
*/
|
*/
|
||||||
public function testBadGetInfo( $Data )
|
public function testBadGetInfo( $Data )
|
||||||
{
|
{
|
||||||
$this->Socket->NextOutput = $Data;
|
$this->Socket->NextOutput = $Data;
|
||||||
|
|||||||
Reference in New Issue
Block a user