This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | use OpenCafe\Datium as Datium; |
||
4 | use OpenCafe\Tools\Leap as Leap; |
||
5 | |||
6 | return array ( |
||
7 | |||
8 | 'language' => 'ku', |
||
9 | |||
10 | 'events' => array(), |
||
11 | |||
12 | 'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'), |
||
13 | |||
14 | 'am_time' => 'AM', |
||
15 | |||
16 | 'pm_time' => 'PM', |
||
17 | |||
18 | 'end_of_days' => array( 'th', 'st', 'nd', 'rd' ), |
||
19 | |||
20 | |||
21 | |||
22 | /************************************************************ |
||
23 | * Convert to |
||
24 | ************************************************************ |
||
25 | * |
||
26 | * Convert algorith to convert Gregorian to Kurdish calerndar |
||
27 | * |
||
28 | *\_________________________________________________________/ |
||
29 | */ |
||
30 | 'convert_to' => function ($date_time) { |
||
31 | |||
32 | $jalali = include 'Jalali.php'; |
||
33 | |||
34 | $date_time = $jalali['convert_to']($date_time); |
||
35 | |||
36 | $date_time->modify('+1321 year'); |
||
37 | |||
38 | return $date_time; |
||
39 | }, |
||
40 | |||
41 | /************************************************************ |
||
42 | * Convert From |
||
43 | ************************************************************ |
||
44 | * |
||
45 | * Convert algorith to convert Kurdish to Gregorian calerndar |
||
46 | * |
||
47 | *\_________________________________________________________/ |
||
48 | */ |
||
49 | 'convert_from' => function ($date_time) { |
||
50 | |||
51 | $jalali = include 'Jalali.php'; |
||
52 | |||
53 | $date_time->modify('-1321 year'); |
||
54 | |||
55 | $date_time = $jalali['convert_from']($date_time); |
||
56 | |||
57 | return $date_time; |
||
58 | |||
59 | |||
60 | }, |
||
61 | |||
62 | /************************************************************ |
||
63 | * Shorthand for kurdish calendar |
||
64 | ************************************************************ |
||
65 | * |
||
66 | * Kurdish calendar shorthand |
||
67 | * |
||
68 | *\_________________________________________________________/ |
||
69 | */ |
||
70 | 'shorthand' => 'ku', |
||
71 | |||
72 | /************************************************************ |
||
73 | * Month's name |
||
74 | ************************************************************ |
||
75 | * |
||
76 | * Jalali month name |
||
77 | * |
||
78 | *\_________________________________________________________/ |
||
79 | */ |
||
80 | 'month' => array ( |
||
81 | |||
82 | 'Xakelêw', |
||
83 | |||
84 | 'Gulan', |
||
85 | |||
86 | 'Cozerdan', |
||
87 | |||
88 | 'PuÅŸper', |
||
89 | |||
90 | 'Gelawêj', |
||
91 | |||
92 | 'Xermanan', |
||
93 | |||
94 | 'Rezber', |
||
95 | |||
96 | 'Gelarêzan', |
||
97 | |||
98 | 'Sermawez', |
||
99 | |||
100 | 'Befranbar', |
||
101 | |||
102 | 'Rêbendan', |
||
103 | |||
104 | 'ReÅŸeme' |
||
105 | |||
106 | ), |
||
107 | |||
108 | /************************************************************ |
||
109 | * Days of Week |
||
110 | ************************************************************ |
||
111 | * |
||
112 | * Here is week days on kurdish calendar, offset 0 is first |
||
113 | * day of week and offset 6 is the last one. |
||
114 | * |
||
115 | *\_________________________________________________________/ |
||
116 | */ |
||
117 | |||
118 | |||
119 | 'days_of_week' => array ( |
||
120 | |||
121 | 'YekÅŸeme', |
||
122 | 'Dúşeme', |
||
123 | 'Séşeme', |
||
124 | 'Çúwarşeme', |
||
125 | 'Péncşeme', |
||
126 | 'HeynÃ', |
||
127 | 'Åžeme', |
||
128 | |||
129 | ), |
||
130 | |||
131 | 'start_day_of_week' => 'Åžeme', |
||
132 | |||
133 | 'month_days_number' => array( 1 => 31, |
||
134 | 2 => 31, |
||
135 | 3 => 31, |
||
136 | 4 => 31, |
||
137 | 5 => 31, |
||
138 | 6 => 31, |
||
139 | 7 => 30, |
||
140 | 8 => 30, |
||
141 | 9 => 30, |
||
142 | 10 => 30, |
||
143 | 11 => 30, |
||
144 | 12 => 29 ), |
||
145 | |||
146 | /************************************************************ |
||
147 | * Day of year |
||
148 | ************************************************************ |
||
149 | * |
||
150 | * Return days of year on Kurdish cleander |
||
151 | * |
||
152 | *\_________________________________________________________/ |
||
153 | */ |
||
154 | View Code Duplication | 'day_of_year' => function ($date_time) { |
|
0 ignored issues
–
show
|
|||
155 | |||
156 | $result = null; |
||
157 | |||
158 | $config = include 'Kurdish.php'; |
||
159 | |||
160 | $month = $date_time->format('n'); |
||
161 | |||
162 | $day = $date_time->format('d'); |
||
163 | |||
164 | foreach ($config[ 'month_days_number' ] as $_month => $value) { |
||
165 | if ($_month < $month) { |
||
166 | $result += $value; |
||
167 | } |
||
168 | } |
||
169 | |||
170 | $result += $day; |
||
171 | |||
172 | return $result; |
||
173 | |||
174 | }, |
||
175 | |||
176 | /************************************************************ |
||
177 | * Day of Week |
||
178 | ************************************************************ |
||
179 | * |
||
180 | * Return day of week on Kurdish cleander |
||
181 | * example : Yekshanbe = result is 2 |
||
182 | *\_________________________________________________________/ |
||
183 | */ |
||
184 | View Code Duplication | 'day_of_week' => function ($date_tim, $day_of_week) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
185 | |||
186 | $days_of_week = array( |
||
187 | 'Dúşeme', |
||
188 | 'Séşeme', |
||
189 | 'Çúwarşeme', |
||
190 | 'Péncşeme', |
||
191 | 'HeynÃ', |
||
192 | 'Åžeme', |
||
193 | 'YekÅŸeme', |
||
194 | ); |
||
195 | |||
196 | $days = array( |
||
197 | 1 => 'Åžeme', |
||
198 | 2 => 'YekÅŸeme', |
||
199 | 3 => 'Dúşeme', |
||
200 | 4 => 'Séşeme', |
||
201 | 5 => 'Çúwarşeme', |
||
202 | 6 => 'Péncşeme', |
||
203 | 7 => 'HeynÃ' |
||
204 | ); |
||
205 | |||
206 | $configGregorian = include 'Gregorian.php'; |
||
207 | |||
208 | $day = str_replace( |
||
209 | $configGregorian[ 'days_of_week' ], |
||
210 | $days_of_week, |
||
211 | $day_of_week |
||
212 | ); |
||
213 | |||
214 | foreach ($days as $key => $value) { |
||
215 | if ($day == $value) { |
||
216 | return $key; |
||
217 | } |
||
218 | } |
||
219 | |||
220 | }, |
||
221 | |||
222 | /************************************************************ |
||
223 | * Leap year |
||
224 | ************************************************************ |
||
225 | * |
||
226 | * Leap Year formula on Kurdish calendar |
||
227 | * |
||
228 | *\_________________________________________________________/ |
||
229 | */ |
||
230 | View Code Duplication | 'leap_year' => function ($year) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
231 | |||
232 | $a = 0.025; |
||
233 | |||
234 | $b = 266; |
||
235 | |||
236 | if ($year > 0) { |
||
237 | $leapDays0 = (($year + 38) % 2820)*0.24219 + $a; |
||
238 | // 0.24219 ~ extra days of one year |
||
239 | $leapDays1 = (($year + 39) % 2820)*0.24219 + $a; |
||
240 | // 38 days is the difference of epoch to 2820-year cycle |
||
241 | } elseif ($year < 0) { |
||
242 | $leapDays0 = (($year + 39) % 2820)*0.24219 + $a; |
||
243 | $leapDays1 = (($year + 40) % 2820)*0.24219 + $a; |
||
244 | } else { |
||
245 | return false; |
||
246 | } |
||
247 | |||
248 | $frac0 = intval(($leapDays0 - intval($leapDays0))*1000); |
||
249 | $frac1 = intval(($leapDays1 - intval($leapDays1))*1000); |
||
250 | |||
251 | if ($frac0 <= $b && $frac1 > $b) { |
||
252 | return true; |
||
253 | } else { |
||
254 | return false; |
||
255 | } |
||
256 | |||
257 | }, |
||
258 | |||
259 | /************************************************************ |
||
260 | * Weekend |
||
261 | ************************************************************ |
||
262 | * |
||
263 | * Kurdish weekend |
||
264 | * |
||
265 | *\_________________________________________________________/ |
||
266 | */ |
||
267 | 'weekend' => array( 'friday' ) |
||
268 | |||
269 | ); |
||
270 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.