Completed
Push — master ( 29af84...9c6b4e )
by judicael
04:46 queued 01:09
created
bundles/lib/Request.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function __construct()
49 49
 	{
50
-        $this->cookies = function() { return new Cookies(); };
51
-        $this->files = function() { return new Files(); };
52
-        $this->headers = function() { return new Headers(); };
53
-        $this->query = function() { return new Query(); };
54
-        $this->request = function() { return new RequestPost(); };
50
+		$this->cookies = function() { return new Cookies(); };
51
+		$this->files = function() { return new Files(); };
52
+		$this->headers = function() { return new Headers(); };
53
+		$this->query = function() { return new Query(); };
54
+		$this->request = function() { return new RequestPost(); };
55 55
 		$this->server = function() { return new Server(); };
56 56
 	}
57 57
 
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
 	 *
121 121
 	 * @access public
122 122
 	 * @return bool
123
-     * @deprecated  don't use this method because they return a false result
124
-     *              delete in the version 5
125
-     * @throws \Exception
123
+	 * @deprecated  don't use this method because they return a false result
124
+	 *              delete in the version 5
125
+	 * @throws \Exception
126 126
 	 */
127 127
 	public static function getPreferredLanguage()
128 128
 	{
129
-        throw new \Exception("Use getLanguages() method now!");
129
+		throw new \Exception("Use getLanguages() method now!");
130 130
 	}
131 131
 
132 132
 	/**
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	 * @access public
172 172
 	 * @param  string $name
173 173
 	 * @return mixed
174
-     * @deprecated  please use $this->request->get()
175
-     *              delete in the version 5
174
+	 * @deprecated  please use $this->request->get()
175
+	 *              delete in the version 5
176 176
 	 */
177 177
 	public function getPost(string $name)
178 178
 	{
@@ -187,22 +187,22 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	public static function getPut() 
189 189
 	{	    
190
-	    $aPut = array();
190
+		$aPut = array();
191 191
 	    
192
-	    $rPutResource = fopen("php://input", "r");
192
+		$rPutResource = fopen("php://input", "r");
193 193
 	    
194
-	    while ($sData = fread($rPutResource, 1024)) {
194
+		while ($sData = fread($rPutResource, 1024)) {
195 195
 
196
-	        $aSeparatePut = explode('&', $sData);
196
+			$aSeparatePut = explode('&', $sData);
197 197
 	        
198
-	        foreach($aSeparatePut as $sOne) {
198
+			foreach($aSeparatePut as $sOne) {
199 199
 	            
200
-	            $aOnePut = explode('=', $sOne);
201
-	            $aPut[$aOnePut[0]] = $aOnePut[1];
202
-	        }
203
-	    }
200
+				$aOnePut = explode('=', $sOne);
201
+				$aPut[$aOnePut[0]] = $aOnePut[1];
202
+			}
203
+		}
204 204
 	    
205
-	    return $aPut;
205
+		return $aPut;
206 206
 	}
207 207
 
208 208
 	/**
@@ -221,29 +221,29 @@  discard block
 block discarded – undo
221 221
 		else if ($iCode === 404) { header('HTTP/1.1 404 Not Found'); }
222 222
 	}
223 223
 
224
-    /**
225
-     * get http method
226
-     * @return string
227
-     */
228
-    public function getMethod() : string
229
-    {
230
-        return $this->server->get('REQUEST_METHOD');
231
-    }
232
-
233
-    /**
234
-     * return languages accepted by the customer
235
-     * @return array
236
-     */
237
-    public function getLanguages() : array
238
-    {
239
-        if (!self::isCliRequest()) { return explode(',', preg_replace('/^([^;]);?.*$/', '$1', $_SERVER['HTTP_ACCEPT_LANGUAGE'])); }
240
-        else { return array(); }
241
-    }
224
+	/**
225
+	 * get http method
226
+	 * @return string
227
+	 */
228
+	public function getMethod() : string
229
+	{
230
+		return $this->server->get('REQUEST_METHOD');
231
+	}
232
+
233
+	/**
234
+	 * return languages accepted by the customer
235
+	 * @return array
236
+	 */
237
+	public function getLanguages() : array
238
+	{
239
+		if (!self::isCliRequest()) { return explode(',', preg_replace('/^([^;]);?.*$/', '$1', $_SERVER['HTTP_ACCEPT_LANGUAGE'])); }
240
+		else { return array(); }
241
+	}
242 242
 
243 243
 	/**
244 244
 	 * get path info
245 245
 	 * @return string
246
-     */
246
+	 */
247 247
 	public function getPathInfo() : string
248 248
 	{
249 249
 		return $this->server->get('REQUEST_URI');
Please login to merge, or discard this patch.
bundles/lib/Cache/Memory.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@
 block discarded – undo
30 30
  */
31 31
 class Memory implements CacheInterface
32 32
 {
33
-    /**
34
-     * A static variable to keep the cache
35
-     * @var array
36
-     */    
37
-    private static $_aMemories = array();
33
+	/**
34
+	 * A static variable to keep the cache
35
+	 * @var array
36
+	 */    
37
+	private static $_aMemories = array();
38 38
     
39 39
 	/**
40 40
 	 * set a value
Please login to merge, or discard this patch.
bundles/lib/Cache/Mock.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function get(string $sName, int &$iFlags = null, int $iTimeout = 0)
43 43
 	{ 
44
-	    return false;
44
+		return false;
45 45
 	}
46 46
 	
47 47
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function delete(string $sName)
81 81
 	{
82
-        return false;
82
+		return false;
83 83
 	}
84 84
 
85 85
 	/**
Please login to merge, or discard this patch.
bundles/lib/I18n.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -31,44 +31,44 @@
 block discarded – undo
31 31
  */
32 32
 class I18n extends CoreI18n
33 33
 {
34
-    /**
35
-     * constructor
36
-     * 
37
-     * @access public
38
-     * @return \Venus\lib\I18n
39
-     */
40
-    public function __construct()
41
-    {
42
-        $this->setI18nDirectory(__DIR__.DIRECTORY_SEPARATOR.I18N_DIRECTORY)
43
-             ->setI18nDomain(I18N_DOMAIN)
44
-             ->setIntermediaiteDirectory(DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR);
34
+	/**
35
+	 * constructor
36
+	 * 
37
+	 * @access public
38
+	 * @return \Venus\lib\I18n
39
+	 */
40
+	public function __construct()
41
+	{
42
+		$this->setI18nDirectory(__DIR__.DIRECTORY_SEPARATOR.I18N_DIRECTORY)
43
+			 ->setI18nDomain(I18N_DOMAIN)
44
+			 ->setIntermediaiteDirectory(DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR);
45 45
         
46
-        foreach (Config::get('Plugins')->list as $iKey => $sPlugin) {
46
+		foreach (Config::get('Plugins')->list as $iKey => $sPlugin) {
47 47
             
48
-            if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'i18n'.DIRECTORY_SEPARATOR.$this->getLanguage().$this->getIntermediaiteDirectory().$sPlugin.'.json')) {
48
+			if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'i18n'.DIRECTORY_SEPARATOR.$this->getLanguage().$this->getIntermediaiteDirectory().$sPlugin.'.json')) {
49 49
 
50
-                $oJson = json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'i18n'.DIRECTORY_SEPARATOR.$this->getLanguage().$this->getIntermediaiteDirectory().$sPlugin.'.json'));
50
+				$oJson = json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'i18n'.DIRECTORY_SEPARATOR.$this->getLanguage().$this->getIntermediaiteDirectory().$sPlugin.'.json'));
51 51
                 
52
-                $fCallBack = function($sValue) use ($oJson)
53
-                {    
54
-                    if (isset($oJson->$sValue)) { return $oJson->$sValue; }
55
-                    else { return ''; }
56
-                };
57
-            }
52
+				$fCallBack = function($sValue) use ($oJson)
53
+				{    
54
+					if (isset($oJson->$sValue)) { return $oJson->$sValue; }
55
+					else { return ''; }
56
+				};
57
+			}
58 58
             
59
-            CoreI18n::addCallback($sPlugin, $fCallBack);
60
-        }
61
-    }
59
+			CoreI18n::addCallback($sPlugin, $fCallBack);
60
+		}
61
+	}
62 62
 
63
-    /**
64
-     * Hilight to add the plugin I18N
65
-     *
66
-     * @access public
67
-     * @param string $sValue value of text to traduct
68
-     * @return string
69
-     */
70
-    public function _(string $sValue) : string
71
-    {
72
-        return $this->getText($sValue);
73
-    }
63
+	/**
64
+	 * Hilight to add the plugin I18N
65
+	 *
66
+	 * @access public
67
+	 * @param string $sValue value of text to traduct
68
+	 * @return string
69
+	 */
70
+	public function _(string $sValue) : string
71
+	{
72
+		return $this->getText($sValue);
73
+	}
74 74
 }
Please login to merge, or discard this patch.
bundles/lib/Form/Input.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -174,10 +174,10 @@
 block discarded – undo
174 174
 		$sContent = '';
175 175
 
176 176
 		if ($this->getType() === 'text' || $this->getType() === 'password' || $this->getType() === 'file'
177
-            || $this->getType() === 'tel' || $this->getType() === 'url' || $this->getType() === 'email'
178
-            || $this->getType() === 'search' || $this->getType() === 'date' || $this->getType() === 'time'
179
-            || $this->getType() === 'datetime' || $this->getType() === 'month' || $this->getType() === 'week'
180
-            || $this->getType() === 'number' || $this->getType() === 'range' || $this->getType() === 'color') {
177
+			|| $this->getType() === 'tel' || $this->getType() === 'url' || $this->getType() === 'email'
178
+			|| $this->getType() === 'search' || $this->getType() === 'date' || $this->getType() === 'time'
179
+			|| $this->getType() === 'datetime' || $this->getType() === 'month' || $this->getType() === 'week'
180
+			|| $this->getType() === 'number' || $this->getType() === 'range' || $this->getType() === 'color') {
181 181
 
182 182
 			$sContent .= '<label>'.$this->getLabel().'</label> ';
183 183
 		}
Please login to merge, or discard this patch.
bundles/lib/Form/Container.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function createView()
75 75
 	{
76
-	    $oView = new \stdClass;
77
-	    $oView->form = $this->_sView;
78
-	    $oView->form_start = $this->_oForm->getFormInObject()->start;
79
-	    $oView->form_end = $this->_oForm->getFormInObject()->end;
80
-	    $oView->form_row = array();
76
+		$oView = new \stdClass;
77
+		$oView->form = $this->_sView;
78
+		$oView->form_start = $this->_oForm->getFormInObject()->start;
79
+		$oView->form_end = $this->_oForm->getFormInObject()->end;
80
+		$oView->form_row = array();
81 81
 	    
82
-	    foreach ($this->_oForm->getFormInObject()->form as $sKey => $mValue) {
82
+		foreach ($this->_oForm->getFormInObject()->form as $sKey => $mValue) {
83 83
 	        
84
-	        if ($mValue instanceof Container) {
84
+			if ($mValue instanceof Container) {
85 85
 	            
86
-	            $oNewForm = $mValue->createView();
87
-	            $oView->form_row[$sKey] = $oNewForm->form_row;
88
-	        }
89
-	        else {
86
+				$oNewForm = $mValue->createView();
87
+				$oView->form_row[$sKey] = $oNewForm->form_row;
88
+			}
89
+			else {
90 90
 	            
91
-	           $oView->form_row[$sKey] = $mValue;
92
-	        }
93
-	    }
91
+			   $oView->form_row[$sKey] = $mValue;
92
+			}
93
+		}
94 94
 	       
95 95
 		return $oView;
96 96
 	}
@@ -117,48 +117,48 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function handleRequest(array $aRequest) : bool
119 119
 	{
120
-	    if (!count($_POST)) { return true; }
120
+		if (!count($_POST)) { return true; }
121 121
 	    
122
-	    // Validation
123
-	    foreach ($this->_oForm->getElement() as $sKey => $sValue) {
122
+		// Validation
123
+		foreach ($this->_oForm->getElement() as $sKey => $sValue) {
124 124
 	    
125
-	        if (!$sValue instanceof self && !$this->_validate($sValue)) {
125
+			if (!$sValue instanceof self && !$this->_validate($sValue)) {
126 126
 
127
-	            return false;
128
-	        }
129
-	    }
127
+				return false;
128
+			}
129
+		}
130 130
 	    
131
-	    // Save
131
+		// Save
132 132
 		if ($this->_oForm->getIdEntity() > 0 && $this->_oForm->getSynchronizeEntity() !== null && count($aRequest) > 0) {
133 133
 		
134
-		    $sModelName = str_replace('Entity', 'Model', $this->_oForm->getSynchronizeEntity());
135
-		    $oModel = new $sModelName;
134
+			$sModelName = str_replace('Entity', 'Model', $this->_oForm->getSynchronizeEntity());
135
+			$oModel = new $sModelName;
136 136
 		
137
-		    $oEntity = new $this->_oForm->getSynchronizeEntity();
138
-		    $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);
139
-		    $sMethodName = 'set_'.$sPrimaryKey;
137
+			$oEntity = new $this->_oForm->getSynchronizeEntity();
138
+			$sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);
139
+			$sMethodName = 'set_'.$sPrimaryKey;
140 140
 		
141
-		    call_user_func_array(array(&$oEntity, $sMethodName), array($this->_oForm->getIdEntity()));
141
+			call_user_func_array(array(&$oEntity, $sMethodName), array($this->_oForm->getIdEntity()));
142 142
 		
143
-		    foreach ($this->_oForm->getElement() as $sKey => $sValue) {
143
+			foreach ($this->_oForm->getElement() as $sKey => $sValue) {
144 144
 		
145
-		        $sMethodName = 'set_'.$sValue->getName().'';
146
-		        call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()]));
147
-		    }
145
+				$sMethodName = 'set_'.$sValue->getName().'';
146
+				call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()]));
147
+			}
148 148
 		
149
-		    $oEntity->save();
149
+			$oEntity->save();
150 150
 		}
151 151
 		else if ($this->_oForm->getSynchronizeEntity() !== null && isset($aRequest) && count($aRequest) > 0) {
152 152
 		
153
-		    $oEntity = new $this->_oForm->_sSynchronizeEntity;
153
+			$oEntity = new $this->_oForm->_sSynchronizeEntity;
154 154
 		
155
-		    foreach ($this->_oForm->getElement() as $sKey => $sValue) {
155
+			foreach ($this->_oForm->getElement() as $sKey => $sValue) {
156 156
 		
157
-		        $sMethodName = 'set_'.$sValue->getName().'';
158
-		        call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()]));
159
-		    }
157
+				$sMethodName = 'set_'.$sValue->getName().'';
158
+				call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()]));
159
+			}
160 160
 		
161
-		    $this->_oForm->setIdEntityCreated($oEntity->save());
161
+			$this->_oForm->setIdEntityCreated($oEntity->save());
162 162
 		}
163 163
 		
164 164
 		$this->_bHandleRequestActivate = true;
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	public function isSubmitted() : bool
201 201
 	{
202
-	    if (isset($_POST['validform'.$this->_oForm->getFormNumber()]) && $_POST['validform'.$this->_oForm->getFormNumber()] == 1) {
202
+		if (isset($_POST['validform'.$this->_oForm->getFormNumber()]) && $_POST['validform'.$this->_oForm->getFormNumber()] == 1) {
203 203
 	        
204
-	        return true;
205
-	    }
204
+			return true;
205
+		}
206 206
 		else { 
207 207
 		    
208
-		    return false;
208
+			return false;
209 209
 		}
210 210
 	}
211 211
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 */
219 219
 	public function isClicked(string $sElementName) : bool
220 220
 	{
221
-	    if (isset($_POST[$sElementName]) && $_POST[$sElementName]) { return true; }
221
+		if (isset($_POST[$sElementName]) && $_POST[$sElementName]) { return true; }
222 222
 		else { return false; }
223 223
 	}
224 224
 
@@ -231,14 +231,14 @@  discard block
 block discarded – undo
231 231
 	 */
232 232
 	private function _validate($oElement) : bool
233 233
 	{
234
-	    foreach ($oElement->getConstraint() as $oConstraint) {
234
+		foreach ($oElement->getConstraint() as $oConstraint) {
235 235
 	        
236
-	        if (!$oConstraint->validate($_POST[$oElement->getName()])) {
236
+			if (!$oConstraint->validate($_POST[$oElement->getName()])) {
237 237
 	            
238
-	            return false;
239
-	        }
240
-	    }
238
+				return false;
239
+			}
240
+		}
241 241
 	    
242
-	    return true;
242
+		return true;
243 243
 	}
244 244
 }
Please login to merge, or discard this patch.
bundles/lib/Session.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
   	 */
50 50
   	public function set(string $sName, $mValue) : Session
51 51
 	{
52
-    	$_SESSION[$sName] = $mValue;
53
-    	return $this;
52
+		$_SESSION[$sName] = $mValue;
53
+		return $this;
54 54
   	}
55 55
 
56 56
   	/**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
   	 * @param  string $sName name of the session
85 85
   	 * @param  string $sValue value of this sesion var
86 86
   	 * @return \Venus\lib\Session
87
-	 */
87
+  	 */
88 88
  	 public function setFlashBag($sName, $sValue)
89 89
 	 {
90 90
   		if (!isset($_SESSION['flashbag'])) { $_SESSION['flashbag'] = array(); }
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
 		    
110 110
 			$aParams = session_get_cookie_params();
111 111
 		    
112
-		    setcookie(session_name(), '', time() - 42000,
113
-		        $aParams["path"], $aParams["domain"],
114
-		        $aParams["secure"], $aParams["httponly"]
115
-		    );
112
+			setcookie(session_name(), '', time() - 42000,
113
+				$aParams["path"], $aParams["domain"],
114
+				$aParams["secure"], $aParams["httponly"]
115
+			);
116 116
 		}
117 117
 
118 118
 		session_destroy();
Please login to merge, or discard this patch.
bundles/lib/Mail.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 	 * the from of mail
40 40
 	 * @access private
41 41
 	 * @var    string
42
-	*/
42
+	 */
43 43
 	private $_sFrom = "[email protected]";
44 44
 
45 45
 	/**
Please login to merge, or discard this patch.
bundles/lib/Benchmark.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public static function setPointInLog(string $sName = 'default')
83 83
 	{
84
-	    $oLogger = Debug::getInstance();
84
+		$oLogger = Debug::getInstance();
85 85
 		$oLogger->setLogger($oLogger);
86 86
 
87 87
 		$oLogger->getLogger()
88
-	         	->log('BENCHMARK: Time at this point '.(microtime(true) - self::$_fStart).' - '.$sName);
88
+			 	->log('BENCHMARK: Time at this point '.(microtime(true) - self::$_fStart).' - '.$sName);
89 89
 	}
90 90
 	
91 91
 	/**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function setLogger(LoggerInterface $logger)
99 99
 	{
100
-	    if ($this->_oLogger === null) { $this->_oLogger = $logger; }
100
+		if ($this->_oLogger === null) { $this->_oLogger = $logger; }
101 101
 	}
102 102
 
103 103
 	/**
Please login to merge, or discard this patch.