diff options
author | Alpha <ngcoder@live.com> | 2016-05-14 20:34:37 -0400 |
---|---|---|
committer | Alpha <ngcoder@live.com> | 2016-05-14 20:34:37 -0400 |
commit | 82d9255dab3e80076644bf93859d11d0fd18b780 (patch) | |
tree | d4131e74c75667cdd29f24c089fa6abef0d9538b | |
parent | a171ab8fe82ee1bd0883d1077c76f451b12a5de8 (diff) | |
download | webgrind-82d9255dab3e80076644bf93859d11d0fd18b780.zip webgrind-82d9255dab3e80076644bf93859d11d0fd18b780.tar.gz webgrind-82d9255dab3e80076644bf93859d11d0fd18b780.tar.bz2 |
Small spacing changes to match code style
-rw-r--r-- | library/Preprocessor.php | 22 | ||||
-rw-r--r-- | library/Reader.php | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/library/Preprocessor.php b/library/Preprocessor.php index 7b06aaf..29668f2 100644 --- a/library/Preprocessor.php +++ b/library/Preprocessor.php @@ -65,9 +65,9 @@ class Webgrind_Preprocessor // Read information into memory while (($line = fgets($in))) { - if (substr($line,0,3)==='fl=') { + if (substr($line, 0, 3) === 'fl=') { // Found invocation of function. Read function name - fscanf($in,"fn=%[^\n\r]s",$function); + fscanf($in, "fn=%[^\n\r]s", $function); $function = self::getCompressedName($function, false); // Special case for ENTRY_POINT - it contains summary header if (self::ENTRY_POINT == $function) { @@ -76,7 +76,7 @@ class Webgrind_Preprocessor fgets($in); } // Cost line - fscanf($in,"%d %d",$lnr,$cost); + fscanf($in, "%d %d", $lnr, $cost); if (!isset($functionNames[$function])) { $index = $nextFuncNr++; @@ -85,7 +85,7 @@ class Webgrind_Preprocessor $proxyQueue[$index] = array(); } $functions[$index] = array( - 'filename' => self::getCompressedName(substr(trim($line),3), true), + 'filename' => self::getCompressedName(substr(trim($line), 3), true), 'line' => $lnr, 'invocationCount' => 1, 'summedSelfCost' => $cost, @@ -101,11 +101,11 @@ class Webgrind_Preprocessor } } else if (substr($line,0,4)==='cfn=') { // Found call to function. ($function/$index should contain function call originates from) - $calledFunctionName = self::getCompressedName(substr(trim($line),4), false); + $calledFunctionName = self::getCompressedName(substr(trim($line), 4), false); // Skip call line fgets($in); // Cost line - fscanf($in,"%d %d",$lnr,$cost); + fscanf($in, "%d %d", $lnr, $cost); // Current function is a proxy -> skip if (isset($proxyQueue[$index])) { @@ -144,7 +144,7 @@ class Webgrind_Preprocessor $functions[$index]['subCallInformation'][$calledKey]['callCount']++; $functions[$index]['subCallInformation'][$calledKey]['summedCallCost'] += $cost; - } else if (strpos($line,': ')!==false) { + } else if (strpos($line, ': ') !== false) { // Found header $headers[] = $line; } @@ -156,7 +156,7 @@ class Webgrind_Preprocessor $functionCount = sizeof($functions); fwrite($out, pack(self::NR_FORMAT.'*', self::FILE_FORMAT_VERSION, 0, $functionCount)); // Make room for function addresses - fseek($out,self::NR_SIZE*$functionCount, SEEK_CUR); + fseek($out, self::NR_SIZE*$functionCount, SEEK_CUR); $functionAddresses = array(); foreach ($functions as $index=>$function) { $functionAddresses[] = ftell($out); @@ -177,14 +177,14 @@ class Webgrind_Preprocessor $headersPos = ftell($out); // Write headers foreach ($headers as $header) { - fwrite($out,$header); + fwrite($out, $header); } // Write addresses - fseek($out,self::NR_SIZE, SEEK_SET); + fseek($out, self::NR_SIZE, SEEK_SET); fwrite($out, pack(self::NR_FORMAT, $headersPos)); // Skip function count - fseek($out,self::NR_SIZE, SEEK_CUR); + fseek($out, self::NR_SIZE, SEEK_CUR); // Write function addresses foreach ($functionAddresses as $address) { fwrite($out, pack(self::NR_FORMAT, $address)); diff --git a/library/Reader.php b/library/Reader.php index 20f12ab..eaa4eeb 100644 --- a/library/Reader.php +++ b/library/Reader.php @@ -95,7 +95,7 @@ class Webgrind_Reader * Returns number of functions * @return int */ - function getFunctionCount(){ + function getFunctionCount() { return count($this->functionPos); } @@ -138,7 +138,7 @@ class Webgrind_Reader * @param $calledFromNr int Called from position nr * @return array Called from information */ - function getCalledFromInfo($functionNr, $calledFromNr){ + function getCalledFromInfo($functionNr, $calledFromNr) { $this->seek( $this->functionPos[$functionNr] + self::NR_SIZE |