Attachment   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 5
Bugs 1 Features 1
Metric Value
wmc 4
c 5
b 1
f 1
lcom 1
cbo 2
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilename() 0 5 3
A getSize() 0 4 1
1
<?php
2
3
namespace Ddeboer\Imap\Message;
4
5
/**
6
 * An e-mail attachment
7
 */
8
class Attachment extends Part
9
{
10
    /**
11
     * Get attachment filename
12
     *
13
     * @return string
14
     */
15
    public function getFilename()
16
    {
17
        if(isset($this->parameters))
18
            return $this->parameters->get('filename')  ?: $this->parameters->get('name');
19
    }
20
21
    /**
22
     * Get attachment file size
23
     *
24
     * @return int Number of bytes
25
     */
26
    public function getSize()
27
    {
28
        return $this->parameters->get('size');
29
    }
30
}
31