icingaweb2-module-director/library/Director/IcingaConfig/IcingaConfigRendered.php

30 lines
572 B
PHP
Raw Normal View History

<?php
namespace Icinga\Module\Director\IcingaConfig;
use Icinga\Exception\ProgrammingError;
class IcingaConfigRendered implements IcingaConfigRenderer
{
protected $rendered;
public function __construct($string)
{
if (! is_string($string)) {
throw new ProgrammingError('IcingaConfigRendered accepts only strings');
}
$this->rendered = $string;
}
public function toConfigString()
{
return $this->rendered;
}
public function __toString()
{
return $this->toConfigString();
}
}