@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | * @param array $mapping Associative list of field position in CSV as key and domain item key as value |
28 | 28 | * @param \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor Decorated processor |
29 | 29 | */ |
30 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
31 | - \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null ) |
|
30 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
31 | + \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null) |
|
32 | 32 | { |
33 | 33 | } |
34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param array $data List of CSV fields with position as key and data as value |
41 | 41 | * @return array List of data which hasn't been imported |
42 | 42 | */ |
43 | - public function process( \Aimeos\MShop\Product\Item\Iface $product, array $data ) |
|
43 | + public function process(\Aimeos\MShop\Product\Item\Iface $product, array $data) |
|
44 | 44 | { |
45 | 45 | return $data; |
46 | 46 | } |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * @param array $mapping Associative list of field position in CSV as key and domain item key as value |
27 | 27 | * @param \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor Decorated processor |
28 | 28 | */ |
29 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
30 | - \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null ); |
|
29 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping, |
|
30 | + \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
@@ -37,5 +37,5 @@ discard block |
||
37 | 37 | * @param array $data List of CSV fields with position as key and data as value |
38 | 38 | * @return array List of data which hasn't been imported |
39 | 39 | */ |
40 | - public function process( \Aimeos\MShop\Product\Item\Iface $product, array $data ); |
|
40 | + public function process(\Aimeos\MShop\Product\Item\Iface $product, array $data); |
|
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
42 | 42 | */ |
43 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
43 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
44 | 44 | { |
45 | - parent::__construct( $context ); |
|
45 | + parent::__construct($context); |
|
46 | 46 | |
47 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' ); |
|
48 | - $result = $manager->searchItems( $manager->createSearch() ); |
|
47 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'attribute'); |
|
48 | + $result = $manager->searchItems($manager->createSearch()); |
|
49 | 49 | |
50 | - foreach( $result as $id => $item ) { |
|
51 | - $this->attributes[ $item->getCode() ][ $item->getType() ] = $item; |
|
50 | + foreach ($result as $id => $item) { |
|
51 | + $this->attributes[$item->getCode()][$item->getType()] = $item; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -60,24 +60,24 @@ discard block |
||
60 | 60 | * @param string|null $type Attribute type |
61 | 61 | * @return \Aimeos\MShop\Attribute\Item\Iface|null Attribute object or null if not found |
62 | 62 | */ |
63 | - public function get( $code, $type = null ) |
|
63 | + public function get($code, $type = null) |
|
64 | 64 | { |
65 | - if( isset( $this->attributes[$code] ) && isset( $this->attributes[$code][$type] ) ) { |
|
65 | + if (isset($this->attributes[$code]) && isset($this->attributes[$code][$type])) { |
|
66 | 66 | return $this->attributes[$code][$type]; |
67 | 67 | } |
68 | 68 | |
69 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' ); |
|
69 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute'); |
|
70 | 70 | |
71 | 71 | $search = $manager->createSearch(); |
72 | 72 | $expr = array( |
73 | - $search->compare( '==', 'attribute.code', $code ), |
|
74 | - $search->compare( '==', 'attribute.type.code', $type ), |
|
73 | + $search->compare('==', 'attribute.code', $code), |
|
74 | + $search->compare('==', 'attribute.type.code', $type), |
|
75 | 75 | ); |
76 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
76 | + $search->setConditions($search->combine('&&', $expr)); |
|
77 | 77 | |
78 | - $result = $manager->searchItems( $search ); |
|
78 | + $result = $manager->searchItems($search); |
|
79 | 79 | |
80 | - if( ( $item = reset( $result ) ) !== false ) |
|
80 | + if (($item = reset($result)) !== false) |
|
81 | 81 | { |
82 | 82 | $this->attributes[$code][$type] = $item; |
83 | 83 | return $item; |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @param \Aimeos\MShop\Common\Item\Iface $item Attribute object |
92 | 92 | */ |
93 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ) |
|
93 | + public function set(\Aimeos\MShop\Common\Item\Iface $item) |
|
94 | 94 | { |
95 | 95 | $code = $item->getCode(); |
96 | 96 | |
97 | - if( !isset( $this->attributes[$code] ) || !is_array( $this->attributes[$code] ) ) { |
|
97 | + if (!isset($this->attributes[$code]) || !is_array($this->attributes[$code])) { |
|
98 | 98 | $this->attributes[$code] = array(); |
99 | 99 | } |
100 | 100 | |
101 | - $this->attributes[$code][ $item->getType() ] = $item; |
|
101 | + $this->attributes[$code][$item->getType()] = $item; |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
26 | 26 | */ |
27 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ); |
|
27 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context); |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Returns the item or ID for the given code |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | * @param string|null $type Item type if used and required |
34 | 34 | * @return \Aimeos\MShop\Common\Item\Iface|string|null Item object, unique ID or null if not found |
35 | 35 | */ |
36 | - public function get( $code, $type = null ); |
|
36 | + public function get($code, $type = null); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Adds the item or ID to the cache |
40 | 40 | * |
41 | 41 | * @param \Aimeos\MShop\Common\Item\Iface $item Item object |
42 | 42 | */ |
43 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ); |
|
43 | + public function set(\Aimeos\MShop\Common\Item\Iface $item); |
|
44 | 44 | } |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
42 | 42 | */ |
43 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
43 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
44 | 44 | { |
45 | - parent::__construct( $context ); |
|
45 | + parent::__construct($context); |
|
46 | 46 | |
47 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'catalog' ); |
|
48 | - $result = $manager->searchItems( $manager->createSearch() ); |
|
47 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'catalog'); |
|
48 | + $result = $manager->searchItems($manager->createSearch()); |
|
49 | 49 | |
50 | - foreach( $result as $id => $item ) { |
|
51 | - $this->categories[ $item->getCode() ] = $id; |
|
50 | + foreach ($result as $id => $item) { |
|
51 | + $this->categories[$item->getCode()] = $id; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -60,20 +60,20 @@ discard block |
||
60 | 60 | * @param string|null $type Not used |
61 | 61 | * @return string|null Catalog ID or null if not found |
62 | 62 | */ |
63 | - public function get( $code, $type = null ) |
|
63 | + public function get($code, $type = null) |
|
64 | 64 | { |
65 | - if( isset( $this->categories[$code] ) ) { |
|
65 | + if (isset($this->categories[$code])) { |
|
66 | 66 | return $this->categories[$code]; |
67 | 67 | } |
68 | 68 | |
69 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' ); |
|
69 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog'); |
|
70 | 70 | |
71 | 71 | $search = $manager->createSearch(); |
72 | - $search->setConditions( $search->compare( '==', 'catalog.code', $code ) ); |
|
72 | + $search->setConditions($search->compare('==', 'catalog.code', $code)); |
|
73 | 73 | |
74 | - $result = $manager->searchItems( $search ); |
|
74 | + $result = $manager->searchItems($search); |
|
75 | 75 | |
76 | - if( ( $item = reset( $result ) ) !== false ) |
|
76 | + if (($item = reset($result)) !== false) |
|
77 | 77 | { |
78 | 78 | $this->categories[$code] = $item->getId(); |
79 | 79 | return $item->getId(); |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @param \Aimeos\MShop\Common\Item\Iface $item Catalog object |
88 | 88 | */ |
89 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ) |
|
89 | + public function set(\Aimeos\MShop\Common\Item\Iface $item) |
|
90 | 90 | { |
91 | - $this->categories[ $item->getCode() ] = $item->getId(); |
|
91 | + $this->categories[$item->getCode()] = $item->getId(); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | \ No newline at end of file |
@@ -42,20 +42,20 @@ discard block |
||
42 | 42 | * @param string|null $type Attribute type |
43 | 43 | * @return string|null Product ID or null if not found |
44 | 44 | */ |
45 | - public function get( $code, $type = null ) |
|
45 | + public function get($code, $type = null) |
|
46 | 46 | { |
47 | - if( isset( $this->prodmap[$code] ) ) { |
|
47 | + if (isset($this->prodmap[$code])) { |
|
48 | 48 | return $this->prodmap[$code]; |
49 | 49 | } |
50 | 50 | |
51 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' ); |
|
51 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product'); |
|
52 | 52 | |
53 | 53 | $search = $manager->createSearch(); |
54 | - $search->setConditions( $search->compare( '==', 'product.code', $code ) ); |
|
54 | + $search->setConditions($search->compare('==', 'product.code', $code)); |
|
55 | 55 | |
56 | - $result = $manager->searchItems( $search ); |
|
56 | + $result = $manager->searchItems($search); |
|
57 | 57 | |
58 | - if( ( $item = reset( $result ) ) !== false ) |
|
58 | + if (($item = reset($result)) !== false) |
|
59 | 59 | { |
60 | 60 | $this->prodmap[$code] = $item->getId(); |
61 | 61 | return $this->prodmap[$code]; |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param \Aimeos\MShop\Common\Item\Iface $item Product object |
70 | 70 | */ |
71 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ) |
|
71 | + public function set(\Aimeos\MShop\Common\Item\Iface $item) |
|
72 | 72 | { |
73 | - $this->prodmap[ $item->getCode() ] = $item->getId(); |
|
73 | + $this->prodmap[$item->getCode()] = $item->getId(); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * |
28 | 28 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
29 | 29 | */ |
30 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
30 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
31 | 31 | { |
32 | 32 | $this->context = $context; |
33 | 33 | } |
@@ -15,14 +15,14 @@ discard block |
||
15 | 15 | public static function bootstrap() |
16 | 16 | { |
17 | 17 | self::getAimeos(); |
18 | - \Aimeos\MShop\Factory::setCache( false ); |
|
18 | + \Aimeos\MShop\Factory::setCache(false); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | |
22 | - public static function getContext( $site = 'unittest' ) |
|
22 | + public static function getContext($site = 'unittest') |
|
23 | 23 | { |
24 | - if( !isset( self::$context[$site] ) ) { |
|
25 | - self::$context[$site] = self::createContext( $site ); |
|
24 | + if (!isset(self::$context[$site])) { |
|
25 | + self::$context[$site] = self::createContext($site); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | return clone self::$context[$site]; |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | |
32 | 32 | public static function getAimeos() |
33 | 33 | { |
34 | - if( !isset( self::$aimeos ) ) |
|
34 | + if (!isset(self::$aimeos)) |
|
35 | 35 | { |
36 | 36 | require_once 'Bootstrap.php'; |
37 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
37 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
38 | 38 | |
39 | - $extdir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ); |
|
40 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
39 | + $extdir = dirname(dirname(dirname(dirname(dirname(__FILE__))))); |
|
40 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return self::$aimeos; |
@@ -47,40 +47,40 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * @param string $site |
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' ); |
|
56 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
57 | 57 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
58 | 58 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
59 | 59 | |
60 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
61 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
62 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
63 | - $ctx->setConfig( $conf ); |
|
60 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
61 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
62 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
63 | + $ctx->setConfig($conf); |
|
64 | 64 | |
65 | 65 | |
66 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
67 | - $ctx->setDatabaseManager( $dbm ); |
|
66 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
67 | + $ctx->setDatabaseManager($dbm); |
|
68 | 68 | |
69 | 69 | |
70 | - $logger = new \Aimeos\MW\Logger\File( 'unittest.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
71 | - $ctx->setLogger( $logger ); |
|
70 | + $logger = new \Aimeos\MW\Logger\File('unittest.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
71 | + $ctx->setLogger($logger); |
|
72 | 72 | |
73 | 73 | |
74 | 74 | $session = new \Aimeos\MW\Session\None(); |
75 | - $ctx->setSession( $session ); |
|
75 | + $ctx->setSession($session); |
|
76 | 76 | |
77 | 77 | |
78 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
79 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
80 | - $ctx->setLocale( $locale ); |
|
78 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
79 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
80 | + $ctx->setLocale($locale); |
|
81 | 81 | |
82 | 82 | |
83 | - $ctx->setEditor( 'core:controller/common' ); |
|
83 | + $ctx->setEditor('core:controller/common'); |
|
84 | 84 | |
85 | 85 | return $ctx; |
86 | 86 | } |
@@ -11,22 +11,22 @@ |
||
11 | 11 | * Set error reporting to maximum |
12 | 12 | */ |
13 | 13 | error_reporting( -1 ); |
14 | -ini_set( 'display_errors', '1' ); |
|
14 | +ini_set('display_errors', '1'); |
|
15 | 15 | |
16 | -date_default_timezone_set( 'UTC' ); |
|
16 | +date_default_timezone_set('UTC'); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Set locale settings to reasonable defaults |
20 | 20 | */ |
21 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
22 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
23 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
24 | -setlocale( LC_TIME, 'POSIX' ); |
|
21 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
22 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
23 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
24 | +setlocale(LC_TIME, 'POSIX'); |
|
25 | 25 | |
26 | 26 | /* |
27 | 27 | * Set include path for tests |
28 | 28 | */ |
29 | -define( 'PATH_TESTS', __DIR__ ); |
|
29 | +define('PATH_TESTS', __DIR__); |
|
30 | 30 | |
31 | 31 | require_once 'TestHelperCntl.php'; |
32 | 32 | \TestHelperCntl::bootstrap(); |