CC-4090: Make code style PSR compliant - part 4

-models dir
This commit is contained in:
Martin Konecny 2012-08-29 10:58:03 -04:00
parent 699a49a103
commit 4848717d4d
17 changed files with 439 additions and 404 deletions

View file

@ -1,7 +1,7 @@
<?php
class LengthFormatter {
class LengthFormatter
{
/**
* @string length
*/
@ -15,7 +15,8 @@ class LengthFormatter {
$this->_length = $length;
}
public function format() {
public function format()
{
if (!preg_match("/^[0-9]{2}:[0-9]{2}:[0-9]{2}/", $this->_length)) {
return $this->_length;
}
@ -45,15 +46,13 @@ class LengthFormatter {
if (isset($hours) && isset($minutes) && isset($seconds)) {
$time = sprintf("%d:%02d:%02d.%s", $hours, $minutes, $seconds, $milliStr);
}
else if (isset($minutes) && isset($seconds)) {
} elseif (isset($minutes) && isset($seconds)) {
$time = sprintf("%d:%02d.%s", $minutes, $seconds, $milliStr);
}
else {
} else {
$time = sprintf("%d.%s", $seconds, $milliStr);
}
return $time;
}
}
}