Completed
Push — master ( 29af84...9c6b4e )
by judicael
04:46 queued 01:09
created
bundles/lib/Validator/Type.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -30,41 +30,41 @@
 block discarded – undo
30 30
  */
31 31
 class Type extends Common
32 32
 {
33
-    /**
34
-     * type
35
-     * @var type
36
-     */
37
-    private $_sType = '';
33
+	/**
34
+	 * type
35
+	 * @var type
36
+	 */
37
+	private $_sType = '';
38 38
     
39
-    /**
40
-     * constructor
41
-     *
42
-     * @access public
43
-     * @param  string $sType type
44
-     * @return Type
45
-     */
46
-    public function __construct(string $sType)
47
-    {
48
-        $this->_sType = $sType;
49
-    }
39
+	/**
40
+	 * constructor
41
+	 *
42
+	 * @access public
43
+	 * @param  string $sType type
44
+	 * @return Type
45
+	 */
46
+	public function __construct(string $sType)
47
+	{
48
+		$this->_sType = $sType;
49
+	}
50 50
     
51
-    /**
52
-     * validate the Type
53
-     *
54
-     * @access public
55
-     * @param  string $sValue
56
-     * @return bool
57
-     */
58
-    public function validate(string $sValue = null) : bool
59
-    {
60
-        if ($this->_sType == 'DateTime') {
51
+	/**
52
+	 * validate the Type
53
+	 *
54
+	 * @access public
55
+	 * @param  string $sValue
56
+	 * @return bool
57
+	 */
58
+	public function validate(string $sValue = null) : bool
59
+	{
60
+		if ($this->_sType == 'DateTime') {
61 61
             
62
-            if (preg_match('#^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}#', $sValue)) {
62
+			if (preg_match('#^[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}#', $sValue)) {
63 63
                 
64
-                return true;
65
-            }
66
-        }
64
+				return true;
65
+			}
66
+		}
67 67
         
68
-        return false;
69
-    }
68
+		return false;
69
+	}
70 70
 }
Please login to merge, or discard this patch.
bundles/lib/Di.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		}
60 60
 		else if (isset($this->_aDependencyInjectorContener[md5($sNameOfDi)])) {
61 61
 		    
62
-		    return $this->_aDependencyInjectorContener[md5($sNameOfDi)];
62
+			return $this->_aDependencyInjectorContener[md5($sNameOfDi)];
63 63
 		}
64 64
 
65 65
 		return false;
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function set(string $sNameOfDi, callable $cFunction, bool $bShared = false) : Di
78 78
 	{
79
-	    if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; }
80
-	    else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; }
79
+		if ($bShared === true) { self::$_aSharedDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; }
80
+		else { $this->_aDependencyInjectorContener[md5($sNameOfDi)] = $cFunction; }
81 81
 		return $this;
82 82
 	}
83 83
 }
Please login to merge, or discard this patch.
bundles/lib/Form.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	public function add($sName, $mType, $sLabel = null, $mValue = null, $mOptions = null)
143 143
 	{
144
-	    if ($mType instanceof Container) {
144
+		if ($mType instanceof Container) {
145 145
 	        
146
-	        $this->_aElement[$sName] = $mType;
147
-	    }
146
+			$this->_aElement[$sName] = $mType;
147
+		}
148 148
 		else if ($mType === 'text' || $mType === 'submit' || $mType === 'password' || $mType === 'file' || $mType === 'tel'
149
-	        || $mType === 'url' || $mType === 'email' || $mType === 'search' || $mType === 'date' || $mType === 'time'
150
-	        || $mType === 'datetime' || $mType === 'month' || $mType === 'week' || $mType === 'number' || $mType === 'range'
151
-	        || $mType === 'color') {
149
+			|| $mType === 'url' || $mType === 'email' || $mType === 'search' || $mType === 'date' || $mType === 'time'
150
+			|| $mType === 'datetime' || $mType === 'month' || $mType === 'week' || $mType === 'number' || $mType === 'range'
151
+			|| $mType === 'color') {
152 152
 
153 153
 			$this->_aElement[$sName] = new Input($sName, $mType, $sLabel, $mValue);
154 154
 		}
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
 		$oContainer = new Container;
296 296
 		$oContainer->setView($sFormContent)
297
-		           ->setForm($this);
297
+				   ->setForm($this);
298 298
 		
299 299
 		return $oContainer;
300 300
 	}
@@ -308,67 +308,67 @@  discard block
 block discarded – undo
308 308
 	 */
309 309
 	public function getFormInObject()
310 310
 	{
311
-	    if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) {
311
+		if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) {
312 312
 	
313
-	        $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity);
314
-	        $oModel = new $sModelName;
313
+			$sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity);
314
+			$oModel = new $sModelName;
315 315
 	        	
316
-	        $oEntity = new $this->_sSynchronizeEntity;
317
-	        $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);
318
-	        $sMethodName = 'findOneBy'.$sPrimaryKey;
319
-	        $oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity));
316
+			$oEntity = new $this->_sSynchronizeEntity;
317
+			$sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);
318
+			$sMethodName = 'findOneBy'.$sPrimaryKey;
319
+			$oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity));
320 320
 	
321
-	        if (is_object($oCompleteEntity)) {
321
+			if (is_object($oCompleteEntity)) {
322 322
 	
323
-	            foreach ($this->_aElement as $sKey => $sValue) {
323
+				foreach ($this->_aElement as $sKey => $sValue) {
324 324
 	
325
-	                if ($sValue instanceof \Venus\lib\Form\Radio) {
325
+					if ($sValue instanceof \Venus\lib\Form\Radio) {
326 326
 	
327
-	                    $sExKey = $sKey;
328
-	                    $sKey = substr($sKey, 0, -6);
329
-	                }
327
+						$sExKey = $sKey;
328
+						$sKey = substr($sKey, 0, -6);
329
+					}
330 330
 	                	
331
-	                if ($sValue instanceof Form) {
331
+					if ($sValue instanceof Form) {
332 332
 	                    
333
-	                    ;
334
-	                }
335
-	                else {
333
+						;
334
+					}
335
+					else {
336 336
 	                 
337
-    	                $sMethodNameInEntity = 'get_'.$sKey;
338
-    	                $mValue = $oCompleteEntity->$sMethodNameInEntity();
337
+						$sMethodNameInEntity = 'get_'.$sKey;
338
+						$mValue = $oCompleteEntity->$sMethodNameInEntity();
339 339
     	
340
-    	                if ($sValue instanceof \Venus\lib\Form\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) {
340
+						if ($sValue instanceof \Venus\lib\Form\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) {
341 341
     	
342
-    	                    $this->_aElement[$sExKey]->setValueChecked($mValue);
343
-    	                }
344
-    	                else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) {
342
+							$this->_aElement[$sExKey]->setValueChecked($mValue);
343
+						}
344
+						else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) {
345 345
     	
346
-    	                    $this->_aElement[$sKey]->setValue($mValue);
347
-    	                }
348
-	                }
349
-	            }
350
-	        }
351
-	    }
346
+							$this->_aElement[$sKey]->setValue($mValue);
347
+						}
348
+					}
349
+				}
350
+			}
351
+		}
352 352
 	
353
-	    $oForm = new \StdClass();
354
-	    $oForm->start = '<form name="form'.$this->_iFormNumber.'" method="post"><input type="hidden" value="1" name="validform'.$this->_iFormNumber.'">';
355
-	    $oForm->form = array();
353
+		$oForm = new \StdClass();
354
+		$oForm->start = '<form name="form'.$this->_iFormNumber.'" method="post"><input type="hidden" value="1" name="validform'.$this->_iFormNumber.'">';
355
+		$oForm->form = array();
356 356
 	
357
-	    foreach ($this->_aElement as $sKey => $sValue) {
357
+		foreach ($this->_aElement as $sKey => $sValue) {
358 358
 
359
-	        if ($sValue instanceof Container) {
359
+			if ($sValue instanceof Container) {
360 360
 	        
361
-	            $oForm->form[$sKey] = $sValue;
362
-	        }
363
-	        else {
361
+				$oForm->form[$sKey] = $sValue;
362
+			}
363
+			else {
364 364
 	            
365
-	            $oForm->form[$sKey] = $sValue->fetch();
366
-	        }
367
-	    }
365
+				$oForm->form[$sKey] = $sValue->fetch();
366
+			}
367
+		}
368 368
 	
369
-	    $oForm->end = '</form>';
369
+		$oForm->end = '</form>';
370 370
 	
371
-	    return $oForm;
371
+		return $oForm;
372 372
 	}
373 373
 
374 374
 	/**
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	 */
450 450
 	public function getElement() {
451 451
 	    
452
-	    return $this->_aElement;
452
+		return $this->_aElement;
453 453
 	}
454 454
 	
455 455
 	/**
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	public function getIdEntity() {
462 462
 	    
463
-	    return $this->_iIdEntity;
463
+		return $this->_iIdEntity;
464 464
 	}
465 465
 	
466 466
 	/**
@@ -471,6 +471,6 @@  discard block
 block discarded – undo
471 471
 	 */
472 472
 	public function getSynchronizeEntity() {
473 473
 	    
474
-	    return $this->_sSynchronizeEntity;
474
+		return $this->_sSynchronizeEntity;
475 475
 	}
476 476
 }
Please login to merge, or discard this patch.
bundles/lib/Log/LoggerAwareInterface.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
  */
8 8
 interface LoggerAwareInterface
9 9
 {
10
-    /**
11
-     * Sets a logger instance on the object
12
-     *
13
-     * @param LoggerInterface $logger
14
-     * @return null
15
-     */
16
-    public function setLogger(LoggerInterface $logger);
10
+	/**
11
+	 * Sets a logger instance on the object
12
+	 *
13
+	 * @param LoggerInterface $logger
14
+	 * @return null
15
+	 */
16
+	public function setLogger(LoggerInterface $logger);
17 17
 }
Please login to merge, or discard this patch.
bundles/lib/Log/AbstractLogger.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,31 +35,31 @@
 block discarded – undo
35 35
 abstract class AbstractLogger implements LoggerInterface 
36 36
 {
37 37
 	/**
38
-     * Logs with an arbitrary level.
39
-     *
40
-     * @param mixed $level
41
-     * @param string $message
42
-     * @param array $context
43
-     * @return void
44
-     */   
45
-    public function log($level, $message, array $context = array())
46
-    {    
47
-        if (!isset($context['file'])) { $context['file'] = __FILE__; }
48
-        if (!isset($context['line'])) { $context['line'] = __LINE__; }
49
-        if ($level === null) { $level = LogLevel::INFO; }
38
+	 * Logs with an arbitrary level.
39
+	 *
40
+	 * @param mixed $level
41
+	 * @param string $message
42
+	 * @param array $context
43
+	 * @return void
44
+	 */   
45
+	public function log($level, $message, array $context = array())
46
+	{    
47
+		if (!isset($context['file'])) { $context['file'] = __FILE__; }
48
+		if (!isset($context['line'])) { $context['line'] = __LINE__; }
49
+		if ($level === null) { $level = LogLevel::INFO; }
50 50
         
51
-        if (Debug::isDebug() === true) {
51
+		if (Debug::isDebug() === true) {
52 52
 
53
-            if (Debug::getKindOfReportLog() === 'error_log' || Debug::getKindOfReportLog() === 'all') {
53
+			if (Debug::getKindOfReportLog() === 'error_log' || Debug::getKindOfReportLog() === 'all') {
54 54
                  
55
-                error_log($context['file'].'> (l.'.$context['line'].') '.$message);
56
-            }
57
-            if (Debug::getKindOfReportLog() === 'screen' || Debug::getKindOfReportLog() === 'all') {
55
+				error_log($context['file'].'> (l.'.$context['line'].') '.$message);
56
+			}
57
+			if (Debug::getKindOfReportLog() === 'screen' || Debug::getKindOfReportLog() === 'all') {
58 58
     
59
-                echo '<table width="100%" style="background:orange;border:solid red 15px;"><tr><td style="color:black;padding:10px;font-size:18px;">';
60
-                echo $context['file'].'> (l.'.$context['line'].') '.$message.'<br/>'."\n";
61
-                echo '</td></tr></table>';
62
-            }
63
-        }
59
+				echo '<table width="100%" style="background:orange;border:solid red 15px;"><tr><td style="color:black;padding:10px;font-size:18px;">';
60
+				echo $context['file'].'> (l.'.$context['line'].') '.$message.'<br/>'."\n";
61
+				echo '</td></tr></table>';
62
+			}
63
+		}
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
bundles/lib/Upload.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,10 +118,10 @@
 block discarded – undo
118 118
 			$aImageSizes = getimagesize($_FILES[$sFile]['tmp_name']);
119 119
 
120 120
 			$fRatio = min($aImageSizes[0] / $this->_iWidth, $aImageSizes[1] / $this->_iHeight);
121
-    		$iHeight =  $aImageSizes[1] / $fRatio;
122
-    		$iWidth =  $aImageSizes[0] / $fRatio;
123
-    		$fY = ($iHeight - $this->_iHeight) / 2 * $fRatio;
124
-    		$fX = ($iWidth - $this->_iWidth) / 2 * $fRatio;
121
+			$iHeight =  $aImageSizes[1] / $fRatio;
122
+			$iWidth =  $aImageSizes[0] / $fRatio;
123
+			$fY = ($iHeight - $this->_iHeight) / 2 * $fRatio;
124
+			$fX = ($iWidth - $this->_iWidth) / 2 * $fRatio;
125 125
 
126 126
 			$rNewImage = imagecreatefromjpeg($_FILES[$sFile]['tmp_name']);
127 127
 
Please login to merge, or discard this patch.
bundles/lib/Less.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
  */
31 31
 class Less
32 32
 {
33
-    /**
34
-     * @var string
35
-     */
36
-    const LESS_WINDOWS = LESS_WINDOWS;
33
+	/**
34
+	 * @var string
35
+	 */
36
+	const LESS_WINDOWS = LESS_WINDOWS;
37 37
     
38 38
 	/**
39 39
 	 * translate the content
@@ -44,18 +44,18 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public static function toCss(string $sFile)
46 46
 	{
47
-	    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
47
+		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
48 48
 	        
49
-	        $sCmd = self::LESS_WINDOWS." ".$sFile." --watch";
50
-            $sContent = shell_exec($sCmd);
51
-	    }
52
-	    else {
49
+			$sCmd = self::LESS_WINDOWS." ".$sFile." --watch";
50
+			$sContent = shell_exec($sCmd);
51
+		}
52
+		else {
53 53
 	       
54
-	        $sCmd = "lessc ".$sFile." --no-color 2>&1";
55
-            $sContent = shell_exec($sCmd);
56
-	    }
54
+			$sCmd = "lessc ".$sFile." --no-color 2>&1";
55
+			$sContent = shell_exec($sCmd);
56
+		}
57 57
 	    
58
-        header("content-type:text/css");
59
-        echo $sContent;
58
+		header("content-type:text/css");
59
+		echo $sContent;
60 60
 	}
61 61
 }
Please login to merge, or discard this patch.
bundles/lib/Functions/Asset.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -39,29 +39,29 @@
 block discarded – undo
39 39
 	 */
40 40
 	public function replaceBy(array $aParams = array()) : string
41 41
 	{
42
-	    $aParams['template'] = trim(str_replace(["'", '"'], "", $aParams['template']));
42
+		$aParams['template'] = trim(str_replace(["'", '"'], "", $aParams['template']));
43 43
 	    
44 44
 		if (isset($aParams['template'])) {
45 45
 
46
-		    $aTemplates = explode(';', $aParams['template']);
47
-		    $sGetUrl = 'getCss?';
46
+			$aTemplates = explode(';', $aParams['template']);
47
+			$sGetUrl = 'getCss?';
48 48
 		    
49
-		    foreach ($aTemplates as $sTemplate) {
49
+			foreach ($aTemplates as $sTemplate) {
50 50
 		     
51
-    		    if (strstr($sTemplate, 'css/')) {
51
+				if (strstr($sTemplate, 'css/')) {
52 52
     			
53
-    		        $sGetUrl .= $sTemplate.'&';
54
-    		    }
55
-    		    else if (strstr($sTemplate, 'js/')) {
53
+					$sGetUrl .= $sTemplate.'&';
54
+				}
55
+				else if (strstr($sTemplate, 'js/')) {
56 56
     		        
57
-    		        $sGetUrl .= $sTemplate.'&';
58
-    		    }
59
-		    }
57
+					$sGetUrl .= $sTemplate.'&';
58
+				}
59
+			}
60 60
 		   
61
-		    if (defined('ASSET_VERSION') && ASSET_VERSION !== false) {
61
+			if (defined('ASSET_VERSION') && ASSET_VERSION !== false) {
62 62
 		        
63
-		        $sGetUrl .= ASSET_VERSION;
64
-		    }
63
+				$sGetUrl .= ASSET_VERSION;
64
+			}
65 65
 
66 66
 			return $sGetUrl;
67 67
 		}
Please login to merge, or discard this patch.
bundles/lib/GoogleMap/Geocoding.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,30 +28,30 @@
 block discarded – undo
28 28
  */
29 29
 class Geocoding
30 30
 {
31
-    /**
32
-     * get the URL with the signature for the Pro account of Google Map
33
-     * 
34
-     * @access public
35
-     * @param unknown $sUrlToSign
36
-     * @param unknown $sClientId
37
-     * @param unknown $sPrivateKey
38
-     * @return string
39
-     */
40
-    public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string
41
-    {
42
-        $aUrl = parse_url($sUrlToSign);
43
-        $aUrl['query'] .= '&client=' .$sClientId;
31
+	/**
32
+	 * get the URL with the signature for the Pro account of Google Map
33
+	 * 
34
+	 * @access public
35
+	 * @param unknown $sUrlToSign
36
+	 * @param unknown $sClientId
37
+	 * @param unknown $sPrivateKey
38
+	 * @return string
39
+	 */
40
+	public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string
41
+	{
42
+		$aUrl = parse_url($sUrlToSign);
43
+		$aUrl['query'] .= '&client=' .$sClientId;
44 44
 
45
-        $aUrlToSign = $aUrl['path']."?".$aUrl['query'];
45
+		$aUrlToSign = $aUrl['path']."?".$aUrl['query'];
46 46
 
47
-        $decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey));
47
+		$decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey));
48 48
 
49
-        $sSignature = hash_hmac("sha1", $aUrlToSign, $decodedKey, true);
49
+		$sSignature = hash_hmac("sha1", $aUrlToSign, $decodedKey, true);
50 50
 
51
-        $sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature));
51
+		$sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature));
52 52
 
53
-        $sOriginalUrl = $aUrl['scheme']."://".$aUrl['host'].$aUrl['path'] . "?".$aUrl['query'];
53
+		$sOriginalUrl = $aUrl['scheme']."://".$aUrl['host'].$aUrl['path'] . "?".$aUrl['query'];
54 54
 
55
-        return $sOriginalUrl. '&signature='. $sEncodedSignature;
56
-    }
55
+		return $sOriginalUrl. '&signature='. $sEncodedSignature;
56
+	}
57 57
 }
Please login to merge, or discard this patch.