Completed
Pull Request — developer (#4001)
by Thom
542:26 queued 508:45
created
libraries/SabreDAV/Xml/LibXMLException.php 3 patches
Unused Use Statements   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Sabre\Xml;
4 4
 
5
-use
6
-    LibXMLError;
5
+use LibXMLError;
7 6
 
8 7
 /**
9 8
  * This exception is thrown when the Readers runs into a parsing error.
Please login to merge, or discard this patch.
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 namespace Sabre\Xml;
4 4
 
5 5
 use
6
-    LibXMLError;
6
+	LibXMLError;
7 7
 
8 8
 /**
9 9
  * This exception is thrown when the Readers runs into a parsing error.
@@ -16,38 +16,38 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class LibXMLException extends ParseException {
18 18
 
19
-    /**
20
-     * The error list.
21
-     *
22
-     * @var LibXMLError[]
23
-     */
24
-    protected $errors;
25
-
26
-    /**
27
-     * Creates the exception.
28
-     *
29
-     * You should pass a list of LibXMLError objects in its constructor.
30
-     *
31
-     * @param LibXMLError[] $errors
32
-     * @param int $code
33
-     * @param Exception $previousException
34
-     */
35
-    public function __construct(array $errors, $code = null, Exception $previousException = null) {
36
-
37
-        $this->errors = $errors;
38
-        parent::__construct($errors[0]->message . ' on line ' . $errors[0]->line . ', column ' . $errors[0]->column, $code, $previousException);
39
-
40
-    }
41
-
42
-    /**
43
-     * Returns the LibXML errors
44
-     *
45
-     * @return void
46
-     */
47
-    public function getErrors() {
48
-
49
-        return $this->errors;
50
-
51
-    }
19
+	/**
20
+	 * The error list.
21
+	 *
22
+	 * @var LibXMLError[]
23
+	 */
24
+	protected $errors;
25
+
26
+	/**
27
+	 * Creates the exception.
28
+	 *
29
+	 * You should pass a list of LibXMLError objects in its constructor.
30
+	 *
31
+	 * @param LibXMLError[] $errors
32
+	 * @param int $code
33
+	 * @param Exception $previousException
34
+	 */
35
+	public function __construct(array $errors, $code = null, Exception $previousException = null) {
36
+
37
+		$this->errors = $errors;
38
+		parent::__construct($errors[0]->message . ' on line ' . $errors[0]->line . ', column ' . $errors[0]->column, $code, $previousException);
39
+
40
+	}
41
+
42
+	/**
43
+	 * Returns the LibXML errors
44
+	 *
45
+	 * @return void
46
+	 */
47
+	public function getErrors() {
48
+
49
+		return $this->errors;
50
+
51
+	}
52 52
 
53 53
 }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
     /**
43 43
      * Returns the LibXML errors
44 44
      *
45
-     * @return void
45
+     * @return LibXMLError[]
46 46
      */
47 47
     public function getErrors() {
48 48
 
Please login to merge, or discard this patch.
libraries/SabreDAV/Yeti/Debug.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php namespace Yeti;
2 2
 
3 3
 use Sabre\DAV,
4
-	Sabre\HTTP\RequestInterface,
5
-	Sabre\HTTP\ResponseInterface;
4
+    Sabre\HTTP\RequestInterface,
5
+    Sabre\HTTP\ResponseInterface;
6 6
 
7 7
 class Debug extends DAV\ServerPlugin
8 8
 {
Please login to merge, or discard this patch.
libraries/SabreDAV/Yeti/WebDAV_Node.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 namespace Yeti;
4 4
 
5 5
 use Sabre\DAV,
6
-	Sabre\HTTP\URLUtil;
6
+    Sabre\HTTP\URLUtil;
7 7
 
8 8
 /**
9 9
  * Base node-class
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 		$stmt = $this->exData->pdo->prepare('SELECT * FROM dav_users WHERE username = ?;');
77 77
 		$stmt->execute([$user['username']]);
78 78
 		$row = $stmt->fetch(\PDO::FETCH_ASSOC);
79
-		if($row){
79
+		if ($row) {
80 80
 			$this->exData->username = $user['username'];
81 81
 			$this->exData->userId = $row['id'];
82 82
 			$this->exData->crmUserId = $row['userid'];
Please login to merge, or discard this patch.
modules/Calendar/CalendarCommon.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
  * To get hour,minute and format
32 32
  * @param $starttime -- The date&time :: Type string
33 33
  * @param $endtime -- The date&time :: Type string
34
- * @param $format -- The format :: Type string
34
+ * @param string $format -- The format :: Type string
35 35
  * @returns $timearr :: Type Array
36 36
  */
37 37
 function getaddEventPopupTime($starttime, $endtime, $format)
Please login to merge, or discard this patch.
Braces   +31 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 	$result = $adb->pquery($query, array($sharedid));
22 22
 	if ($adb->num_rows($result) != 0) {
23 23
 		$countResult = $adb->num_rows($result);
24
-		for ($j = 0; $j < $countResult; $j++)
25
-			$userid[] = $adb->query_result($result, $j, 'userid');
24
+		for ($j = 0; $j < $countResult; $j++) {
25
+					$userid[] = $adb->query_result($result, $j, 'userid');
26
+		}
26 27
 		$shared_ids = implode(",", $userid);
27 28
 	}
28 29
 	return $shared_ids;
@@ -43,15 +44,17 @@  discard block
 block discarded – undo
43 44
 	if ($format == 'am/pm' || $format == '12') {
44 45
 		$hr = $sthr + 0;
45 46
 		$timearr['startfmt'] = ($hr >= 12) ? "pm" : "am";
46
-		if ($hr == 0)
47
-			$hr = 12;
47
+		if ($hr == 0) {
48
+					$hr = 12;
49
+		}
48 50
 		$timearr['starthour'] = twoDigit(($hr > 12) ? ($hr - 12) : $hr);
49 51
 		$timearr['startmin'] = $stmin;
50 52
 
51 53
 		$edhr = $edhr + 0;
52 54
 		$timearr['endfmt'] = ($edhr >= 12) ? "pm" : "am";
53
-		if ($edhr == 0)
54
-			$edhr = 12;
55
+		if ($edhr == 0) {
56
+					$edhr = 12;
57
+		}
55 58
 		$timearr['endhour'] = twoDigit(($edhr > 12) ? ($edhr - 12) : $edhr);
56 59
 		$timearr['endmin'] = $edmin;
57 60
 		return $timearr;
@@ -99,10 +102,11 @@  discard block
 block discarded – undo
99 102
 	$startDate = new DateTimeField($description['st_date_time']);
100 103
 	$endDate = new DateTimeField($description['end_date_time']);
101 104
 
102
-	if ($from == "invite")
103
-		$msg = \App\Language::translate($mod_strings['LBL_ACTIVITY_INVITATION']);
104
-	else
105
-		$msg = \App\Language::translate($mod_strings['LBL_ACTIVITY_NOTIFICATION']);
105
+	if ($from == "invite") {
106
+			$msg = \App\Language::translate($mod_strings['LBL_ACTIVITY_INVITATION']);
107
+	} else {
108
+			$msg = \App\Language::translate($mod_strings['LBL_ACTIVITY_NOTIFICATION']);
109
+	}
106 110
 
107 111
 	$currentUsername = \App\Fields\Owner::getUserLabel($currentUser->id);
108 112
 	$status = \App\Language::translate($description['status'], 'Calendar');
@@ -116,8 +120,9 @@  discard block
 block discarded – undo
116 120
 	$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["Related To"] . ': ' . \App\Language::translate($description['relatedto']);
117 121
 	if (!empty($description['contact_name'])) {
118 122
 		$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["LBL_CONTACT_LIST"] . ' ' . $description['contact_name'];
119
-	} else
120
-		$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["Location"] . ' : ' . $description['location'];
123
+	} else {
124
+			$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["Location"] . ' : ' . $description['location'];
125
+	}
121 126
 
122 127
 	$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["LBL_APP_DESCRIPTION"] . ': ' . $description['description'];
123 128
 	$list .= '<br><br>' . $mod_strings["LBL_REGARDS_STRING"] . ' ,';
@@ -129,11 +134,12 @@  discard block
 block discarded – undo
129 134
 
130 135
 function twoDigit($no)
131 136
 {
132
-	if ($no < 10 && strlen(trim($no)) < 2)
133
-		return "0" . $no;
134
-	else
135
-		return "" . $no;
136
-}
137
+	if ($no < 10 && strlen(trim($no)) < 2) {
138
+			return "0" . $no;
139
+	} else {
140
+			return "" . $no;
141
+	}
142
+	}
137 143
 
138 144
 // User Select Customization
139 145
 /**
@@ -144,8 +150,9 @@  discard block
 block discarded – undo
144 150
 {
145 151
 	$currentUser = Users_Privileges_Model::getCurrentUserModel();
146 152
 	$onlyForUser = htmlspecialchars(strip_tags(AppRequest::getForSql('onlyforuser')), ENT_QUOTES, AppConfig::main('default_charset'));
147
-	if ($onlyForUser == '')
148
-		$onlyForUser = $currentUser->id;
153
+	if ($onlyForUser == '') {
154
+			$onlyForUser = $currentUser->id;
155
+	}
149 156
 	return $onlyForUser;
150 157
 }
151 158
 
@@ -161,10 +168,11 @@  discard block
 block discarded – undo
161 168
 			if ($onlyForUser == $currentUser->id) {
162 169
 				$userGroupIds = fetchUserGroupids($currentUser->id);
163 170
 				// User does not belong to any group? Let us reset to non-existent group
164
-				if (!empty($userGroupIds))
165
-					$userGroupIds .= ',';
166
-				else
167
-					$userGroupIds = '';
171
+				if (!empty($userGroupIds)) {
172
+									$userGroupIds .= ',';
173
+				} else {
174
+									$userGroupIds = '';
175
+				}
168 176
 				$userGroupIds .= $currentUser->id;
169 177
 				$qcondition = " && vtiger_crmentity.smownerid IN (" . $userGroupIds . ")";
170 178
 			} else {
Please login to merge, or discard this patch.
modules/Calendar/iCal/ical-parser-class.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -10,12 +10,18 @@
 block discarded – undo
10 10
 		$this->folders = 'cache/import/';
11 11
 	}
12 12
 
13
+	/**
14
+	 * @param string $filename
15
+	 */
13 16
 	public function iCalReader($filename, $rootDirectory = '')
14 17
 	{
15 18
 		$iCaltoArray = $this->iCalDecoder($filename, $rootDirectory);
16 19
 		return $iCaltoArray;
17 20
 	}
18 21
 
22
+	/**
23
+	 * @param string $rootDirectory
24
+	 */
19 25
 	public function iCalDecoder($file, $rootDirectory)
20 26
 	{
21 27
 		$ical = file_get_contents($rootDirectory . $this->folders . $file);
Please login to merge, or discard this patch.
modules/Calendar/iCal/iCalendar_parameters.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -31,6 +31,9 @@  discard block
 block discarded – undo
31 31
 		}
32 32
 	}
33 33
 
34
+	/**
35
+	 * @param iCalendar_property $parent_property
36
+	 */
34 37
 	public function is_valid_value(&$parent_property, $parameter, $value)
35 38
 	{
36 39
 		switch ($parameter) {
@@ -183,6 +186,9 @@  discard block
 block discarded – undo
183 186
 		}
184 187
 	}
185 188
 
189
+	/**
190
+	 * @param string $parameter
191
+	 */
186 192
 	public function do_value_formatting($parameter, $value)
187 193
 	{
188 194
 		switch ($parameter) {
Please login to merge, or discard this patch.
modules/Calendar/iCal/iCalendar_properties.php 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -27,6 +27,10 @@  discard block
 block discarded – undo
27 27
 
28 28
 	// If some property needs extra care with its parameters, override this
29 29
 	// IMPORTANT: the parameter name MUST BE CAPITALIZED!
30
+
31
+	/**
32
+	 * @param string $parameter
33
+	 */
30 34
 	public function is_valid_parameter($parameter, $value)
31 35
 	{
32 36
 
@@ -1218,6 +1222,9 @@  discard block
 block discarded – undo
1218 1222
 		);
1219 1223
 	}
1220 1224
 
1225
+	/**
1226
+	 * @param string $name
1227
+	 */
1221 1228
 	public function set_name($name)
1222 1229
 	{
1223 1230
 
Please login to merge, or discard this patch.
modules/Calendar/iCal/iCalendar_rfc2445.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -40,6 +40,9 @@  discard block
 block discarded – undo
40 40
 define('RFC2445_TYPE_URI', 12); // CAL_ADDRESS === URI
41 41
 define('RFC2445_TYPE_UTC_OFFSET', 13);
42 42
 
43
+/**
44
+ * @param string $string
45
+ */
43 46
 function rfc2445_fold($string)
44 47
 {
45 48
 	if (strlen($string) <= RFC2445_FOLDED_LINE_LENGTH) {
@@ -67,6 +70,9 @@  discard block
 block discarded – undo
67 70
 	return $string;
68 71
 }
69 72
 
73
+/**
74
+ * @param string $name
75
+ */
70 76
 function rfc2445_is_xname($name)
71 77
 {
72 78
 
Please login to merge, or discard this patch.
modules/Calendar/views/Edit.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -155,6 +155,10 @@
 block discarded – undo
155 155
 		$viewer->view('EditView.tpl', $moduleName);
156 156
 	}
157 157
 
158
+	/**
159
+	 * @param Vtiger_Request $request
160
+	 * @param string $moduleName
161
+	 */
158 162
 	public function Calendar($request, $moduleName)
159 163
 	{
160 164
 		parent::process($request);
Please login to merge, or discard this patch.