@@ -15,15 +15,15 @@ discard block |
||
| 15 | 15 | public static function bootstrap() |
| 16 | 16 | { |
| 17 | 17 | self::getAimeos(); |
| 18 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 19 | - \Aimeos\Controller\Frontend\Factory::setCache( false ); |
|
| 18 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 19 | + \Aimeos\Controller\Frontend\Factory::setCache(false); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
| 23 | - public static function getContext( $site = 'unittest' ) |
|
| 23 | + public static function getContext($site = 'unittest') |
|
| 24 | 24 | { |
| 25 | - if( !isset( self::$context[$site] ) ) { |
|
| 26 | - self::$context[$site] = self::createContext( $site ); |
|
| 25 | + if (!isset(self::$context[$site])) { |
|
| 26 | + self::$context[$site] = self::createContext($site); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return clone self::$context[$site]; |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | private static function getAimeos() |
| 34 | 34 | { |
| 35 | - if( !isset( self::$aimeos ) ) |
|
| 35 | + if (!isset(self::$aimeos)) |
|
| 36 | 36 | { |
| 37 | 37 | require_once 'Bootstrap.php'; |
| 38 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 38 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
| 39 | 39 | |
| 40 | - $extdir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ); |
|
| 41 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
| 40 | + $extdir = dirname(dirname(dirname(dirname(dirname(__FILE__))))); |
|
| 41 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | return self::$aimeos; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | /** |
| 49 | 49 | * @param string $site |
| 50 | 50 | */ |
| 51 | - private static function createContext( $site ) |
|
| 51 | + private static function createContext($site) |
|
| 52 | 52 | { |
| 53 | 53 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 54 | 54 | $aimeos = self::getAimeos(); |
@@ -58,34 +58,34 @@ discard block |
||
| 58 | 58 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
| 59 | 59 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
| 60 | 60 | |
| 61 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
| 62 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 63 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 64 | - $ctx->setConfig( $conf ); |
|
| 61 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
| 62 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
| 63 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
| 64 | + $ctx->setConfig($conf); |
|
| 65 | 65 | |
| 66 | 66 | |
| 67 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 68 | - $ctx->setDatabaseManager( $dbm ); |
|
| 67 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 68 | + $ctx->setDatabaseManager($dbm); |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | - $logger = new \Aimeos\MW\Logger\File( 'unittest.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 72 | - $ctx->setLogger( $logger ); |
|
| 71 | + $logger = new \Aimeos\MW\Logger\File('unittest.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 72 | + $ctx->setLogger($logger); |
|
| 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 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
| 85 | - $ctx->setLocale( $locale ); |
|
| 83 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 84 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
| 85 | + $ctx->setLocale($locale); |
|
| 86 | 86 | |
| 87 | 87 | |
| 88 | - $ctx->setEditor( 'core:controller/frontend' ); |
|
| 88 | + $ctx->setEditor('core:controller/frontend'); |
|
| 89 | 89 | |
| 90 | 90 | return $ctx; |
| 91 | 91 | } |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | * @param string $name Name of the manager |
| 26 | 26 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
| 27 | 27 | */ |
| 28 | - public function createManager( $name ) |
|
| 28 | + public function createManager($name) |
|
| 29 | 29 | { |
| 30 | - return $this->getController()->createManager( $name ); |
|
| 30 | + return $this->getController()->createManager($name); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys |
| 53 | 53 | * @since 2015.08 |
| 54 | 54 | */ |
| 55 | - public function getCatalogPath( $id, array $domains = array( 'text', 'media' ) ) |
|
| 55 | + public function getCatalogPath($id, array $domains = array('text', 'media')) |
|
| 56 | 56 | { |
| 57 | - return $this->getController()->getCatalogPath( $id, $domains ); |
|
| 57 | + return $this->getController()->getCatalogPath($id, $domains); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant |
| 70 | 70 | * @since 2015.08 |
| 71 | 71 | */ |
| 72 | - public function getCatalogTree( $id = null, array $domains = array( 'text', 'media' ), |
|
| 73 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null ) |
|
| 72 | + public function getCatalogTree($id = null, array $domains = array('text', 'media'), |
|
| 73 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null) |
|
| 74 | 74 | { |
| 75 | - return $this->getController()->getCatalogTree( $id, $domains, $level, $search ); |
|
| 75 | + return $this->getController()->getCatalogTree($id, $domains, $level, $search); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | * @return array Associative list of key values as key and the product count for this key as value |
| 85 | 85 | * @since 2015.08 |
| 86 | 86 | */ |
| 87 | - public function aggregateIndex( \Aimeos\MW\Criteria\Iface $filter, $key ) |
|
| 87 | + public function aggregateIndex(\Aimeos\MW\Criteria\Iface $filter, $key) |
|
| 88 | 88 | { |
| 89 | - return $this->getController()->aggregateIndex( $filter, $key ); |
|
| 89 | + return $this->getController()->aggregateIndex($filter, $key); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 99 | 99 | * @since 2015.08 |
| 100 | 100 | */ |
| 101 | - public function addIndexFilterCategory( \Aimeos\MW\Criteria\Iface $search, $catid ) |
|
| 101 | + public function addIndexFilterCategory(\Aimeos\MW\Criteria\Iface $search, $catid) |
|
| 102 | 102 | { |
| 103 | - return $this->getController()->addIndexFilterCategory( $search, $catid ); |
|
| 103 | + return $this->getController()->addIndexFilterCategory($search, $catid); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 114 | 114 | * @since 2015.08 |
| 115 | 115 | */ |
| 116 | - public function addIndexFilterText( \Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default' ) |
|
| 116 | + public function addIndexFilterText(\Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default') |
|
| 117 | 117 | { |
| 118 | - return $this->getController()->addIndexFilterText( $search, $input, $listtype ); |
|
| 118 | + return $this->getController()->addIndexFilterText($search, $input, $listtype); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 131 | 131 | * @since 2015.08 |
| 132 | 132 | */ |
| 133 | - public function createIndexFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
|
| 133 | + public function createIndexFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default') |
|
| 134 | 134 | { |
| 135 | - return $this->getController()->createIndexFilter( $sort, $direction, $start, $size, $listtype ); |
|
| 135 | + return $this->getController()->createIndexFilter($sort, $direction, $start, $size, $listtype); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 149 | 149 | * @since 2015.08 |
| 150 | 150 | */ |
| 151 | - public function createIndexFilterCategory( $catid, $sort = 'position', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default' ) |
|
| 151 | + public function createIndexFilterCategory($catid, $sort = 'position', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default') |
|
| 152 | 152 | { |
| 153 | - return $this->getController()->createIndexFilter( $catid, $sort, $direction, $start, $size, $listtype ); |
|
| 153 | + return $this->getController()->createIndexFilter($catid, $sort, $direction, $start, $size, $listtype); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 167 | 167 | * @since 2015.08 |
| 168 | 168 | */ |
| 169 | - public function createIndexFilterText( $input, $sort = 'relevance', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default' ) |
|
| 169 | + public function createIndexFilterText($input, $sort = 'relevance', $direction = 'asc', $start = 0, $size = 100, $listtype = 'default') |
|
| 170 | 170 | { |
| 171 | - return $this->getController()->createIndexFilter( $input, $sort, $direction, $start, $size, $listtype ); |
|
| 171 | + return $this->getController()->createIndexFilter($input, $sort, $direction, $start, $size, $listtype); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
| 182 | 182 | * @since 2015.08 |
| 183 | 183 | */ |
| 184 | - public function getIndexItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
| 184 | + public function getIndexItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
| 185 | 185 | { |
| 186 | - return $this->getController()->getIndexItems( $filter, $domains, $total ); |
|
| 186 | + return $this->getController()->getIndexItems($filter, $domains, $total); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | * @return array List of product items implementing \Aimeos\MShop\Product\Item\Iface |
| 196 | 196 | * @since 2015.08 |
| 197 | 197 | */ |
| 198 | - public function getProductItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ) |
|
| 198 | + public function getProductItems(array $ids, array $domains = array('media', 'price', 'text')) |
|
| 199 | 199 | { |
| 200 | - return $this->getController()->getProductItems( $ids, $domains ); |
|
| 200 | + return $this->getController()->getProductItems($ids, $domains); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
@@ -213,9 +213,9 @@ discard block |
||
| 213 | 213 | * @param string $type Type of the text like "name", "short", "long", etc. |
| 214 | 214 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 215 | 215 | */ |
| 216 | - public function createTextFilter( $input, $sort = null, $direction = 'desc', $start = 0, $size = 25, $listtype = 'default', $type = 'name' ) |
|
| 216 | + public function createTextFilter($input, $sort = null, $direction = 'desc', $start = 0, $size = 25, $listtype = 'default', $type = 'name') |
|
| 217 | 217 | { |
| 218 | - return $this->getController()->createTextFilter( $input, $sort, $direction, $start, $size, $listtype, $type ); |
|
| 218 | + return $this->getController()->createTextFilter($input, $sort, $direction, $start, $size, $listtype, $type); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
@@ -225,8 +225,8 @@ discard block |
||
| 225 | 225 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
| 226 | 226 | * @return array Associative list of the product ID as key and the product text as value |
| 227 | 227 | */ |
| 228 | - public function getTextList( \Aimeos\MW\Criteria\Iface $filter ) |
|
| 228 | + public function getTextList(\Aimeos\MW\Criteria\Iface $filter) |
|
| 229 | 229 | { |
| 230 | - return $this->getController()->getTextList( $filter ); |
|
| 230 | + return $this->getController()->getTextList($filter); |
|
| 231 | 231 | } |
| 232 | 232 | } |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | * @param array $ref List of domains for which the items referenced by the services should be fetched too |
| 28 | 28 | * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface with referenced items |
| 29 | 29 | */ |
| 30 | - public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
| 31 | - $ref = array( 'media', 'price', 'text' ) ) |
|
| 30 | + public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
|
| 31 | + $ref = array('media', 'price', 'text')) |
|
| 32 | 32 | { |
| 33 | - return $this->getController()->getServices( $type, $basket, $ref ); |
|
| 33 | + return $this->getController()->getServices($type, $basket, $ref); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object |
| 44 | 44 | * @return array List of attribute definitions implementing \Aimeos\MW\Criteria\Attribute\Iface |
| 45 | 45 | */ |
| 46 | - public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
| 46 | + public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
| 47 | 47 | { |
| 48 | - return $this->getController()->getServiceAttributes( $type, $serviceId, $basket ); |
|
| 48 | + return $this->getController()->getServiceAttributes($type, $serviceId, $basket); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | * @throws \Aimeos\MShop\Exception If service provider isn't available |
| 61 | 61 | * @throws \Exception If an error occurs |
| 62 | 62 | */ |
| 63 | - public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
| 63 | + public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
| 64 | 64 | { |
| 65 | - return $this->getController()->getServicePrice( $type, $serviceId, $basket ); |
|
| 65 | + return $this->getController()->getServicePrice($type, $serviceId, $basket); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | * @return array List of key/value pairs of attributes keys and an error message for values that are invalid or |
| 77 | 77 | * missing |
| 78 | 78 | */ |
| 79 | - public function checkServiceAttributes( $type, $serviceId, array $attributes ) |
|
| 79 | + public function checkServiceAttributes($type, $serviceId, array $attributes) |
|
| 80 | 80 | { |
| 81 | - return $this->getController()->checkServiceAttributes( $type, $serviceId, $attributes ); |
|
| 81 | + return $this->getController()->checkServiceAttributes($type, $serviceId, $attributes); |
|
| 82 | 82 | } |
| 83 | 83 | } |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object to be stored |
| 30 | 30 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
| 31 | 31 | */ |
| 32 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
| 32 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
| 33 | 33 | { |
| 34 | - return $this->getController()->store( $basket ); |
|
| 34 | + return $this->getController()->store($basket); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 57 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 58 | 58 | { |
| 59 | - $this->getController()->block( $orderItem ); |
|
| 59 | + $this->getController()->block($orderItem); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 80 | 80 | * @return void |
| 81 | 81 | */ |
| 82 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 82 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 83 | 83 | { |
| 84 | - $this->getController()->unblock( $orderItem ); |
|
| 84 | + $this->getController()->unblock($orderItem); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 101 | 101 | * @return void |
| 102 | 102 | */ |
| 103 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 103 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 104 | 104 | { |
| 105 | - $this->getController()->update( $orderItem ); |
|
| 105 | + $this->getController()->update($orderItem); |
|
| 106 | 106 | } |
| 107 | 107 | } |