Completed
Branch develop (14e9c9)
by
unknown
14:28
created
htdocs/ticket/document.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	accessforbidden();
92 92
 }
93 93
 
94
-$permissiontoadd = $user->hasRight('ticket', 'write');	// Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
94
+$permissiontoadd = $user->hasRight('ticket', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
95 95
 
96 96
 
97 97
 /*
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 	if ($resql) {
212 212
 		$file_msg_array = array();
213 213
 		$numrows = $db->num_rows($resql);
214
-		for ($i=0; $i < $numrows; $i++) {
214
+		for ($i = 0; $i < $numrows; $i++) {
215 215
 			$upload_msg_dir = $conf->agenda->dir_output.'/'.$db->fetch_row($resql)[0];
216 216
 			$file_msg = dol_dir_list($upload_msg_dir, "files", 0, '', '\.meta$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
217 217
 			if (count($file_msg)) {
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/Geometry.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 	abstract public function geometryN($n);
22 22
 	abstract public function startPoint();
23 23
 	abstract public function endPoint();
24
-	abstract public function isRing();            // Mssing dependancy
25
-	abstract public function isClosed();          // Missing dependancy
24
+	abstract public function isRing(); // Mssing dependancy
25
+	abstract public function isClosed(); // Missing dependancy
26 26
 	abstract public function numPoints();
27 27
 	abstract public function pointN($n);
28 28
 	abstract public function exteriorRing();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		}
68 68
 
69 69
 		$bbox = $this->getBBox();
70
-		$points = array (
70
+		$points = array(
71 71
 		new Point($bbox['maxx'], $bbox['miny']),
72 72
 		new Point($bbox['maxx'], $bbox['maxy']),
73 73
 		new Point($bbox['minx'], $bbox['maxy']),
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/Collection.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 	* */
53 53
 	public function invertxy()
54 54
 	{
55
-		for ($i=0;$i<count($this->components);$i++) {
56
-			if ( method_exists($this->components[$i], 'invertxy') )
55
+		for ($i = 0; $i < count($this->components); $i++) {
56
+			if (method_exists($this->components[$i], 'invertxy'))
57 57
 			$this->components[$i]->invertxy();
58 58
 		}
59 59
 	}
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 	public function geometryN($n)
173 173
 	{
174 174
 		$n = intval($n);
175
-		if (array_key_exists($n-1, $this->components)) {
176
-			return $this->components[$n-1];
175
+		if (array_key_exists($n - 1, $this->components)) {
176
+			return $this->components[$n - 1];
177 177
 		} else {
178 178
 			return null;
179 179
 		}
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/Point.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,9 +95,9 @@
 block discarded – undo
95 95
 	 * */
96 96
 	public function invertxy()
97 97
 	{
98
-		$x=$this->coords[0];
99
-		$this->coords[0]=$this->coords[1];
100
-		$this->coords[1]=$x;
98
+		$x = $this->coords[0];
99
+		$this->coords[0] = $this->coords[1];
100
+		$this->coords[1] = $x;
101 101
 	}
102 102
 
103 103
 
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/LineString.class.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		foreach ($this->getPoints() as $delta => $point) {
81 81
 			$previous_point = $this->geometryN($delta);
82 82
 			if ($previous_point) {
83
-				$length += sqrt(pow(($previous_point->getX() - $point->getX()), 2) + pow(($previous_point->getY()- $point->getY()), 2));
83
+				$length += sqrt(pow(($previous_point->getX() - $point->getX()), 2) + pow(($previous_point->getY() - $point->getY()), 2));
84 84
 			}
85 85
 		}
86 86
 		return $length;
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		$length = 0;
92 92
 		$points = $this->getPoints();
93
-		for ($i=0; $i<$this->numPoints()-1; $i++) {
93
+		for ($i = 0; $i < $this->numPoints() - 1; $i++) {
94 94
 			$point = $points[$i];
95
-			$next_point = $points[$i+1];
96
-			if (!is_object($next_point)) {continue;}
95
+			$next_point = $points[$i + 1];
96
+			if (!is_object($next_point)) {continue; }
97 97
 			// Great circle method
98 98
 			$lat1 = deg2rad($point->getY());
99 99
 			$lat2 = deg2rad($next_point->getY());
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 	{
120 120
 		$degrees = 0;
121 121
 		$points = $this->getPoints();
122
-		for ($i=0; $i<$this->numPoints()-1; $i++) {
122
+		for ($i = 0; $i < $this->numPoints() - 1; $i++) {
123 123
 			$point = $points[$i];
124
-			$next_point = $points[$i+1];
125
-			if (!is_object($next_point)) {continue;}
124
+			$next_point = $points[$i + 1];
125
+			if (!is_object($next_point)) {continue; }
126 126
 			$degree = rad2deg(
127 127
 			acos(
128 128
 			  sin(deg2rad($point->getY())) * sin(deg2rad($next_point->getY())) +
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 		$points = $this->getPoints();
143 143
 
144 144
 		foreach ($points as $i => $point) {
145
-			if (isset($points[$i+1])) {
146
-				$parts[] = new LineString(array($point, $points[$i+1]));
145
+			if (isset($points[$i + 1])) {
146
+				$parts[] = new LineString(array($point, $points[$i + 1]));
147 147
 			}
148 148
 		}
149 149
 		return $parts;
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
 		$p3_x = $segment->endPoint()->x();
183 183
 		$p3_y = $segment->endPoint()->y();
184 184
 
185
-		$s1_x = $p1_x - $p0_x;     $s1_y = $p1_y - $p0_y;
186
-		$s2_x = $p3_x - $p2_x;     $s2_y = $p3_y - $p2_y;
185
+		$s1_x = $p1_x - $p0_x; $s1_y = $p1_y - $p0_y;
186
+		$s2_x = $p3_x - $p2_x; $s2_y = $p3_y - $p2_y;
187 187
 
188 188
 		$fps = (-$s2_x * $s1_y) + ($s1_x * $s2_y);
189 189
 		$fpt = (-$s2_x * $s1_y) + ($s1_x * $s2_y);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		}
194 194
 
195 195
 		$s = (-$s1_y * ($p0_x - $p2_x) + $s1_x * ($p0_y - $p2_y)) / $fps;
196
-		$t = ( $s2_x * ($p0_y - $p2_y) - $s2_y * ($p0_x - $p2_x)) / $fpt;
196
+		$t = ($s2_x * ($p0_y - $p2_y) - $s2_y * ($p0_x - $p2_x)) / $fpt;
197 197
 
198 198
 		if ($s > 0 && $s < 1 && $t > 0 && $t < 1) {
199 199
 			// Collision detected
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/geometry/Polygon.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 			$cn['y'] = $cn['y'] + ($p->getY() + $pts[$j]->getY()) * $P;
77 77
 		}
78 78
 
79
-		$cn['x'] = $cn['x'] / ( 6 * $a);
80
-		$cn['y'] = $cn['y'] / ( 6 * $a);
79
+		$cn['x'] = $cn['x'] / (6 * $a);
80
+		$cn['y'] = $cn['y'] / (6 * $a);
81 81
 
82 82
 		$centroid = new Point($cn['x'], $cn['y']);
83 83
 		return $centroid;
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
 	public function numInteriorRings()
116 116
 	{
117 117
 		if ($this->isEmpty()) return 0;
118
-		return $this->numGeometries()-1;
118
+		return $this->numGeometries() - 1;
119 119
 	}
120 120
 
121 121
 	public function interiorRingN($n)
122 122
 	{
123
-		return $this->geometryN($n+1);
123
+		return $this->geometryN($n + 1);
124 124
 	}
125 125
 
126 126
 	public function dimension()
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 		$intersections = 0;
173 173
 		$vertices_count = count($vertices);
174 174
 
175
-		for ($i=1; $i < $vertices_count; $i++) {
176
-			$vertex1 = $vertices[$i-1];
175
+		for ($i = 1; $i < $vertices_count; $i++) {
176
+			$vertex1 = $vertices[$i - 1];
177 177
 			$vertex2 = $vertices[$i];
178 178
 			if ($vertex1->y() == $vertex2->y()
179 179
 			&& $vertex1->y() == $point->y()
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/adapters/WKT.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 		$parts = explode('),(', $data_string);
95 95
 		$lines = array();
96 96
 		foreach ($parts as $part) {
97
-			if (!$this->beginsWith($part, '(')) $part = '(' . $part;
98
-			if (!$this->endsWith($part, ')'))   $part = $part . ')';
97
+			if (!$this->beginsWith($part, '(')) $part = '('.$part;
98
+			if (!$this->endsWith($part, ')'))   $part = $part.')';
99 99
 			$lines[] = $this->parseLineString($part);
100 100
 		}
101 101
 		return new Polygon($lines);
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 		$lines = array();
128 128
 		foreach ($parts as $part) {
129 129
 			// Repair the string if the explode broke it
130
-			if (!$this->beginsWith($part, '(')) $part = '(' . $part;
131
-			if (!$this->endsWith($part, ')'))   $part = $part . ')';
130
+			if (!$this->beginsWith($part, '(')) $part = '('.$part;
131
+			if (!$this->endsWith($part, ')'))   $part = $part.')';
132 132
 			$lines[] = $this->parseLineString($part);
133 133
 		}
134 134
 		return new MultiLineString($lines);
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
 		$polys = array();
146 146
 		foreach ($parts as $part) {
147 147
 			// Repair the string if the explode broke it
148
-			if (!$this->beginsWith($part, '((')) $part = '((' . $part;
149
-			if (!$this->endsWith($part, '))'))   $part = $part . '))';
148
+			if (!$this->beginsWith($part, '((')) $part = '(('.$part;
149
+			if (!$this->endsWith($part, '))'))   $part = $part.'))';
150 150
 			$polys[] = $this->parsePolygon($part);
151 151
 		}
152 152
 		return new MultiPolygon($polys);
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/adapters/GPX.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 		$xmlobj = new DOMDocument();
55 55
 		@$xmlobj->loadXML($text);
56 56
 		if ($xmlobj === false) {
57
-			throw new Exception("Invalid GPX: ". $text);
57
+			throw new Exception("Invalid GPX: ".$text);
58 58
 		}
59 59
 
60 60
 		$this->xmlobj = $xmlobj;
61 61
 		try {
62 62
 			$geom = $this->geomFromXML();
63 63
 		} catch (InvalidText $e) {
64
-			throw new Exception("Cannot Read Geometry From GPX: ". $text);
64
+			throw new Exception("Cannot Read Geometry From GPX: ".$text);
65 65
 		} catch (Exception $e) {
66 66
 			throw $e;
67 67
 		}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 					$components[] = new Point($lon, $lat);
120 120
 				}
121 121
 			}
122
-			if ($components) {$lines[] = new LineString($components);}
122
+			if ($components) {$lines[] = new LineString($components); }
123 123
 		}
124 124
 		return $lines;
125 125
 	}
Please login to merge, or discard this patch.
htdocs/includes/geoPHP/lib/adapters/EWKT.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 		$srid = $geometry->SRID();
18 18
 		$wkt = '';
19 19
 		if ($srid) {
20
-			$wkt = 'SRID=' . $srid . ';';
20
+			$wkt = 'SRID='.$srid.';';
21 21
 			$wkt .= $geometry->out('wkt');
22 22
 			return $wkt;
23 23
 		} else {
Please login to merge, or discard this patch.