From 3c0ca191b55940d85a02adc4b38ce1589a311984 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 22 Oct 2015 00:06:04 +0300 Subject: [PATCH] Pass in callable correctly --- SourceQuery/BaseSocket.php | 2 +- SourceQuery/Socket.php | 2 +- Tests/Tests.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SourceQuery/BaseSocket.php b/SourceQuery/BaseSocket.php index 7ef4d8d..473c370 100644 --- a/SourceQuery/BaseSocket.php +++ b/SourceQuery/BaseSocket.php @@ -36,7 +36,7 @@ abstract public function Write( $Header, $String = '' ); abstract public function Read( $Length = 1400 ); - protected function ReadInternal( $Buffer, $SherlockFunction ) + protected function ReadInternal( $Buffer, callable $SherlockFunction ) { if( $Buffer->Remaining( ) === 0 ) { diff --git a/SourceQuery/Socket.php b/SourceQuery/Socket.php index 19ea80f..8c85f4b 100644 --- a/SourceQuery/Socket.php +++ b/SourceQuery/Socket.php @@ -73,7 +73,7 @@ $Buffer = new Buffer( ); $Buffer->Set( FRead( $this->Socket, $Length ) ); - $this->ReadInternal( $Buffer, $this->Sherlock ); + $this->ReadInternal( $Buffer, [ $this, 'Sherlock' ] ); return $Buffer; } diff --git a/Tests/Tests.php b/Tests/Tests.php index fb8c57b..d513f99 100644 --- a/Tests/Tests.php +++ b/Tests/Tests.php @@ -35,7 +35,7 @@ $this->NextOutput = ''; - $this->ReadInternal( $Buffer, $this->Sherlock ); + $this->ReadInternal( $Buffer, [ $this, 'Sherlock' ] ); return $Buffer; } @@ -97,9 +97,9 @@ } /** - * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException - * @dataProvider BadInfoProvider - */ + * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException + * @dataProvider BadInfoProvider + */ public function testBadGetInfo( $Data ) { $this->Socket->NextOutput = $Data;