Skip to content

Commit

Permalink
MOD: AnalyzeDcp.php BaseParser.php BaseWriter.php CplParserTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
cinemapub committed Sep 13, 2024
1 parent 0a6677b commit d072abd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/Folders/AnalyzeDcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ private static function detectType(DcpFile $dcpFile): Type
if (stripos($dcpFile->name, 'CPL') !== false) {
return Type::CPL;
}
if (stripos($dcpFile->name, 'ASSETMAP') !== false) {
return Type::MAP;
}
if (stripos($dcpFile->name, 'PKL') !== false) {
return Type::PKL;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Parsers/BaseParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ class BaseParser
{
protected SimpleXMLElement $xml;

public function getXml(): SimpleXMLElement
{
return $this->xml;
}

/**
* @throws InputMissingException
*/
Expand All @@ -25,6 +20,11 @@ public function __construct(string $file)
$this->xml = simplexml_load_file($file);
}

public function getXml(): SimpleXMLElement
{
return $this->xml;
}

public function Id(): string
{
return (string) $this->xml->Id ?? '';
Expand Down
10 changes: 5 additions & 5 deletions src/Writers/BaseWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
use DOMDocument;
use SimpleXMLElement;

class BaseWriter
final class BaseWriter
{
protected SimpleXMLElement $contents;
private SimpleXMLElement $contents;

protected string $Issuer = 'Brightfish';
private string $Issuer = 'Brightfish';

protected string $Creator = 'Spottix Renamer';
private string $Creator = 'Spottix Renamer';

protected array $templates;
private array $templates;

public function __construct()
{
Expand Down
4 changes: 4 additions & 0 deletions tests/Parsers/CplParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Brightfish\DcpToolkit\Tests\Parsers;

use Brightfish\DcpToolkit\Exceptions\InputMissingException;
use Brightfish\DcpToolkit\Parsers\CplParser;
use PHPUnit\Framework\TestCase;

Expand All @@ -11,6 +12,9 @@ class CplParserTest extends TestCase

private CplParser $parser;

/**
* @throws InputMissingException
*/
protected function setUp(): void
{
$this->parser = new CplParser($this->cpl_file);
Expand Down

0 comments on commit d072abd

Please sign in to comment.