for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Chrisyue\PhpM3u8\M3u8;
use Chrisyue\PhpM3u8\Stream\StreamInterface;
abstract class AbstractTag extends AbstractM3u8 implements SequenceAwareInterface
{
public function parse()
$lineInfo = $this->getStream()->read();
if (!isset($lineInfo['tag']) || $lineInfo['tag'] !== $this->getName()) {
return $this;
}
foreach ($this->getTransformers() as $transformer) {
$lineInfo['value'] = $transformer->transform($lineInfo['value']);
return $this->setResult($lineInfo['value']);
public function dump()
$value = $this->getResult();
foreach (array_reverse($this->getTransformers()) as $transformer) {
$value = $transformer->reverse($value);
$this->getStream()->write(['tag' => $this->getName(), 'value' => $value]);
abstract protected function getName();
abstract protected function getTransformers();