summaryrefslogtreecommitdiffstats
path: root/library/Director/IcingaConfig/IcingaConfigRendered.php
blob: 90b710e3ff2adc30eb83b3c88d65fa47ccda1048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

namespace Icinga\Module\Director\IcingaConfig;

use InvalidArgumentException;

class IcingaConfigRendered implements IcingaConfigRenderer
{
    protected $rendered;

    public function __construct($string)
    {
        if (! is_string($string)) {
            throw new InvalidArgumentException('IcingaConfigRendered accepts only strings');
        }

        $this->rendered = $string;
    }

    public function toConfigString()
    {
        return $this->rendered;
    }

    public function __toString()
    {
        return $this->toConfigString();
    }

    public function toLegacyConfigString()
    {
        return $this->rendered;
    }
}