Issues (2687)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Eccube/Service/MailService.php (64 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
namespace Eccube\Service;
25
26
use Eccube\Application;
27
use Eccube\Event\EccubeEvents;
28
use Eccube\Event\EventArgs;
29
30
class MailService
0 ignored issues
show
Missing class doc comment
Loading history...
31
{
32
    /** @var \Eccube\Application */
33
    public $app;
34
35
36
    /** @var \Eccube\Entity\BaseInfo */
37
    public $BaseInfo;
0 ignored issues
show
Member variable "BaseInfo" is not in valid camel caps format
Loading history...
38
39 51
    public function __construct(Application $app)
0 ignored issues
show
Missing function doc comment
Loading history...
40
    {
41 51
        $this->app = $app;
42 51
        $this->BaseInfo = $app['eccube.repository.base_info']->get();
43
    }
44
45
46
    /**
0 ignored issues
show
Doc comment for parameter "$Customer" missing
Loading history...
Doc comment for parameter "$activateUrl" missing
Loading history...
47
     * Send customer confirm mail.
48
     *
49
     * @param $Customer 会員情報
0 ignored issues
show
Missing parameter name
Loading history...
50
     * @param $activateUrl アクティベート用url
0 ignored issues
show
Missing parameter name
Loading history...
51
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
52 3
    public function sendCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl)
53
    {
54
55 3
        log_info('仮会員登録メール送信開始');
56
57 3
        $body = $this->app->renderView('Mail/entry_confirm.twig', array(
58 3
            'Customer' => $Customer,
59 3
            'BaseInfo' => $this->BaseInfo,
60 3
            'activateUrl' => $activateUrl,
61
        ));
62
63 3
        $message = \Swift_Message::newInstance()
64 3
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認')
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
65 3
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
66 3
            ->setTo(array($Customer->getEmail()))
67 3
            ->setBcc($this->BaseInfo->getEmail01())
68 3
            ->setReplyTo($this->BaseInfo->getEmail03())
69 3
            ->setReturnPath($this->BaseInfo->getEmail04())
70 3
            ->setBody($body);
71
72 3
        $event = new EventArgs(
73
            array(
74 3
                'message' => $message,
75 3
                'Customer' => $Customer,
76 3
                'BaseInfo' => $this->BaseInfo,
77 3
                'activateUrl' => $activateUrl,
78
            ),
79 3
            null
80
        );
81 3
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_CUSTOMER_CONFIRM, $event);
82
83 3
        $count = $this->app->mail($message, $failures);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
84
85 3
        log_info('仮会員登録メール送信完了', array('count' => $count));
86
87 3
        return $count;
88
    }
89
90
    /**
0 ignored issues
show
Doc comment for parameter "$Customer" missing
Loading history...
91
     * Send customer complete mail.
92
     *
93
     * @param $Customer 会員情報
0 ignored issues
show
Missing parameter name
Loading history...
94
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
95 3 View Code Duplication
    public function sendCustomerCompleteMail(\Eccube\Entity\Customer $Customer)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
96
    {
97 3
        log_info('会員登録完了メール送信開始');
98
99 3
        $body = $this->app->renderView('Mail/entry_complete.twig', array(
100 3
            'Customer' => $Customer,
101 3
            'BaseInfo' => $this->BaseInfo,
102
        ));
103
104 3
        $message = \Swift_Message::newInstance()
105 3
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録が完了しました。')
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
106 3
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
107 3
            ->setTo(array($Customer->getEmail()))
108 3
            ->setBcc($this->BaseInfo->getEmail01())
109 3
            ->setReplyTo($this->BaseInfo->getEmail03())
110 3
            ->setReturnPath($this->BaseInfo->getEmail04())
111 3
            ->setBody($body);
112
113 3
        $event = new EventArgs(
114
            array(
115 3
                'message' => $message,
116 3
                'Customer' => $Customer,
117 3
                'BaseInfo' => $this->BaseInfo,
118
            ),
119 3
            null
120
        );
121 3
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_CUSTOMER_COMPLETE, $event);
122
123 3
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
124
125 3
        log_info('会員登録完了メール送信完了', array('count' => $count));
126
127 3
        return $count;
128
    }
129
130
131
    /**
0 ignored issues
show
Doc comment for parameter "$email" missing
Loading history...
Doc comment for parameter "$Customer" missing
Loading history...
132
     * Send withdraw mail.
133
     *
134
     * @param $Customer 会員情報
0 ignored issues
show
Missing parameter name
Loading history...
135
     * @param $email 会員email
0 ignored issues
show
Missing parameter name
Loading history...
136
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
137 3 View Code Duplication
    public function sendCustomerWithdrawMail(\Eccube\Entity\Customer $Customer, $email)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
138
    {
139 3
        log_info('退会手続き完了メール送信開始');
140
141 3
        $body = $this->app->renderView('Mail/customer_withdraw_mail.twig', array(
142 3
            'Customer' => $Customer,
143 3
            'BaseInfo' => $this->BaseInfo,
144
        ));
145
146 3
        $message = \Swift_Message::newInstance()
147 3
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 退会手続きのご完了')
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
148 3
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
149 3
            ->setTo(array($email))
150 3
            ->setBcc($this->BaseInfo->getEmail01())
151 3
            ->setReplyTo($this->BaseInfo->getEmail03())
152 3
            ->setReturnPath($this->BaseInfo->getEmail04())
153 3
            ->setBody($body);
154
155 3
        $event = new EventArgs(
156
            array(
157 3
                'message' => $message,
158 3
                'Customer' => $Customer,
159 3
                'BaseInfo' => $this->BaseInfo,
160 3
                'email' => $email,
161
            ),
162 3
            null
163
        );
164 3
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_CUSTOMER_WITHDRAW, $event);
165
166 3
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
167
168 3
        log_info('退会手続き完了メール送信完了', array('count' => $count));
169
170 3
        return $count;
171
    }
172
173
174
    /**
0 ignored issues
show
Doc comment for parameter "$formData" missing
Loading history...
175
     * Send contact mail.
176
     *
177
     * @param $formData お問い合わせ内容
0 ignored issues
show
Missing parameter name
Loading history...
178
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
179 6 View Code Duplication
    public function sendContactMail($formData)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
180
    {
181 6
        log_info('お問い合わせ受付メール送信開始');
182
183 6
        $body = $this->app->renderView('Mail/contact_mail.twig', array(
184 6
            'data' => $formData,
185 6
            'BaseInfo' => $this->BaseInfo,
186
        ));
187
188
        // 問い合わせ者にメール送信
189 6
        $message = \Swift_Message::newInstance()
190 6
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] お問い合わせを受け付けました。')
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
191 6
            ->setFrom(array($this->BaseInfo->getEmail02() => $this->BaseInfo->getShopName()))
192 6
            ->setTo(array($formData['email']))
193 6
            ->setBcc($this->BaseInfo->getEmail02())
194 6
            ->setReplyTo($this->BaseInfo->getEmail02())
195 6
            ->setReturnPath($this->BaseInfo->getEmail04())
196 6
            ->setBody($body);
197
198 6
        $event = new EventArgs(
199
            array(
200 6
                'message' => $message,
201 6
                'formData' => $formData,
202 6
                'BaseInfo' => $this->BaseInfo,
203
            ),
204 6
            null
205
        );
206 6
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_CONTACT, $event);
207
208 6
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
209
210 6
        log_info('お問い合わせ受付メール送信完了', array('count' => $count));
211
212 6
        return $count;
213
    }
214
215
    /**
0 ignored issues
show
Doc comment for parameter "$formData" missing
Loading history...
216
     * Alias of sendContactMail().
217
     *
218
     * @param $formData お問い合わせ内容
0 ignored issues
show
Missing parameter name
Loading history...
219
     * @see sendContactMail()
220
     * @deprecated since 3.0.0, to be removed in 3.1
221
     * @link https://github.com/EC-CUBE/ec-cube/issues/1315
222
     */
223
    public function sendrContactMail($formData)
224
    {
225
        $this->sendContactMail($formData);
226
    }
227
228
    /**
229
     * Send order mail.
230
     *
231
     * @param \Eccube\Entity\Order $Order 受注情報
232
     * @return string
233
     */
234 24
    public function sendOrderMail(\Eccube\Entity\Order $Order)
235
    {
236 24
        log_info('受注メール送信開始');
237
238 24
        $MailTemplate = $this->app['eccube.repository.mail_template']->find(1);
239
240 24
        $body = $this->app->renderView($MailTemplate->getFileName(), array(
241 24
            'header' => $MailTemplate->getHeader(),
242 24
            'footer' => $MailTemplate->getFooter(),
243 24
            'Order' => $Order,
244
        ));
245
246 24
        $message = \Swift_Message::newInstance()
247 24
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] ' . $MailTemplate->getSubject())
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
248 24
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
249 24
            ->setTo(array($Order->getEmail()))
250 24
            ->setBcc($this->BaseInfo->getEmail01())
251 24
            ->setReplyTo($this->BaseInfo->getEmail03())
252 24
            ->setReturnPath($this->BaseInfo->getEmail04())
253 24
            ->setBody($body);
254
255 24
        $event = new EventArgs(
256
            array(
257 24
                'message' => $message,
258 24
                'Order' => $Order,
259 24
                'MailTemplate' => $MailTemplate,
260 24
                'BaseInfo' => $this->BaseInfo,
261
            ),
262 24
            null
263
        );
264 24
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_ORDER, $event);
265
266 24
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
267
268 24
        log_info('受注メール送信完了', array('count' => $count));
269
270 24
        return $message;
271
272
    }
273
274
275
    /**
0 ignored issues
show
Doc comment for parameter "$Customer" missing
Loading history...
Doc comment for parameter "$activateUrl" missing
Loading history...
276
     * Send admin customer confirm mail.
277
     *
278
     * @param $Customer 会員情報
0 ignored issues
show
Missing parameter name
Loading history...
279
     * @param $activateUrl アクティベート用url
0 ignored issues
show
Missing parameter name
Loading history...
280
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
281 3 View Code Duplication
    public function sendAdminCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
282
    {
283 3
        log_info('仮会員登録再送メール送信開始');
284
285 3
        $body = $this->app->renderView('Mail/entry_confirm.twig', array(
286 3
            'Customer' => $Customer,
287 3
            'activateUrl' => $activateUrl,
288
        ));
289
290 3
        $message = \Swift_Message::newInstance()
291 3
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認')
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
292 3
            ->setFrom(array($this->BaseInfo->getEmail03() => $this->BaseInfo->getShopName()))
293 3
            ->setTo(array($Customer->getEmail()))
294 3
            ->setBcc($this->BaseInfo->getEmail01())
295 3
            ->setReplyTo($this->BaseInfo->getEmail03())
296 3
            ->setReturnPath($this->BaseInfo->getEmail04())
297 3
            ->setBody($body);
298
299 3
        $event = new EventArgs(
300
            array(
301 3
                'message' => $message,
302 3
                'Customer' => $Customer,
303 3
                'BaseInfo' => $this->BaseInfo,
304 3
                'activateUrl' => $activateUrl,
305
            ),
306 3
            null
307
        );
308 3
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_ADMIN_CUSTOMER_CONFIRM, $event);
309
310 3
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
311
312 3
        log_info('仮会員登録再送メール送信完了', array('count' => $count));
313
314 3
        return $count;
315
    }
316
317
318
    /**
0 ignored issues
show
Doc comment for parameter "$Order" missing
Loading history...
Doc comment for parameter "$formData" missing
Loading history...
319
     * Send admin order mail.
320
     *
321
     * @param $Order 受注情報
0 ignored issues
show
Missing parameter name
Loading history...
322
     * @param $formData 入力内容
0 ignored issues
show
Missing parameter name
Loading history...
323
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
324 5
    public function sendAdminOrderMail(\Eccube\Entity\Order $Order, $formData)
325
    {
326 5
        log_info('受注管理通知メール送信開始');
327
328 5
        $body = $this->app->renderView('Mail/order.twig', array(
329 5
            'header' => $formData['header'],
330 5
            'footer' => $formData['footer'],
331 5
            'Order' => $Order,
332
        ));
333
334 5
        $message = \Swift_Message::newInstance()
335 5
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] ' . $formData['subject'])
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
336 5
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
337 5
            ->setTo(array($Order->getEmail()))
338 5
            ->setBcc($this->BaseInfo->getEmail01())
339 5
            ->setReplyTo($this->BaseInfo->getEmail03())
340 5
            ->setReturnPath($this->BaseInfo->getEmail04())
341 5
            ->setBody($body);
342
343 5
        $event = new EventArgs(
344
            array(
345 5
                'message' => $message,
346 5
                'Order' => $Order,
347 5
                'formData' => $formData,
348 5
                'BaseInfo' => $this->BaseInfo,
349
            ),
350 5
            null
351
        );
352 5
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_ADMIN_ORDER, $event);
353
354 5
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
355
356 5
        log_info('受注管理通知メール送信完了', array('count' => $count));
357
358 5
        return $count;
359
    }
360
361
    /**
0 ignored issues
show
Doc comment for parameter "$reset_url" missing
Loading history...
Doc comment for parameter "$Customer" missing
Loading history...
362
     * Send password reset notification mail.
363
     *
364
     * @param $Customer 会員情報
0 ignored issues
show
Missing parameter name
Loading history...
365
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
366 3 View Code Duplication
    public function sendPasswordResetNotificationMail(\Eccube\Entity\Customer $Customer, $reset_url)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
367
    {
368 3
        log_info('パスワード再発行メール送信開始');
369
370 3
        $body = $this->app->renderView('Mail/forgot_mail.twig', array(
0 ignored issues
show
Add a comma after each item in a multi-line array
Loading history...
371 3
            'Customer' => $Customer,
372 3
            'reset_url' => $reset_url
373
        ));
374
375 3
        $message = \Swift_Message::newInstance()
376 3
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のご確認')
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
377 3
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
378 3
            ->setTo(array($Customer->getEmail()))
379 3
            ->setBcc($this->BaseInfo->getEmail01())
380 3
            ->setReplyTo($this->BaseInfo->getEmail03())
381 3
            ->setReturnPath($this->BaseInfo->getEmail04())
382 3
            ->setBody($body);
383
384 3
        $event = new EventArgs(
385
            array(
386 3
                'message' => $message,
387 3
                'Customer' => $Customer,
388 3
                'BaseInfo' => $this->BaseInfo,
389 3
                'resetUrl' => $reset_url,
390
            ),
391 3
            null
392
        );
393 3
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_PASSWORD_RESET, $event);
394
395 3
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
396
397 3
        log_info('パスワード再発行メール送信完了', array('count' => $count));
398
399 3
        return $count;
400
    }
401
402
    /**
0 ignored issues
show
Doc comment for parameter "$password" missing
Loading history...
Doc comment for parameter "$Customer" missing
Loading history...
403
     * Send password reset notification mail.
404
     *
405
     * @param $Customer 会員情報
0 ignored issues
show
Missing parameter name
Loading history...
406
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
407 3 View Code Duplication
    public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
408
    {
409 3
        log_info('パスワード変更完了メール送信開始');
410
411 3
        $body = $this->app->renderView('Mail/reset_complete_mail.twig', array(
412 3
            'Customer' => $Customer,
413 3
            'password' => $password,
414
        ));
415
416 3
        $message = \Swift_Message::newInstance()
417 3
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のお知らせ')
0 ignored issues
show
Concat operator must not be surrounded by spaces
Loading history...
418 3
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
419 3
            ->setTo(array($Customer->getEmail()))
420 3
            ->setBcc($this->BaseInfo->getEmail01())
421 3
            ->setReplyTo($this->BaseInfo->getEmail03())
422 3
            ->setReturnPath($this->BaseInfo->getEmail04())
423 3
            ->setBody($body);
424
425 3
        $event = new EventArgs(
426
            array(
427 3
                'message' => $message,
428 3
                'Customer' => $Customer,
429 3
                'BaseInfo' => $this->BaseInfo,
430 3
                'password' => $password,
431
            ),
432 3
            null
433
        );
434 3
        $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_PASSWORD_RESET_COMPLETE, $event);
435
436 3
        $count = $this->app->mail($message);
0 ignored issues
show
$message of type object<Swift_Mime_MimePart> is not a sub-type of object<Swift_Message>. It seems like you assume a child class of the class Swift_Mime_MimePart to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
437
438 3
        log_info('パスワード変更完了メール送信完了', array('count' => $count));
439
440 3
        return $count;
441
    }
442
443
}
444