ContactMailer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A contact() 0 9 2
1
<?php
2
namespace App\Mailer;
3
4
use Cake\Core\Configure;
5
use Cake\Mailer\Mailer;
6
7
class ContactMailer extends Mailer
8
{
9
    /**
10
     * Contact Email.
11
     *
12
     * @param array $viewVars The variables to pass to the view.
13
     *
14
     * @return void
15
     */
16
    public function contact($viewVars = [])
17
    {
18
        $this
0 ignored issues
show
Deprecated Code introduced by
The method Cake\Mailer\Email::from() has been deprecated with message: 3.4.0 Use setFrom()/getFrom() instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
19
            ->emailFormat('html')
20
            ->from(['[email protected]' => 'Contact Form'])
21
            ->to(Configure::read('Site.contact_email'))
22
            ->subject(isset($viewVars['subject']) ? $viewVars['subject'] : 'Someone has contacted you')
23
            ->set($viewVars);
24
    }
25
}
26