MockMIMEWriter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 2
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createMultipartBoundaryName() 0 7 1
1
<?php
2
3
namespace Kodus\Mail\Test\Unit;
4
5
use Kodus\Mail\MIMEWriter;
6
7
/**
8
 * Overrides boundary name creation for testing
9
 */
10
class MockMIMEWriter extends MIMEWriter
11
{
12
    private $index = 0;
13
14
    protected function createMultipartBoundaryName(string $prefix): string
15
    {
16
        $this->index += 1;
17
18
        $id = sha1($prefix . $this->index);
19
20
        return "++++{$prefix}-{$id}++++";
21
    }
22
}
23