Skip to content

Commit

Permalink
Fix CS/WS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 13, 2015
1 parent ee7a2af commit 83fe1bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/Timer.php
Expand Up @@ -45,7 +45,7 @@ class PHP_Timer
*/
public static function start()
{
array_push(self::$startTimes, microtime(TRUE));
array_push(self::$startTimes, microtime(true));
}

/**
Expand All @@ -55,7 +55,7 @@ public static function start()
*/
public static function stop()
{
return microtime(TRUE) - array_pop(self::$startTimes);
return microtime(true) - array_pop(self::$startTimes);
}

/**
Expand Down Expand Up @@ -85,7 +85,7 @@ public static function secondsToTimeString($time)
*/
public static function timeSinceStartOfRequest()
{
return self::secondsToTimeString(microtime(TRUE) - self::$requestTime);
return self::secondsToTimeString(microtime(true) - self::$requestTime);
}

/**
Expand All @@ -96,9 +96,9 @@ public static function timeSinceStartOfRequest()
public static function resourceUsage()
{
return sprintf(
'Time: %s, Memory: %4.2fMb',
self::timeSinceStartOfRequest(),
memory_get_peak_usage(TRUE) / 1048576
'Time: %s, Memory: %4.2fMb',
self::timeSinceStartOfRequest(),
memory_get_peak_usage(true) / 1048576
);
}
}
Expand All @@ -108,5 +108,5 @@ public static function resourceUsage()
} elseif (isset($_SERVER['REQUEST_TIME'])) {
PHP_Timer::$requestTime = $_SERVER['REQUEST_TIME'];
} else {
PHP_Timer::$requestTime = microtime(TRUE);
PHP_Timer::$requestTime = microtime(true);
}
9 changes: 6 additions & 3 deletions tests/TimerTest.php
Expand Up @@ -37,7 +37,8 @@ public function testStartStop()
public function testSecondsToTimeString($string, $seconds)
{
$this->assertEquals(
$string, PHP_Timer::secondsToTimeString($seconds)
$string,
PHP_Timer::secondsToTimeString($seconds)
);
}

Expand All @@ -47,7 +48,8 @@ public function testSecondsToTimeString($string, $seconds)
public function testTimeSinceStartOfRequest()
{
$this->assertStringMatchesFormat(
'%f %s', PHP_Timer::timeSinceStartOfRequest()
'%f %s',
PHP_Timer::timeSinceStartOfRequest()
);
}

Expand All @@ -58,7 +60,8 @@ public function testTimeSinceStartOfRequest()
public function testResourceUsage()
{
$this->assertStringMatchesFormat(
'Time: %s, Memory: %s', PHP_Timer::resourceUsage()
'Time: %s, Memory: %s',
PHP_Timer::resourceUsage()
);
}

Expand Down

0 comments on commit 83fe1bd

Please sign in to comment.