Code Duplication    Length = 19-21 lines in 4 locations

lib/custom/src/MW/Filesystem/FlyFtp.php 1 location

@@ 23-43 (lines=21) @@
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

lib/custom/src/MW/Filesystem/FlyMemory.php 1 location

@@ 23-41 (lines=19) @@
20
 * @package MW
21
 * @subpackage Filesystem
22
 */
23
class FlyMemory 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
			$this->fs = new Filesystem( new MemoryAdapter() );
37
		}
38
39
		return $this->fs;
40
	}
41
}
42

lib/custom/src/MW/Filesystem/FlyNone.php 1 location

@@ 23-41 (lines=19) @@
20
 * @package MW
21
 * @subpackage Filesystem
22
 */
23
class FlyNone 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
			$this->fs = new Filesystem( new NullAdapter() );
37
		}
38
39
		return $this->fs;
40
	}
41
}
42

lib/custom/src/MW/Filesystem/FlySftp.php 1 location

@@ 23-41 (lines=19) @@
20
 * @package MW
21
 * @subpackage Filesystem
22
 */
23
class FlySftp 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
			$this->fs = new Filesystem( new SftpAdapter( $this->getConfig() ) );
37
		}
38
39
		return $this->fs;
40
	}
41
}
42