Ftpd   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 9
c 3
b 0
f 0
lcom 1
cbo 1
dl 0
loc 32
ccs 11
cts 11
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
B getMetadata() 0 12 5
A listDirectoryContents() 0 10 4
1
<?php
2
3
namespace League\Flysystem\Adapter;
4
5
class Ftpd extends Ftp
6
{
7
    /**
8
     * @inheritdoc
9
     */
10 6
    public function getMetadata($path)
11
    {
12 6
        if (empty($path) || ! ($object = ftp_raw($this->getConnection(), 'STAT ' . $path)) || count($object) < 3) {
13 3
            return false;
14
        }
15
16 6
        if (substr($object[1], 0, 5) === "ftpd:") {
17 3
            return false;
18
        }
19
20 6
        return $this->normalizeObject($object[1], '');
21
    }
22
23
    /**
24
     * @inheritdoc
25
     */
26 6
    protected function listDirectoryContents($directory, $recursive = true)
27
    {
28 6
        $listing = ftp_rawlist($this->getConnection(), $directory, $recursive);
29
30 6
        if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) {
31 3
            return array();
32
        }
33
34 3
        return $this->normalizeListing($listing, $directory);
35
    }
36
}
37