@@ -18,7 +18,7 @@ |
||
18 | 18 | $user = $this->getHttpUser(); |
19 | 19 | $response = $this->http('POST', '/broadcasting/auth', [ |
20 | 20 | 'socket_id' => '125191.2709135', |
21 | - 'channel_name' => 'private-user.' . $user->getKey() |
|
21 | + 'channel_name' => 'private-user.'.$user->getKey() |
|
22 | 22 | ]); |
23 | 23 | |
24 | 24 | $response->assertStatus(200); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $this->assertCount(2, $notifications); |
26 | 26 | $notification = $user->unreadNotifications()->first(); |
27 | 27 | $notificationId = $notification->getKey(); |
28 | - $response = $this->http('POST', 'v1/notifications/' . $notificationId); |
|
28 | + $response = $this->http('POST', 'v1/notifications/'.$notificationId); |
|
29 | 29 | $response->assertStatus(200); |
30 | 30 | $unreadnotifications = User::find($user->getKey())->unreadNotifications; |
31 | 31 | $this->assertCount(1, $unreadnotifications); |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | $user->notifyNow(new UserRegisteredNotification($user)); |
52 | 52 | $notification = $user->unreadNotifications()->first(); |
53 | 53 | $notificationId = $notification->getKey(); |
54 | - $response = $this->http('POST', 'v1/notifications/' . $notificationId); |
|
54 | + $response = $this->http('POST', 'v1/notifications/'.$notificationId); |
|
55 | 55 | $response->assertStatus(200); |
56 | 56 | $response = $this->http('GET', 'v1/notifications/unread'); |
57 | 57 | $response->assertStatus(200); |
58 | - $notifications = (array)User::find($user->getKey())->unreadNotifications->toArray(); |
|
58 | + $notifications = (array) User::find($user->getKey())->unreadNotifications->toArray(); |
|
59 | 59 | //$this->assertEquals($notifications, $this->decodeHttpContent($response->getContent())); |
60 | 60 | } |
61 | 61 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | $randomIndex = random_int(0, count($array) - 1); |
44 | 44 | |
45 | - return $array[$randomIndex]; |
|
45 | + return $array[ $randomIndex ]; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | if (!function_exists('create_multiple_from_factory')) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $traits = array_flip(class_uses_recursive($class)); |
93 | 93 | |
94 | - return isset($traits[$trait]); |
|
94 | + return isset($traits[ $trait ]); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | if (!function_exists('array_keys_exists')) { |
@@ -123,8 +123,9 @@ discard block |
||
123 | 123 | |
124 | 124 | $result = array_intersect($subset, $array); |
125 | 125 | |
126 | - if ($strict) |
|
127 | - return $result === $subset; |
|
126 | + if ($strict) { |
|
127 | + return $result === $subset; |
|
128 | + } |
|
128 | 129 | |
129 | 130 | return $result == $subset; |
130 | 131 | } |
@@ -133,7 +134,9 @@ discard block |
||
133 | 134 | if (!function_exists('is_associative_array')) { |
134 | 135 | function is_associative_array(array $arr) |
135 | 136 | { |
136 | - if (array() === $arr) return false; |
|
137 | + if (array() === $arr) { |
|
138 | + return false; |
|
139 | + } |
|
137 | 140 | return array_keys($arr) !== range(0, count($arr) - 1); |
138 | 141 | } |
139 | 142 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $this->artisan('cache:clear'); |
24 | 24 | $this->artisan('db:seed'); |
25 | 25 | |
26 | - $this->beforeApplicationDestroyed(function () { |
|
26 | + $this->beforeApplicationDestroyed(function() { |
|
27 | 27 | $this->artisan('cache:clear'); |
28 | 28 | $this->artisan('migrate:rollback'); |
29 | 29 | RefreshDatabaseState::$migrated = false; |
@@ -13,20 +13,20 @@ |
||
13 | 13 | |
14 | 14 | trait Cacheable |
15 | 15 | { |
16 | - public static function find($id, $columns = ['*']) |
|
16 | + public static function find($id, $columns = [ '*' ]) |
|
17 | 17 | { |
18 | 18 | $model = ModelCache::findOrRequery($id, get_called_class()); |
19 | 19 | return self::filterFromColumns($model, $columns); |
20 | 20 | } |
21 | 21 | |
22 | - public static function findWithoutCache($id, $columns = ['*']) |
|
22 | + public static function findWithoutCache($id, $columns = [ '*' ]) |
|
23 | 23 | { |
24 | 24 | return get_parent_class(self::class)::find($id, $columns); |
25 | 25 | } |
26 | 26 | |
27 | 27 | private static function filterFromColumns($model, $columns) |
28 | 28 | { |
29 | - if ($columns !== ['*']) { |
|
29 | + if ($columns !== [ '*' ]) { |
|
30 | 30 | return collect($model)->first($columns); |
31 | 31 | } |
32 | 32 | return $model; |
@@ -28,6 +28,6 @@ |
||
28 | 28 | |
29 | 29 | public function receivesBroadcastNotificationsOn() |
30 | 30 | { |
31 | - return strtolower(get_short_class_name($this)) . '.' . $this->getKey(); |
|
31 | + return strtolower(get_short_class_name($this)).'.'.$this->getKey(); |
|
32 | 32 | } |
33 | 33 | } |