Passed
Push — master ( 65540f...3f31dd )
by Hirofumi
04:05
created

NonRFCMimeGrammer::getDefinition()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 10
ccs 4
cts 5
cp 0.8
crap 2.032
rs 9.9332
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Shippinno\Email\SwiftMailer;
5
6
use Swift_Mime_Grammar;
7
8
class NonRFCMimeGrammer extends Swift_Mime_Grammar
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 1
    public function getDefinition($name)
14
    {
15 1
        switch ($name) {
16
            case 'addr-spec':
17 1
                return '.+\@\S+\.\S+';
18
            default:
19
                /** @noinspection PhpUnhandledExceptionInspection */
20 1
                return parent::getDefinition($name);
21
        }
22
    }
23
}
24