FlyFtp   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getProvider() 0 9 2
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2018
6
 * @package MW
7
 * @subpackage Filesystem
8
 */
9
10
11
namespace Aimeos\MW\Filesystem;
12
13
use League\Flysystem\Filesystem;
14
use League\Flysystem\Adapter\Ftp as FtpAdapter;
15
16
17
/**
18
 * Implementation of Flysystem FTP file system adapter
19
 *
20
 * @package MW
21
 * @subpackage Filesystem
22
 */
23
class FlyFtp extends FlyBase implements Iface, DirIface, MetaIface
24
{
25
	private $fs;
26
27
28
	/**
29
	 * Returns the file system provider
30
	 *
31
	 * @return \League\Flysystem\FilesystemInterface File system provider
32
	 */
33
	protected function getProvider()
34
	{
35
		if( !isset( $this->fs ) )
36
		{
37
			$config = $this->getConfig();
38
			$this->fs = new Filesystem( new FtpAdapter( $config ) );
39
		}
40
41
		return $this->fs;
42
	}
43
}
44