Passed
Push — 1.0.0-dev ( 407604...83bedf )
by nguereza
03:26
created
core/lang/en/lang_file_upload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
  	$lang['fu_upload_err_ini_size']     = 'The uploaded file exceeds the upload_max_filesize directive in php.ini.';
7 7
     $lang['fu_upload_err_form_size']   	= 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.';
8 8
     $lang['fu_upload_err_partial']   	= 'The uploaded file was only partially uploaded.';
9
-    $lang['fu_upload_err_no_file'] 		= 'No file was choosed. Please select one.';
9
+    $lang['fu_upload_err_no_file'] = 'No file was choosed. Please select one.';
10 10
     $lang['fu_upload_err_no_tmp_dir']   = 'Missing a temporary folder.';
11
-    $lang['fu_upload_err_cant_write'] 	= 'Failed to write file to disk.';
11
+    $lang['fu_upload_err_cant_write'] = 'Failed to write file to disk.';
12 12
     $lang['fu_upload_err_extension']    = 'A PHP extension stopped the file upload.';
13
-    $lang['fu_accept_file_types']  		= 'Filetype not allowed';
13
+    $lang['fu_accept_file_types'] = 'Filetype not allowed';
14 14
     $lang['fu_file_uploads_disabled']   = 'File uploading option is disabled in php.ini';
15 15
     $lang['fu_max_file_size']           = 'The uploaded file size is too big max size is %s';
16 16
     $lang['fu_overwritten_not_allowed'] = 'You don\'t allow overwriting existing file';
Please login to merge, or discard this patch.
tests/include/testsUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 	/**
4 4
 	* Function to test private & protected method
5 5
 	*/
6
-	function runPrivateOrProtectedMethod($object, $method, array $args = array()){
6
+	function runPrivateOrProtectedMethod($object, $method, array $args = array()) {
7 7
 		$r = new ReflectionClass(get_class($object));
8 8
 		$m = $r->getMethod($method);
9 9
 		$m->setAccessible(true);
Please login to merge, or discard this patch.
core/classes/model/DBSessionHandlerModel.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		 */
46 46
 		protected $sessionTableColumns = array();
47 47
 
48
-		public function __construct(Database $db = null){
48
+		public function __construct(Database $db = null) {
49 49
 			parent::__construct($db);
50 50
 		}
51 51
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		 * Return the session database table columns
54 54
 		 * @return array 
55 55
 		 */
56
-		public function getSessionTableColumns(){
56
+		public function getSessionTableColumns() {
57 57
 			return $this->sessionTableColumns;
58 58
 		}
59 59
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		 * Set the session database table columns
62 62
 		 * @param array $columns the columns definition
63 63
 		 */
64
-		public function setSessionTableColumns(array $columns){
64
+		public function setSessionTableColumns(array $columns) {
65 65
 			$this->sessionTableColumns = $columns;
66 66
 			return $this;
67 67
 		}
Please login to merge, or discard this patch.
core/bootstrap.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	
43 43
 	//if the application is running in CLI mode $_SESSION global variable is not available
44
-	if(IS_CLI){
44
+	if (IS_CLI) {
45 45
 		$_SESSION = array();
46 46
 	}
47 47
 		
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 	/**
61 61
 	 * The Benchmark class
62 62
 	 */
63
-	$BENCHMARK =& class_loader('Benchmark');
63
+	$BENCHMARK = & class_loader('Benchmark');
64 64
 	
65 65
 	$BENCHMARK->mark('APP_EXECUTION_START');
66 66
 	
67 67
 	/**
68 68
     * instance of the Log class
69 69
     */
70
-    $LOGGER =& class_loader('Log', 'classes');
70
+    $LOGGER = & class_loader('Log', 'classes');
71 71
 
72 72
     $LOGGER->setLogger('ApplicationBootstrap');
73 73
 
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 	/**
77 77
 	* Verification of the PHP environment: minimum and maximum version
78 78
 	*/
79
-	if (version_compare(phpversion(), TNH_REQUIRED_PHP_MIN_VERSION, '<')){
79
+	if (version_compare(phpversion(), TNH_REQUIRED_PHP_MIN_VERSION, '<')) {
80 80
 		show_error('Your PHP Version [' . phpversion() . '] is less than [' . TNH_REQUIRED_PHP_MIN_VERSION . '], please install a new version or update your PHP to the latest.', 'PHP Error environment');	
81 81
 	}
82
-	else if(version_compare(phpversion(), TNH_REQUIRED_PHP_MAX_VERSION, '>')){
82
+	else if (version_compare(phpversion(), TNH_REQUIRED_PHP_MAX_VERSION, '>')) {
83 83
 		show_error('Your PHP Version [' . phpversion() . '] is greather than [' . TNH_REQUIRED_PHP_MAX_VERSION . '] please install a PHP version that is compatible.', 'PHP Error environment');	
84 84
 	}
85 85
 	$LOGGER->info('PHP version [' . phpversion() . '] is OK [REQUIRED MINIMUM: ' . TNH_REQUIRED_PHP_MIN_VERSION . ', REQUIRED MAXIMUM: ' . TNH_REQUIRED_PHP_MAX_VERSION . '], application can work without any issue');
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 	
102 102
 	//if user have some composer packages
103 103
 	$LOGGER->debug('Check for composer autoload');
104
-	if(file_exists(VENDOR_PATH . 'autoload.php')){
104
+	if (file_exists(VENDOR_PATH . 'autoload.php')) {
105 105
 		$LOGGER->info('The composer autoload file exists include it');
106 106
 		require_once VENDOR_PATH . 'autoload.php';
107 107
 	}
108
-	else{
108
+	else {
109 109
 		$LOGGER->info('The composer autoload file does not exist skipping');
110 110
 	}
111 111
 	
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	* Load configurations and using the 
122 122
 	* static method "init()" to initialize the Config class .
123 123
 	*/
124
-	$CONFIG =& class_loader('Config', 'classes');	
124
+	$CONFIG = & class_loader('Config', 'classes');	
125 125
 	$CONFIG->init();
126 126
 	$BENCHMARK->mark('CONFIG_INIT_END');
127 127
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	* Load modules and using the 
131 131
 	* static method "init()" to initialize the Module class.
132 132
 	*/
133
-	$MODULE =& class_loader('Module', 'classes');
133
+	$MODULE = & class_loader('Module', 'classes');
134 134
 	$MODULE->init();
135 135
 	$BENCHMARK->mark('MODULE_INIT_END');
136 136
 
@@ -149,34 +149,34 @@  discard block
 block discarded – undo
149 149
 	/**
150 150
 	* Loading Security class
151 151
 	*/
152
-	$SECURITY =& class_loader('Security', 'classes');
152
+	$SECURITY = & class_loader('Security', 'classes');
153 153
 	$SECURITY->checkWhiteListIpAccess();
154 154
 	
155 155
 	/**
156 156
 	* Loading Url class
157 157
 	*/
158
-	$URL =& class_loader('Url', 'classes');
158
+	$URL = & class_loader('Url', 'classes');
159 159
 	
160
-	if(get_config('cache_enable', false)){
160
+	if (get_config('cache_enable', false)) {
161 161
 		/**
162 162
 		 * Load Cache interface file
163 163
 		 */
164 164
 		require_once CORE_CLASSES_CACHE_PATH . 'CacheInterface.php';
165 165
 		$cacheHandler = get_config('cache_handler');
166
-		if(! $cacheHandler){
166
+		if (!$cacheHandler) {
167 167
 			show_error('The cache feature is enabled in the configuration but the cache handler class is not set.');
168 168
 		}
169 169
 		$CACHE = null;
170 170
 		//first check if the cache handler is the system driver
171
-		if(file_exists(CORE_CLASSES_CACHE_PATH . $cacheHandler . '.php')){
172
-			$CACHE =& class_loader($cacheHandler, 'classes/cache');
171
+		if (file_exists(CORE_CLASSES_CACHE_PATH . $cacheHandler . '.php')) {
172
+			$CACHE = & class_loader($cacheHandler, 'classes/cache');
173 173
 		}
174
-		else{
174
+		else {
175 175
 			//it's not a system driver use user library
176
-			$CACHE =& class_loader($cacheHandler);
176
+			$CACHE = & class_loader($cacheHandler);
177 177
 		}
178 178
 		//check if the page already cached
179
-		if(! empty($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'get'){
179
+		if (!empty($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'get') {
180 180
 			$RESPONSE = & class_loader('Response', 'classes');
181 181
 			$RESPONSE->renderFinalPageFromCache($CACHE);
182 182
 		}
Please login to merge, or discard this patch.
tests/tnhfw/CommonTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,20 +24,20 @@
 block discarded – undo
24 24
 		}
25 25
 
26 26
 		
27
-		public function testFunctionGetConfigKeyNotExist(){
27
+		public function testFunctionGetConfigKeyNotExist() {
28 28
 			$key = 'foo';
29 29
 			$cfg = get_config($key);
30 30
 			$this->assertNull($cfg);
31 31
 		}
32 32
 		
33
-		public function testFunctionGetConfigKeyNotExistUsingDefaultValue(){
33
+		public function testFunctionGetConfigKeyNotExistUsingDefaultValue() {
34 34
 			$key = 'foo';
35 35
 			$expected = 'bar';
36 36
 			$cfg = get_config($key, $expected);
37 37
 			$this->assertEquals($cfg, $expected);
38 38
 		}
39 39
 		
40
-		public function testFunctionGetConfigAfterSet(){
40
+		public function testFunctionGetConfigAfterSet() {
41 41
 			$key = 'foo';
42 42
 			$expected = 'bar';
43 43
 			$c = new Config();
Please login to merge, or discard this patch.
core/classes/cache/ApcCache.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25 25
 	*/
26 26
 	
27
-	class ApcCache implements CacheInterface{
27
+	class ApcCache implements CacheInterface {
28 28
 
29 29
 		/**
30 30
 		 * The logger instance
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 		private $logger;
34 34
 		
35 35
 		
36
-		public function __construct(Log $logger = null){
37
-			if(! $this->isSupported()){
36
+		public function __construct(Log $logger = null) {
37
+			if (!$this->isSupported()) {
38 38
 				show_error('The cache for APC[u] driver is not available. Check if APC[u] extension is loaded and enabled.');
39 39
 			}
40 40
 
41 41
 			/**
42 42
 	         * instance of the Log class
43 43
 	         */
44
-	        if(is_object($logger)){
44
+	        if (is_object($logger)) {
45 45
 	          $this->logger = $logger;
46 46
 	        }
47
-	        else{
48
-	            $this->logger =& class_loader('Log', 'classes');
47
+	        else {
48
+	            $this->logger = & class_loader('Log', 'classes');
49 49
 	            $this->logger->setLogger('Library::ApcCache');
50 50
 	        }
51 51
 		}
@@ -55,21 +55,21 @@  discard block
 block discarded – undo
55 55
 		 * @param  string $key the key to identify the cache data
56 56
 		 * @return mixed      the cache data if exists else return false
57 57
 		 */
58
-		public function get($key){
59
-			$this->logger->debug('Getting cache data for key ['. $key .']');
58
+		public function get($key) {
59
+			$this->logger->debug('Getting cache data for key [' . $key . ']');
60 60
 			$success = false;
61 61
 			$data = apc_fetch($key, $success);
62
-			if($success === false){
63
-				$this->logger->info('No cache found for the key ['. $key .'], return false');
62
+			if ($success === false) {
63
+				$this->logger->info('No cache found for the key [' . $key . '], return false');
64 64
 				return false;
65 65
 			}
66
-			else{
66
+			else {
67 67
 				$cacheInfo = $this->_getCacheInfo($key);
68 68
 				$expire = time();
69
-				if($cacheInfo){
69
+				if ($cacheInfo) {
70 70
 					$expire = $cacheInfo['creation_time'] + $cacheInfo['ttl'];
71 71
 				}
72
-				$this->logger->info('The cache not yet expire, now return the cache data for key ['. $key .'], the cache will expire at [' . date('Y-m-d H:i:s', $expire) . ']');
72
+				$this->logger->info('The cache not yet expire, now return the cache data for key [' . $key . '], the cache will expire at [' . date('Y-m-d H:i:s', $expire) . ']');
73 73
 				return $data;
74 74
 			}
75 75
 		}
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
 		 * @param integer $ttl  the cache life time
83 83
 		 * @return boolean true if success otherwise will return false
84 84
 		 */
85
-		public function set($key, $data, $ttl = 0){
85
+		public function set($key, $data, $ttl = 0) {
86 86
 			$expire = time() + $ttl;
87
-			$this->logger->debug('Setting cache data for key ['. $key .'], time to live [' .$ttl. '], expire at [' . date('Y-m-d H:i:s', $expire) . ']');
87
+			$this->logger->debug('Setting cache data for key [' . $key . '], time to live [' . $ttl . '], expire at [' . date('Y-m-d H:i:s', $expire) . ']');
88 88
 			$result = apc_store($key, $data, $ttl);
89
-			if($result === false){
90
-		    	$this->logger->error('Can not write cache data for the key ['. $key .'], return false');
89
+			if ($result === false) {
90
+		    	$this->logger->error('Can not write cache data for the key [' . $key . '], return false');
91 91
 		    	return false;
92 92
 		    }
93
-		    else{
94
-		    	$this->logger->info('Cache data saved for the key ['. $key .']');
93
+		    else {
94
+		    	$this->logger->info('Cache data saved for the key [' . $key . ']');
95 95
 		    	return true;
96 96
 		    }
97 97
 		}
@@ -103,15 +103,15 @@  discard block
 block discarded – undo
103 103
 		 * @return boolean      true if the cache is deleted, false if can't delete 
104 104
 		 * the cache or the cache with the given key not exist
105 105
 		 */
106
-		public function delete($key){
107
-			$this->logger->debug('Deleting of cache data for key [' .$key. ']');
106
+		public function delete($key) {
107
+			$this->logger->debug('Deleting of cache data for key [' . $key . ']');
108 108
 			$cacheInfo = $this->_getCacheInfo($key);
109
-			if($cacheInfo === false){
109
+			if ($cacheInfo === false) {
110 110
 				$this->logger->info('This cache data does not exists skipping');
111 111
 				return false;
112 112
 			}
113
-			else{
114
-				$this->logger->info('Found cache data for the key [' .$key. '] remove it');
113
+			else {
114
+				$this->logger->info('Found cache data for the key [' . $key . '] remove it');
115 115
 	      		return apc_delete($key) === true;
116 116
 			}
117 117
 		}
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
 		 * 'expire' => expiration time of the cache (Unix timestamp),
125 125
 		 * 'ttl' => the time to live of the cache in second
126 126
 		 */
127
-		public function getInfo($key){
128
-			$this->logger->debug('Getting of cache info for key [' .$key. ']');
127
+		public function getInfo($key) {
128
+			$this->logger->debug('Getting of cache info for key [' . $key . ']');
129 129
 			$cacheInfos = $this->_getCacheInfo($key);
130
-			if($cacheInfos){
130
+			if ($cacheInfos) {
131 131
 				$data = array(
132 132
 							'mtime' => $cacheInfos['creation_time'],
133 133
 							'expire' => $cacheInfos['creation_time'] + $cacheInfos['ttl'],
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 							);
136 136
 				return $data;
137 137
 			}
138
-			else{
138
+			else {
139 139
 				$this->logger->info('This cache does not exists skipping');
140 140
 				return false;
141 141
 			}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		/**
146 146
 		 * Used to delete expired cache data
147 147
 		 */
148
-		public function deleteExpiredCache(){
148
+		public function deleteExpiredCache() {
149 149
 			//for APC[u] is done automatically
150 150
 			return true;
151 151
 		}
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
 		/**
154 154
 		 * Remove all cache data
155 155
 		 */
156
-		public function clean(){
156
+		public function clean() {
157 157
 			$this->logger->debug('Deleting of all cache data');
158 158
 			$cacheInfos = apc_cache_info('user');
159
-			if(empty($cacheInfos['cache_list'])){
159
+			if (empty($cacheInfos['cache_list'])) {
160 160
 				$this->logger->info('No cache data were found skipping');
161 161
 				return false;
162 162
 			}
163
-			else{
163
+			else {
164 164
 				$this->logger->info('Found [' . count($cacheInfos) . '] cache data to remove');
165 165
 				return apc_clear_cache('user');
166 166
 			}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		 *
173 173
 		 * @return bool
174 174
 		 */
175
-		public function isSupported(){
175
+		public function isSupported() {
176 176
 			return (extension_loaded('apc') || extension_loaded('apcu')) && ini_get('apc.enabled');
177 177
 		}
178 178
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	     * Return the Log instance
181 181
 	     * @return Log
182 182
 	     */
183
-	    public function getLogger(){
183
+	    public function getLogger() {
184 184
 	      return $this->logger;
185 185
 	    }
186 186
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	     * Set the log instance
189 189
 	     * @param Log $logger the log object
190 190
 	     */
191
-	    public function setLogger(Log $logger){
191
+	    public function setLogger(Log $logger) {
192 192
 	      $this->logger = $logger;
193 193
 	      return $this;
194 194
 	    }
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 		* @param string $key the cache key to get the cache information 
200 200
 		* @return boolean|array
201 201
 		*/
202
-		private function _getCacheInfo($key){
202
+		private function _getCacheInfo($key) {
203 203
 			$caches = apc_cache_info('user');
204
-			if(! empty($caches['cache_list'])){
204
+			if (!empty($caches['cache_list'])) {
205 205
 				$cacheLists = $caches['cache_list'];
206
-				foreach ($cacheLists as $c){
207
-					if(isset($c['info']) && $c['info'] === $key){
206
+				foreach ($cacheLists as $c) {
207
+					if (isset($c['info']) && $c['info'] === $key) {
208 208
 						return $c;
209 209
 					}
210 210
 				}
Please login to merge, or discard this patch.
core/libraries/Cookie.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25 25
 	*/
26 26
 
27
-	class Cookie{
27
+	class Cookie {
28 28
 		
29 29
 		/**
30 30
 		 * The logger instance
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 		 * The signleton of the logger
37 37
 		 * @return Object the Log instance
38 38
 		 */
39
-		private static function getLogger(){
40
-			if(self::$logger == null){
41
-				self::$logger[0] =& class_loader('Log', 'classes');
39
+		private static function getLogger() {
40
+			if (self::$logger == null) {
41
+				self::$logger[0] = & class_loader('Log', 'classes');
42 42
 				self::$logger[0]->setLogger('Library::Cookie');
43 43
 			}
44 44
 			return self::$logger[0];
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 		 * @param  mixed $default the default value to use if can not find the cokkie item in the list
51 51
 		 * @return mixed          the cookie value if exist or the default value
52 52
 		 */
53
-		public static function get($item, $default = null){
53
+		public static function get($item, $default = null) {
54 54
 			$logger = self::getLogger();
55
-			if(array_key_exists($item, $_COOKIE)){
55
+			if (array_key_exists($item, $_COOKIE)) {
56 56
 				return $_COOKIE[$item];
57 57
 			}
58 58
 			$logger->warning('Cannot find cookie item [' . $item . '], using the default value [' . $default . ']');
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 		 * @param boolean $secure   if this cookie will be available on secure connection or not
70 70
 		 * @param boolean $httponly if this cookie will be available under HTTP protocol.
71 71
 		 */
72
-		public static function set($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = false, $httponly = false){
73
-			if(headers_sent()){
72
+		public static function set($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = false, $httponly = false) {
73
+			if (headers_sent()) {
74 74
 				show_error('There exists a cookie that we wanted to create that we couldn\'t 
75 75
 						    because headers was already sent. Make sure to do this first 
76 76
 							before outputing anything.');
77 77
 			}
78 78
 			$timestamp = $expire;
79
-			if($expire){
79
+			if ($expire) {
80 80
 				$timestamp = time() + $expire;
81 81
 			}
82 82
 			setcookie($name, $value, $timestamp, $path, $domain, $secure, $httponly);
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
 		 * @param  string $item the cookie item name to be cleared
88 88
 		 * @return boolean true if the item exists and is deleted successfully otherwise will return false.
89 89
 		 */
90
-		public static function delete($item){
90
+		public static function delete($item) {
91 91
 			$logger = self::getLogger();
92
-			if(array_key_exists($item, $_COOKIE)){
93
-				$logger->info('Delete cookie item ['.$item.']');
92
+			if (array_key_exists($item, $_COOKIE)) {
93
+				$logger->info('Delete cookie item [' . $item . ']');
94 94
 				unset($_COOKIE[$item]);
95 95
 				return true;
96 96
 			}
97
-			else{
98
-				$logger->warning('Cookie item ['.$item.'] to be deleted does not exists');
97
+			else {
98
+				$logger->warning('Cookie item [' . $item . '] to be deleted does not exists');
99 99
 				return false;
100 100
 			}
101 101
 		}
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		 * @param  string $item the cookie item name
106 106
 		 * @return boolean       true if the cookie item is set, false or not
107 107
 		 */
108
-		public static function exists($item){
108
+		public static function exists($item) {
109 109
 			return array_key_exists($item, $_COOKIE);
110 110
 		}
111 111
 
Please login to merge, or discard this patch.
core/libraries/Benchmark.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	/**
28 28
 	 * Class for Benchmark
29 29
 	 */
30
-	class Benchmark{
30
+	class Benchmark {
31 31
 		/**
32 32
 		 * The markers for excution time
33 33
 		 * @var array
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		 * This method is used to mark one point for benchmark (execution time and memory usage)
45 45
 		 * @param  string $name the marker name
46 46
 		 */
47
-		public function mark($name){
47
+		public function mark($name) {
48 48
 			//Marker for execution time
49 49
 			$this->markersTime[$name] = microtime(true);
50 50
 			//Marker for memory usage
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 		 * @param  integer $decimalCount   the number of decimal
59 59
 		 * @return string         the total execution time
60 60
 		 */
61
-		public function elapsedTime($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){
62
-			if(! $startMarkerName || !isset($this->markersTime[$startMarkerName])){
61
+		public function elapsedTime($startMarkerName = null, $endMarkerName = null, $decimalCount = 6) {
62
+			if (!$startMarkerName || !isset($this->markersTime[$startMarkerName])) {
63 63
 				return 0;
64 64
 			}
65 65
 			
66
-			if(! isset($this->markersTime[$endMarkerName])){
66
+			if (!isset($this->markersTime[$endMarkerName])) {
67 67
 				$this->markersTime[$endMarkerName] = microtime(true);
68 68
 			}
69 69
 			return number_format($this->markersTime[$endMarkerName] - $this->markersTime[$startMarkerName], $decimalCount);
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 		 * @param  integer $decimalCount   the number of decimal
77 77
 		 * @return string         the total memory usage
78 78
 		 */
79
-		public function memoryUsage($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){
80
-			if(! $startMarkerName || !isset($this->markersMemory[$startMarkerName])){
79
+		public function memoryUsage($startMarkerName = null, $endMarkerName = null, $decimalCount = 6) {
80
+			if (!$startMarkerName || !isset($this->markersMemory[$startMarkerName])) {
81 81
 				return 0;
82 82
 			}
83 83
 			
84
-			if(! isset($this->markersMemory[$endMarkerName])){
84
+			if (!isset($this->markersMemory[$endMarkerName])) {
85 85
 				$this->markersMemory[$endMarkerName] = microtime(true);
86 86
 			}
87 87
 			return number_format($this->markersMemory[$endMarkerName] - $this->markersMemory[$startMarkerName], $decimalCount);
Please login to merge, or discard this patch.
core/libraries/Email.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		 */
87 87
 		public function __construct()
88 88
 		{
89
-			$this->logger =& class_loader('Log', 'classes');
89
+			$this->logger = & class_loader('Log', 'classes');
90 90
             $this->logger->setLogger('Library::Email');
91 91
 			$this->reset();
92 92
 		}
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 		public function setTos(array $emails)
149 149
 		{
150 150
 			foreach ($emails as $name => $email) {
151
-				if(is_numeric($name)){
151
+				if (is_numeric($name)) {
152 152
 					$this->setTo($email);
153 153
 				}
154
-				else{
154
+				else {
155 155
 					$this->setTo($email, $name);
156 156
 				}
157 157
 			}
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
 		 */
282 282
 		public function addAttachment($path, $filename = null, $data = null)
283 283
 		{
284
-			if(! file_exists($path)){
285
-				show_error('The file [' .$path. '] does not exists.');
284
+			if (!file_exists($path)) {
285
+				show_error('The file [' . $path . '] does not exists.');
286 286
 			}
287 287
 			$filename = empty($filename) ? basename($path) : $filename;
288 288
 			$filename = $this->encodeUtf8($this->filterOther((string) $filename));
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
 		 */
305 305
 		public function getAttachmentData($path)
306 306
 		{
307
-			if(! file_exists($path)){
308
-				show_error('The file [' .$path. '] does not exists.');
307
+			if (!file_exists($path)) {
308
+				show_error('The file [' . $path . '] does not exists.');
309 309
 			}
310 310
 			$filesize = filesize($path);
311 311
 			$handle = fopen($path, "r");
312 312
 			$attachment = null;
313
-			if(is_resource($handle)){
313
+			if (is_resource($handle)) {
314 314
 				$attachment = fread($handle, $filesize);
315 315
 				fclose($handle);
316 316
 			}
Please login to merge, or discard this patch.