Passed
Pull Request — master (#267)
by
unknown
05:47
created
app/Http/Controllers/TeacherCalendarController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
         $teachers = Teacher::all()->toArray();
28 28
 
29
-        $teachers = array_map(function ($teacher) {
29
+        $teachers = array_map(function($teacher) {
30 30
             return [
31 31
                 'id' => $teacher['id'],
32 32
                 'title' => $teacher['name'] ?? '',
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         array_push($teachers, ['id' => 'tbd', 'title' => 'Unassigned']);
37 37
 
38
-        $events = array_map(function ($event) {
38
+        $events = array_map(function($event) {
39 39
             return [
40 40
                 'title' => $event['name'] ?? '',
41 41
                 'resourceId' => $event['teacher_id'],
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         $unassigned_events = Event::where('teacher_id', null)->get()->toArray();
51 51
 
52
-        $unassigned_events = array_map(function ($event) {
52
+        $unassigned_events = array_map(function($event) {
53 53
             return [
54 54
                 'title' => $event['name'] ?? '',
55 55
                 'resourceId' => 'tbd',
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         $leaves = Leave::orderBy('date', 'desc')->limit(10000)->get()->toArray();
65 65
 
66
-        $leaves = array_map(function ($event) {
66
+        $leaves = array_map(function($event) {
67 67
             return [
68 68
                 'title' => $event->leaveType->name ?? 'ABS', // todo fix
69 69
                 'resourceId' => $event['teacher_id'],
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         }
93 93
 
94 94
         $events = $teacher->events->toArray();
95
-        $events = array_map(function ($event) {
95
+        $events = array_map(function($event) {
96 96
             return [
97 97
                 'title' => $event['name'],
98 98
                 'start' => $event['start'],
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
         }, $events);
104 104
 
105 105
         $leaves = $teacher->leaves->toArray();
106
-        $leaves = array_map(function ($event) {
106
+        $leaves = array_map(function($event) {
107 107
             return [
108
-                'title' => $event->leaveType->name ?? 'vacances',  // todo fix
108
+                'title' => $event->leaveType->name ?? 'vacances', // todo fix
109 109
                 'start' => $event['date'],
110 110
                 'allDay' => true,
111 111
             ];
Please login to merge, or discard this patch.
app/Http/Controllers/ConfigController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function get()
12 12
     {
13
-        if (! backpack_user()->hasPermissionTo('courses.edit')) {
13
+        if (!backpack_user()->hasPermissionTo('courses.edit')) {
14 14
             abort(403);
15 15
         }
16 16
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function update(UpdateConfigRequest $request)
25 25
     {
26
-        if (! backpack_user()->hasPermissionTo('courses.edit')) {
26
+        if (!backpack_user()->hasPermissionTo('courses.edit')) {
27 27
             abort(403);
28 28
         }
29 29
 
Please login to merge, or discard this patch.
app/Http/Controllers/InvoiceController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         // persist the products
88 88
         foreach ($request->products as $f => $product) {
89
-            $productType = match ($product['type']) {
89
+            $productType = match($product['type']) {
90 90
                 'enrollment' => Enrollment::class,
91 91
                 'scheduledPayment' => Enrollment::class,
92 92
                 'fee' => Fee::class,
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             Payment::create([
156 156
                 'responsable_id' => backpack_user()->id,
157 157
                 'invoice_id' => $invoice->id,
158
-                'payment_method' => isset($payment['method']) ? $payment['method'] : null ,
158
+                'payment_method' => isset($payment['method']) ? $payment['method'] : null,
159 159
                 'value' => $payment['value'],
160 160
                 'date' => isset($payment['date']) ? Carbon::parse($payment['date']) : Carbon::now(),
161 161
             ]);
Please login to merge, or discard this patch.
app/Http/Controllers/LeadStatusController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         // if the sync with external mailing system is enabled
20 20
         if (config('mailing-system.external_mailing_enabled') == true) {
21 21
 
22
-            match ($request->input('status')) {
22
+            match($request->input('status')) {
23 23
                 1 => $listId = config('mailing-system.mailerlite.activeStudentsListId'),
24 24
                 2, 3 => $listId = config('mailing-system.mailerlite.inactiveStudentsListId'),
25 25
                 default => abort(422, 'List ID not found'),
Please login to merge, or discard this patch.
app/Http/Controllers/HRController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
         $report_end_date = $request->report_end_date ? Carbon::parse($request->report_end_date) : Carbon::parse($period->end);
33 33
 
34 34
         // if we are dealing with a complete period, add theoretical volumes
35
-        if (! $request->report_start_date && ! $request->report_end_date) {
35
+        if (!$request->report_start_date && !$request->report_end_date) {
36 36
             // ensure the report end date is not before the end date to avoid inconsistent results.
37 37
             $report_end_date = $report_start_date->max($report_end_date);
38 38
 
Please login to merge, or discard this patch.
app/Events/LeadStatusUpdatedEvent.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,10 +17,9 @@
 block discarded – undo
17 17
     public $firstname;
18 18
     public $listId;
19 19
 
20
-    public function __construct(Student|Contact $user, $listId = null)
20
+    public function __construct(Student | Contact $user, $listId = null)
21 21
     {
22
-        $listId = $listId ? $listId :
23
-        $this->email = $user->email;
22
+        $listId = $listId ? $listId : $this->email = $user->email;
24 23
         $this->name = $user->firstname;
25 24
         $this->lastname = $user->lastname;
26 25
         $this->listId = $listId;
Please login to merge, or discard this patch.
app/Mail/ExternalCourseReport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,6 +24,6 @@
 block discarded – undo
24 24
 
25 25
     public function build()
26 26
     {
27
-        return $this->subject('Facturation ' . $this->data['partner_name'])->view('emails.external_courses_report');
27
+        return $this->subject('Facturation '.$this->data['partner_name'])->view('emails.external_courses_report');
28 28
     }
29 29
 }
Please login to merge, or discard this patch.
app/Listeners/SendExternalCoursesReport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
         // foreach partner with an alert set for this day of month
33 33
         foreach (Partner::where('send_report_on', Carbon::now()->day)->get() as $partner) {
34 34
             // get all courses
35
-            $courses = $partner->courses()->whereHas('events', function (Builder $query) use ($period_start, $period_end) {
35
+            $courses = $partner->courses()->whereHas('events', function(Builder $query) use ($period_start, $period_end) {
36 36
                 $query->where('start', '>=', $period_start->toDateString())->where('end', '<=', $period_end->toDateString());
37 37
             })
38 38
             ->with('events')->withCount('events')
Please login to merge, or discard this patch.
app/Providers/TelescopeServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
         $this->hideSensitiveRequestDetails();
22 22
 
23
-        Telescope::filter(function (IncomingEntry $entry) {
23
+        Telescope::filter(function(IncomingEntry $entry) {
24 24
             if ($this->app->isLocal()) {
25 25
                 return true;
26 26
             }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function gate()
63 63
     {
64
-        Gate::define('viewTelescope', function ($user = null) {
64
+        Gate::define('viewTelescope', function($user = null) {
65 65
             return backpack_user() && backpack_user()->email === config('app.admin_email');
66 66
         });
67 67
     }
Please login to merge, or discard this patch.