Completed
Push — master ( 8086a8...921503 )
by Aimeos
01:52
created
controller/frontend/src/Controller/Frontend/Supplier/Decorator/Base.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
 	/**
119 119
 	 * Returns the frontend controller
120 120
 	 *
121
-	 * @return \Aimeos\Controller\Frontend\Supplier\Iface Frontend controller object
121
+	 * @return \Aimeos\Controller\Frontend\Iface Frontend controller object
122 122
 	 */
123 123
 	protected function getController()
124 124
 	{
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
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\\Supplier\\Iface', $controller );
35
+		\Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Frontend\\Supplier\\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
 block discarded – undo
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
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 * @return \Aimeos\MShop\Supplier\Item\Iface Supplier item including the referenced domains items
76 76
 	 * @since 2018.07
77 77
 	 */
78
-	public function getItem( $id, array $domains = array( 'media', 'text' ) )
78
+	public function getItem($id, array $domains = array('media', 'text'))
79 79
 	{
80
-		return $this->controller->getItem( $id, $domains );
80
+		return $this->controller->getItem($id, $domains);
81 81
 	}
82 82
 
83 83
 
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	 * @return \Aimeos\MShop\Supplier\Item\Iface[] Associative list of supplier item including the referenced domains items
90 90
 	 * @since 2018.07
91 91
 	 */
92
-	public function getItems( array $ids, array $domains = array( 'media', 'text' ) )
92
+	public function getItems(array $ids, array $domains = array('media', 'text'))
93 93
 	{
94
-		return $this->controller->getItems( $ids, $domains );
94
+		return $this->controller->getItems($ids, $domains);
95 95
 	}
96 96
 
97 97
 
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 	 * @return array Ordered list of supplier items implementing \Aimeos\MShop\Supplier\Item\Iface
105 105
 	 * @since 2018.07
106 106
 	 */
107
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'text' ), &$total = null )
107
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'text'), &$total = null)
108 108
 	{
109
-		return $this->controller->searchItems( $filter, $domains, $total );
109
+		return $this->controller->searchItems($filter, $domains, $total);
110 110
 	}
111 111
 
112 112
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Supplier/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @return \Aimeos\MShop\Supplier\Item\Iface Supplier item including the referenced domains items
37 37
 	 * @since 2018.07
38 38
 	 */
39
-	public function getItem( $id, array $domains = array( 'media', 'text' ) );
39
+	public function getItem($id, array $domains = array('media', 'text'));
40 40
 
41 41
 
42 42
 	/**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * @return \Aimeos\MShop\Supplier\Item\Iface[] Associative list of supplier item including the referenced domains items
48 48
 	 * @since 2018.07
49 49
 	 */
50
-	public function getItems( array $ids, array $domains = array( 'media', 'text' ) );
50
+	public function getItems(array $ids, array $domains = array('media', 'text'));
51 51
 
52 52
 
53 53
 	/**
@@ -59,5 +59,5 @@  discard block
 block discarded – undo
59 59
 	 * @return array Ordered list of supplier items implementing \Aimeos\MShop\Supplier\Item\Iface
60 60
 	 * @since 2018.07
61 61
 	 */
62
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'text' ), &$total = null );
62
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'text'), &$total = null);
63 63
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/BaseTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,31 +18,31 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Subscription/Standard.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	 * @param string $id Unique subscription ID
28 28
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Canceled subscription item
29 29
 	 */
30
-	public function cancel( $id )
30
+	public function cancel($id)
31 31
 	{
32
-		$item = $this->getItem( $id );
33
-		$item->setDateEnd( $item->getDateNext() );
34
-		$item->setReason( \Aimeos\MShop\Subscription\Item\Iface::REASON_CANCEL );
32
+		$item = $this->getItem($id);
33
+		$item->setDateEnd($item->getDateNext());
34
+		$item->setReason(\Aimeos\MShop\Subscription\Item\Iface::REASON_CANCEL);
35 35
 
36
-		return $this->saveItem( $item );
36
+		return $this->saveItem($item);
37 37
 	}
38 38
 
39 39
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function createFilter()
46 46
 	{
47
-		return \Aimeos\MShop::create( $this->getContext(), 'subscription' )->createSearch();
47
+		return \Aimeos\MShop::create($this->getContext(), 'subscription')->createSearch();
48 48
 	}
49 49
 
50 50
 
@@ -54,25 +54,25 @@  discard block
 block discarded – undo
54 54
 	 * @param string $id Unique subscription ID
55 55
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Subscription object
56 56
 	 */
57
-	public function getItem( $id )
57
+	public function getItem($id)
58 58
 	{
59 59
 		$context = $this->getContext();
60
-		$manager = \Aimeos\MShop::create( $context, 'subscription' );
60
+		$manager = \Aimeos\MShop::create($context, 'subscription');
61 61
 
62 62
 		$filter = $manager->createSearch();
63 63
 		$expr = [
64
-			$filter->compare( '==', 'subscription.id', $id ),
65
-			$filter->compare( '==', 'order.base.customerid', $context->getUserId() ),
64
+			$filter->compare('==', 'subscription.id', $id),
65
+			$filter->compare('==', 'order.base.customerid', $context->getUserId()),
66 66
 			$filter->getConditions(),
67 67
 		];
68
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
68
+		$filter->setConditions($filter->combine('&&', $expr));
69 69
 
70
-		$items = $this->searchItems( $filter );
70
+		$items = $this->searchItems($filter);
71 71
 
72
-		if( ( $item = reset( $items ) ) === false )
72
+		if (($item = reset($items)) === false)
73 73
 		{
74 74
 			$msg = 'Invalid subscription ID "%1$s" for customer ID "%2$s"';
75
-			throw new \Aimeos\Controller\Frontend\Subscription\Exception( sprintf( $msg, $id, $context->getUserId() ) );
75
+			throw new \Aimeos\Controller\Frontend\Subscription\Exception(sprintf($msg, $id, $context->getUserId()));
76 76
 		}
77 77
 
78 78
 		return $item;
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
 	public function getIntervals()
88 88
 	{
89 89
 		$intervals = [];
90
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'attribute' );
90
+		$manager = \Aimeos\MShop::create($this->getContext(), 'attribute');
91 91
 
92
-		$search = $manager->createSearch( true );
92
+		$search = $manager->createSearch(true);
93 93
 		$expr = array(
94 94
 			$search->getConditions(),
95
-			$search->compare( '==', 'attribute.domain', 'product' ),
96
-			$search->compare( '==', 'attribute.type', 'interval' ),
95
+			$search->compare('==', 'attribute.domain', 'product'),
96
+			$search->compare('==', 'attribute.type', 'interval'),
97 97
 		);
98
-		$search->setConditions( $search->combine( '&&', $expr ) );
99
-		$search->setSlice( 0, 0x7fffffff );
98
+		$search->setConditions($search->combine('&&', $expr));
99
+		$search->setSlice(0, 0x7fffffff);
100 100
 
101
-		foreach( $manager->searchItems( $search, ['text'] ) as $attrItem ) {
101
+		foreach ($manager->searchItems($search, ['text']) as $attrItem) {
102 102
 			$intervals[$attrItem->getCode()] = $attrItem;
103 103
 		}
104 104
 
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 	 * @param \Aimeos\MShop\Subscription\Item\Iface $item Subscription object
112 112
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Saved subscription item
113 113
 	 */
114
-	public function saveItem( \Aimeos\MShop\Subscription\Item\Iface $item )
114
+	public function saveItem(\Aimeos\MShop\Subscription\Item\Iface $item)
115 115
 	{
116
-		return \Aimeos\MShop::create( $this->getContext(), 'subscription' )->saveItem( $item );
116
+		return \Aimeos\MShop::create($this->getContext(), 'subscription')->saveItem($item);
117 117
 	}
118 118
 
119 119
 
@@ -124,17 +124,17 @@  discard block
 block discarded – undo
124 124
 	 * @param integer &$total|null Variable that will contain the total number of available items
125 125
 	 * @return \Aimeos\MShop\Subscription\Item\Iface[] Associative list of IDs as keys and subscription objects as values
126 126
 	 */
127
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
127
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
128 128
 	{
129 129
 		$context = $this->getContext();
130
-		$manager = \Aimeos\MShop::create( $context, 'subscription' );
130
+		$manager = \Aimeos\MShop::create($context, 'subscription');
131 131
 
132 132
 		$expr = [
133
-			$filter->compare( '==', 'order.base.customerid', $context->getUserId() ),
133
+			$filter->compare('==', 'order.base.customerid', $context->getUserId()),
134 134
 			$filter->getConditions(),
135 135
 		];
136
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
136
+		$filter->setConditions($filter->combine('&&', $expr));
137 137
 
138
-		return $manager->searchItems( $filter, [], $total );
138
+		return $manager->searchItems($filter, [], $total);
139 139
 	}
140 140
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Service/Standard.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 	 * @param string[] $attributes List of attribute codes as keys and strings entered by the customer as value
36 36
 	 * @return string[] List of attributes codes as keys and error messages as values for invalid or missing values
37 37
 	 */
38
-	public function checkAttributes( $serviceId, array $attributes )
38
+	public function checkAttributes($serviceId, array $attributes)
39 39
 	{
40
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'service' );
40
+		$manager = \Aimeos\MShop::create($this->getContext(), 'service');
41 41
 
42
-		$item = $manager->getItem( $serviceId, [], true );
43
-		$provider = $manager->getProvider( $item, $item->getType() );
42
+		$item = $manager->getItem($serviceId, [], true);
43
+		$provider = $manager->getProvider($item, $item->getType());
44 44
 
45
-		return array_filter( $provider->checkConfigFE( $attributes ) );
45
+		return array_filter($provider->checkConfigFE($attributes));
46 46
 	}
47 47
 
48 48
 
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	 * @param string[] $ref List of domain names whose items should be fetched too
54 54
 	 * @return \Aimeos\MShop\Service\Provider\Iface Service provider object
55 55
 	 */
56
-	public function getProvider( $serviceId, $ref = ['media', 'price', 'text'] )
56
+	public function getProvider($serviceId, $ref = ['media', 'price', 'text'])
57 57
 	{
58
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'service' );
59
-		$item = $manager->getItem( $serviceId, $ref, true );
58
+		$manager = \Aimeos\MShop::create($this->getContext(), 'service');
59
+		$item = $manager->getItem($serviceId, $ref, true);
60 60
 
61
-		return $manager->getProvider( $item, $item->getType() );
61
+		return $manager->getProvider($item, $item->getType());
62 62
 	}
63 63
 
64 64
 
@@ -69,25 +69,25 @@  discard block
 block discarded – undo
69 69
 	 * @param string[] $ref List of domain names whose items should be fetched too
70 70
 	 * @return \Aimeos\MShop\Service\Provider\Iface[] List of service IDs as keys and service provider objects as values
71 71
 	 */
72
-	public function getProviders( $type = null, $ref = ['media', 'price', 'text'] )
72
+	public function getProviders($type = null, $ref = ['media', 'price', 'text'])
73 73
 	{
74 74
 		$list = [];
75
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'service' );
75
+		$manager = \Aimeos\MShop::create($this->getContext(), 'service');
76 76
 
77
-		$search = $manager->createSearch( true );
78
-		$search->setSortations( [$search->sort( '+', 'service.position' )] );
77
+		$search = $manager->createSearch(true);
78
+		$search->setSortations([$search->sort('+', 'service.position')]);
79 79
 
80
-		if( $type != null )
80
+		if ($type != null)
81 81
 		{
82 82
 			$expr = array(
83 83
 				$search->getConditions(),
84
-				$search->compare( '==', 'service.type', $type ),
84
+				$search->compare('==', 'service.type', $type),
85 85
 			);
86
-			$search->setConditions( $search->combine( '&&', $expr ) );
86
+			$search->setConditions($search->combine('&&', $expr));
87 87
 		}
88 88
 
89
-		foreach( $manager->searchItems( $search, $ref ) as $id => $item ) {
90
-			$list[$id] = $manager->getProvider( $item, $item->getType() );
89
+		foreach ($manager->searchItems($search, $ref) as $id => $item) {
90
+			$list[$id] = $manager->getProvider($item, $item->getType());
91 91
 		}
92 92
 
93 93
 		return $list;
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 	 * @return \Aimeos\MShop\Common\Item\Helper\Form\Iface|null Form object with URL, parameters, etc.
106 106
 	 * 	or null if no form data is required
107 107
 	 */
108
-	public function process( \Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params )
108
+	public function process(\Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params)
109 109
 	{
110
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'service' );
111
-		$item = $manager->getItem( $serviceId, [], true );
110
+		$manager = \Aimeos\MShop::create($this->getContext(), 'service');
111
+		$item = $manager->getItem($serviceId, [], true);
112 112
 
113
-		$provider = $manager->getProvider( $item, $item->getType() );
114
-		$provider->injectGlobalConfigBE( $urls );
113
+		$provider = $manager->getProvider($item, $item->getType());
114
+		$provider->injectGlobalConfigBE($urls);
115 115
 
116
-		return $provider->process( $orderItem, $params );
116
+		return $provider->process($orderItem, $params);
117 117
 	}
118 118
 
119 119
 
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
 	 * @param string $code Unique code of the service used for the current order
126 126
 	 * @return \Psr\Http\Message\ResponseInterface Response object
127 127
 	 */
128
-	public function updatePush( ServerRequestInterface $request, ResponseInterface $response, $code )
128
+	public function updatePush(ServerRequestInterface $request, ResponseInterface $response, $code)
129 129
 	{
130
-		$manager = \Aimeos\MShop::create( $this->getContext(), 'service' );
131
-		$item = $manager->findItem( $code );
130
+		$manager = \Aimeos\MShop::create($this->getContext(), 'service');
131
+		$item = $manager->findItem($code);
132 132
 
133
-		$provider = $manager->getProvider( $item, $item->getType() );
133
+		$provider = $manager->getProvider($item, $item->getType());
134 134
 
135
-		return $provider->updatePush( $request, $response );
135
+		return $provider->updatePush($request, $response);
136 136
 	}
137 137
 
138 138
 
@@ -144,24 +144,24 @@  discard block
 block discarded – undo
144 144
 	 * @param string $orderid ID of the order whose payment status should be updated
145 145
 	 * @return \Aimeos\MShop\Order\Item\Iface $orderItem Order item that has been updated
146 146
 	 */
147
-	public function updateSync( ServerRequestInterface $request, $code, $orderid )
147
+	public function updateSync(ServerRequestInterface $request, $code, $orderid)
148 148
 	{
149 149
 		$context = $this->getContext();
150
-		$orderManager = \Aimeos\MShop::create( $context, 'order' );
151
-		$serviceManager = \Aimeos\MShop::create( $context, 'service' );
150
+		$orderManager = \Aimeos\MShop::create($context, 'order');
151
+		$serviceManager = \Aimeos\MShop::create($context, 'service');
152 152
 
153
-		$orderItem = $orderManager->getItem( $orderid );
154
-		$serviceItem = $serviceManager->findItem( $code );
153
+		$orderItem = $orderManager->getItem($orderid);
154
+		$serviceItem = $serviceManager->findItem($code);
155 155
 
156
-		$provider = $serviceManager->getProvider( $serviceItem, $serviceItem->getType() );
156
+		$provider = $serviceManager->getProvider($serviceItem, $serviceItem->getType());
157 157
 
158 158
 
159
-		if( ( $orderItem = $provider->updateSync( $request, $orderItem ) ) !== null )
159
+		if (($orderItem = $provider->updateSync($request, $orderItem)) !== null)
160 160
 		{
161
-			if( $orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED
162
-				&& $provider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY )
161
+			if ($orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED
162
+				&& $provider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY)
163 163
 			) {
164
-				$provider->query( $orderItem );
164
+				$provider->query($orderItem);
165 165
 			}
166 166
 		}
167 167
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Locale/Standard.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	public function createFilter()
32 32
 	{
33 33
 		$context = $this->getContext();
34
-		$filter = \Aimeos\MShop::create( $context, 'locale' )->createSearch( true );
34
+		$filter = \Aimeos\MShop::create($context, 'locale')->createSearch(true);
35 35
 
36 36
 		$expr = array(
37
-			$filter->compare( '==', 'locale.siteid', $context->getLocale()->getSitePath() ),
37
+			$filter->compare('==', 'locale.siteid', $context->getLocale()->getSitePath()),
38 38
 			$filter->getConditions(),
39 39
 		);
40 40
 
41
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
42
-		$filter->setSortations( array( $filter->sort( '+', 'locale.position' ) ) );
41
+		$filter->setConditions($filter->combine('&&', $expr));
42
+		$filter->setSortations(array($filter->sort('+', 'locale.position')));
43 43
 
44 44
 		return $filter;
45 45
 	}
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item including the referenced domains items
54 54
 	 * @since 2017.03
55 55
 	 */
56
-	public function getItem( $id, array $domains = [] )
56
+	public function getItem($id, array $domains = [])
57 57
 	{
58
-		return \Aimeos\MShop::create( $this->getContext(), 'locale' )->getItem( $id, $domains, true );
58
+		return \Aimeos\MShop::create($this->getContext(), 'locale')->getItem($id, $domains, true);
59 59
 	}
60 60
 
61 61
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 * @return array Ordered list of locale items implementing \Aimeos\MShop\Locale\Item\Iface
69 69
 	 * @since 2017.03
70 70
 	 */
71
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = [], &$total = null )
71
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = [], &$total = null)
72 72
 	{
73
-		return \Aimeos\MShop::create( $this->getContext(), 'locale' )->searchItems( $filter, $domains, $total );
73
+		return \Aimeos\MShop::create($this->getContext(), 'locale')->searchItems($filter, $domains, $total);
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Basket/Decorator/Category.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,27 +36,27 @@
 block discarded – undo
36 36
 	 * @param string $stocktype Unique code of the stock type to deliver the products from
37 37
 	 * @throws \Aimeos\Controller\Frontend\Basket\Exception If the product isn't available
38 38
 	 */
39
-	public function addProduct( $prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [],
40
-		array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = [] )
39
+	public function addProduct($prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [],
40
+		array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = [])
41 41
 	{
42 42
 		$context = $this->getContext();
43
-		$catalogListManager = \Aimeos\MShop::create( $context, 'catalog/lists' );
43
+		$catalogListManager = \Aimeos\MShop::create($context, 'catalog/lists');
44 44
 
45
-		$search = $catalogListManager->createSearch( true );
45
+		$search = $catalogListManager->createSearch(true);
46 46
 		$expr = array(
47
-			$search->compare( '==', 'catalog.lists.domain', 'product' ),
48
-			$search->compare( '==', 'catalog.lists.refid', $prodid ),
47
+			$search->compare('==', 'catalog.lists.domain', 'product'),
48
+			$search->compare('==', 'catalog.lists.refid', $prodid),
49 49
 			$search->getConditions()
50 50
 		);
51
-		$search->setConditions( $search->combine( '&&', $expr ) );
52
-		$search->setSlice( 0, 1 );
51
+		$search->setConditions($search->combine('&&', $expr));
52
+		$search->setSlice(0, 1);
53 53
 
54
-		$result = $catalogListManager->searchItems( $search );
54
+		$result = $catalogListManager->searchItems($search);
55 55
 
56
-		if( reset( $result ) === false )
56
+		if (reset($result) === false)
57 57
 		{
58
-			$msg = $context->getI18n()->dt( 'controller/frontend', 'Adding product with ID "%1$s" is not allowed' );
59
-			throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( $msg, $prodid ) );
58
+			$msg = $context->getI18n()->dt('controller/frontend', 'Adding product with ID "%1$s" is not allowed');
59
+			throw new \Aimeos\Controller\Frontend\Basket\Exception(sprintf($msg, $prodid));
60 60
 		}
61 61
 
62 62
 		$this->getController()->addProduct(
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Basket/Decorator/Bundle.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 	 * @param string $stocktype Unique code of the stock type to deliver the products from
37 37
 	 * @throws \Aimeos\Controller\Frontend\Basket\Exception If the product isn't available
38 38
 	 */
39
-	public function addProduct( $prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [],
40
-		array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = [] )
39
+	public function addProduct($prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [],
40
+		array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = [])
41 41
 	{
42 42
 		$context = $this->getContext();
43
-		$productManager = \Aimeos\MShop::create( $context, 'product' );
43
+		$productManager = \Aimeos\MShop::create($context, 'product');
44 44
 
45
-		if( $productManager->getItem( $prodid, [], true )->getType() !== 'bundle' )
45
+		if ($productManager->getItem($prodid, [], true)->getType() !== 'bundle')
46 46
 		{
47 47
 			return $this->getController()->addProduct(
48 48
 				$prodid, $quantity, $stocktype, $variantAttributeIds,
@@ -51,29 +51,29 @@  discard block
 block discarded – undo
51 51
 		}
52 52
 
53 53
 		$attributeMap = [
54
-			'custom' => array_keys( $customAttributeValues ),
55
-			'config' => array_keys( $configAttributeIds ),
54
+			'custom' => array_keys($customAttributeValues),
55
+			'config' => array_keys($configAttributeIds),
56 56
 		];
57
-		$this->checkListRef( $prodid, 'attribute', $attributeMap );
57
+		$this->checkListRef($prodid, 'attribute', $attributeMap);
58 58
 
59 59
 
60
-		$productItem = $productManager->getItem( $prodid, ['attribute', 'media', 'supplier', 'price', 'product', 'text'], true );
61
-		$prices = $productItem->getRefItems( 'price', 'default', 'default' );
62
-		$hidden = $productItem->getRefItems( 'attribute', null, 'hidden' );
60
+		$productItem = $productManager->getItem($prodid, ['attribute', 'media', 'supplier', 'price', 'product', 'text'], true);
61
+		$prices = $productItem->getRefItems('price', 'default', 'default');
62
+		$hidden = $productItem->getRefItems('attribute', null, 'hidden');
63 63
 
64
-		$orderBaseProductItem = \Aimeos\MShop::create( $context, 'order/base/product' )->createItem();
65
-		$orderBaseProductItem->copyFrom( $productItem )->setQuantity( $quantity )->setStockType( $stocktype );
64
+		$orderBaseProductItem = \Aimeos\MShop::create($context, 'order/base/product')->createItem();
65
+		$orderBaseProductItem->copyFrom($productItem)->setQuantity($quantity)->setStockType($stocktype);
66 66
 
67
-		$this->addBundleProducts( $orderBaseProductItem, $productItem, $variantAttributeIds, $stocktype );
67
+		$this->addBundleProducts($orderBaseProductItem, $productItem, $variantAttributeIds, $stocktype);
68 68
 
69
-		$custAttr = $this->getOrderProductAttributes( 'custom', array_keys( $customAttributeValues ), $customAttributeValues );
70
-		$confAttr = $this->getOrderProductAttributes( 'config', array_keys( $configAttributeIds ), [], $configAttributeIds );
71
-		$attr = array_merge( $custAttr, $confAttr, $this->getOrderProductAttributes( 'hidden', array_keys( $hidden ) ) );
69
+		$custAttr = $this->getOrderProductAttributes('custom', array_keys($customAttributeValues), $customAttributeValues);
70
+		$confAttr = $this->getOrderProductAttributes('config', array_keys($configAttributeIds), [], $configAttributeIds);
71
+		$attr = array_merge($custAttr, $confAttr, $this->getOrderProductAttributes('hidden', array_keys($hidden)));
72 72
 
73
-		$orderBaseProductItem->setAttributeItems( $attr );
74
-		$orderBaseProductItem->setPrice( $this->calcPrice( $orderBaseProductItem, $prices, $quantity ) );
73
+		$orderBaseProductItem->setAttributeItems($attr);
74
+		$orderBaseProductItem->setPrice($this->calcPrice($orderBaseProductItem, $prices, $quantity));
75 75
 
76
-		$this->getController()->get()->addProduct( $orderBaseProductItem );
76
+		$this->getController()->get()->addProduct($orderBaseProductItem);
77 77
 		$this->getController()->save();
78 78
 	}
79 79
 
@@ -86,43 +86,43 @@  discard block
 block discarded – undo
86 86
 	 * @param array $variantAttributeIds List of product variant attribute IDs
87 87
 	 * @param string $stocktype
88 88
 	 */
89
-	protected function addBundleProducts( \Aimeos\MShop\Order\Item\Base\Product\Iface $orderBaseProductItem,
90
-		\Aimeos\MShop\Product\Item\Iface $productItem, array $variantAttributeIds, $stocktype )
89
+	protected function addBundleProducts(\Aimeos\MShop\Order\Item\Base\Product\Iface $orderBaseProductItem,
90
+		\Aimeos\MShop\Product\Item\Iface $productItem, array $variantAttributeIds, $stocktype)
91 91
 	{
92 92
 		$quantity = $orderBaseProductItem->getQuantity();
93 93
 		$products = $subProductIds = $orderProducts = [];
94
-		$orderProductManager = \Aimeos\MShop::create( $this->getContext(), 'order/base/product' );
94
+		$orderProductManager = \Aimeos\MShop::create($this->getContext(), 'order/base/product');
95 95
 
96
-		foreach( $productItem->getRefItems( 'product', null, 'default' ) as $item ) {
96
+		foreach ($productItem->getRefItems('product', null, 'default') as $item) {
97 97
 			$subProductIds[] = $item->getId();
98 98
 		}
99 99
 
100
-		if( count( $subProductIds ) > 0 )
100
+		if (count($subProductIds) > 0)
101 101
 		{
102
-			$productManager = \Aimeos\MShop::create( $this->getContext(), 'product' );
102
+			$productManager = \Aimeos\MShop::create($this->getContext(), 'product');
103 103
 
104
-			$search = $productManager->createSearch( true );
104
+			$search = $productManager->createSearch(true);
105 105
 			$expr = array(
106
-				$search->compare( '==', 'product.id', $subProductIds ),
106
+				$search->compare('==', 'product.id', $subProductIds),
107 107
 				$search->getConditions(),
108 108
 			);
109
-			$search->setConditions( $search->combine( '&&', $expr ) );
109
+			$search->setConditions($search->combine('&&', $expr));
110 110
 
111
-			$products = $productManager->searchItems( $search, array( 'attribute', 'media', 'price', 'text' ) );
111
+			$products = $productManager->searchItems($search, array('attribute', 'media', 'price', 'text'));
112 112
 		}
113 113
 
114
-		foreach( $products as $product )
114
+		foreach ($products as $product)
115 115
 		{
116
-			$prices = $product->getRefItems( 'price', 'default', 'default' );
116
+			$prices = $product->getRefItems('price', 'default', 'default');
117 117
 
118 118
 			$orderProduct = $orderProductManager->createItem();
119
-			$orderProduct->copyFrom( $product );
120
-			$orderProduct->setStockType( $stocktype );
121
-			$orderProduct->setPrice( $this->calcPrice( $orderProduct, $prices, $quantity ) );
119
+			$orderProduct->copyFrom($product);
120
+			$orderProduct->setStockType($stocktype);
121
+			$orderProduct->setPrice($this->calcPrice($orderProduct, $prices, $quantity));
122 122
 
123 123
 			$orderProducts[] = $orderProduct;
124 124
 		}
125 125
 
126
-		$orderBaseProductItem->setProducts( $orderProducts );
126
+		$orderBaseProductItem->setProducts($orderProducts);
127 127
 	}
128 128
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Catalog/Standard.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function createFilter()
32 32
 	{
33
-		return \Aimeos\MShop::create( $this->getContext(), 'catalog' )->createSearch( true );
33
+		return \Aimeos\MShop::create($this->getContext(), 'catalog')->createSearch(true);
34 34
 	}
35 35
 
36 36
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys
43 43
 	 * @since 2017.03
44 44
 	 */
45
-	public function getPath( $id, array $domains = array( 'text', 'media' ) )
45
+	public function getPath($id, array $domains = array('text', 'media'))
46 46
 	{
47
-		return \Aimeos\MShop::create( $this->getContext(), 'catalog' )->getPath( $id, $domains );
47
+		return \Aimeos\MShop::create($this->getContext(), 'catalog')->getPath($id, $domains);
48 48
 	}
49 49
 
50 50
 
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 	 * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant
60 60
 	 * @since 2017.03
61 61
 	 */
62
-	public function getTree( $id = null, array $domains = array( 'text', 'media' ),
63
-		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null )
62
+	public function getTree($id = null, array $domains = array('text', 'media'),
63
+		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null)
64 64
 	{
65
-		return \Aimeos\MShop::create( $this->getContext(), 'catalog' )->getTree( $id, $domains, $level, $search );
65
+		return \Aimeos\MShop::create($this->getContext(), 'catalog')->getTree($id, $domains, $level, $search);
66 66
 	}
67 67
 }
Please login to merge, or discard this patch.