1 | <?php |
||
18 | class DbRepository implements RepositoryInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var EmailEntityInterface |
||
22 | */ |
||
23 | protected $email; |
||
24 | |||
25 | /** |
||
26 | * @var EntityManagerInterface |
||
27 | */ |
||
28 | protected $em; |
||
29 | |||
30 | /** |
||
31 | * @var Twig_Environment |
||
32 | */ |
||
33 | protected $twig; |
||
34 | |||
35 | /** |
||
36 | * DbRepository constructor. |
||
37 | * |
||
38 | * @param EntityManagerInterface $em |
||
39 | * @param Twig_Environment $twig |
||
40 | */ |
||
41 | public function __construct(EntityManagerInterface $em, Twig_Environment $twig) |
||
46 | |||
47 | /** |
||
48 | * Repository initialize |
||
49 | * |
||
50 | * @param TemplateInterface $template |
||
51 | * @param array $arguments |
||
52 | * |
||
53 | * @throws RepositoryUnavailableException |
||
54 | */ |
||
55 | public function connect(TemplateInterface $template, array $arguments = []) |
||
69 | |||
70 | /** |
||
71 | * Get subject template |
||
72 | * |
||
73 | * @param array $data |
||
74 | * |
||
75 | * @return string |
||
76 | * |
||
77 | * @throws \Throwable |
||
78 | */ |
||
79 | public function getSubjectTemplate(array $data): string |
||
83 | |||
84 | /** |
||
85 | * Get body template |
||
86 | * |
||
87 | * @param array $data |
||
88 | * |
||
89 | * @return string |
||
90 | * |
||
91 | * @throws \Throwable |
||
92 | */ |
||
93 | public function getBodyTemplate(array $data): string |
||
97 | |||
98 | /** |
||
99 | * Get sender name template |
||
100 | * |
||
101 | * @param array $data |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getSenderNameTemplate(array $data): string |
||
109 | |||
110 | /** |
||
111 | * Get sender email template |
||
112 | * |
||
113 | * @param array $data |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | public function getSenderEmailTemplate(array $data): string |
||
121 | |||
122 | /** |
||
123 | * Apply arguments to string |
||
124 | * |
||
125 | * @param string $str |
||
126 | * @param array $args |
||
127 | * |
||
128 | * @return string |
||
129 | * |
||
130 | * @throws \Throwable |
||
131 | */ |
||
132 | protected function applyArguments(string $str, array $args): string |
||
142 | } |
||
143 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.