@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Supplier\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Supplier\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Supplier\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -14,31 +14,31 @@ |
||
14 | 14 | { |
15 | 15 | $target = '\\Aimeos\\Controller\\Frontend\\Catalog\\Iface'; |
16 | 16 | |
17 | - $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext() ); |
|
18 | - $this->assertInstanceOf( $target, $controller ); |
|
17 | + $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext()); |
|
18 | + $this->assertInstanceOf($target, $controller); |
|
19 | 19 | |
20 | - $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
21 | - $this->assertInstanceOf( $target, $controller ); |
|
20 | + $controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
21 | + $this->assertInstanceOf($target, $controller); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | 25 | public function testCreateControllerInvalidImplementation() |
26 | 26 | { |
27 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
28 | - \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
27 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
28 | + \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCreateControllerInvalidName() |
33 | 33 | { |
34 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
35 | - \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
34 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
35 | + \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testCreateControllerNotExisting() |
40 | 40 | { |
41 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
42 | - \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
41 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
42 | + \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
43 | 43 | } |
44 | 44 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Attribute\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -14,31 +14,31 @@ |
||
14 | 14 | { |
15 | 15 | $target = '\\Aimeos\\Controller\\Frontend\\Basket\\Iface'; |
16 | 16 | |
17 | - $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext() ); |
|
18 | - $this->assertInstanceOf( $target, $controller ); |
|
17 | + $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext()); |
|
18 | + $this->assertInstanceOf($target, $controller); |
|
19 | 19 | |
20 | - $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
21 | - $this->assertInstanceOf( $target, $controller ); |
|
20 | + $controller = \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
21 | + $this->assertInstanceOf($target, $controller); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | 25 | public function testCreateControllerInvalidImplementation() |
26 | 26 | { |
27 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
28 | - \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
27 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
28 | + \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testCreateControllerInvalidName() |
33 | 33 | { |
34 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
35 | - \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
34 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
35 | + \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testCreateControllerNotExisting() |
40 | 40 | { |
41 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
42 | - \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
41 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
42 | + \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
43 | 43 | } |
44 | 44 | } |
@@ -18,31 +18,31 @@ |
||
18 | 18 | { |
19 | 19 | $context = \TestHelperFrontend::getContext(); |
20 | 20 | |
21 | - $this->object = $this->getMockBuilder( \Aimeos\Controller\Frontend\Base::class ) |
|
22 | - ->setConstructorArgs( [$context] ) |
|
21 | + $this->object = $this->getMockBuilder(\Aimeos\Controller\Frontend\Base::class) |
|
22 | + ->setConstructorArgs([$context]) |
|
23 | 23 | ->getMockForAbstractClass(); |
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() |
28 | 28 | { |
29 | - unset( $this->object ); |
|
29 | + unset($this->object); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testGetContext() |
34 | 34 | { |
35 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
35 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
36 | 36 | |
37 | - $this->assertInstanceOf( \Aimeos\MShop\Context\Item\Iface::class, $result ); |
|
37 | + $this->assertInstanceOf(\Aimeos\MShop\Context\Item\Iface::class, $result); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | - protected function access( $name ) |
|
41 | + protected function access($name) |
|
42 | 42 | { |
43 | - $class = new \ReflectionClass( \Aimeos\Controller\Frontend\Base::class ); |
|
44 | - $method = $class->getMethod( $name ); |
|
45 | - $method->setAccessible( true ); |
|
43 | + $class = new \ReflectionClass(\Aimeos\Controller\Frontend\Base::class); |
|
44 | + $method = $class->getMethod($name); |
|
45 | + $method->setAccessible(true); |
|
46 | 46 | |
47 | 47 | return $method; |
48 | 48 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
31 | 31 | * @since 2017.03 |
32 | 32 | */ |
33 | - public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds ); |
|
33 | + public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds); |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
44 | 44 | * @since 2017.03 |
45 | 45 | */ |
46 | - public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catIds, $listtype = 'default', |
|
47 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
|
46 | + public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catIds, $listtype = 'default', |
|
47 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE); |
|
48 | 48 | |
49 | 49 | |
50 | 50 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
57 | 57 | * @since 2018.07 |
58 | 58 | */ |
59 | - public function addFilterSupplier( \Aimeos\MW\Criteria\Iface $filter, $supIds, $listtype = 'default' ); |
|
59 | + public function addFilterSupplier(\Aimeos\MW\Criteria\Iface $filter, $supIds, $listtype = 'default'); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
68 | 68 | * @since 2017.03 |
69 | 69 | */ |
70 | - public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input ); |
|
70 | + public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input); |
|
71 | 71 | |
72 | 72 | |
73 | 73 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return array Associative list of key values as key and the product count for this key as value |
79 | 79 | * @since 2017.03 |
80 | 80 | */ |
81 | - public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key ); |
|
81 | + public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key); |
|
82 | 82 | |
83 | 83 | |
84 | 84 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
92 | 92 | * @since 2017.03 |
93 | 93 | */ |
94 | - public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100 ); |
|
94 | + public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100); |
|
95 | 95 | |
96 | 96 | |
97 | 97 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
103 | 103 | * @since 2017.03 |
104 | 104 | */ |
105 | - public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) ); |
|
105 | + public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text')); |
|
106 | 106 | |
107 | 107 | |
108 | 108 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values |
114 | 114 | * @since 2017.03 |
115 | 115 | */ |
116 | - public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) ); |
|
116 | + public function getItems(array $productIds, array $domains = array('media', 'price', 'text')); |
|
117 | 117 | |
118 | 118 | |
119 | 119 | /** |
@@ -125,5 +125,5 @@ discard block |
||
125 | 125 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
126 | 126 | * @since 2017.03 |
127 | 127 | */ |
128 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ); |
|
128 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null); |
|
129 | 129 | } |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Frontend\\Product\\Iface', $controller ); |
|
35 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Frontend\\Product\\Iface', $controller); |
|
36 | 36 | |
37 | 37 | $this->controller = $controller; |
38 | 38 | |
39 | - parent::__construct( $context ); |
|
39 | + parent::__construct($context); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | * @return mixed Returns the value of the called method |
49 | 49 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
50 | 50 | */ |
51 | - public function __call( $name, array $param ) |
|
51 | + public function __call($name, array $param) |
|
52 | 52 | { |
53 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
53 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
65 | 65 | * @since 2017.03 |
66 | 66 | */ |
67 | - public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds ) |
|
67 | + public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds) |
|
68 | 68 | { |
69 | - return $this->controller->addFilterAttribute( $filter, $attrIds, $optIds, $oneIds ); |
|
69 | + return $this->controller->addFilterAttribute($filter, $attrIds, $optIds, $oneIds); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
81 | 81 | * @since 2017.03 |
82 | 82 | */ |
83 | - public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catIds, $listtype = 'default', |
|
84 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ) |
|
83 | + public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catIds, $listtype = 'default', |
|
84 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE) |
|
85 | 85 | { |
86 | - return $this->controller->addFilterCategory( $filter, $catIds, $listtype, $level ); |
|
86 | + return $this->controller->addFilterCategory($filter, $catIds, $listtype, $level); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
97 | 97 | * @since 2018.07 |
98 | 98 | */ |
99 | - public function addFilterSupplier( \Aimeos\MW\Criteria\Iface $filter, $supIds, $listtype = 'default' ) |
|
99 | + public function addFilterSupplier(\Aimeos\MW\Criteria\Iface $filter, $supIds, $listtype = 'default') |
|
100 | 100 | { |
101 | - return $this->controller->addFilterSupplier( $filter, $supIds, $listtype ); |
|
101 | + return $this->controller->addFilterSupplier($filter, $supIds, $listtype); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
111 | 111 | * @since 2017.03 |
112 | 112 | */ |
113 | - public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input ) |
|
113 | + public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input) |
|
114 | 114 | { |
115 | - return $this->controller->addFilterText( $filter, $input ); |
|
115 | + return $this->controller->addFilterText($filter, $input); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | * @return array Associative list of key values as key and the product count for this key as value |
125 | 125 | * @since 2015.08 |
126 | 126 | */ |
127 | - public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key ) |
|
127 | + public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key) |
|
128 | 128 | { |
129 | - return $this->controller->aggregate( $filter, $key ); |
|
129 | + return $this->controller->aggregate($filter, $key); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
141 | 141 | * @since 2015.08 |
142 | 142 | */ |
143 | - public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100 ) |
|
143 | + public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100) |
|
144 | 144 | { |
145 | - return $this->controller->createFilter( $sort, $direction, $start, $size ); |
|
145 | + return $this->controller->createFilter($sort, $direction, $start, $size); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
155 | 155 | * @since 2017.03 |
156 | 156 | */ |
157 | - public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) ) |
|
157 | + public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text')) |
|
158 | 158 | { |
159 | - return $this->controller->getItem( $productId, $domains ); |
|
159 | + return $this->controller->getItem($productId, $domains); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values |
169 | 169 | * @since 2017.03 |
170 | 170 | */ |
171 | - public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) ) |
|
171 | + public function getItems(array $productIds, array $domains = array('media', 'price', 'text')) |
|
172 | 172 | { |
173 | - return $this->controller->getItems( $productIds, $domains ); |
|
173 | + return $this->controller->getItems($productIds, $domains); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
184 | 184 | * @since 2015.08 |
185 | 185 | */ |
186 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
186 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
187 | 187 | { |
188 | - return $this->controller->searchItems( $filter, $domains, $total ); |
|
188 | + return $this->controller->searchItems($filter, $domains, $total); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | * @return \Aimeos\Controller\Frontend\Iface New frontend controller |
27 | 27 | * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found |
28 | 28 | */ |
29 | - static public function createController( \Aimeos\MShop\Context\Item\Iface $context, $path ) |
|
29 | + static public function createController(\Aimeos\MShop\Context\Item\Iface $context, $path) |
|
30 | 30 | { |
31 | - return self::create( $context, $path ); |
|
31 | + return self::create($context, $path); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | * @param boolean $value True to enable caching, false to disable it. |
39 | 39 | * @return boolean Previous cache setting |
40 | 40 | */ |
41 | - static public function setCache( $value ) |
|
41 | + static public function setCache($value) |
|
42 | 42 | { |
43 | - return self::cache( $value ); |
|
43 | + return self::cache($value); |
|
44 | 44 | } |
45 | 45 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param boolean $value True to enable caching, false to disable it. |
28 | 28 | * @return boolean Previous cache setting |
29 | 29 | */ |
30 | - static public function cache( $value ) |
|
30 | + static public function cache($value) |
|
31 | 31 | { |
32 | 32 | $old = self::$cache; |
33 | 33 | self::$cache = (boolean) $value; |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | * @param integer $id Context ID the objects have been created with (string of \Aimeos\MShop\Context\Item\Iface) |
45 | 45 | * @param string $path Path describing the controller to clear, e.g. "basket" |
46 | 46 | */ |
47 | - static public function clear( $id = null, $path = null ) |
|
47 | + static public function clear($id = null, $path = null) |
|
48 | 48 | { |
49 | - if( $id !== null ) |
|
49 | + if ($id !== null) |
|
50 | 50 | { |
51 | - if( $path !== null ) { |
|
51 | + if ($path !== null) { |
|
52 | 52 | self::$controllers[$id][$path] = null; |
53 | 53 | } else { |
54 | 54 | self::$controllers[$id] = []; |
@@ -76,37 +76,37 @@ discard block |
||
76 | 76 | * @return \Aimeos\Controller\Frontend\Iface New frontend controller |
77 | 77 | * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found |
78 | 78 | */ |
79 | - static public function create( \Aimeos\MShop\Context\Item\Iface $context, $path ) |
|
79 | + static public function create(\Aimeos\MShop\Context\Item\Iface $context, $path) |
|
80 | 80 | { |
81 | - if( empty( $path ) ) { |
|
82 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Controller path is empty' ) ); |
|
81 | + if (empty($path)) { |
|
82 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Controller path is empty')); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $id = (string) $context; |
86 | 86 | |
87 | - if( self::$cache === false || !isset( self::$controllers[$id][$path] ) ) |
|
87 | + if (self::$cache === false || !isset(self::$controllers[$id][$path])) |
|
88 | 88 | { |
89 | - $parts = explode( '/', $path ); |
|
89 | + $parts = explode('/', $path); |
|
90 | 90 | |
91 | - foreach( $parts as $key => $part ) |
|
91 | + foreach ($parts as $key => $part) |
|
92 | 92 | { |
93 | - if( ctype_alnum( $part ) === false ) { |
|
94 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in controller name "%1$s" in "%2$s"', $part, $path ) ); |
|
93 | + if (ctype_alnum($part) === false) { |
|
94 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in controller name "%1$s" in "%2$s"', $part, $path)); |
|
95 | 95 | } |
96 | 96 | |
97 | - $parts[$key] = ucwords( $part ); |
|
97 | + $parts[$key] = ucwords($part); |
|
98 | 98 | } |
99 | 99 | |
100 | - $factory = '\\Aimeos\\Controller\\Frontend\\' . join( '\\', $parts ) . '\\Factory'; |
|
100 | + $factory = '\\Aimeos\\Controller\\Frontend\\' . join('\\', $parts) . '\\Factory'; |
|
101 | 101 | |
102 | - if( class_exists( $factory ) === false ) { |
|
103 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $factory ) ); |
|
102 | + if (class_exists($factory) === false) { |
|
103 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $factory)); |
|
104 | 104 | } |
105 | 105 | |
106 | - $manager = call_user_func_array( array( $factory, 'createController' ), array( $context ) ); |
|
106 | + $manager = call_user_func_array(array($factory, 'createController'), array($context)); |
|
107 | 107 | |
108 | - if( $manager === false ) { |
|
109 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) ); |
|
108 | + if ($manager === false) { |
|
109 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid factory "%1$s"', $factory)); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | self::$controllers[$id][$path] = $manager; |