From a4c86fc291fa8cea41b31bed702a8a97eabcba30 Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Fri, 9 Feb 2018 11:47:02 +0100 Subject: [PATCH] Apply fixes from StyleCI (#26) --- src/TelegramDriver.php | 4 ++-- tests/TelegramDriverTest.php | 38 ++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/TelegramDriver.php b/src/TelegramDriver.php index 27834ad..d31ecab 100644 --- a/src/TelegramDriver.php +++ b/src/TelegramDriver.php @@ -133,8 +133,8 @@ protected function isValidLoginRequest() // Get sorted array of values $check = $this->queryParameters ->except('hash') - ->map(function($value, $key) { - return $key . '=' . $value; + ->map(function ($value, $key) { + return $key.'='.$value; }) ->values() ->sort(); diff --git a/tests/TelegramDriverTest.php b/tests/TelegramDriverTest.php index b9afbab..0d31b83 100644 --- a/tests/TelegramDriverTest.php +++ b/tests/TelegramDriverTest.php @@ -2,11 +2,11 @@ namespace Tests; -use Illuminate\Support\Collection; use Mockery as m; use BotMan\BotMan\Http\Curl; use BotMan\BotMan\Users\User; use PHPUnit_Framework_TestCase; +use Illuminate\Support\Collection; use BotMan\Drivers\Telegram\TelegramDriver; use BotMan\BotMan\Messages\Attachments\File; use BotMan\BotMan\Messages\Attachments\Audio; @@ -219,14 +219,14 @@ public function it_calls_telegram_login_event() 'last_name' => 'Pociot', 'username' => 'marcelpociot', 'photo_url' => 'https://some/picture.jpg', - 'auth_date' => time() + 'auth_date' => time(), ]; // Calculate hash $check = Collection::make($queryParameters) ->except('hash') - ->map(function($value, $key) { - return $key . '=' . $value; + ->map(function ($value, $key) { + return $key.'='.$value; }) ->values() ->sort(); @@ -241,8 +241,8 @@ public function it_calls_telegram_login_event() $driver = new TelegramDriver($request, [ 'telegram' => [ - 'token' => $token - ] + 'token' => $token, + ], ], m::mock(Curl::class)); $event = $driver->hasMatchingEvent(); @@ -266,14 +266,14 @@ public function it_does_not_call_telegram_login_event_with_outdated_auth_date() 'last_name' => 'Pociot', 'username' => 'marcelpociot', 'photo_url' => 'https://some/picture.jpg', - 'auth_date' => time() - 90000 + 'auth_date' => time() - 90000, ]; // Calculate hash $check = Collection::make($queryParameters) ->except('hash') - ->map(function($value, $key) { - return $key . '=' . $value; + ->map(function ($value, $key) { + return $key.'='.$value; }) ->values() ->sort(); @@ -288,8 +288,8 @@ public function it_does_not_call_telegram_login_event_with_outdated_auth_date() $driver = new TelegramDriver($request, [ 'telegram' => [ - 'token' => $token - ] + 'token' => $token, + ], ], m::mock(Curl::class)); $this->assertFalse($driver->hasMatchingEvent()); @@ -307,15 +307,15 @@ public function it_does_not_call_telegram_login_event_with_invalid_hash() 'username' => 'marcelpociot', 'photo_url' => 'https://some/picture.jpg', 'auth_date' => time(), - 'hash' => 'kajhsdkjhaskjdh' + 'hash' => 'kajhsdkjhaskjdh', ]; $request = new Request($queryParameters); $driver = new TelegramDriver($request, [ 'telegram' => [ - 'token' => $token - ] + 'token' => $token, + ], ], m::mock(Curl::class)); $this->assertFalse($driver->hasMatchingEvent()); @@ -332,14 +332,14 @@ public function telegram_login_event_has_the_correct_chat_id() 'last_name' => 'Pociot', 'username' => 'marcelpociot', 'photo_url' => 'https://some/picture.jpg', - 'auth_date' => time() + 'auth_date' => time(), ]; // Calculate hash $check = Collection::make($queryParameters) ->except('hash') - ->map(function($value, $key) { - return $key . '=' . $value; + ->map(function ($value, $key) { + return $key.'='.$value; }) ->values() ->sort(); @@ -354,8 +354,8 @@ public function telegram_login_event_has_the_correct_chat_id() $driver = new TelegramDriver($request, [ 'telegram' => [ - 'token' => $token - ] + 'token' => $token, + ], ], m::mock(Curl::class)); $message = $driver->getMessages();