@@ -35,21 +35,21 @@ |
||
35 | 35 | */ |
36 | 36 | protected function getProvider() |
37 | 37 | { |
38 | - if( !isset( $this->fs ) ) |
|
38 | + if (!isset($this->fs)) |
|
39 | 39 | { |
40 | 40 | $config = $this->getConfig(); |
41 | 41 | |
42 | - if( !isset( $config['root'] ) ) { |
|
43 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'root' ) ); |
|
42 | + if (!isset($config['root'])) { |
|
43 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'root')); |
|
44 | 44 | } |
45 | 45 | |
46 | - $conn = DriverManager::getConnection( $config ); |
|
46 | + $conn = DriverManager::getConnection($config); |
|
47 | 47 | $factory = new RepositoryFactoryDoctrineDBAL(); |
48 | 48 | |
49 | - $repo = $factory->getRepository( array( 'jackalope.doctrine_dbal_connection' => $conn ) ); |
|
50 | - $session = $repo->login( new \PHPCR\SimpleCredentials( null, null ) ); |
|
49 | + $repo = $factory->getRepository(array('jackalope.doctrine_dbal_connection' => $conn)); |
|
50 | + $session = $repo->login(new \PHPCR\SimpleCredentials(null, null)); |
|
51 | 51 | |
52 | - $this->fs = new Filesystem( new PhpcrAdapter( $session, $config['root'] ) ); |
|
52 | + $this->fs = new Filesystem(new PhpcrAdapter($session, $config['root'])); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return $this->fs; |
@@ -34,17 +34,17 @@ |
||
34 | 34 | */ |
35 | 35 | protected function getProvider() |
36 | 36 | { |
37 | - if( !isset( $this->fs ) ) |
|
37 | + if (!isset($this->fs)) |
|
38 | 38 | { |
39 | 39 | $config = $this->getConfig(); |
40 | 40 | |
41 | - if( !isset( $config['container'] ) ) { |
|
42 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'container' ) ); |
|
41 | + if (!isset($config['container'])) { |
|
42 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'container')); |
|
43 | 43 | } |
44 | 44 | |
45 | - $client = new OpenStack( Rackspace::UK_IDENTITY_ENDPOINT, $config ); |
|
46 | - $container = $client->objectStoreService( 'cloudFiles', 'LON' )->getContainer( $config['container'] ); |
|
47 | - $this->fs = new Filesystem( new RackspaceAdapter( $container ) ); |
|
45 | + $client = new OpenStack(Rackspace::UK_IDENTITY_ENDPOINT, $config); |
|
46 | + $container = $client->objectStoreService('cloudFiles', 'LON')->getContainer($config['container']); |
|
47 | + $this->fs = new Filesystem(new RackspaceAdapter($container)); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return $this->fs; |
@@ -32,21 +32,21 @@ |
||
32 | 32 | */ |
33 | 33 | protected function getProvider() |
34 | 34 | { |
35 | - if( !isset( $this->fs ) ) |
|
35 | + if (!isset($this->fs)) |
|
36 | 36 | { |
37 | 37 | $config = $this->getConfig(); |
38 | 38 | |
39 | - if( !isset( $config['source'] ) ) { |
|
40 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'source' ) ); |
|
39 | + if (!isset($config['source'])) { |
|
40 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'source')); |
|
41 | 41 | } |
42 | 42 | |
43 | - if( !isset( $config['replica'] ) ) { |
|
44 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'replica' ) ); |
|
43 | + if (!isset($config['replica'])) { |
|
44 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'replica')); |
|
45 | 45 | } |
46 | 46 | |
47 | - $source = Factory::create( (array) $config['source'] )->getAdapter(); |
|
48 | - $replica = Factory::create( (array) $config['replica'] )->getAdapter(); |
|
49 | - $this->fs = new Filesystem( new ReplicateAdapter( $source, $replica ) ); |
|
47 | + $source = Factory::create((array) $config['source'])->getAdapter(); |
|
48 | + $replica = Factory::create((array) $config['replica'])->getAdapter(); |
|
49 | + $this->fs = new Filesystem(new ReplicateAdapter($source, $replica)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $this->fs; |
@@ -32,8 +32,8 @@ |
||
32 | 32 | */ |
33 | 33 | protected function getProvider() |
34 | 34 | { |
35 | - if( !isset( $this->fs ) ) { |
|
36 | - $this->fs = new Filesystem( new SftpAdapter( $this->getConfig() ) ); |
|
35 | + if (!isset($this->fs)) { |
|
36 | + $this->fs = new Filesystem(new SftpAdapter($this->getConfig())); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return $this->fs; |
@@ -32,13 +32,13 @@ |
||
32 | 32 | */ |
33 | 33 | protected function getProvider() |
34 | 34 | { |
35 | - if( !isset( $this->fs ) ) |
|
35 | + if (!isset($this->fs)) |
|
36 | 36 | { |
37 | 37 | $config = $this->getConfig(); |
38 | - $prefix = ( isset( $config['prefix'] ) ? $config['prefix'] : null ); |
|
38 | + $prefix = (isset($config['prefix']) ? $config['prefix'] : null); |
|
39 | 39 | |
40 | - $client = new \Sabre\DAV\Client( $config ); |
|
41 | - $this->fs = new Filesystem( new WebDAVAdapter( $client, $prefix ) ); |
|
40 | + $client = new \Sabre\DAV\Client($config); |
|
41 | + $this->fs = new Filesystem(new WebDAVAdapter($client, $prefix)); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | return $this->fs; |
@@ -32,15 +32,15 @@ |
||
32 | 32 | */ |
33 | 33 | protected function getProvider() |
34 | 34 | { |
35 | - if( !isset( $this->fs ) ) |
|
35 | + if (!isset($this->fs)) |
|
36 | 36 | { |
37 | 37 | $config = $this->getConfig(); |
38 | 38 | |
39 | - if( !isset( $config['filepath'] ) ) { |
|
40 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'filepath' ) ); |
|
39 | + if (!isset($config['filepath'])) { |
|
40 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'filepath')); |
|
41 | 41 | } |
42 | 42 | |
43 | - $this->fs = new Filesystem( new ZipArchiveAdapter( $config['filepath'] ) ); |
|
43 | + $this->fs = new Filesystem(new ZipArchiveAdapter($config['filepath'])); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return $this->fs; |
@@ -7,24 +7,24 @@ |
||
7 | 7 | { |
8 | 8 | public function testGetProvider() |
9 | 9 | { |
10 | - if( !class_exists( '\League\Flysystem\AwsS3v3\AwsS3Adapter' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem AwsS3v3 adapter' ); |
|
10 | + if (!class_exists('\League\Flysystem\AwsS3v3\AwsS3Adapter')) { |
|
11 | + $this->markTestSkipped('Install Flysystem AwsS3v3 adapter'); |
|
12 | 12 | } |
13 | 13 | |
14 | - $object = new FlyAwsS3( array( 'bucket' => 'test' ) ); |
|
15 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
14 | + $object = new FlyAwsS3(array('bucket' => 'test')); |
|
15 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
16 | 16 | |
17 | - $this->setExpectedException( 'InvalidArgumentException' ); |
|
18 | - $object->has( 'test' ); |
|
17 | + $this->setExpectedException('InvalidArgumentException'); |
|
18 | + $object->has('test'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | |
22 | 22 | public function testGetProviderNoBucket() |
23 | 23 | { |
24 | - $object = new FlyAwsS3( array() ); |
|
25 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
24 | + $object = new FlyAwsS3(array()); |
|
25 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
26 | 26 | |
27 | - $this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' ); |
|
28 | - $object->has( 'test' ); |
|
27 | + $this->setExpectedException('\Aimeos\MW\Filesystem\Exception'); |
|
28 | + $object->has('test'); |
|
29 | 29 | } |
30 | 30 | } |
@@ -7,13 +7,13 @@ |
||
7 | 7 | { |
8 | 8 | public function testGetProvider() |
9 | 9 | { |
10 | - if( !class_exists( '\League\Flysystem\Azure\AzureAdapter' ) ) { |
|
11 | - $this->markTestSkipped( 'Install Flysystem Azure adapter' ); |
|
10 | + if (!class_exists('\League\Flysystem\Azure\AzureAdapter')) { |
|
11 | + $this->markTestSkipped('Install Flysystem Azure adapter'); |
|
12 | 12 | } |
13 | 13 | |
14 | - $object = new FlyAzure( array() ); |
|
15 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
14 | + $object = new FlyAzure(array()); |
|
15 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
16 | 16 | |
17 | - $object->has( 'test' ); |
|
17 | + $object->has('test'); |
|
18 | 18 | } |
19 | 19 | } |
@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | { |
8 | 8 | public function testGetProvider() |
9 | 9 | { |
10 | - $object = new FlyCopy( array() ); |
|
11 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
10 | + $object = new FlyCopy(array()); |
|
11 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
12 | 12 | |
13 | - $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
14 | - $object->has( 'test' ); |
|
13 | + $this->setExpectedException('Aimeos\MW\Filesystem\Exception'); |
|
14 | + $object->has('test'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | $config = array( |
21 | 21 | 'consumerkey' => 'test' |
22 | 22 | ); |
23 | - $object = new FlyCopy( $config ); |
|
24 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
23 | + $object = new FlyCopy($config); |
|
24 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
25 | 25 | |
26 | - $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
27 | - $object->has( 'test' ); |
|
26 | + $this->setExpectedException('Aimeos\MW\Filesystem\Exception'); |
|
27 | + $object->has('test'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | 'consumerkey' => 'test', |
35 | 35 | 'consumersecret' => 'test', |
36 | 36 | ); |
37 | - $object = new FlyCopy( $config ); |
|
38 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
37 | + $object = new FlyCopy($config); |
|
38 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
39 | 39 | |
40 | - $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
41 | - $object->has( 'test' ); |
|
40 | + $this->setExpectedException('Aimeos\MW\Filesystem\Exception'); |
|
41 | + $object->has('test'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | 'consumersecret' => 'test', |
50 | 50 | 'accesstoken' => 'test', |
51 | 51 | ); |
52 | - $object = new FlyCopy( $config ); |
|
53 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
52 | + $object = new FlyCopy($config); |
|
53 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
54 | 54 | |
55 | - $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
56 | - $object->has( 'test' ); |
|
55 | + $this->setExpectedException('Aimeos\MW\Filesystem\Exception'); |
|
56 | + $object->has('test'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
60 | 60 | public function testGetProviderAccess() |
61 | 61 | { |
62 | - if( !class_exists( '\League\Flysystem\Copy\CopyAdapter' ) ) { |
|
63 | - $this->markTestSkipped( 'Install Flysystem Copy adapter' ); |
|
62 | + if (!class_exists('\League\Flysystem\Copy\CopyAdapter')) { |
|
63 | + $this->markTestSkipped('Install Flysystem Copy adapter'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $config = array( |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | 'accesstoken' => 'test', |
70 | 70 | 'tokensecret' => 'test', |
71 | 71 | ); |
72 | - $object = new FlyCopy( $config ); |
|
73 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
72 | + $object = new FlyCopy($config); |
|
73 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
74 | 74 | |
75 | - $this->setExpectedException( 'Exception' ); |
|
76 | - $object->has( 'test' ); |
|
75 | + $this->setExpectedException('Exception'); |
|
76 | + $object->has('test'); |
|
77 | 77 | } |
78 | 78 | } |