@@ -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 | } |
@@ -144,27 +144,22 @@ discard block |
||
| 144 | 144 | if ($mType instanceof Container) { |
| 145 | 145 | |
| 146 | 146 | $this->_aElement[$sName] = $mType; |
| 147 | - } |
|
| 148 | - else if ($mType === 'text' || $mType === 'submit' || $mType === 'password' || $mType === 'file' || $mType === 'tel' |
|
| 147 | + } else if ($mType === 'text' || $mType === 'submit' || $mType === 'password' || $mType === 'file' || $mType === 'tel' |
|
| 149 | 148 | || $mType === 'url' || $mType === 'email' || $mType === 'search' || $mType === 'date' || $mType === 'time' |
| 150 | 149 | || $mType === 'datetime' || $mType === 'month' || $mType === 'week' || $mType === 'number' || $mType === 'range' |
| 151 | 150 | || $mType === 'color') { |
| 152 | 151 | |
| 153 | 152 | $this->_aElement[$sName] = new Input($sName, $mType, $sLabel, $mValue); |
| 154 | - } |
|
| 155 | - elseif ($mType === 'textarea') { |
|
| 153 | + } elseif ($mType === 'textarea') { |
|
| 156 | 154 | |
| 157 | 155 | $this->_aElement[$sName] = new Textarea($sName, $sLabel, $mValue); |
| 158 | - } |
|
| 159 | - else if ($mType === 'select') { |
|
| 156 | + } else if ($mType === 'select') { |
|
| 160 | 157 | |
| 161 | 158 | $this->_aElement[$sName] = new Select($sName, $mOptions, $sLabel, $mValue); |
| 162 | - } |
|
| 163 | - else if ($mType === 'label') { |
|
| 159 | + } else if ($mType === 'label') { |
|
| 164 | 160 | |
| 165 | 161 | $this->_aElement[$sName] = new Label($sName); |
| 166 | - } |
|
| 167 | - else if ($mType === 'list_checkbox') { |
|
| 162 | + } else if ($mType === 'list_checkbox') { |
|
| 168 | 163 | |
| 169 | 164 | $i = 0; |
| 170 | 165 | |
@@ -174,23 +169,19 @@ discard block |
||
| 174 | 169 | |
| 175 | 170 | $this->_aElement[$sName.'_'.$i++] = new Checkbox($sName, $sValue, $mKey, $mOptions); |
| 176 | 171 | } |
| 177 | - } |
|
| 178 | - else if ($mType === 'checkbox') { |
|
| 172 | + } else if ($mType === 'checkbox') { |
|
| 179 | 173 | |
| 180 | 174 | $this->_aElement[$sName] = new Checkbox($sName, $sLabel, $mValue, $mOptions); |
| 181 | - } |
|
| 182 | - else if ($mType === 'radio') { |
|
| 175 | + } else if ($mType === 'radio') { |
|
| 183 | 176 | |
| 184 | 177 | $this->_aElement[$sName.rand(100000,999999)] = new Radio($sName, $sLabel, $mValue, $mOptions); |
| 185 | - } |
|
| 186 | - else if ($mType === 'date') { |
|
| 178 | + } else if ($mType === 'date') { |
|
| 187 | 179 | |
| 188 | 180 | $aDay = array(); |
| 189 | 181 | |
| 190 | 182 | for ($i = 1 ; $i <= 31 ; $i++) { |
| 191 | 183 | |
| 192 | - if ($i < 10) { $aDay['0'.$i] = '0'.$i; } |
|
| 193 | - else { $aDay[$i] = $i; } |
|
| 184 | + if ($i < 10) { $aDay['0'.$i] = '0'.$i; } else { $aDay[$i] = $i; } |
|
| 194 | 185 | } |
| 195 | 186 | |
| 196 | 187 | $this->_aElement[$sName.'_day'] = new Select($sName, $aDay); |
@@ -331,8 +322,7 @@ discard block |
||
| 331 | 322 | if ($sValue instanceof Form) { |
| 332 | 323 | |
| 333 | 324 | ; |
| 334 | - } |
|
| 335 | - else { |
|
| 325 | + } else { |
|
| 336 | 326 | |
| 337 | 327 | $sMethodNameInEntity = 'get_'.$sKey; |
| 338 | 328 | $mValue = $oCompleteEntity->$sMethodNameInEntity(); |
@@ -340,8 +330,7 @@ discard block |
||
| 340 | 330 | if ($sValue instanceof \Venus\lib\Form\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) { |
| 341 | 331 | |
| 342 | 332 | $this->_aElement[$sExKey]->setValueChecked($mValue); |
| 343 | - } |
|
| 344 | - else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) { |
|
| 333 | + } else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) { |
|
| 345 | 334 | |
| 346 | 335 | $this->_aElement[$sKey]->setValue($mValue); |
| 347 | 336 | } |
@@ -359,8 +348,7 @@ discard block |
||
| 359 | 348 | if ($sValue instanceof Container) { |
| 360 | 349 | |
| 361 | 350 | $oForm->form[$sKey] = $sValue; |
| 362 | - } |
|
| 363 | - else { |
|
| 351 | + } else { |
|
| 364 | 352 | |
| 365 | 353 | $oForm->form[$sKey] = $sValue->fetch(); |
| 366 | 354 | } |
@@ -110,8 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | if ($this->_sExtension === null) { $this->setExtension($sExtension); } |
| 112 | 112 | |
| 113 | - if ($this->_sName) { $sName = $sPath.$this->_sName.'.'.$this->_sExtension; } |
|
| 114 | - else { $sName = $sPath.md5(uniqid(rand(), true)).'.'.$this->_sExtension;} |
|
| 113 | + if ($this->_sName) { $sName = $sPath.$this->_sName.'.'.$this->_sExtension; } else { $sName = $sPath.md5(uniqid(rand(), true)).'.'.$this->_sExtension;} |
|
| 115 | 114 | |
| 116 | 115 | if ($this->_bProportion == true && ($this->_iWidth || $this->_iHeight)) { |
| 117 | 116 | |
@@ -129,8 +128,7 @@ discard block |
||
| 129 | 128 | imagecopyresampled($rNewImgTrueColor , $rNewImage, 0, 0, $fX, $fY, $this->_iWidth, $this->_iHeight, $iWidth * $fRatio - $fX * 2, $iHeight * $fRatio - $fY * 2); |
| 130 | 129 | |
| 131 | 130 | imagejpeg($rNewImgTrueColor , $sName, 100); |
| 132 | - } |
|
| 133 | - else { |
|
| 131 | + } else { |
|
| 134 | 132 | |
| 135 | 133 | $bResultat = move_uploaded_file($_FILES[$sFile]['tmp_name'], $sName); |
| 136 | 134 | |