1 | <?php |
||
18 | class TwigFileRepository implements RepositoryInterface |
||
19 | { |
||
20 | /** |
||
21 | * Twig template |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $template; |
||
26 | |||
27 | /** |
||
28 | * @var Twig_Environment |
||
29 | */ |
||
30 | protected $twig; |
||
31 | |||
32 | /** |
||
33 | * TwigFileRepository constructor. |
||
34 | * |
||
35 | * @param Twig_Environment $twig |
||
36 | */ |
||
37 | public function __construct(Twig_Environment $twig) |
||
41 | |||
42 | /** |
||
43 | * Get subject template |
||
44 | * |
||
45 | * @param array $data |
||
46 | * |
||
47 | * @return string |
||
48 | * |
||
49 | * @throws \Throwable |
||
50 | */ |
||
51 | public function getSubjectTemplate(array $data): string |
||
55 | |||
56 | /** |
||
57 | * Get body template |
||
58 | * |
||
59 | * @param array $data |
||
60 | * |
||
61 | * @return string |
||
62 | * |
||
63 | * @throws \Throwable |
||
64 | */ |
||
65 | public function getBodyTemplate(array $data): string |
||
69 | |||
70 | /** |
||
71 | * Get sender name template |
||
72 | * |
||
73 | * @param array $data |
||
74 | * |
||
75 | * @return string |
||
76 | * |
||
77 | * @throws \Throwable |
||
78 | */ |
||
79 | public function getSenderNameTemplate(array $data): string |
||
87 | |||
88 | /** |
||
89 | * Get sender email template |
||
90 | * |
||
91 | * @param array $data |
||
92 | * |
||
93 | * @return string |
||
94 | * |
||
95 | * @throws \Throwable |
||
96 | */ |
||
97 | public function getSenderEmailTemplate(array $data): string |
||
105 | |||
106 | /** |
||
107 | * Render twig template |
||
108 | * |
||
109 | * @param string $block |
||
110 | * @param array $data |
||
111 | * |
||
112 | * @return string |
||
113 | * |
||
114 | * @throws \Throwable |
||
115 | */ |
||
116 | protected function renderBlock(string $block, array $data): string |
||
124 | |||
125 | /** |
||
126 | * Repository initialize |
||
127 | * |
||
128 | * @param TemplateInterface $template |
||
129 | * @param array $arguments |
||
130 | * |
||
131 | * @throws RepositoryUnavailableException |
||
132 | * @throws \ReflectionException |
||
133 | */ |
||
134 | public function connect(TemplateInterface $template, array $arguments = []) |
||
161 | } |
||
162 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.