@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
30 | 30 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/frontend/catalog/name |
35 | 35 | * Class name of the used catalog frontend controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2014.03 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'controller/frontend/catalog/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('controller/frontend/catalog/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Catalog\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Catalog\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Frontend\\Catalog\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Frontend\\Catalog\\' . $name; |
79 | 79 | |
80 | - $manager = self::createControllerBase( $context, $classname, $iface ); |
|
80 | + $manager = self::createControllerBase($context, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/frontend/catalog/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the catalog frontend controllers |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @see controller/frontend/catalog/decorators/excludes |
154 | 154 | * @see controller/frontend/catalog/decorators/global |
155 | 155 | */ |
156 | - return self::addControllerDecorators( $context, $manager, 'catalog' ); |
|
156 | + return self::addControllerDecorators($context, $manager, 'catalog'); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | } |
@@ -32,22 +32,22 @@ discard block |
||
32 | 32 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object to be stored |
33 | 33 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
34 | 34 | */ |
35 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
35 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
36 | 36 | { |
37 | 37 | $context = $this->getContext(); |
38 | 38 | |
39 | - $orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
40 | - $orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
39 | + $orderManager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
40 | + $orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
41 | 41 | |
42 | 42 | |
43 | 43 | $orderBaseManager->begin(); |
44 | - $orderBaseManager->store( $basket ); |
|
44 | + $orderBaseManager->store($basket); |
|
45 | 45 | $orderBaseManager->commit(); |
46 | 46 | |
47 | 47 | $orderItem = $orderManager->createItem(); |
48 | - $orderItem->setBaseId( $basket->getId() ); |
|
49 | - $orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB ); |
|
50 | - $orderManager->saveItem( $orderItem ); |
|
48 | + $orderItem->setBaseId($basket->getId()); |
|
49 | + $orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB); |
|
50 | + $orderManager->saveItem($orderItem); |
|
51 | 51 | |
52 | 52 | |
53 | 53 | return $orderItem; |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
74 | 74 | */ |
75 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
75 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
76 | 76 | { |
77 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem ); |
|
77 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
98 | 98 | */ |
99 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
99 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
100 | 100 | { |
101 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem ); |
|
101 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
118 | 118 | */ |
119 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
119 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
120 | 120 | { |
121 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem ); |
|
121 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem); |
|
122 | 122 | } |
123 | 123 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object to be stored |
32 | 32 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
33 | 33 | */ |
34 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ); |
|
34 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
54 | 54 | * @return void |
55 | 55 | */ |
56 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
56 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
76 | 76 | * @return void |
77 | 77 | */ |
78 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
78 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
79 | 79 | |
80 | 80 | |
81 | 81 | /** |
@@ -93,5 +93,5 @@ discard block |
||
93 | 93 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
94 | 94 | * @return void |
95 | 95 | */ |
96 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
96 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
97 | 97 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
30 | 30 | * @return \Aimeos\Controller\Frontend\Common\Iface Controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/frontend/order/name |
35 | 35 | * Class name of the used order frontend controller implementation |
@@ -64,19 +64,19 @@ discard block |
||
64 | 64 | * @since 2014.03 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'controller/frontend/order/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('controller/frontend/order/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) { |
|
72 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Order\\' . $name : '<not a string>'; |
|
73 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
71 | + if (ctype_alnum($name) === false) { |
|
72 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Order\\' . $name : '<not a string>'; |
|
73 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $iface = '\\Aimeos\\Controller\\Frontend\\Order\\Iface'; |
77 | 77 | $classname = '\\Aimeos\\Controller\\Frontend\\Order\\' . $name; |
78 | 78 | |
79 | - $manager = self::createControllerBase( $context, $classname, $iface ); |
|
79 | + $manager = self::createControllerBase($context, $classname, $iface); |
|
80 | 80 | |
81 | 81 | /** controller/frontend/order/decorators/excludes |
82 | 82 | * Excludes decorators added by the "common" option from the order frontend controllers |
@@ -152,6 +152,6 @@ discard block |
||
152 | 152 | * @see controller/frontend/order/decorators/excludes |
153 | 153 | * @see controller/frontend/order/decorators/global |
154 | 154 | */ |
155 | - return self::addControllerDecorators( $context, $manager, 'order' ); |
|
155 | + return self::addControllerDecorators($context, $manager, 'order'); |
|
156 | 156 | } |
157 | 157 | } |
@@ -17,33 +17,33 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $context = \TestHelperFrontend::getContext(); |
20 | - $cntl = new \Aimeos\Controller\Frontend\Catalog\Standard( $context ); |
|
20 | + $cntl = new \Aimeos\Controller\Frontend\Catalog\Standard($context); |
|
21 | 21 | |
22 | - $this->object = new \Aimeos\Controller\Frontend\Common\Decorator\Example( $cntl, $context ); |
|
22 | + $this->object = new \Aimeos\Controller\Frontend\Common\Decorator\Example($cntl, $context); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCall() |
27 | 27 | { |
28 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager( 'product' ) ); |
|
28 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager('product')); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCallInvalid() |
33 | 33 | { |
34 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
34 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
35 | 35 | $this->object->invalidMethod(); |
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testGetContext() |
40 | 40 | { |
41 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $this->object->getContext() ); |
|
41 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $this->object->getContext()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testGetController() |
46 | 46 | { |
47 | - $this->assertInstanceOf( '\Aimeos\Controller\Frontend\Iface', $this->object->getController() ); |
|
47 | + $this->assertInstanceOf('\Aimeos\Controller\Frontend\Iface', $this->object->getController()); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param \Aimeos\MShop\Context\Item\Iface $context Common MShop context object |
30 | 30 | */ |
31 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
|
31 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) |
|
32 | 32 | { |
33 | 33 | $this->context = $context; |
34 | 34 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param array $param List of method parameter |
42 | 42 | * @return boolean Returns always false |
43 | 43 | */ |
44 | - public function __call( $name, array $param ) |
|
44 | + public function __call($name, array $param) |
|
45 | 45 | { |
46 | 46 | return false; |
47 | 47 | } |