TestImage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileName() 0 4 1
A getFileContent() 0 8 2
1
<?php
2
3
namespace SfCod\EmailEngineBundle\Example\Attachments;
4
5
use SfCod\EmailEngineBundle\Example\TestTemplateOptions;
6
use SfCod\EmailEngineBundle\Template\Attachments\AbstractAttachment;
7
8
/**
9
 * Class TestAttachment
10
 *
11
 * @author Virchenko Maksim <[email protected]>
12
 *
13
 * @package SfCod\EmailEngineBundle\Example\Attachments
14
 *
15
 * @property TestTemplateOptions $options
16
 */
17
class TestImage extends AbstractAttachment
18
{
19
    /**
20
     * Get attachment name
21
     *
22
     * @return string
23
     */
24
    public function getFileName(): string
25
    {
26
        return 'test_file.php';
27
    }
28
29
    /**
30
     * Get attachment path
31
     *
32
     * @return string
33
     */
34
    public function getFileContent(): string
35
    {
36
        if (file_exists($this->options->filePath)) {
37
            return file_get_contents($this->options->filePath);
38
        }
39
40
        return '';
41
    }
42
}
43