@@ -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,21 +7,21 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - if( !class_exists( '\League\Flysystem\Sftp\SftpAdapter' ) ) { |
|
| 19 | - $this->markTestSkipped( 'Install Flysystem SFTP adapter' ); |
|
| 18 | + if (!class_exists('\League\Flysystem\Sftp\SftpAdapter')) { |
|
| 19 | + $this->markTestSkipped('Install Flysystem SFTP adapter'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - $object = new FlySftp( array( 'host' => 'test.rebex.net', 'username' => 'demo', 'password' => 'password' ) ); |
|
| 23 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 22 | + $object = new FlySftp(array('host' => 'test.rebex.net', 'username' => 'demo', 'password' => 'password')); |
|
| 23 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 24 | 24 | |
| 25 | - $object->has( 'test' ); |
|
| 25 | + $object->has('test'); |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -7,17 +7,17 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - $object = new FlyFtp( array( 'host' => 'ftp.heise.de' ) ); |
|
| 19 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 18 | + $object = new FlyFtp(array('host' => 'ftp.heise.de')); |
|
| 19 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 20 | 20 | |
| 21 | - $object->has( 'test' ); |
|
| 21 | + $object->has('test'); |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $includepaths = $aimeos->getIncludePaths(); |
| 20 | 20 | $includepaths[] = get_include_path(); |
| 21 | - set_include_path( implode( PATH_SEPARATOR, $includepaths ) ); |
|
| 21 | + set_include_path(implode(PATH_SEPARATOR, $includepaths)); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
| 25 | - public static function getContext( $site = 'unittest' ) |
|
| 25 | + public static function getContext($site = 'unittest') |
|
| 26 | 26 | { |
| 27 | - if( !isset( self::$context[$site] ) ) { |
|
| 28 | - self::$context[$site] = self::createContext( $site ); |
|
| 27 | + if (!isset(self::$context[$site])) { |
|
| 28 | + self::$context[$site] = self::createContext($site); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | return clone self::$context[$site]; |
@@ -34,58 +34,58 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | private static function getAimeos() |
| 36 | 36 | { |
| 37 | - if( !isset( self::$aimeos ) ) |
|
| 37 | + if (!isset(self::$aimeos)) |
|
| 38 | 38 | { |
| 39 | 39 | require_once 'Bootstrap.php'; |
| 40 | - spl_autoload_register( '\Aimeos\Bootstrap::autoload' ); |
|
| 40 | + spl_autoload_register('\Aimeos\Bootstrap::autoload'); |
|
| 41 | 41 | |
| 42 | - $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
|
| 43 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
| 42 | + $extdir = dirname(dirname(dirname(__DIR__))); |
|
| 43 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return self::$aimeos; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | - private static function createContext( $site ) |
|
| 50 | + private static function createContext($site) |
|
| 51 | 51 | { |
| 52 | 52 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 53 | 53 | $aimeos = self::getAimeos(); |
| 54 | 54 | |
| 55 | 55 | |
| 56 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 57 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
| 56 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
| 57 | + $paths[] = __DIR__.DIRECTORY_SEPARATOR.'config'; |
|
| 58 | 58 | |
| 59 | - $conf = new \Aimeos\MW\Config\PHPArray( [], $paths ); |
|
| 60 | - $ctx->setConfig( $conf ); |
|
| 59 | + $conf = new \Aimeos\MW\Config\PHPArray([], $paths); |
|
| 60 | + $ctx->setConfig($conf); |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 64 | - $ctx->setDatabaseManager( $dbm ); |
|
| 63 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 64 | + $ctx->setDatabaseManager($dbm); |
|
| 65 | 65 | |
| 66 | 66 | |
| 67 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 68 | - $ctx->setLogger( $logger ); |
|
| 67 | + $logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 68 | + $ctx->setLogger($logger); |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | $cache = new \Aimeos\MW\Cache\None(); |
| 72 | - $ctx->setCache( $cache ); |
|
| 72 | + $ctx->setCache($cache); |
|
| 73 | 73 | |
| 74 | 74 | |
| 75 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 76 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 75 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
| 76 | + $ctx->setI18n(array('de' => $i18n)); |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | $session = new \Aimeos\MW\Session\None(); |
| 80 | - $ctx->setSession( $session ); |
|
| 80 | + $ctx->setSession($session); |
|
| 81 | 81 | |
| 82 | 82 | |
| 83 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 84 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
| 83 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 84 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
| 85 | 85 | |
| 86 | - $ctx->setLocale( $localeItem ); |
|
| 86 | + $ctx->setLocale($localeItem); |
|
| 87 | 87 | |
| 88 | - $ctx->setEditor( 'ai-filesystem:unittest' ); |
|
| 88 | + $ctx->setEditor('ai-filesystem:unittest'); |
|
| 89 | 89 | |
| 90 | 90 | return $ctx; |
| 91 | 91 | } |
@@ -7,17 +7,17 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - $object = new FlyNone( [] ); |
|
| 19 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 18 | + $object = new FlyNone([]); |
|
| 19 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 20 | 20 | |
| 21 | - $object->has( 'test' ); |
|
| 21 | + $object->has('test'); |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - if( !class_exists( '\League\Flysystem\Memory\MemoryAdapter' ) ) { |
|
| 19 | - $this->markTestSkipped( 'Install Flysystem memory adapter' ); |
|
| 18 | + if (!class_exists('\League\Flysystem\Memory\MemoryAdapter')) { |
|
| 19 | + $this->markTestSkipped('Install Flysystem memory adapter'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - $object = new FlyMemory( [] ); |
|
| 23 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 22 | + $object = new FlyMemory([]); |
|
| 23 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 24 | 24 | |
| 25 | - $object->has( 'test' ); |
|
| 25 | + $object->has('test'); |
|
| 26 | 26 | } |
| 27 | 27 | } |