From 13cba29326815febdb1948a0c170b7eadbe1eeb3 Mon Sep 17 00:00:00 2001 From: paragraf-lex Date: Thu, 10 Jan 2019 08:40:32 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Bot.php | 11 +++++------ src/Http/Controllers/ViberBotController.php | 2 +- src/helpers.php | 13 +++++-------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/Bot.php b/src/Bot.php index ef79b31..1981d46 100644 --- a/src/Bot.php +++ b/src/Bot.php @@ -5,8 +5,9 @@ use Paragraf\ViberBot\Http\Http; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Collection; + //TODO: Make it through composer | Not it's not working, no reason -require_once "helpers.php"; +require_once 'helpers.php'; class Bot { @@ -56,13 +57,11 @@ public function hears($text) if (is_string($text)) { - /** + /* * This represent regex. */ - if (startWith('/', $text) && endWith('/', $text)) - { - if (preg_match($text, $this->request->message['text'])) - { + if (startWith('/', $text) && endWith('/', $text)) { + if (preg_match($text, $this->request->message['text'])) { return $this; } } diff --git a/src/Http/Controllers/ViberBotController.php b/src/Http/Controllers/ViberBotController.php index 5c73563..5923c0a 100644 --- a/src/Http/Controllers/ViberBotController.php +++ b/src/Http/Controllers/ViberBotController.php @@ -36,7 +36,7 @@ public function index(Request $request) (new Bot($request, new TextMessage())) ->on(new MessageEvent($request->timestamp, $request->message_token, new ViberUser($request->sender['id'], $request->sender['name']), $request->message)) ->hears('/^[\\\P\\\p][\d+]{5,5}$/') - ->body(function (){ + ->body(function () { dump(factory(User::class)->create()->id); dump(factory(User::class)->create()->id); }) diff --git a/src/helpers.php b/src/helpers.php index 3a1d8fa..855c1e1 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -1,18 +1,16 @@