MockMIMEWriter::createMultipartBoundaryName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
rs 10
c 2
b 0
f 0
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