Completed
Push — master ( 973e33...58fb89 )
by Алексей
04:55
created
src/Config/FileConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function __construct($path)
24 24
     {
25
-        $this->path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
25
+        $this->path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
26 26
     }
27 27
 
28 28
     public function getValue($chatId, $value, $default)
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     private function getFileName($chatId)
46 46
     {
47
-        return $this->path . 'c' . $chatId;
47
+        return $this->path.'c'.$chatId;
48 48
     }
49 49
 
50 50
     public function setValue($chatId, $key, $value)
Please login to merge, or discard this patch.
src/Base/BaseType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $map = $this->map;
50 50
 
51 51
         return collect($attributes)
52
-            ->mapWithKeys(function ($item, $key) use ($map) {
52
+            ->mapWithKeys(function($item, $key) use ($map) {
53 53
                 $keyData = array_get($map, $key);
54 54
                 if (is_callable($keyData)) {
55 55
                     return [$key => call_user_func($keyData, $item)];
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function toArray()
82 82
     {
83 83
         return $this->attributes
84
-            ->mapWithKeys(function ($item, $key) {
84
+            ->mapWithKeys(function($item, $key) {
85 85
                 if (is_subclass_of($item, BaseType::class)) {
86 86
                     /** @var BaseType $item */
87 87
                     return [$key => $item->toArray()];
Please login to merge, or discard this patch.
src/Entry/InlineKeyboard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         return $keyboard;
40 40
     }
41 41
 
42
-    public function toArray(){
42
+    public function toArray() {
43 43
         return $this->rows->toArray();
44 44
     }
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
src/Base/ArrayOfBaseType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     {
29 29
         $baseType    = $this->baseType;
30 30
         $this->array = collect($array)
31
-            ->map(function ($item) use ($baseType) {
31
+            ->map(function($item) use ($baseType) {
32 32
                 return new BaseType($item);
33 33
             });
34 34
     }
Please login to merge, or discard this patch.
src/Base/BaseEntry.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,10 +38,9 @@
 block discarded – undo
38 38
     public function toArray()
39 39
     {
40 40
         return $this->attributes
41
-            ->mapWithKeys(function ($item, $key) {
42
-                return $item instanceof Collection || get_parent_class($item) === BaseEntry::class?
43
-                    [$key => $item->toArray()] :
44
-                    [$key => $item];
41
+            ->mapWithKeys(function($item, $key) {
42
+                return $item instanceof Collection || get_parent_class($item) === BaseEntry::class ?
43
+                    [$key => $item->toArray()] : [$key => $item];
45 44
             })
46 45
             ->toArray();
47 46
     }
Please login to merge, or discard this patch.
src/helpers.php 3 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,9 +12,13 @@
 block discarded – undo
12 12
      */
13 13
     function array_get($array, $key, $default = null)
14 14
     {
15
-        if (is_null($key)) return $array;
15
+        if (is_null($key)) {
16
+            return $array;
17
+        }
16 18
 
17
-        if (isset($array[$key])) return $array[$key];
19
+        if (isset($array[$key])) {
20
+            return $array[$key];
21
+        }
18 22
 
19 23
         foreach (explode('.', $key) as $segment)
20 24
         {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 {
36 36
         function snake_case($value, $delimiter = '_')
37 37
         {
38
-        	$replace = '$1'.$delimiter.'$2';
39
-        	return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value));
38
+            $replace = '$1'.$delimiter.'$2';
39
+            return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value));
40 40
         }
41 41
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! function_exists('array_get'))
3
+if (!function_exists('array_get'))
4 4
 {
5 5
     /**
6 6
      * Get an item from an array using "dot" notation.
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
         foreach (explode('.', $key) as $segment)
20 20
         {
21
-            if ( ! is_array($array) || ! array_key_exists($segment, $array))
21
+            if (!is_array($array) || !array_key_exists($segment, $array))
22 22
             {
23 23
                 return value($default);
24 24
             }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 }
32 32
 
33 33
 
34
-if ( ! function_exists('snake_case'))
34
+if (!function_exists('snake_case'))
35 35
 {
36 36
         function snake_case($value, $delimiter = '_')
37 37
         {
Please login to merge, or discard this patch.
src/Entry/KeyboardButtonEntry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
      * @param bool $requestLocation
50 50
      * @return $this
51 51
      */
52
-    public function setRequestLocation($requestLocation){
52
+    public function setRequestLocation($requestLocation) {
53 53
         return $this->set('request_contact', $requestLocation);
54 54
     }
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
src/Entry/ReplyKeyboardEntry.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,10 +77,10 @@
 block discarded – undo
77 77
             $clone = clone $this;
78 78
             $rows  = $clone
79 79
                 ->get(self::KEYBOARD_KEY, collect())
80
-                ->mapWithKeys(function ($item, $key) {
80
+                ->mapWithKeys(function($item, $key) {
81 81
                     return [
82 82
                         $key => collect($item)
83
-                            ->mapWithKeys(function ($item, $key) {
83
+                            ->mapWithKeys(function($item, $key) {
84 84
                                 /** @var $item Collection */
85 85
                                 return [$key => $item->toArray()];
86 86
                             }),
Please login to merge, or discard this patch.
src/Bot.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         if (!$this->token) {
47 47
             throw new TelegramCoreException('Token must be defined');
48 48
         }
49
-        $baseOptions  = [
49
+        $baseOptions = [
50 50
             'base_uri'    => sprintf('https://api.telegram.org/bot%s/', $token),
51 51
             'verify'      => false,
52 52
             'http_errors' => false,
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $json = \GuzzleHttp\json_decode($response->getBody()->getContents(), true);
81 81
         if (array_get($json, 'ok') === false) {
82
-            throw new TelegramCoreException(array_get($json, 'description', 'error') . array_get($json, 'error_code'),
82
+            throw new TelegramCoreException(array_get($json, 'description', 'error').array_get($json, 'error_code'),
83 83
                 array_get($json, 'error_code'));
84 84
         }
85 85
 
Please login to merge, or discard this patch.