@@ -51,8 +51,7 @@ |
||
51 | 51 | |
52 | 52 | $fCallBack = function($sValue) use ($oJson) |
53 | 53 | { |
54 | - if (isset($oJson->$sValue)) { return $oJson->$sValue; } |
|
55 | - else { return ''; } |
|
54 | + if (isset($oJson->$sValue)) { return $oJson->$sValue; } else { return ''; } |
|
56 | 55 | }; |
57 | 56 | } |
58 | 57 |
@@ -43,11 +43,9 @@ discard block |
||
43 | 43 | { |
44 | 44 | $iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear)); |
45 | 45 | |
46 | - if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } |
|
47 | - else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
|
46 | + if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
|
48 | 47 | |
49 | - if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } |
|
50 | - else { $iWeekInSeconds = 0; } |
|
48 | + if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } else { $iWeekInSeconds = 0; } |
|
51 | 49 | |
52 | 50 | $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift; |
53 | 51 | $iTimestampLastDay = mktime(0, 0, 0, 1, 6, $iYear) + $iWeekInSeconds + $iShift + 604800; |
@@ -78,18 +76,7 @@ discard block |
||
78 | 76 | { |
79 | 77 | if ($sLanguage == 'fr') { |
80 | 78 | |
81 | - if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; } |
|
82 | - else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; } |
|
83 | - else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; } |
|
84 | - else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; } |
|
85 | - else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; } |
|
86 | - else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; } |
|
87 | - else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; } |
|
88 | - else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; } |
|
89 | - else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; } |
|
90 | - else if ($sMonth == 10) { return 'Octobre'; } |
|
91 | - else if ($sMonth == 11) { return 'Novembre'; } |
|
92 | - else if ($sMonth == 12) { return 'Décembre'; } |
|
79 | + if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; } else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; } else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; } else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; } else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; } else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; } else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; } else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; } else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; } else if ($sMonth == 10) { return 'Octobre'; } else if ($sMonth == 11) { return 'Novembre'; } else if ($sMonth == 12) { return 'Décembre'; } |
|
93 | 80 | } |
94 | 81 | } |
95 | 82 | |
@@ -105,13 +92,7 @@ discard block |
||
105 | 92 | { |
106 | 93 | if ($sLanguage == 'fr') { |
107 | 94 | |
108 | - if ($sDay == 0) { return 'dimanche'; } |
|
109 | - else if ($sDay == 1) { return 'lundi'; } |
|
110 | - else if ($sDay == 2) { return 'mardi'; } |
|
111 | - else if ($sDay == 3) { return 'mercredi'; } |
|
112 | - else if ($sDay == 4) { return 'jeudi'; } |
|
113 | - else if ($sDay == 5) { return 'vendredi'; } |
|
114 | - else if ($sDay == 6) { return 'samedi'; } |
|
95 | + if ($sDay == 0) { return 'dimanche'; } else if ($sDay == 1) { return 'lundi'; } else if ($sDay == 2) { return 'mardi'; } else if ($sDay == 3) { return 'mercredi'; } else if ($sDay == 4) { return 'jeudi'; } else if ($sDay == 5) { return 'vendredi'; } else if ($sDay == 6) { return 'samedi'; } |
|
115 | 96 | } |
116 | 97 | } |
117 | 98 | |
@@ -138,8 +119,7 @@ discard block |
||
138 | 119 | if ($iMonth == $aToday['mois']) { |
139 | 120 | |
140 | 121 | if ($iDay > $aToday['jour']) { $iYears--; } |
141 | - } |
|
142 | - else { |
|
122 | + } else { |
|
143 | 123 | |
144 | 124 | $iYears--; |
145 | 125 | } |
@@ -160,18 +140,15 @@ discard block |
||
160 | 140 | { |
161 | 141 | $iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear)); |
162 | 142 | |
163 | - if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } |
|
164 | - else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
|
143 | + if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
|
165 | 144 | |
166 | - if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } |
|
167 | - else { $iWeekInSeconds = 0; } |
|
145 | + if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } else { $iWeekInSeconds = 0; } |
|
168 | 146 | |
169 | 147 | if (date('N') > 2) { |
170 | 148 | |
171 | 149 | $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift + 172800; |
172 | 150 | $iTimestampLastDay = $iTimestamp + 604800; |
173 | - } |
|
174 | - else { |
|
151 | + } else { |
|
175 | 152 | |
176 | 153 | $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift - 432000; |
177 | 154 | $iTimestampLastDay = $iTimestamp + 604800; |
@@ -228,7 +205,6 @@ discard block |
||
228 | 205 | if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp/60).' '.$sMinutes.$sEndReturn; } |
229 | 206 | if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp/3600).' '.$sHours.$sEndReturn; } |
230 | 207 | if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp/86400).' '.$sDays.$sEndReturn; } |
231 | - if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } |
|
232 | - else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; } |
|
208 | + if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; } |
|
233 | 209 | } |
234 | 210 | } |
@@ -85,8 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | $oNewForm = $mValue->createView(); |
87 | 87 | $oView->form_row[$sKey] = $oNewForm->form_row; |
88 | - } |
|
89 | - else { |
|
88 | + } else { |
|
90 | 89 | |
91 | 90 | $oView->form_row[$sKey] = $mValue; |
92 | 91 | } |
@@ -147,8 +146,7 @@ discard block |
||
147 | 146 | } |
148 | 147 | |
149 | 148 | $oEntity->save(); |
150 | - } |
|
151 | - else if ($this->_oForm->getSynchronizeEntity() !== null && isset($aRequest) && count($aRequest) > 0) { |
|
149 | + } else if ($this->_oForm->getSynchronizeEntity() !== null && isset($aRequest) && count($aRequest) > 0) { |
|
152 | 150 | |
153 | 151 | $oEntity = new $this->_oForm->_sSynchronizeEntity; |
154 | 152 | |
@@ -187,8 +185,7 @@ discard block |
||
187 | 185 | */ |
188 | 186 | public function isValid() : bool |
189 | 187 | { |
190 | - if ($this->_bHandleRequestActivate === true) { return true; } |
|
191 | - else { return false; } |
|
188 | + if ($this->_bHandleRequestActivate === true) { return true; } else { return false; } |
|
192 | 189 | } |
193 | 190 | |
194 | 191 | /** |
@@ -202,8 +199,7 @@ discard block |
||
202 | 199 | if (isset($_POST['validform'.$this->_oForm->getFormNumber()]) && $_POST['validform'.$this->_oForm->getFormNumber()] == 1) { |
203 | 200 | |
204 | 201 | return true; |
205 | - } |
|
206 | - else { |
|
202 | + } else { |
|
207 | 203 | |
208 | 204 | return false; |
209 | 205 | } |
@@ -218,8 +214,7 @@ discard block |
||
218 | 214 | */ |
219 | 215 | public function isClicked(string $sElementName) : bool |
220 | 216 | { |
221 | - if (isset($_POST[$sElementName]) && $_POST[$sElementName]) { return true; } |
|
222 | - else { return false; } |
|
217 | + if (isset($_POST[$sElementName]) && $_POST[$sElementName]) { return true; } else { return false; } |
|
223 | 218 | } |
224 | 219 | |
225 | 220 | /** |
@@ -60,8 +60,7 @@ |
||
60 | 60 | $this->setName($sName); |
61 | 61 | $this->setValue($sValue); |
62 | 62 | |
63 | - if ($sLabel !== null) { $this->setLabel($sLabel); } |
|
64 | - else { $this->setLabel($sName); } |
|
63 | + if ($sLabel !== null) { $this->setLabel($sLabel); } else { $this->setLabel($sName); } |
|
65 | 64 | } |
66 | 65 | |
67 | 66 | /** |
@@ -88,8 +88,7 @@ |
||
88 | 88 | |
89 | 89 | $aParams['param'][$iIndex][] = $sValue; |
90 | 90 | } |
91 | - } |
|
92 | - else { |
|
91 | + } else { |
|
93 | 92 | |
94 | 93 | $aParams[$aOneMatch[1]] = array(); |
95 | 94 |
@@ -62,8 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | public function get(string $sName) |
64 | 64 | { |
65 | - if (isset($_SESSION[$sName])) { return $_SESSION[$sName]; } |
|
66 | - else { return false; } |
|
65 | + if (isset($_SESSION[$sName])) { return $_SESSION[$sName]; } else { return false; } |
|
67 | 66 | } |
68 | 67 | |
69 | 68 | /** |
@@ -60,23 +60,19 @@ |
||
60 | 60 | str_replace('bundles'.DIRECTORY_SEPARATOR.'lib', CACHE_DIR, __DIR__), $mParam2); |
61 | 61 | |
62 | 62 | return $oApollina->addFunctionPath(__DIR__.DIRECTORY_SEPARATOR.'Functions', '\Venus\lib\Functions\\'); |
63 | - } |
|
64 | - else if ($sVendorName === 'Attila\Orm') { |
|
63 | + } else if ($sVendorName === 'Attila\Orm') { |
|
65 | 64 | |
66 | 65 | $oDbConfig = Config::get('Db')->configuration; |
67 | 66 | |
68 | 67 | return new $sVendorName($oDbConfig->db, $oDbConfig->type, $oDbConfig->host, $oDbConfig->user, $oDbConfig->password, |
69 | 68 | $oDbConfig->db); |
70 | - } |
|
71 | - else if (isset($mParam) && isset($mParam2)) { |
|
69 | + } else if (isset($mParam) && isset($mParam2)) { |
|
72 | 70 | |
73 | 71 | return new $sVendorName($mParam, $mParam2); |
74 | - } |
|
75 | - else if (isset($mParam)) { |
|
72 | + } else if (isset($mParam)) { |
|
76 | 73 | |
77 | 74 | return new $sVendorName($mParam); |
78 | - } |
|
79 | - else { |
|
75 | + } else { |
|
80 | 76 | |
81 | 77 | return new $sVendorName; |
82 | 78 | } |
@@ -39,7 +39,6 @@ |
||
39 | 39 | */ |
40 | 40 | public function validate(string $sValue = null) : bool |
41 | 41 | { |
42 | - if (trim($sValue) != '') { return true; } |
|
43 | - else { return false; } |
|
42 | + if (trim($sValue) != '') { return true; } else { return false; } |
|
44 | 43 | } |
45 | 44 | } |
@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | if (isset(self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)])) { |
57 | 57 | |
58 | 58 | return self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)]; |
59 | - } |
|
60 | - else if (isset($this->_aDependencyInjectorContener[md5($sNameOfDi)])) { |
|
59 | + } else if (isset($this->_aDependencyInjectorContener[md5($sNameOfDi)])) { |
|
61 | 60 | |
62 | 61 | return $this->_aDependencyInjectorContener[md5($sNameOfDi)]; |
63 | 62 | } |
@@ -76,8 +75,7 @@ discard block |
||
76 | 75 | */ |
77 | 76 | public function set(string $sNameOfDi, callable $cFunction, bool $bShared = false) : Di |
78 | 77 | { |
79 | - if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
80 | - else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
78 | + if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; } |
|
81 | 79 | return $this; |
82 | 80 | } |
83 | 81 | } |