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