1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Twig;
13
14/**
15 * Holds information about a non-compiled Twig template.
16 *
17 * @author Fabien Potencier <fabien@symfony.com>
18 */
19final class Source
20{
21    /**
22     * @param string $code The template source code
23     * @param string $name The template logical name
24     * @param string $path The filesystem path of the template if any
25     */
26    public function __construct(
27        private string $code,
28        private string $name,
29        private string $path = '',
30    ) {
31    }
32
33    public function getCode(): string
34    {
35        return $this->code;
36    }
37
38    public function getName(): string
39    {
40        return $this->name;
41    }
42
43    public function getPath(): string
44    {
45        return $this->path;
46    }
47}
48