Completed
Pull Request — develop (#27)
by Chris
13:09
created

PlaylistBuffer::copyToPlaylist()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Chrisyue\PhpM3u8\Parser;
4
5
use Chrisyue\PhpM3u8\Model\AbstractPlaylist;
6
7
class PlaylistBuffer extends AbstractPlaylist implements PlaylistCopyableInterface
8
{
9
    public function copyToPlaylist(AbstractPlaylist $playlist)
10
    {
11
        $refClass = new \ReflectionClass(AbstractPlaylist::class);
12
        foreach ($refClass->getProperties() as $prop) {
13
            $prop->setAccessible(true);
14
            $prop->setValue($playlist, $prop->getValue($this));
15
        }
16
    }
17
}
18