Completed
Push — master ( 59556b...857b2d )
by Adam
02:44
created

WebDAVFactory::getAutTypes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * WebDAVFactory.php
4
 *
5
 * @copyright      More in license.md
6
 * @license        http://www.ipublikuj.eu
7
 * @author         Adam Kadlec http://www.ipublikuj.eu
8
 * @package        iPublikuj:Flysystem!
9
 * @subpackage     Adapters
10
 * @since          1.0.0
11
 *
12
 * @date           23.04.16
13
 */
14
15
namespace IPub\Flysystem\Factories\Adapters;
16
17
use Nette;
18
use Nette\DI;
19
use Nette\Utils;
20
21
use League\Flysystem;
22
use League\Flysystem\WebDAV;
23
24
use Sabre\DAV;
25
26
/**
27
 * WebDAV compress adapter filesystem factory
28
 *
29
 * @package        iPublikuj:Flysystem!
30
 * @subpackage     Adapters
31
 *
32
 * @author         Adam Kadlec <[email protected]>
33
 */
34
class WebDAVFactory
35
{
36
	/**
37
	 * @param Utils\ArrayHash $parameters
38
	 * @param DI\Container $container
39
	 *
40
	 * @return WebDAV\WebDAVAdapter
41
	 */
42
	public static function create(Utils\ArrayHash $parameters, DI\Container $container)
43
	{
44
		/** @var DAV\Client $client */
45
		$client = $container->getService($parameters->client);
46
47
		return new WebDAV\WebDAVAdapter($client, $parameters->prefix);
48
	}
49
}
50