AttachmentHelperTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A applyNameToPart() 0 9 2
1
<?php
2
declare(strict_types=1);
3
4
namespace AcMailer\Attachment\Helper;
5
6
use Zend\Mime\Part;
7
8
trait AttachmentHelperTrait
9
{
10
    protected function applyNameToPart(Part $part, string $name = null): Part
11
    {
12
        if ($name !== null) {
13
            $part->id = $name;
14
            $part->filename = $name;
15
        }
16
17
        return $part;
18
    }
19
}
20