Test Setup Failed
Push — master ( 12c298...4a14e0 )
by Ralf
22:03
created
api/src/Etemplate/Widget/Checkbox.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param array &$validated=array() validated content
45 45
 	 * @return boolean true if no validation error, false otherwise
46 46
 	 */
47
-	public function validate($cname, array $expand, array $content, &$validated=array())
47
+	public function validate($cname, array $expand, array $content, &$validated = array())
48 48
 	{
49 49
 		$form_name = self::form_name($cname, $this->id, $expand);
50 50
 
@@ -56,28 +56,28 @@  discard block
 block discarded – undo
56 56
 		if (!$this->is_readonly($cname, $form_name))
57 57
 		{
58 58
 			$value = self::get_array($content, $form_name);
59
-			if (!isset($value))	return;	// value not transmitted --> nothing to validate
60
-			$valid =& self::get_array($validated, $form_name, true);
59
+			if (!isset($value))	return; // value not transmitted --> nothing to validate
60
+			$valid = & self::get_array($validated, $form_name, true);
61 61
 
62 62
 			if (!$value && $this->attrs['needed'])
63 63
 			{
64
-				self::set_validation_error($form_name,lang('Field must not be empty !!!'),'');
64
+				self::set_validation_error($form_name, lang('Field must not be empty !!!'), '');
65 65
 			}
66 66
 			$type = $this->type ? $this->type : $this->attrs['type'];
67 67
 			$value_attr = $type == 'radio' ? 'set_value' : 'selected_value';
68 68
 			// defaults for set and unset values
69 69
 			$selected_value = true;
70 70
 			$unselected_value = false;
71
-			if (array_key_exists($value_attr, $this->attrs) || array_key_exists('unselected_value',$this->attrs))
71
+			if (array_key_exists($value_attr, $this->attrs) || array_key_exists('unselected_value', $this->attrs))
72 72
 			{
73
-				if(array_key_exists($value_attr, $this->attrs))
73
+				if (array_key_exists($value_attr, $this->attrs))
74 74
 				{
75 75
 					// Expand any content stuff
76
-					$selected_value = self::expand_name($this->attrs[$value_attr], $expand['c'], $expand['row'], $expand['c_'], $expand['row_'],$expand['cont']);
76
+					$selected_value = self::expand_name($this->attrs[$value_attr], $expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']);
77 77
 				}
78
-				if(array_key_exists('unselected_value',$this->attrs))
78
+				if (array_key_exists('unselected_value', $this->attrs))
79 79
 				{
80
-					$unselected_value = self::expand_name($this->attrs['unselected_value'], $expand['c'], $expand['row'], $expand['c_'], $expand['row_'],$expand['cont']);
80
+					$unselected_value = self::expand_name($this->attrs['unselected_value'], $expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']);
81 81
 				}
82 82
 			}
83 83
 			if ($type == 'radio')
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 				{
88 88
 					$valid = $value;
89 89
 				}
90
-				elseif ( !$options && $selected_value && $value == $selected_value)
90
+				elseif (!$options && $selected_value && $value == $selected_value)
91 91
 				{
92 92
 					// Options set in template, not in sel_options
93 93
 					$valid = $selected_value;
94 94
 				}
95 95
 				elseif (!isset($valid))
96 96
 				{
97
-					$valid = '';	// do not overwrite value of an other radio-button of the same group (identical name)!
97
+					$valid = ''; // do not overwrite value of an other radio-button of the same group (identical name)!
98 98
 				}
99 99
 			}
100 100
 			elseif (in_array((string)$selected_value, (array)$value))
Please login to merge, or discard this patch.
api/src/Etemplate/WidgetBrowser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
 		Api\Framework::includeCSS('/api/templates/default/etemplate2.css');
48 48
 
49
-		Api\Framework::includeCSS('api','widget_browser',false);
49
+		Api\Framework::includeCSS('api', 'widget_browser', false);
50 50
 
51 51
 		// load translations
52 52
 		Api\Translation::add_app('etemplate');
Please login to merge, or discard this patch.
api/src/MimeMagic.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		{
47 47
 			return $mime;
48 48
 		}
49
-		return lang('%1 file',strtoupper($ext)).' ('.$mime.')';
49
+		return lang('%1 file', strtoupper($ext)).' ('.$mime.')';
50 50
 	}
51 51
 
52 52
 	/**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		if (empty($_ext))
65 65
 		{
66
-			return 'text/plain';//assume no extension is a text file
66
+			return 'text/plain'; //assume no extension is a text file
67 67
 		}
68 68
 		$ext = strtolower($_ext);
69 69
 		if (!array_key_exists($ext, self::$mime_extension_map))
@@ -188,24 +188,24 @@  discard block
 block discarded – undo
188 188
 	 */
189 189
 	public static function analyze_data($data)
190 190
 	{
191
-		if(!is_writeable(@$GLOBALS['egw_info']['server']['temp_dir']))
191
+		if (!is_writeable(@$GLOBALS['egw_info']['server']['temp_dir']))
192 192
 		{
193 193
 			//nothing we can do but bail out
194 194
 			return false;
195 195
 		}
196 196
 
197 197
 		mt_srand(time());
198
-		$filename = $GLOBALS['egw_info']['server']['temp_dir'] . '/'
199
-			. md5( time() + mt_rand() ) . '.tmp';
198
+		$filename = $GLOBALS['egw_info']['server']['temp_dir'].'/'
199
+			. md5(time() + mt_rand()).'.tmp';
200 200
 
201 201
 		$fp = @fopen($filename, 'ab');
202
-		if(!$fp || !$data)
202
+		if (!$fp || !$data)
203 203
 		{
204 204
 			//houston we have a problem - bail out
205 205
 			return false;
206 206
 		}
207 207
 
208
-		if(!fwrite($fp, $data))
208
+		if (!fwrite($fp, $data))
209 209
 		{
210 210
 			//bail out again
211 211
 			return false;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 		$mime = self::analyze_file($filename);
217 217
 
218
-		unlink($filename);//remove the temp file
218
+		unlink($filename); //remove the temp file
219 219
 
220 220
 		return $mime;
221 221
 	}
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 * @var array of extenstion to mime mappings
234 234
 	 */
235 235
 	static $mime_extension_map = array(
236
-		'txt'				=> 'text/plain',	// should be first, so text/plain maps back to .txt
236
+		'txt'				=> 'text/plain', // should be first, so text/plain maps back to .txt
237 237
 		'3dml'              => 'text/vnd.in3d.3dml',
238 238
 		'3ds'               => 'image/x-3ds',
239 239
 		'3g2'               => 'video/3gpp2',
Please login to merge, or discard this patch.
api/src/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 class Exception extends \Exception
30 30
 {
31 31
 	// nothing fancy yet
32
-	function __construct($msg=null,$code=100,\Exception $previous=null)
32
+	function __construct($msg = null, $code = 100, \Exception $previous = null)
33 33
 	{
34 34
 		return parent::__construct($msg, $code, $previous);
35 35
 	}
Please login to merge, or discard this patch.
api/src/Cache/Memcache.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -54,26 +54,26 @@  discard block
 block discarded – undo
54 54
 	 * @throws Exception if connection to backend could not be established
55 55
 	 * @param array $params eg. array('localhost'[,'localhost:11211',...])
56 56
 	 */
57
-	function __construct(array $params=null)
57
+	function __construct(array $params = null)
58 58
 	{
59
-		check_load_extension('memcache',true);
59
+		check_load_extension('memcache', true);
60 60
 		$this->memcache = new \Memcache();
61 61
 
62
-		if (!$params) $params = array('localhost');	// some reasonable default
62
+		if (!$params) $params = array('localhost'); // some reasonable default
63 63
 
64 64
 		$ok = false;
65
-		foreach($params as $host_port)
65
+		foreach ($params as $host_port)
66 66
 		{
67
-			$parts = explode(':',$host_port);
67
+			$parts = explode(':', $host_port);
68 68
 			$host = array_shift($parts);
69
-			$port = $parts ? array_shift($parts) : 11211;	// default port
69
+			$port = $parts ? array_shift($parts) : 11211; // default port
70 70
 
71
-			$ok = $this->memcache->addServer($host,$port) || $ok;
71
+			$ok = $this->memcache->addServer($host, $port) || $ok;
72 72
 			//error_log(__METHOD__."(".array2string($params).") memcache->addServer('$host',$port) = ".(int)$ok);
73 73
 		}
74 74
 		if (!$ok)
75 75
 		{
76
-			throw new Exception (__METHOD__.'('.array2string($params).") Can't open connection to any memcached server!");
76
+			throw new Exception(__METHOD__.'('.array2string($params).") Can't open connection to any memcached server!");
77 77
 		}
78 78
 		$this->igbinary_available = function_exists('igbinary_serialize') && function_exists('igbinary_unserialize');
79 79
 	}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * @param int $expiration =0
87 87
 	 * @return boolean true on success, false on error, incl. key already exists in cache
88 88
 	 */
89
-	function add(array $keys,$data,$expiration=0)
89
+	function add(array $keys, $data, $expiration = 0)
90 90
 	{
91 91
 		return $this->memcache->add(self::key($keys),
92 92
 			$this->igbinary_available ? igbinary_serialize($data) : serialize($data),
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @param int $expiration =0
102 102
 	 * @return boolean true on success, false on error
103 103
 	 */
104
-	function set(array $keys,$data,$expiration=0)
104
+	function set(array $keys, $data, $expiration = 0)
105 105
 	{
106 106
 		return $this->memcache->set(self::key($keys),
107 107
 			$this->igbinary_available ? igbinary_serialize($data) : serialize($data),
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	function get(array $keys)
118 118
 	{
119
-		if (($data = $this->memcache->get($key=self::key($keys))) === false)
119
+		if (($data = $this->memcache->get($key = self::key($keys))) === false)
120 120
 		{
121 121
 			//error_log(__METHOD__."(".array2string($keys).") key='$key' NOT found!");
122 122
 			return null;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	{
136 136
 		$locations = array_pop($keys);
137 137
 		$prefix = self::key($keys);
138
-		foreach($locations as &$location)
138
+		foreach ($locations as &$location)
139 139
 		{
140 140
 			$location = $prefix.'::'.$location;
141 141
 		}
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
 			return array();
145 145
 		}
146 146
 		$ret = array();
147
-		$prefix_len = strlen($prefix)+2;
148
-		foreach($multiple as $location => $data)
147
+		$prefix_len = strlen($prefix) + 2;
148
+		foreach ($multiple as $location => $data)
149 149
 		{
150
-			$key = substr($location,$prefix_len);
150
+			$key = substr($location, $prefix_len);
151 151
 			//error_log(__METHOD__."(".array2string($locations).") key='$key' found ".bytes($data)." bytes).");
152 152
 			$ret[$key] = $this->igbinary_available && $data[1] !== ':' ? igbinary_unserialize($data) : unserialize($data);
153 153
 		}
@@ -175,6 +175,6 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	private function key(array $keys)
177 177
 	{
178
-		return implode('::',$keys);
178
+		return implode('::', $keys);
179 179
 	}
180 180
 }
Please login to merge, or discard this patch.
api/src/Cache/Base.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @param boolean $verbose =false true: echo failed checks
29 29
 	 * @return int number of failed checks
30 30
 	 */
31
-	function check($verbose=false)
31
+	function check($verbose = false)
32 32
 	{
33 33
 		// set us up as provider for Api\Cache class
34 34
 		$GLOBALS['egw_info']['server']['install_id'] = md5(microtime(true));
@@ -37,27 +37,27 @@  discard block
 block discarded – undo
37 37
 		Api\Cache::$default_provider = get_class($this);
38 38
 
39 39
 		$failed = 0;
40
-		foreach(array(
40
+		foreach (array(
41 41
 			Api\Cache::TREE => 'tree',
42 42
 			Api\Cache::INSTANCE => 'instance',
43 43
 		) as $level => $label)
44 44
 		{
45 45
 			$locations = array();
46
-			foreach(array('string',123,true,false,null,array(),array(1,2,3)) as $data)
46
+			foreach (array('string', 123, true, false, null, array(), array(1, 2, 3)) as $data)
47 47
 			{
48 48
 				$location = md5(microtime(true).$label.serialize($data));
49
-				$get_before_set = $this->get(array($level,__CLASS__,$location));
49
+				$get_before_set = $this->get(array($level, __CLASS__, $location));
50 50
 				if (!is_null($get_before_set))
51 51
 				{
52 52
 					if ($verbose) echo "$label: get_before_set=".array2string($get_before_set)." != NULL\n";
53 53
 					++$failed;
54 54
 				}
55
-				if (($set = $this->set(array($level,__CLASS__,$location), $data, 10)) !== true)
55
+				if (($set = $this->set(array($level, __CLASS__, $location), $data, 10)) !== true)
56 56
 				{
57 57
 					if ($verbose) echo "$label: set returned ".array2string($set)." !== TRUE\n";
58 58
 					++$failed;
59 59
 				}
60
-				$get_after_set = $this->get(array($level,__CLASS__,$location));
60
+				$get_after_set = $this->get(array($level, __CLASS__, $location));
61 61
 				if ($get_after_set !== $data)
62 62
 				{
63 63
 					if ($verbose) echo "$label: get_after_set=".array2string($get_after_set)." !== ".array2string($data)."\n";
@@ -65,25 +65,25 @@  discard block
 block discarded – undo
65 65
 				}
66 66
 				if (is_a($this, 'EGroupware\Api\Cache\ProviderMultiple'))
67 67
 				{
68
-					$mget_after_set = $this->mget(array($level,__CLASS__,array($location)));
68
+					$mget_after_set = $this->mget(array($level, __CLASS__, array($location)));
69 69
 					if ($mget_after_set[$location] !== $data)
70 70
 					{
71 71
 						if ($verbose) echo "$label: mget_after_set['$location']=".array2string($mget_after_set[$location])." !== ".array2string($data)."\n";
72 72
 						++$failed;
73 73
 					}
74 74
 				}
75
-				$add_after_set = $this->add(array($level,__CLASS__,$location), 'other-data');
75
+				$add_after_set = $this->add(array($level, __CLASS__, $location), 'other-data');
76 76
 				if ($add_after_set !== false)
77 77
 				{
78 78
 					if ($verbose) echo "$label: add_after_set=".array2string($add_after_set)."\n";
79 79
 					++$failed;
80 80
 				}
81
-				if (($delete = $this->delete(array($level,__CLASS__,$location))) !== true)
81
+				if (($delete = $this->delete(array($level, __CLASS__, $location))) !== true)
82 82
 				{
83 83
 					if ($verbose) echo "$label: delete returned ".array2string($delete)." !== TRUE\n";
84 84
 					++$failed;
85 85
 				}
86
-				$get_after_delete = $this->get(array($level,__CLASS__,$location));
86
+				$get_after_delete = $this->get(array($level, __CLASS__, $location));
87 87
 				if (!is_null($get_after_delete))
88 88
 				{
89 89
 					if ($verbose) echo "$label: get_after_delete=".array2string($get_after_delete)." != NULL\n";
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 				if (is_a($this, 'EGroupware\Api\Cache\ProviderMultiple'))
94 94
 				{
95 95
 					$locations[$location] = $data;
96
-					$mget_after_delete = $this->mget(array($level,__CLASS__,array($location)));
96
+					$mget_after_delete = $this->mget(array($level, __CLASS__, array($location)));
97 97
 					if (isset($mget_after_delete[$location]))
98 98
 					{
99 99
 						if ($verbose) echo "$label: mget_after_delete['$location']=".array2string($mget_after_delete[$location])." != NULL\n";
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 				{
105 105
 					$locations[$location] = $data;
106 106
 				}
107
-				$add_after_delete = $this->add(array($level,__CLASS__,$location), $data, 10);
107
+				$add_after_delete = $this->add(array($level, __CLASS__, $location), $data, 10);
108 108
 				if ($add_after_delete !== true)
109 109
 				{
110 110
 					if ($verbose) echo "$label: add_after_delete=".array2string($add_after_delete)."\n";
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 				}
113 113
 				else
114 114
 				{
115
-					$get_after_add = $this->get(array($level,__CLASS__,$location));
115
+					$get_after_add = $this->get(array($level, __CLASS__, $location));
116 116
 					if ($get_after_add !== $data)
117 117
 					{
118 118
 						if ($verbose) echo "$label: get_after_add=".array2string($get_after_add)." !== ".array2string($data)."\n";
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 			}
123 123
 			// get all above in one request
124 124
 			$keys = array_keys($locations);
125
-			$keys_bogus = array_merge(array('not-set'),array_keys($locations),array('not-set-too'));
125
+			$keys_bogus = array_merge(array('not-set'), array_keys($locations), array('not-set-too'));
126 126
 			if (is_a($this, 'EGroupware\Api\Cache\ProviderMultiple'))
127 127
 			{
128
-				$mget = $this->mget(array($level,__CLASS__,$keys));
129
-				$mget_bogus = $this->mget(array($level,__CLASS__,$keys_bogus));
128
+				$mget = $this->mget(array($level, __CLASS__, $keys));
129
+				$mget_bogus = $this->mget(array($level, __CLASS__, $keys_bogus));
130 130
 			/* Api\Cache::getCache() gives a different result, as it does NOT use $level direkt
131 131
 			}
132 132
 			else
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 */
161 161
 	function flush(array $keys)
162 162
 	{
163
-		unset($keys);	// required by function signature
163
+		unset($keys); // required by function signature
164 164
 		return false;
165 165
 	}
166 166
 }
Please login to merge, or discard this patch.
api/src/Cache/Provider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 * @param int $expiration =0
39 39
 	 * @return boolean true on success, false on error, incl. key already exists in cache
40 40
 	 */
41
-	function add(array $keys,$data,$expiration=0);
41
+	function add(array $keys, $data, $expiration = 0);
42 42
 
43 43
 	/**
44 44
 	 * Stores some data in the cache
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * @param int $expiration =0
49 49
 	 * @return boolean true on success, false on error
50 50
 	 */
51
-	function set(array $keys,$data,$expiration=0);
51
+	function set(array $keys, $data, $expiration = 0);
52 52
 
53 53
 	/**
54 54
 	 * Get some data from the cache
Please login to merge, or discard this patch.
api/src/Auth/Fallbackmail2sql.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 	/**
23 23
 	 * Constructor
24 24
 	 */
25
-	function __construct($primary='mail', $fallback='sql')
25
+	function __construct($primary = 'mail', $fallback = 'sql')
26 26
 	{
27 27
 		parent::__construct($primary, $fallback);
28 28
 	}
Please login to merge, or discard this patch.
api/src/Auth/Nis.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,22 +26,22 @@  discard block
 block discarded – undo
26 26
 	 * @param string $passwd_type ='text' 'text' for cleartext passwords (default)
27 27
 	 * @return boolean true if successful authenticated, false otherwise
28 28
 	 */
29
-	function authenticate($username, $passwd, $passwd_type='text')
29
+	function authenticate($username, $passwd, $passwd_type = 'text')
30 30
 	{
31
-		unset($passwd_type);	// not used but required by interface
31
+		unset($passwd_type); // not used but required by interface
32 32
 
33 33
 		$domain = yp_get_default_domain();
34
-		if(!empty($GLOBALS['egw_info']['server']['nis_domain']))
34
+		if (!empty($GLOBALS['egw_info']['server']['nis_domain']))
35 35
 		{
36 36
 			$domain = $GLOBALS['egw_info']['server']['nis_domain'];
37 37
 		}
38 38
 
39 39
 		$map = "passwd.byname";
40
-		if(!empty($GLOBALS['egw_info']['server']['nis_map']))
40
+		if (!empty($GLOBALS['egw_info']['server']['nis_map']))
41 41
 		{
42 42
 			$map = $GLOBALS['egw_info']['server']['nis_map'];
43 43
 		}
44
-		$entry = yp_match( $domain, $map, $username );
44
+		$entry = yp_match($domain, $map, $username);
45 45
 
46 46
 		/*
47 47
 		 * we assume that the map is structured in the usual
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 	 * @param int $account_id =0 account id of user whose passwd should be changed
64 64
 	 * @return boolean true if password successful changed, false otherwise
65 65
 	 */
66
-	function change_password($old_passwd, $new_passwd, $account_id=0)
66
+	function change_password($old_passwd, $new_passwd, $account_id = 0)
67 67
 	{
68
-		unset($old_passwd, $new_passwd, $account_id);	// not used but required by interface
68
+		unset($old_passwd, $new_passwd, $account_id); // not used but required by interface
69 69
 
70 70
 		// can't change passwords unless server runs as root (bad idea)
71
-		return( False );
71
+		return(False);
72 72
 	}
73 73
 }
Please login to merge, or discard this patch.