Passed
Pull Request — main (#24)
by PRATIK
19:05 queued 15:10
created
src/Helpers/website.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // Search Schema
15 15
 
16
-if (! function_exists('about_organization_schema')) {
16
+if (!function_exists('about_organization_schema')) {
17 17
     function about_organization_schema()
18 18
     {
19 19
         $org = Schema::organization()
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
     }
30 30
 }
31 31
 
32
-if (! function_exists('services_schema')) {
32
+if (!function_exists('services_schema')) {
33 33
     function services_schema()
34 34
     {
35 35
         $graph = new Graph();
36 36
         $services = Cache::get('services', Service::orderBy('position')->get());
37 37
         foreach ($services as $service) {
38
-            $graph->service(str_replace(' ', '', $service->name), function (SchemaOrgService $schema, Graph $graph) use ($service): void {
38
+            $graph->service(str_replace(' ', '', $service->name), function(SchemaOrgService $schema, Graph $graph) use ($service): void {
39 39
                 $schema
40 40
                     ->name($service->meta_name ?? $service->name)
41 41
                     ->description($service->meta_description ?? $service->excerpt)
@@ -48,20 +48,20 @@  discard block
 block discarded – undo
48 48
     }
49 49
 }
50 50
 
51
-if (! function_exists('software_schema')) {
51
+if (!function_exists('software_schema')) {
52 52
     function software_schema()
53 53
     {
54 54
         $graph = new Graph();
55 55
         $software = Cache::get('software', Software::orderBy('position')->get());
56 56
         foreach ($software as $sw) {
57 57
             $modules = isset($sw->data['modules']) ? $sw->data['modules'] : null;
58
-            $graph->softwareApplication(str_replace(' ', '', $sw->name), function (SoftwareApplication $schema, Graph $graph) use ($sw, $modules): void {
58
+            $graph->softwareApplication(str_replace(' ', '', $sw->name), function(SoftwareApplication $schema, Graph $graph) use ($sw, $modules): void {
59 59
                 $schema
60 60
                     ->name($sw->meta_name ?? $sw->name)
61 61
                     ->author(title())
62 62
                     ->description($sw->meta_description ?? $sw->excerpt)
63 63
                     ->image($sw->banner)
64
-                    ->if(! is_null($modules), function (SoftwareApplication $schema) use ($modules) {
64
+                    ->if(!is_null($modules), function(SoftwareApplication $schema) use ($modules) {
65 65
                         $schema->email(collect($modules)->pluck('name')->toArray());
66 66
                     })
67 67
                     ->url(route('website.software', ['software' => $sw->slug]))
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
     }
74 74
 }
75 75
 
76
-if (! function_exists('posts_schema')) {
76
+if (!function_exists('posts_schema')) {
77 77
     function posts_schema()
78 78
     {
79 79
         $graph = new Graph();
80 80
         $posts = Cache::get('posts', Post::published()->orderBy('position')->get());
81 81
         foreach ($posts as $post) {
82
-            $graph->article(str_replace(' ', '', $post->name), function (Article $schema, Graph $graph) use ($post): void {
82
+            $graph->article(str_replace(' ', '', $post->name), function(Article $schema, Graph $graph) use ($post): void {
83 83
                 $schema
84 84
                     ->name($post->meta_name ?? $post->name)
85 85
                     ->description($post->meta_description ?? $post->excerpt)
86
-                    ->if(! is_null($post->getFirstMedia('image')), function (Article $schema) use ($post) {
86
+                    ->if(!is_null($post->getFirstMedia('image')), function(Article $schema) use ($post) {
87 87
                         $schema->image($post->getFirstMediaUrl('image'));
88 88
                     })
89 89
                     ->keywords($post->meta_keywords);
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
     }
95 95
 }
96 96
 
97
-if (! function_exists('dateMode')) {
97
+if (!function_exists('dateMode')) {
98 98
     function dateMode()
99 99
     {
100 100
         $mode = config('adminetic.cache_mode', true) ?
101
-            Cache::has('date_mode') ? Cache::get('date_mode') : Cache::rememberForever('date_mode', function () {
101
+            Cache::has('date_mode') ? Cache::get('date_mode') : Cache::rememberForever('date_mode', function() {
102 102
                 return setting('date_mode', config('website.date_mode', 'bs'));
103 103
             })
104 104
             : setting('date_mode', config('website.date_mode', 'bs'));
@@ -107,112 +107,112 @@  discard block
 block discarded – undo
107 107
     }
108 108
 }
109 109
 
110
-if (! function_exists('modeDate')) {
110
+if (!function_exists('modeDate')) {
111 111
     function modeDate(Carbon $date)
112 112
     {
113 113
         return dateMode() == 'bs' ? nepaliDate($date) : $date->toFormattedDateString();
114 114
     }
115 115
 }
116 116
 
117
-if (! function_exists('currency')) {
117
+if (!function_exists('currency')) {
118 118
     function currency()
119 119
     {
120 120
         return setting('currency', config('website.currency', 'Rs.'));
121 121
     }
122 122
 }
123 123
 
124
-if (! function_exists('short_description')) {
124
+if (!function_exists('short_description')) {
125 125
     function short_description()
126 126
     {
127 127
         return setting('short_description', config('website.short_description', null));
128 128
     }
129 129
 }
130 130
 
131
-if (! function_exists('description')) {
131
+if (!function_exists('description')) {
132 132
     function description()
133 133
     {
134 134
         return setting('description', config('website.description', null));
135 135
     }
136 136
 }
137 137
 
138
-if (! function_exists('map')) {
138
+if (!function_exists('map')) {
139 139
     function map()
140 140
     {
141 141
         return setting('map', config('website.map', null));
142 142
     }
143 143
 }
144 144
 
145
-if (! function_exists('phone')) {
145
+if (!function_exists('phone')) {
146 146
     function phone()
147 147
     {
148 148
         return setting('phone', config('website.phone', ''));
149 149
     }
150 150
 }
151 151
 
152
-if (! function_exists('email')) {
152
+if (!function_exists('email')) {
153 153
     function email()
154 154
     {
155 155
         return setting('email', config('website.email', ''));
156 156
     }
157 157
 }
158 158
 
159
-if (! function_exists('address')) {
159
+if (!function_exists('address')) {
160 160
     function address()
161 161
     {
162 162
         return setting('address', config('website.address', ''));
163 163
     }
164 164
 }
165 165
 
166
-if (! function_exists('keywords')) {
166
+if (!function_exists('keywords')) {
167 167
     function keywords()
168 168
     {
169 169
         return setting('keywords', config('website.keywords', 'event management, doctype innovations'));
170 170
     }
171 171
 }
172 172
 
173
-if (! function_exists('opening_hour')) {
173
+if (!function_exists('opening_hour')) {
174 174
     function opening_hour()
175 175
     {
176 176
         return setting('opening_hour', config('website.opening_hour', '9am to 6pm'));
177 177
     }
178 178
 }
179 179
 
180
-if (! function_exists('facebook')) {
180
+if (!function_exists('facebook')) {
181 181
     function facebook()
182 182
     {
183 183
         return setting('facebook', config('website.facebook', 'https://www.facebook.com/doctypenepal'));
184 184
     }
185 185
 }
186 186
 
187
-if (! function_exists('email')) {
187
+if (!function_exists('email')) {
188 188
     function email()
189 189
     {
190 190
         return setting('email', config('website.email', '[email protected]'));
191 191
     }
192 192
 }
193 193
 
194
-if (! function_exists('facebook_messenger')) {
194
+if (!function_exists('facebook_messenger')) {
195 195
     function facebook_messenger()
196 196
     {
197 197
         return setting('facebook_messenger', config('website.facebook_messenger', 'https://m.me/doctypenepal'));
198 198
     }
199 199
 }
200 200
 
201
-if (! function_exists('parseYoutube')) {
201
+if (!function_exists('parseYoutube')) {
202 202
     function parseYoutube($video)
203 203
     {
204 204
         return preg_replace("/\s*[a-zA-Z\/\/:\.]*youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", '<div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" style="width: 100%;height: 30vh;" src="//www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe></div>', $video);
205 205
     }
206 206
 }
207 207
 
208
-if (! function_exists('services')) {
208
+if (!function_exists('services')) {
209 209
     function services()
210 210
     {
211 211
         return Cache::get('services', Service::orderBy('position')->get());
212 212
     }
213 213
 }
214 214
 
215
-if (! function_exists('software')) {
215
+if (!function_exists('software')) {
216 216
     function software()
217 217
     {
218 218
         return Cache::get('software', Software::orderBy('position')->get());
Please login to merge, or discard this patch.
src/Traits/HasFileUpload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@
 block discarded – undo
10 10
 {
11 11
     public function fileUpload($file, $directory, $given_name = null)
12 12
     {
13
-        if (! $file->isValid()) {
13
+        if (!$file->isValid()) {
14 14
             throw new \Exception('File was not uploaded successfully');
15 15
         }
16 16
 
17 17
         /** Check if folder exits or not. If not then create the folder */
18
-        if (! File::exists(storage_path($directory))) {
18
+        if (!File::exists(storage_path($directory))) {
19 19
             File::makeDirectory(storage_path($directory), 0775, true);
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/Services/PaymentRegister.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         $this->amount = $amount;
18 18
         $this->payment_id = $payment_id;
19 19
 
20
-        if (! is_null($payment_id)) {
20
+        if (!is_null($payment_id)) {
21 21
             Payment::where('payment_id', $payment_id)->delete();
22 22
         }
23 23
     }
Please login to merge, or discard this patch.
src/Services/Statistic.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
         $data = null;
20 20
         $period = CarbonPeriod::create($start_date, $end_date);
21 21
         foreach ($period as $date) {
22
-            if (! is_null($event)) {
23
-                $payments = $event->payments->filter(function ($payment) use ($date) {
22
+            if (!is_null($event)) {
23
+                $payments = $event->payments->filter(function($payment) use ($date) {
24 24
                     return $payment->created_at->format('Y-m-d') == $date->format('Y-m-d');
25 25
                 });
26
-                $passes = $event->passes->filter(function ($pass) use ($date) {
26
+                $passes = $event->passes->filter(function($pass) use ($date) {
27 27
                     return $pass->created_at->format('Y-m-d') == $date->format('Y-m-d');
28 28
                 });
29 29
             } else {
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             ];
38 38
         }
39 39
 
40
-        return ! is_null($data) ? array_reverse($data) : null;
40
+        return !is_null($data) ? array_reverse($data) : null;
41 41
     }
42 42
 
43 43
     /*
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             $period = CarbonPeriod::create($start_date, $end_date);
56 56
             $total = [];
57 57
             foreach ($period as $date) {
58
-                $total[modeDate($date)] = $data->filter(function ($p) use ($date) {
58
+                $total[modeDate($date)] = $data->filter(function($p) use ($date) {
59 59
                     return $p->created_at->format('Y-m-d') == $date->format('Y-m-d');
60 60
                 })->count();
61 61
             }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             $period = CarbonPeriod::create($start_date, $end_date);
82 82
             $total = [];
83 83
             foreach ($period as $date) {
84
-                $total[modeDate($date)] = $data->filter(function ($p) use ($date) {
84
+                $total[modeDate($date)] = $data->filter(function($p) use ($date) {
85 85
                     return $p->created_at->format('Y-m-d') == $date->format('Y-m-d');
86 86
                 })->sum('payment');
87 87
             }
Please login to merge, or discard this patch.
src/Repositories/CareerRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     public function indexCareer()
17 17
     {
18 18
         $careers = config('adminetic.caching', true)
19
-            ? (Cache::has('careers') ? Cache::get('careers') : Cache::rememberForever('careers', function () {
19
+            ? (Cache::has('careers') ? Cache::get('careers') : Cache::rememberForever('careers', function() {
20 20
                 return Career::orderBy('position')->get();
21 21
             }))
22 22
             : Career::orderBy('position')->get();
Please login to merge, or discard this patch.
src/Repositories/CategoryRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
     public function indexCategory()
14 14
     {
15 15
         $categories = config('adminetic.caching', true)
16
-            ? (Cache::has('categories') ? Cache::get('categories') : Cache::rememberForever('categories', function () {
16
+            ? (Cache::has('categories') ? Cache::get('categories') : Cache::rememberForever('categories', function() {
17 17
                 return Category::orderBy('position')->get();
18 18
             }))
19 19
             : Category::orderBy('position')->get();
20 20
 
21 21
         // Parent Categories
22
-        if (! Cache::has('parent_categories')) {
23
-            Cache::rememberForever('parent_categories', function () {
22
+        if (!Cache::has('parent_categories')) {
23
+            Cache::rememberForever('parent_categories', function() {
24 24
                 return Category::whoIsParent()->position()->get();
25 25
             });
26 26
         }
Please login to merge, or discard this patch.