@@ -11,6 +11,9 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | namespace Chrisyue\PhpM3u8\Loader; |
| 13 | 13 | |
| 14 | +/** |
|
| 15 | + * @param string $uri |
|
| 16 | + */ |
|
| 14 | 17 | function file_get_contents($uri) |
| 15 | 18 | { |
| 16 | 19 | return 'hello world'; |
@@ -55,6 +58,12 @@ discard block |
||
| 55 | 58 | $this->assertEquals($loader->load($uri), $content); |
| 56 | 59 | } |
| 57 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $uri |
|
| 63 | + * @param boolean $isHit |
|
| 64 | + * @param string $content |
|
| 65 | + * @param integer $expiresAfter |
|
| 66 | + */ |
|
| 58 | 67 | private function prophesizeCachePool($uri, $isHit, $content, $expiresAfter) |
| 59 | 68 | { |
| 60 | 69 | $cachePool = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | if (preg_match('/^#EXT-X-BYTERANGE:(\d+)(@(\d+))?$/', $line, $matches)) { |
| 109 | 109 | $data['playlist'][$mediaSequence]['byteRangeLength'] = (int) $matches[1]; |
| 110 | 110 | if (isset($matches[3])) { |
| 111 | - $data['playlist'][$mediaSequence]['byteRangeOffset'] = (int) $matches[3]; |
|
| 111 | + $data['playlist'][$mediaSequence]['byteRangeOffset'] = (int) $matches[3]; |
|
| 112 | 112 | } |
| 113 | 113 | continue; |
| 114 | 114 | } |
@@ -28,9 +28,9 @@ |
||
| 28 | 28 | $this->isDiscontinuity = $isDiscontinuity; |
| 29 | 29 | $this->title = $title; |
| 30 | 30 | $this->byterange = \SplFixedArray::fromArray( |
| 31 | - array($byteRangeLength, |
|
| 32 | - is_null($byteRangeLength) ? null : $byteRangeOffset), |
|
| 33 | - false); |
|
| 31 | + array($byteRangeLength, |
|
| 32 | + is_null($byteRangeLength) ? null : $byteRangeOffset), |
|
| 33 | + false); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function getUri() |
@@ -38,12 +38,12 @@ |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | if (!is_null($mediaSegment->getByteRangeFixed()[0])) { |
| 41 | - $lines[] = sprintf( |
|
| 41 | + $lines[] = sprintf( |
|
| 42 | 42 | '#EXT-X-BYTERANGE:%d%s%d', |
| 43 | 43 | $mediaSegment->getByteRangeFixed()[0], |
| 44 | 44 | is_null($mediaSegment->getByteRangeFixed()[1]) ? null : '@', |
| 45 | 45 | $mediaSegment->getByteRangeFixed()[1] |
| 46 | - ); |
|
| 46 | + ); |
|
| 47 | 47 | |
| 48 | 48 | } |
| 49 | 49 | |