Passed
Push — master ( b585ab...4bc108 )
by Mohammed
13:03
created
src/TransDate.php 2 patches
Braces   +21 added lines, -42 removed lines patch added patch discarded remove patch
@@ -22,16 +22,13 @@  discard block
 block discarded – undo
22 22
                 if($dateArray[0] == 1)
23 23
                 {
24 24
                     return $zaman."ثانية واحدة";
25
-                }
26
-                elseif($dateArray[0] == 2)
25
+                } elseif($dateArray[0] == 2)
27 26
                 {
28 27
                     return $zaman. "ثانيتين";
29
-                }
30
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
28
+                } elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
31 29
                 {
32 30
                     return $zaman. $dateArray[0] . " ثواني";
33
-                }
34
-                else
31
+                } else
35 32
                 {
36 33
                     return $zaman.  $dateArray[0] . " ثانية";
37 34
                 }
@@ -42,16 +39,13 @@  discard block
 block discarded – undo
42 39
                 if($dateArray[0] == 1)
43 40
                 {
44 41
                     return $zaman."دقيقة واحدة";
45
-                }
46
-                elseif($dateArray[0] == 2)
42
+                } elseif($dateArray[0] == 2)
47 43
                 {
48 44
                     return $zaman. "دقيقتين";
49
-                }
50
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
45
+                } elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
51 46
                 {
52 47
                     return $zaman. $dateArray[0] . " دقائق";
53
-                }
54
-                else
48
+                } else
55 49
                 {
56 50
                     return $zaman.  $dateArray[0] . " دقيقة";
57 51
                 }
@@ -62,16 +56,13 @@  discard block
 block discarded – undo
62 56
                 if($dateArray[0] == 1)
63 57
                 {
64 58
                     return $zaman."ساعة";
65
-                }
66
-                elseif($dateArray[0] == 2)
59
+                } elseif($dateArray[0] == 2)
67 60
                 {
68 61
                     return $zaman. "ساعتين";
69
-                }
70
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
62
+                } elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
71 63
                 {
72 64
                     return $zaman. $dateArray[0] . " ساعات";
73
-                }
74
-                else
65
+                } else
75 66
                 {
76 67
                     return $zaman.  $dateArray[0] . " ساعة";
77 68
                 }
@@ -82,16 +73,13 @@  discard block
 block discarded – undo
82 73
                 if($dateArray[0] == 1)
83 74
                 {
84 75
                     return $zaman." يوم";
85
-                }
86
-                elseif($dateArray[0] == 2)
76
+                } elseif($dateArray[0] == 2)
87 77
                 {
88 78
                     return $zaman. "يومين";
89
-                }
90
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
79
+                } elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
91 80
                 {
92 81
                     return $zaman. $dateArray[0] . " أيام";
93
-                }
94
-                else
82
+                } else
95 83
                 {
96 84
                     return $zaman.  $dateArray[0] . " يوم";
97 85
                 }
@@ -102,16 +90,13 @@  discard block
 block discarded – undo
102 90
                 if($dateArray[0] == 1)
103 91
                 {
104 92
                     return $zaman." أسبوع";
105
-                }
106
-                elseif($dateArray[0] == 2)
93
+                } elseif($dateArray[0] == 2)
107 94
                 {
108 95
                     return $zaman. " أسبوعين";
109
-                }
110
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
96
+                } elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
111 97
                 {
112 98
                     return $zaman. $dateArray[0] . " أسابيع";
113
-                }
114
-                else
99
+                } else
115 100
                 {
116 101
                     return $zaman.  $dateArray[0] . " أسبوع";
117 102
                 }
@@ -122,16 +107,13 @@  discard block
 block discarded – undo
122 107
                 if($dateArray[0] == 1)
123 108
                 {
124 109
                     return $zaman."شهر";
125
-                }
126
-                elseif($dateArray[0] == 2)
110
+                } elseif($dateArray[0] == 2)
127 111
                 {
128 112
                     return $zaman. " شهرين";
129
-                }
130
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
113
+                } elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
131 114
                 {
132 115
                     return $zaman. $dateArray[0] . " شهور";
133
-                }
134
-                else
116
+                } else
135 117
                 {
136 118
                     return $zaman.  $dateArray[0] . " شهر";
137 119
                 }
@@ -142,16 +124,13 @@  discard block
 block discarded – undo
142 124
                 if($dateArray[0] == 1)
143 125
                 {
144 126
                     return $zaman."سنة";
145
-                }
146
-                elseif($dateArray[0] == 2)
127
+                } elseif($dateArray[0] == 2)
147 128
                 {
148 129
                     return $zaman. " سنتين";
149
-                }
150
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
130
+                } elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
151 131
                 {
152 132
                     return $zaman. $dateArray[0] . " سنوات";
153
-                }
154
-                else
133
+                } else
155 134
                 {
156 135
                     return $zaman.  $dateArray[0] . " سنة";
157 136
                 }
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -18,186 +18,186 @@
 block discarded – undo
18 18
             //$dateArray[0] is number, $dateArray[1] is the time period , $dateArray[2] is the word ago
19 19
             $time = $dateArray[1];
20 20
             // handl seconds
21
-            if((new self)->isSecond($time))
21
+            if ((new self)->isSecond($time))
22 22
             {
23
-                if($dateArray[0] == 1)
23
+                if ($dateArray[0] == 1)
24 24
                 {
25 25
                     return $zaman."ثانية واحدة";
26 26
                 }
27
-                elseif($dateArray[0] == 2)
27
+                elseif ($dateArray[0] == 2)
28 28
                 {
29
-                    return $zaman. "ثانيتين";
29
+                    return $zaman."ثانيتين";
30 30
                 }
31
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
31
+                elseif ($dateArray[0] >= 3 && $dateArray[0] <= 10)
32 32
                 {
33
-                    return $zaman. $dateArray[0] . " ثواني";
33
+                    return $zaman.$dateArray[0]." ثواني";
34 34
                 }
35 35
                 else
36 36
                 {
37
-                    return $zaman.  $dateArray[0] . " ثانية";
37
+                    return $zaman.$dateArray[0]." ثانية";
38 38
                 }
39 39
             }
40 40
             // handl minutes
41
-            if((new self)->isMinute($time))
41
+            if ((new self)->isMinute($time))
42 42
             {
43
-                if($dateArray[0] == 1)
43
+                if ($dateArray[0] == 1)
44 44
                 {
45 45
                     return $zaman."دقيقة واحدة";
46 46
                 }
47
-                elseif($dateArray[0] == 2)
47
+                elseif ($dateArray[0] == 2)
48 48
                 {
49
-                    return $zaman. "دقيقتين";
49
+                    return $zaman."دقيقتين";
50 50
                 }
51
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
51
+                elseif ($dateArray[0] >= 3 && $dateArray[0] <= 10)
52 52
                 {
53
-                    return $zaman. $dateArray[0] . " دقائق";
53
+                    return $zaman.$dateArray[0]." دقائق";
54 54
                 }
55 55
                 else
56 56
                 {
57
-                    return $zaman.  $dateArray[0] . " دقيقة";
57
+                    return $zaman.$dateArray[0]." دقيقة";
58 58
                 }
59 59
             }
60 60
             // handl hours
61
-            if((new self)->isHour($time))
61
+            if ((new self)->isHour($time))
62 62
             {
63
-                if($dateArray[0] == 1)
63
+                if ($dateArray[0] == 1)
64 64
                 {
65 65
                     return $zaman."ساعة";
66 66
                 }
67
-                elseif($dateArray[0] == 2)
67
+                elseif ($dateArray[0] == 2)
68 68
                 {
69
-                    return $zaman. "ساعتين";
69
+                    return $zaman."ساعتين";
70 70
                 }
71
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
71
+                elseif ($dateArray[0] >= 3 && $dateArray[0] <= 10)
72 72
                 {
73
-                    return $zaman. $dateArray[0] . " ساعات";
73
+                    return $zaman.$dateArray[0]." ساعات";
74 74
                 }
75 75
                 else
76 76
                 {
77
-                    return $zaman.  $dateArray[0] . " ساعة";
77
+                    return $zaman.$dateArray[0]." ساعة";
78 78
                 }
79 79
             }
80 80
             // handl days
81
-            if((new self)->isDay($time))
81
+            if ((new self)->isDay($time))
82 82
             {
83
-                if($dateArray[0] == 1)
83
+                if ($dateArray[0] == 1)
84 84
                 {
85 85
                     return $zaman." يوم";
86 86
                 }
87
-                elseif($dateArray[0] == 2)
87
+                elseif ($dateArray[0] == 2)
88 88
                 {
89
-                    return $zaman. "يومين";
89
+                    return $zaman."يومين";
90 90
                 }
91
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
91
+                elseif ($dateArray[0] >= 3 && $dateArray[0] <= 10)
92 92
                 {
93
-                    return $zaman. $dateArray[0] . " أيام";
93
+                    return $zaman.$dateArray[0]." أيام";
94 94
                 }
95 95
                 else
96 96
                 {
97
-                    return $zaman.  $dateArray[0] . " يوم";
97
+                    return $zaman.$dateArray[0]." يوم";
98 98
                 }
99 99
             }
100 100
             // handl weeks
101
-            if((new self)->isWeek($time))
101
+            if ((new self)->isWeek($time))
102 102
             {
103
-                if($dateArray[0] == 1)
103
+                if ($dateArray[0] == 1)
104 104
                 {
105 105
                     return $zaman." أسبوع";
106 106
                 }
107
-                elseif($dateArray[0] == 2)
107
+                elseif ($dateArray[0] == 2)
108 108
                 {
109
-                    return $zaman. " أسبوعين";
109
+                    return $zaman." أسبوعين";
110 110
                 }
111
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
111
+                elseif ($dateArray[0] >= 3 && $dateArray[0] <= 10)
112 112
                 {
113
-                    return $zaman. $dateArray[0] . " أسابيع";
113
+                    return $zaman.$dateArray[0]." أسابيع";
114 114
                 }
115 115
                 else
116 116
                 {
117
-                    return $zaman.  $dateArray[0] . " أسبوع";
117
+                    return $zaman.$dateArray[0]." أسبوع";
118 118
                 }
119 119
             }
120 120
             // handl months
121
-            if((new self)->isMonth($time))
121
+            if ((new self)->isMonth($time))
122 122
             {
123
-                if($dateArray[0] == 1)
123
+                if ($dateArray[0] == 1)
124 124
                 {
125 125
                     return $zaman."شهر";
126 126
                 }
127
-                elseif($dateArray[0] == 2)
127
+                elseif ($dateArray[0] == 2)
128 128
                 {
129
-                    return $zaman. " شهرين";
129
+                    return $zaman." شهرين";
130 130
                 }
131
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
131
+                elseif ($dateArray[0] >= 3 && $dateArray[0] <= 10)
132 132
                 {
133
-                    return $zaman. $dateArray[0] . " شهور";
133
+                    return $zaman.$dateArray[0]." شهور";
134 134
                 }
135 135
                 else
136 136
                 {
137
-                    return $zaman.  $dateArray[0] . " شهر";
137
+                    return $zaman.$dateArray[0]." شهر";
138 138
                 }
139 139
             }
140 140
             // handl years
141
-            if((new self)->isYear($time))
141
+            if ((new self)->isYear($time))
142 142
             {
143
-                if($dateArray[0] == 1)
143
+                if ($dateArray[0] == 1)
144 144
                 {
145 145
                     return $zaman."سنة";
146 146
                 }
147
-                elseif($dateArray[0] == 2)
147
+                elseif ($dateArray[0] == 2)
148 148
                 {
149
-                    return $zaman. " سنتين";
149
+                    return $zaman." سنتين";
150 150
                 }
151
-                elseif($dateArray[0] >= 3 && $dateArray[0] <= 10  )
151
+                elseif ($dateArray[0] >= 3 && $dateArray[0] <= 10)
152 152
                 {
153
-                    return $zaman. $dateArray[0] . " سنوات";
153
+                    return $zaman.$dateArray[0]." سنوات";
154 154
                 }
155 155
                 else
156 156
                 {
157
-                    return $zaman.  $dateArray[0] . " سنة";
157
+                    return $zaman.$dateArray[0]." سنة";
158 158
                 }
159 159
             }
160 160
         }
161 161
 
162 162
         public function isSecond($time)
163 163
         {
164
-            Str::startsWith($time,'second') ? $isSecond = true : $isSecond = false ;
164
+            Str::startsWith($time, 'second') ? $isSecond = true : $isSecond = false;
165 165
             return $isSecond;
166 166
         }
167 167
 
168 168
         public function isMinute($time)
169 169
         {
170
-            Str::startsWith($time,'minute') ? $isMinute = true : $isMinute = false ;
170
+            Str::startsWith($time, 'minute') ? $isMinute = true : $isMinute = false;
171 171
             return $isMinute;
172 172
         }
173 173
 
174 174
         public function isHour($time)
175 175
         {
176
-            Str::startsWith($time,'hour') ? $isHour = true : $isHour = false ;
176
+            Str::startsWith($time, 'hour') ? $isHour = true : $isHour = false;
177 177
             return $isHour;
178 178
         }
179 179
 
180 180
         public function isDay($time)
181 181
         {
182
-            Str::startsWith($time,'day') ? $isDay = true : $isDay = false ;
182
+            Str::startsWith($time, 'day') ? $isDay = true : $isDay = false;
183 183
             return $isDay;
184 184
         }
185 185
 
186 186
         public function isWeek($time)
187 187
         {
188
-            Str::startsWith($time,'week') ? $isWeek = true : $isWeek = false ;
188
+            Str::startsWith($time, 'week') ? $isWeek = true : $isWeek = false;
189 189
             return $isWeek;
190 190
         }
191 191
 
192 192
         public function isMonth($time)
193 193
         {
194
-            Str::startsWith($time,'month') ? $isMonth = true : $isMonth = false ;
194
+            Str::startsWith($time, 'month') ? $isMonth = true : $isMonth = false;
195 195
             return $isMonth;
196 196
         }
197 197
 
198 198
         public function isYear($time)
199 199
         {
200
-            Str::startsWith($time,'year') ? $isYear = true : $isYear = false ;
200
+            Str::startsWith($time, 'year') ? $isYear = true : $isYear = false;
201 201
             return $isYear;
202 202
         }
203 203
 
Please login to merge, or discard this patch.