Completed
Push — master ( 076ecd...1e6ec2 )
by Ariel
13:10
created
migrations/2016_03_18_000001_create_humanresources_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('humanresources', function (Blueprint $table) {
15
+        Schema::create('humanresources', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('name');
18 18
             $table->string('slug', 50)->index();
Please login to merge, or discard this patch.
src/Vacancy/VacancyManager.php 4 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,9 +105,9 @@
 block discarded – undo
105 105
         if(!is_numeric($statement['capacity']))
106 106
         {
107 107
             $vacancyValues['humanresource_id'] = $business->humanresources()
108
-                                                          ->where('slug', $statement['capacity'])
109
-                                                          ->first()
110
-                                                          ->id;
108
+                                                            ->where('slug', $statement['capacity'])
109
+                                                            ->first()
110
+                                                            ->id;
111 111
         }
112 112
         else
113 113
         {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
             ];
103 103
 
104 104
         // If capacity is a slug, grab the humanresource
105
-        if(!is_numeric($statement['capacity']))
105
+        if (!is_numeric($statement['capacity']))
106 106
         {
107 107
             $vacancyValues['humanresource_id'] = $business->humanresources()
108 108
                                                           ->where('slug', $statement['capacity'])
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,7 @@
 block discarded – undo
108 108
                                                           ->where('slug', $statement['capacity'])
109 109
                                                           ->first()
110 110
                                                           ->id;
111
-        }
112
-        else
111
+        } else
113 112
         {
114 113
             $vacancyValues['capacity'] = intval($statement['capacity']);
115 114
         }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,6 +124,9 @@  discard block
 block discarded – undo
124 124
         return $vacancy !== null;
125 125
     }
126 126
 
127
+    /**
128
+     * @param string $key
129
+     */
127 130
     protected function arrayGroupBy($key, $array)
128 131
     {
129 132
         $grouped = [];
@@ -156,7 +159,6 @@  discard block
 block discarded – undo
156 159
     /**
157 160
      * [generateAvailability description].
158 161
      *
159
-     * @param Illuminate\Database\Eloquent\Collection $vacancies
160 162
      * @param string                                  $startDate
161 163
      * @param int                                     $futureDays
162 164
      *
Please login to merge, or discard this patch.
src/Models/Appointment.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -440,11 +440,11 @@  discard block
 block discarded – undo
440 440
         $carbon = Carbon::parse('today midnight')->timezone('UTC');
441 441
 
442 442
         return $query
443
-            ->where(function ($query) use ($carbon) {
443
+            ->where(function($query) use ($carbon) {
444 444
 
445 445
                 $query->whereIn('status', [Self::STATUS_RESERVED, Self::STATUS_CONFIRMED])
446 446
                     ->where('start_at', '<=', $carbon)
447
-                    ->orWhere(function ($query) use ($carbon) {
447
+                    ->orWhere(function($query) use ($carbon) {
448 448
                         $query->where('start_at', '>=', $carbon);
449 449
                     });
450 450
             });
@@ -532,17 +532,17 @@  discard block
 block discarded – undo
532 532
         $finishAt->timezone('UTC');
533 533
 
534 534
         return $query
535
-            ->where(function ($query) use ($startAt, $finishAt) {
535
+            ->where(function($query) use ($startAt, $finishAt) {
536 536
 
537
-                $query->where(function ($query) use ($startAt, $finishAt) {
537
+                $query->where(function($query) use ($startAt, $finishAt) {
538 538
                     $query->where('finish_at', '>=', $finishAt)
539 539
                             ->where('start_at', '<', $startAt);
540 540
                 })
541
-                ->orWhere(function ($query) use ($startAt, $finishAt) {
541
+                ->orWhere(function($query) use ($startAt, $finishAt) {
542 542
                     $query->where('finish_at', '<=', $finishAt)
543 543
                             ->where('finish_at', '>', $startAt);
544 544
                 })
545
-                ->orWhere(function ($query) use ($startAt, $finishAt) {
545
+                ->orWhere(function($query) use ($startAt, $finishAt) {
546 546
                     $query->where('start_at', '>=', $startAt)
547 547
                             ->where('start_at', '<', $finishAt);
548 548
                 });
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
240 240
     /**
241 241
      * Get cancellation deadline (target date).
242 242
      *
243
-     * @return Carbon\Carbon
243
+     * @return Carbon
244 244
      */
245 245
     public function getCancellationDeadlineAttribute()
246 246
     {
Please login to merge, or discard this patch.
src/Presenters/BusinessPresenter.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $url = parse_url($this->wrappedObject->social_facebook);
25 25
 
26
-        if(!$this->wrappedObject->social_facebook || !array_key_exists('path', $url)){
26
+        if (!$this->wrappedObject->social_facebook || !array_key_exists('path', $url)) {
27 27
             return "<img class=\"img-thumbnail\" src=\"//placehold.it/100x100\" alt=\"{$this->wrappedObject->name}\"/>";
28 28
         }
29 29
 
@@ -69,8 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function industryIcon()
71 71
     {
72
-        $src = ($this->wrappedObject->pref('cover_photo_url')) ?:
73
-            asset('/img/industries/'.$this->wrappedObject->category->slug.'.png');
72
+        $src = ($this->wrappedObject->pref('cover_photo_url')) ?: asset('/img/industries/'.$this->wrappedObject->category->slug.'.png');
74 73
 
75 74
         return "<img class=\"img-responsive center-block\" src=\"{$src}\"/>";
76 75
     }
Please login to merge, or discard this patch.
src/Presenters/AppointmentPresenter.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -66,16 +66,16 @@
 block discarded – undo
66 66
         }
67 67
 
68 68
         $fromTime = $this->wrappedObject
69
-                         ->vacancy
70
-                         ->start_at
71
-                         ->timezone($this->timezone)
72
-                         ->format($timeFormat);
69
+                            ->vacancy
70
+                            ->start_at
71
+                            ->timezone($this->timezone)
72
+                            ->format($timeFormat);
73 73
 
74 74
         $toTime = $this->wrappedObject
75
-                       ->vacancy
76
-                       ->finish_at
77
-                       ->timezone($this->timezone)
78
-                       ->format($timeFormat);
75
+                        ->vacancy
76
+                        ->finish_at
77
+                        ->timezone($this->timezone)
78
+                        ->format($timeFormat);
79 79
 
80 80
         return ['from' => $fromTime, 'to' => $toTime];
81 81
     }
Please login to merge, or discard this patch.
src/Addressbook.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -14,6 +14,9 @@
 block discarded – undo
14 14
 {
15 15
     private $business;
16 16
 
17
+    /**
18
+     * @param Models\Business $business
19
+     */
17 20
     public function __construct($business)
18 21
     {
19 22
         $this->business = $business;
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Timegridio\Concierge;
4 4
 
5 5
 use Carbon\Carbon;
6
-use Models\Business;
7 6
 use Timegridio\Concierge\Models\Contact;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.
src/Duration.php 1 patch
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @param string $format rounding method after we reveal the readable 
114 114
      * interval. You can use PHP_ROUND_HALF_UP and PHP_ROUND_HALF_DOWN
115 115
      *
116
-     * @return well formatted output
116
+     * @return string formatted output
117 117
      */
118 118
     public function format($format = [])
119 119
     {
@@ -154,6 +154,7 @@  discard block
 block discarded – undo
154 154
     /**
155 155
      * @param int $round_method rounding method after we reveal the readable 
156 156
      * interval. You can use PHP_ROUND_HALF_UP and PHP_ROUND_HALF_DOWN
157
+     * @param integer $result
157 158
      *
158 159
      * @return float current number of the result. if it is using $round_method,
159 160
      * it will rounded up or down
@@ -170,7 +171,7 @@  discard block
 block discarded – undo
170 171
     }
171 172
 
172 173
     /**
173
-     * @return well formatted output
174
+     * @return string formatted output
174 175
      */
175 176
     public function __toString()
176 177
     {
Please login to merge, or discard this patch.
migrations/2016_07_09_000001_add_humanresource_calendar_link.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::table('humanresources', function (Blueprint $table) {
15
+        Schema::table('humanresources', function(Blueprint $table) {
16 16
             $table->string('calendar_link')->nullable();
17 17
         });
18 18
     }
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function down()
26 26
     {
27
-        Schema::table('humanresources', function (Blueprint $table) {
27
+        Schema::table('humanresources', function(Blueprint $table) {
28 28
             $table->dropColumn('calendar_link');
29 29
         });
30 30
     }
Please login to merge, or discard this patch.
src/Models/Vacancy.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,6 @@
 block discarded – undo
159 159
      * Scope Until.
160 160
      *
161 161
      * @param Illuminate\Database\Query $query
162
-     * @param \Carbon\Carbon $since
163 162
      *
164 163
      * @return Illuminate\Database\Query Scoped query
165 164
      */
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
     public function hasRoomBetween(Carbon $startAt, Carbon $finishAt)
267 267
     {
268 268
         return $this->capacity > $this->business
269
-                                      ->bookings()
270
-                                      ->active()
271
-                                      ->affectingInterval($startAt, $finishAt)
272
-                                      ->affectingHumanresource($this->humanresource_id)
273
-                                      ->count() &&
269
+                                        ->bookings()
270
+                                        ->active()
271
+                                        ->affectingInterval($startAt, $finishAt)
272
+                                        ->affectingHumanresource($this->humanresource_id)
273
+                                        ->count() &&
274 274
             ($this->start_at <= $startAt && $this->finish_at >= $finishAt);
275 275
     }
276 276
 
@@ -286,11 +286,11 @@  discard block
 block discarded – undo
286 286
         }
287 287
 
288 288
         $count = $this->business
289
-                      ->bookings()
290
-                      ->active()
291
-                      ->affectingHumanresource($this->humanresource_id)
292
-                      ->affectingInterval($startAt, $finishAt)
293
-                      ->count();
289
+                        ->bookings()
290
+                        ->active()
291
+                        ->affectingHumanresource($this->humanresource_id)
292
+                        ->affectingInterval($startAt, $finishAt)
293
+                        ->count();
294 294
 
295 295
         return $this->capacity - intval($count);
296 296
     }
Please login to merge, or discard this patch.