Attachment::getFilename()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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