@@ -113,11 +113,11 @@ |
||
113 | 113 | throw new Exception('conversion function doesnt support more than 1 day, edit the code'); |
114 | 114 | } |
115 | 115 | |
116 | - $milliseconds = $seconds - (int) $seconds; |
|
116 | + $milliseconds = $seconds - (int)$seconds; |
|
117 | 117 | $framesUnpadded = floor(25 * $milliseconds); // 25 frames |
118 | - $frames = str_pad((string) $framesUnpadded, 2, '0', STR_PAD_LEFT); |
|
118 | + $frames = str_pad((string)$framesUnpadded, 2, '0', STR_PAD_LEFT); |
|
119 | 119 | |
120 | - return gmdate("H:i:s:$frames", (int) $seconds); |
|
120 | + return gmdate("H:i:s:$frames", (int)$seconds); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected static function toStlLines(array $lines): string |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parts = explode('.', $srtTime); |
57 | 57 | |
58 | 58 | $onlySeconds = strtotime("1970-01-01 {$parts[0]} UTC"); |
59 | - $milliseconds = (float) '0.' . $parts[1]; |
|
59 | + $milliseconds = (float)'0.' . $parts[1]; |
|
60 | 60 | |
61 | 61 | return $onlySeconds + $milliseconds; |
62 | 62 | } |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | $whole = $parts[0]; // 1 |
72 | 72 | $decimal = isset($parts[1]) ? substr($parts[1], 0, 3) : 0; // 23 |
73 | 73 | |
74 | - return gmdate("0:i:s", (int) floor($whole)) . '.' . str_pad($decimal, 3, '0', STR_PAD_RIGHT); |
|
74 | + return gmdate("0:i:s", (int)floor($whole)) . '.' . str_pad($decimal, 3, '0', STR_PAD_RIGHT); |
|
75 | 75 | } |
76 | 76 | } |
@@ -78,6 +78,6 @@ |
||
78 | 78 | $whole = $parts[0]; // 1 |
79 | 79 | $decimal = isset($parts[1]) ? substr($parts[1], 0, 2) : 0; |
80 | 80 | |
81 | - return gmdate("G:i:s", (int) floor($whole)) . '.' . str_pad($decimal, 2, '0', STR_PAD_RIGHT); |
|
81 | + return gmdate("G:i:s", (int)floor($whole)) . '.' . str_pad($decimal, 2, '0', STR_PAD_RIGHT); |
|
82 | 82 | } |
83 | 83 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $parts = explode('.', $subTime); |
71 | 71 | |
72 | 72 | $onlySeconds = strtotime("1970-01-01 {$parts[0]} UTC"); |
73 | - $milliseconds = (float) '0.' . $parts[1]; |
|
73 | + $milliseconds = (float)'0.' . $parts[1]; |
|
74 | 74 | |
75 | 75 | return $onlySeconds + $milliseconds; |
76 | 76 | } |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $seconds = floor($internalTime); |
85 | 85 | $remainder = fmod($internalTime, 1); |
86 | 86 | $remainderString = round($remainder, 2) * 100; |
87 | - $remainderString = str_pad((string) $remainderString, 2, '0', STR_PAD_RIGHT); |
|
87 | + $remainderString = str_pad((string)$remainderString, 2, '0', STR_PAD_RIGHT); |
|
88 | 88 | |
89 | - return gmdate("H:i:s", (int) $seconds) . '.' . $remainderString; |
|
89 | + return gmdate("H:i:s", (int)$seconds) . '.' . $remainderString; |
|
90 | 90 | } |
91 | 91 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $whole = $parts[0]; // 1 |
72 | 72 | $decimal = isset($parts[1]) ? substr($parts[1], 0, 3) : 0; // 23 |
73 | 73 | |
74 | - return gmdate("H:i:s", (int) floor($whole)) . ',' . str_pad($decimal, 3, '0', STR_PAD_RIGHT); |
|
74 | + return gmdate("H:i:s", (int)floor($whole)) . ',' . str_pad($decimal, 3, '0', STR_PAD_RIGHT); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | protected static function dfxpTimeToInternal(string $dfxpTime): float |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $parts = explode(',', $dfxpTime); |
80 | 80 | |
81 | 81 | $onlySeconds = strtotime("1970-01-01 {$parts[0]} UTC"); |
82 | - $milliseconds = (float) '0.' . $parts[1]; |
|
82 | + $milliseconds = (float)'0.' . $parts[1]; |
|
83 | 83 | |
84 | 84 | return $onlySeconds + $milliseconds; |
85 | 85 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | |
78 | 78 | $frame = round($decimal / 100 * 24); |
79 | 79 | |
80 | - $srtTime = gmdate("H:i:s", (int) floor($whole)) . '.' . str_pad((string) $frame, 2, '0', STR_PAD_LEFT); |
|
80 | + $srtTime = gmdate("H:i:s", (int)floor($whole)) . '.' . str_pad((string)$frame, 2, '0', STR_PAD_LEFT); |
|
81 | 81 | |
82 | 82 | return "[$srtTime]"; |
83 | 83 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | protected static function fixLine(): Closure |
87 | 87 | { |
88 | - return function ($line) { |
|
88 | + return function($line) { |
|
89 | 89 | if (substr($line, 0, 3) === '<v ') { |
90 | 90 | $line = substr($line, 3); |
91 | 91 | $line = str_replace('>', ' ', $line); |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | throw new InvalidTimeFormatException($subtitleFormat); |
105 | 105 | } |
106 | 106 | |
107 | - return (int) $matches['hours'] * ConstantsInterface::HOURS_SECONDS |
|
108 | - + (int) $matches['minutes'] * ConstantsInterface::MINUTES_SECONDS |
|
109 | - + (int) $matches['seconds'] |
|
110 | - + (float) $matches['fraction'] / 1000; |
|
107 | + return (int)$matches['hours'] * ConstantsInterface::HOURS_SECONDS |
|
108 | + + (int)$matches['minutes'] * ConstantsInterface::MINUTES_SECONDS |
|
109 | + + (int)$matches['seconds'] |
|
110 | + + (float)$matches['fraction'] / 1000; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -71,10 +71,10 @@ |
||
71 | 71 | throw new InvalidTimeFormatException($subtitleFormat); |
72 | 72 | } |
73 | 73 | |
74 | - return (int) $matches['hours'] * ConstantsInterface::HOURS_SECONDS |
|
75 | - + (int) $matches['minutes'] * ConstantsInterface::MINUTES_SECONDS |
|
76 | - + (int) $matches['seconds'] |
|
77 | - + (float) $matches['fraction'] / 1000; |
|
74 | + return (int)$matches['hours'] * ConstantsInterface::HOURS_SECONDS |
|
75 | + + (int)$matches['minutes'] * ConstantsInterface::MINUTES_SECONDS |
|
76 | + + (int)$matches['seconds'] |
|
77 | + + (float)$matches['fraction'] / 1000; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -73,10 +73,10 @@ |
||
73 | 73 | |
74 | 74 | $abc = 123; |
75 | 75 | |
76 | - return (int) $matches['hours'] * ConstantsInterface::HOURS_SECONDS |
|
77 | - + (int) $matches['minutes'] * ConstantsInterface::MINUTES_SECONDS |
|
78 | - + (int) $matches['seconds'] |
|
79 | - + (float) $matches['fraction'] / 1000; |
|
76 | + return (int)$matches['hours'] * ConstantsInterface::HOURS_SECONDS |
|
77 | + + (int)$matches['minutes'] * ConstantsInterface::MINUTES_SECONDS |
|
78 | + + (int)$matches['seconds'] |
|
79 | + + (float)$matches['fraction'] / 1000; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | public function toSubtitleTimeFormat(float $internalFormat): string |