1 | <?php |
||
11 | class Message |
||
12 | { |
||
13 | /** |
||
14 | * |
||
15 | * @var ServiceManager |
||
16 | */ |
||
17 | protected $serviceLocator; |
||
18 | |||
19 | public function __construct(ServiceLocatorInterface $locator) |
||
23 | |||
24 | /** |
||
25 | * |
||
26 | * @var \Zend\View\Renderer\RendererInterface |
||
27 | */ |
||
28 | protected $renderer; |
||
29 | |||
30 | /** |
||
31 | * |
||
32 | * @var \Zend\Mail\Transport\TransportInterface |
||
33 | */ |
||
34 | protected $transport; |
||
35 | |||
36 | /** |
||
37 | * Return a HTML message ready to be sent |
||
38 | * |
||
39 | * @param array|string $from |
||
40 | * A string containing the sender e-mail address, or if array with keys email and name |
||
41 | * @param array|string $to |
||
42 | * An array containing the recipients of the mail |
||
43 | * @param string $subject |
||
44 | * Subject of the mail |
||
45 | * @param string|\Zend\View\Model\ModelInterface $nameOrModel |
||
46 | * Either the template to use, or a ViewModel |
||
47 | * @param null|array $values |
||
48 | * Values to use when the template is rendered |
||
49 | * @return Message |
||
50 | */ |
||
51 | public function createHtmlMessage($from, $to, $subject, $nameOrModel, $values = array()) |
||
95 | |||
96 | /** |
||
97 | * Return a text message ready to be sent |
||
98 | * |
||
99 | * @param array|string $from |
||
100 | * A string containing the sender e-mail address, or if array with keys email and name |
||
101 | * @param array|string $to |
||
102 | * An array containing the recipients of the mail |
||
103 | * @param string $subject |
||
104 | * Subject of the mail |
||
105 | * @param string|\Zend\View\Model\ModelInterface $nameOrModel |
||
106 | * Either the template to use, or a ViewModel |
||
107 | * @param null|array $values |
||
108 | * Values to use when the template is rendered |
||
109 | * @return Message |
||
110 | */ |
||
111 | public function createTextMessage($from, $to, $subject, $nameOrModel, $values = array()) |
||
118 | |||
119 | /** |
||
120 | * Send the message |
||
121 | * |
||
122 | * @param Message $message |
||
123 | */ |
||
124 | public function send(MailMessage $message) |
||
129 | |||
130 | /** |
||
131 | * Get the renderer |
||
132 | * |
||
133 | * @return \Zend\View\Renderer\RendererInterface |
||
134 | */ |
||
135 | protected function getRenderer() |
||
143 | |||
144 | /** |
||
145 | * Get the transport |
||
146 | * |
||
147 | * @return \Zend\Mail\Transport\TransportInterface |
||
148 | */ |
||
149 | protected function getTransport() |
||
157 | |||
158 | /** |
||
159 | * |
||
160 | * @return Message |
||
161 | */ |
||
162 | protected function getDefaultMessage($from, $encoding, $to, $subject, $body) |
||
179 | } |
||
180 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.