Passed
Push — master ( 740cbb...93b814 )
by Vinicius Lourenço
03:07
created
src/Scheduler/Contracts/SchedulerModelTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,21 +18,21 @@  discard block
 block discarded – undo
18 18
      * @param  string  $localKey
19 19
      * @return \Illuminate\Database\Eloquent\Relations\HasOne
20 20
      */
21
-    abstract public function hasOne($related, $foreignKey = null, $localKey = null);
21
+    abstract public function hasOne ($related, $foreignKey = null, $localKey = null);
22 22
 
23 23
 	/**
24 24
      * Get the value of the model's primary key.
25 25
      *
26 26
      * @return mixed
27 27
      */
28
-	abstract public function getKey();
28
+	abstract public function getKey ();
29 29
 
30 30
 	/**
31 31
      * Retorna apenas os horários que possuem o mesmo [model_type] do [parent] dessa [trait].
32 32
      *
33 33
      * @return \Illuminate\Database\Eloquent\Relations\HasMany
34 34
      */
35
-	public function schedules();
35
+	public function schedules ();
36 36
 
37 37
 	/**
38 38
 	 * Agenda um horário para esta model.
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param  array|null $data Informações opcionais que podem ser anexadas ao horário cadastrado.
45 45
 	 * @return \H4ad\Scheduler\Models\Schedule
46 46
 	 */
47
-	public function addSchedule($start_at, $end_at = null, $status = null, $data = null);
47
+	public function addSchedule ($start_at, $end_at = null, $status = null, $data = null);
48 48
 
49 49
 	/**
50 50
 	 * Exibe uma lista dos horários do dia de hoje.
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      *                                         Se for nulo, ele busca a referencia da config.
56 56
 	 * @return array
57 57
 	 */
58
-	public function availableToday($duration = 0, $openingTime = null);
58
+	public function availableToday ($duration = 0, $openingTime = null);
59 59
 
60 60
 	/**
61 61
 	 * Lista os horários livres em um determinado dia.
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      *                                         Se for nulo, ele busca a referencia da config.
68 68
 	 * @return array
69 69
 	 */
70
-	public function availableOn($date, $duration = 0, $openingTime = null);
70
+	public function availableOn ($date, $duration = 0, $openingTime = null);
71 71
 
72 72
 	/**
73 73
 	 * Faz um parse e retorna um Schedule.
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @param  \Carbon\Carbon|string|int $value Valor que representará a data ou o id a ser buscado.
76 76
 	 * @return \H4ad\Scheduler\Models\Schedule|null
77 77
 	 */
78
-	public function parseToSchedule($value);
78
+	public function parseToSchedule ($value);
79 79
 
80 80
 	/**
81 81
 	 * Remove um horário agendado pelo seu ID ou pelo horário em que foi marcado.
@@ -89,5 +89,5 @@  discard block
 block discarded – undo
89 89
 	 * @throws \H4ad\Scheduler\Exceptions\CantRemoveByDate
90 90
 	 * @throws \H4ad\Scheduler\Exceptions\ModelNotFound
91 91
 	 */
92
-	public function removeSchedule($schedule);
92
+	public function removeSchedule ($schedule);
93 93
 }
94 94
\ No newline at end of file
Please login to merge, or discard this patch.
src/Scheduler/Traits/SchedulerModelTrait.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -31,21 +31,21 @@  discard block
 block discarded – undo
31 31
      * @param  string  $localKey
32 32
      * @return \Illuminate\Database\Eloquent\Relations\HasOne
33 33
      */
34
-    abstract public function hasOne($related, $foreignKey = null, $localKey = null);
34
+    abstract public function hasOne ($related, $foreignKey = null, $localKey = null);
35 35
 
36 36
 	/**
37 37
      * Get the value of the model's primary key.
38 38
      *
39 39
      * @return mixed
40 40
      */
41
-	abstract public function getKey();
41
+	abstract public function getKey ();
42 42
 
43 43
 	/**
44 44
      * Retorna apenas o horário que possui o mesmo [model_id] do [parent] dessa [trait].
45 45
      *
46 46
      * @return \Illuminate\Database\Eloquent\Relations\HasOne
47 47
      */
48
-	public function schedules()
48
+	public function schedules ()
49 49
 	{
50 50
 		return $this->hasOne(Config::get('scheduler.schedules_table'), 'model_id');
51 51
 	}
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 	 * @param  array|null $data Informações opcionais que podem ser anexadas ao horário cadastrado.
61 61
 	 * @return \H4ad\Scheduler\Models\Schedule
62 62
 	 */
63
-	public function addSchedule($start_at, $end_at = null, $status = null, $data = null)
63
+	public function addSchedule ($start_at, $end_at = null, $status = null, $data = null)
64 64
 	{
65 65
 		$schedule = Scheduler::validateSchedule(self::class, $start_at, $end_at, $status);
66 66
 
67
-		$schedule['model_id'] = $this->getKey();
68
-		$schedule['data'] = $data;
67
+		$schedule[ 'model_id' ] = $this->getKey();
68
+		$schedule[ 'data' ] = $data;
69 69
 
70 70
 		return Schedule::create($schedule);
71 71
 	}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      *                                         Se for nulo, ele busca a referencia da config.
80 80
 	 * @return array
81 81
 	 */
82
-	public function availableToday($duration = 0, $openingTime = null)
82
+	public function availableToday ($duration = 0, $openingTime = null)
83 83
 	{
84 84
 		return Scheduler::availableToday(self::class, $duration, $openingTime);
85 85
 	}
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      *                                         Se for nulo, ele busca a referencia da config.
95 95
 	 * @return array
96 96
 	 */
97
-	public function availableOn($date, $duration = 0, $openingTime = null)
97
+	public function availableOn ($date, $duration = 0, $openingTime = null)
98 98
 	{
99 99
 		return Scheduler::availableOn(self::class, $date, $duration, $openingTime);
100 100
 	}
@@ -111,17 +111,17 @@  discard block
 block discarded – undo
111 111
 	 * @throws \H4ad\Scheduler\Exceptions\CantRemoveByDate
112 112
 	 * @throws \H4ad\Scheduler\Exceptions\ModelNotFound
113 113
 	 */
114
-	public function removeSchedule($schedule)
114
+	public function removeSchedule ($schedule)
115 115
 	{
116
-		if(!Config::get('scheduler.enable_schedule_conflict') && !is_int($schedule))
116
+		if (!Config::get('scheduler.enable_schedule_conflict') && !is_int($schedule))
117 117
 			throw new CantRemoveByDate;
118 118
 
119 119
 		$schedule = Scheduler::parseToSchedule($schedule);
120 120
 
121
-		if(!($schedule instanceof Model))
121
+		if (!($schedule instanceof Model))
122 122
 			throw (new ModelNotFound)->setValues(Schedule::class);
123 123
 
124
-		if($schedule->model_type != self::class || $schedule->model_id != $this->getKey())
124
+		if ($schedule->model_type != self::class || $schedule->model_id != $this->getKey())
125 125
 			throw new DoesNotBelong;
126 126
 
127 127
 		return $schedule->delete();
Please login to merge, or discard this patch.