@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | trigger_error('Trend(): Number of elements in coordinate arrays do not match.', E_USER_ERROR); |
88 | 88 | } |
89 | 89 | |
90 | - $key = md5($trendType.$const.serialize($yValues).serialize($xValues)); |
|
90 | + $key = md5($trendType . $const . serialize($yValues) . serialize($xValues)); |
|
91 | 91 | // Determine which Trend method has been requested |
92 | 92 | switch ($trendType) { |
93 | 93 | // Instantiate and return the class for the requested Trend method |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | case self::TREND_EXPONENTIAL: |
97 | 97 | case self::TREND_POWER: |
98 | 98 | if (!isset(self::$trendCache[$key])) { |
99 | - $className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\'.$trendType.'BestFit'; |
|
99 | + $className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit'; |
|
100 | 100 | self::$trendCache[$key] = new $className($yValues, $xValues, $const); |
101 | 101 | } |
102 | 102 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | // If the request is to determine the best fit regression, then we test each Trend line in turn |
118 | 118 | // Start by generating an instance of each available Trend method |
119 | 119 | foreach (self::$trendTypes as $trendMethod) { |
120 | - $className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\'.$trendType.'BestFit'; |
|
120 | + $className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit'; |
|
121 | 121 | $bestFit[$trendMethod] = new $className($yValues, $xValues, $const); |
122 | 122 | $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit(); |
123 | 123 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $slope = $this->getSlope($dp); |
73 | 73 | $intersect = $this->getIntersect($dp); |
74 | 74 | |
75 | - return 'Y = '.$intersect.' + '.$slope.' * X'; |
|
75 | + return 'Y = ' . $intersect . ' + ' . $slope . ' * X'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | $slope = $this->getSlope($dp); |
100 | 100 | $intersect = $this->getIntersect($dp); |
101 | 101 | |
102 | - $equation = 'Y = '.$intersect; |
|
102 | + $equation = 'Y = ' . $intersect; |
|
103 | 103 | foreach ($slope as $key => $value) { |
104 | 104 | if ($value != 0.0) { |
105 | - $equation .= ' + '.$value.' * X'; |
|
105 | + $equation .= ' + ' . $value . ' * X'; |
|
106 | 106 | if ($key > 0) { |
107 | - $equation .= '^'.($key + 1); |
|
107 | + $equation .= '^' . ($key + 1); |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | { |
208 | 208 | if (parent::__construct($yValues, $xValues) !== false) { |
209 | 209 | if ($order < $this->valueCount) { |
210 | - $this->bestFitType .= '_'.$order; |
|
210 | + $this->bestFitType .= '_' . $order; |
|
211 | 211 | $this->order = $order; |
212 | 212 | $this->polynomialRegression($order, $yValues, $xValues, $const); |
213 | 213 | if (($this->getGoodnessOfFit() < 0.0) || ($this->getGoodnessOfFit() > 1.0)) { |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $slope = $this->getSlope($dp); |
73 | 73 | $intersect = $this->getIntersect($dp); |
74 | 74 | |
75 | - return 'Y = '.$intersect.' + '.$slope.' * log(X)'; |
|
75 | + return 'Y = ' . $intersect . ' + ' . $slope . ' * log(X)'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $slope = $this->getSlope($dp); |
73 | 73 | $intersect = $this->getIntersect($dp); |
74 | 74 | |
75 | - return 'Y = '.$intersect.' * '.$slope.'^X'; |
|
75 | + return 'Y = ' . $intersect . ' * ' . $slope . '^X'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | namespace PhpOffice\PhpSpreadsheet\Shared; |
4 | 4 | |
5 | 5 | if (!defined('PCLZIP_TEMPORARY_DIR')) { |
6 | - define('PCLZIP_TEMPORARY_DIR', File::sysGetTempDir().DIRECTORY_SEPARATOR); |
|
6 | + define('PCLZIP_TEMPORARY_DIR', File::sysGetTempDir() . DIRECTORY_SEPARATOR); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | use PhpOffice\PhpSpreadsheet\Shared\PCLZip\PclZip; |
@@ -86,16 +86,16 @@ discard block |
||
86 | 86 | { |
87 | 87 | $filenameParts = pathinfo($localname); |
88 | 88 | |
89 | - $handle = fopen($this->tempDir.'/'.$filenameParts['basename'], 'wb'); |
|
89 | + $handle = fopen($this->tempDir . '/' . $filenameParts['basename'], 'wb'); |
|
90 | 90 | fwrite($handle, $contents); |
91 | 91 | fclose($handle); |
92 | 92 | |
93 | - $res = $this->zip->add($this->tempDir.'/'.$filenameParts['basename'], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts['dirname']); |
|
93 | + $res = $this->zip->add($this->tempDir . '/' . $filenameParts['basename'], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts['dirname']); |
|
94 | 94 | if ($res == 0) { |
95 | - throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Error zipping files : '.$this->zip->errorInfo(true)); |
|
95 | + throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Error zipping files : ' . $this->zip->errorInfo(true)); |
|
96 | 96 | } |
97 | 97 | |
98 | - unlink($this->tempDir.'/'.$filenameParts['basename']); |
|
98 | + unlink($this->tempDir . '/' . $filenameParts['basename']); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -154,6 +154,6 @@ |
||
154 | 154 | case 65001: |
155 | 155 | return 'UTF-8'; // Unicode (UTF-8) |
156 | 156 | } |
157 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Unknown codepage: '.$codePage); |
|
157 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Unknown codepage: ' . $codePage); |
|
158 | 158 | } |
159 | 159 | } |
@@ -234,7 +234,7 @@ |
||
234 | 234 | .pack('V', 0)// Extra BDList Count |
235 | 235 | ); |
236 | 236 | } else { |
237 | - fwrite($FILE, pack('V', $iAll + $iBdCnt).pack('V', $iBdExL)); |
|
237 | + fwrite($FILE, pack('V', $iAll + $iBdCnt) . pack('V', $iBdExL)); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | // BDList |
@@ -219,12 +219,12 @@ |
||
219 | 219 | $GLOBALS['_OLE_INSTANCES'][] = $this; |
220 | 220 | $instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES'])); |
221 | 221 | |
222 | - $path = 'ole-chainedblockstream://oleInstanceId='.$instanceId; |
|
222 | + $path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId; |
|
223 | 223 | if ($blockIdOrPps instanceof OLE\PPS) { |
224 | - $path .= '&blockId='.$blockIdOrPps->startBlock; |
|
225 | - $path .= '&size='.$blockIdOrPps->Size; |
|
224 | + $path .= '&blockId=' . $blockIdOrPps->startBlock; |
|
225 | + $path .= '&size=' . $blockIdOrPps->Size; |
|
226 | 226 | } else { |
227 | - $path .= '&blockId='.$blockIdOrPps; |
|
227 | + $path .= '&blockId=' . $blockIdOrPps; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return fopen($path, 'r'); |