Completed
Push — master ( 55dc5c...4aebe4 )
by Aimeos
06:03
created
client/html/src/Client/Html/Locale/Select/Language/Standard.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68 68
 	 * @return string HTML code
69 69
 	 */
70
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
70
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
71 71
 	{
72
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
72
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
73 73
 
74 74
 		$html = '';
75
-		foreach( $this->getSubClients() as $subclient ) {
76
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
75
+		foreach ($this->getSubClients() as $subclient) {
76
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
77 77
 		}
78 78
 		$view->languageBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/locale/select/language/standard/template-body';
101 101
 		$default = 'locale/select/language-body-default.php';
102 102
 
103
-		return $view->render( $view->config( $tplconf, $default ) );
103
+		return $view->render($view->config($tplconf, $default));
104 104
 	}
105 105
 
106 106
 
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113 113
 	 * @return string|null String including HTML tags for the header on error
114 114
 	 */
115
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
115
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
116 116
 	{
117
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
117
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
118 118
 
119 119
 		$html = '';
120
-		foreach( $this->getSubClients() as $subclient ) {
121
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
120
+		foreach ($this->getSubClients() as $subclient) {
121
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
122 122
 		}
123 123
 		$view->languageHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/locale/select/language/standard/template-header';
147 147
 		$default = 'locale/select/language-header-default.php';
148 148
 
149
-		return $view->render( $view->config( $tplconf, $default ) );
149
+		return $view->render($view->config($tplconf, $default));
150 150
 	}
151 151
 
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** client/html/locale/select/language/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the locale select language html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/locale/select/language/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'locale/select/language/' . $type, $name );
236
+		return $this->createSubClient('locale/select/language/'.$type, $name);
237 237
 	}
238 238
 
239 239
 
@@ -249,10 +249,10 @@  discard block
 block discarded – undo
249 249
 		$config = $context->getConfig();
250 250
 		$session = $context->getSession();
251 251
 
252
-		$name = $config->get( 'client/html/locale/select/language/param-name', 'loc_languageid' );
252
+		$name = $config->get('client/html/locale/select/language/param-name', 'loc_languageid');
253 253
 
254
-		if( ( $languageId = $view->param( $name ) ) !== null ) {
255
-			$session->set( 'aimeos/locale/languageid', $languageId );
254
+		if (($languageId = $view->param($name)) !== null) {
255
+			$session->set('aimeos/locale/languageid', $languageId);
256 256
 		}
257 257
 
258 258
 		parent::process();
@@ -266,6 +266,6 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	protected function getSubClientNames()
268 268
 	{
269
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
269
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
270 270
 	}
271 271
 }
Please login to merge, or discard this patch.
client/html/src/Client/Html/Factory.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,35 +29,35 @@
 block discarded – undo
29 29
 	 * @return \Aimeos\Client\Html\Iface HTML client implementing \Aimeos\Client\Html\Iface
30 30
 	 * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails
31 31
 	 */
32
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $type, $name = null )
32
+	public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $type, $name = null)
33 33
 	{
34
-		if( empty( $type ) ) {
35
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Client HTML type is empty' ) );
34
+		if (empty($type)) {
35
+			throw new \Aimeos\Client\Html\Exception(sprintf('Client HTML type is empty'));
36 36
 		}
37 37
 
38
-		$parts = explode( '/', $type );
38
+		$parts = explode('/', $type);
39 39
 
40
-		if( count( $parts ) !== 2 ) {
41
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Client type "%1$s" must consist of two parts separated by "/"', $type ) );
40
+		if (count($parts) !== 2) {
41
+			throw new \Aimeos\Client\Html\Exception(sprintf('Client type "%1$s" must consist of two parts separated by "/"', $type));
42 42
 		}
43 43
 
44
-		foreach( $parts as $part )
44
+		foreach ($parts as $part)
45 45
 		{
46
-			if( ctype_alnum( $part ) === false ) {
47
-				throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in client name "%1$s" in "%2$s"', $part, $type ) );
46
+			if (ctype_alnum($part) === false) {
47
+				throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in client name "%1$s" in "%2$s"', $part, $type));
48 48
 			}
49 49
 		}
50 50
 
51
-		$factory = '\\Aimeos\\Client\\Html\\' . ucwords( $parts[0] ) . '\\' . ucwords( $parts[1] ) . '\\Factory';
51
+		$factory = '\\Aimeos\\Client\\Html\\'.ucwords($parts[0]).'\\'.ucwords($parts[1]).'\\Factory';
52 52
 
53
-		if( class_exists( $factory ) === false ) {
54
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Class "%1$s" not available', $factory ) );
53
+		if (class_exists($factory) === false) {
54
+			throw new \Aimeos\Client\Html\Exception(sprintf('Class "%1$s" not available', $factory));
55 55
 		}
56 56
 
57
-		$client = @call_user_func_array( array( $factory, 'createClient' ), array( $context, $templatePaths, $name ) );
57
+		$client = @call_user_func_array(array($factory, 'createClient'), array($context, $templatePaths, $name));
58 58
 
59
-		if( $client === false ) {
60
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) );
59
+		if ($client === false) {
60
+			throw new \Aimeos\Client\Html\Exception(sprintf('Invalid factory "%1$s"', $factory));
61 61
 		}
62 62
 
63 63
 		return $client;
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Base.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$session = $this->getContext()->getSession();
30 30
 
31
-		foreach( $session->get( 'aimeos/basket/cache', array() ) as $key => $value ) {
32
-			$session->set( $key, null );
31
+		foreach ($session->get('aimeos/basket/cache', array()) as $key => $value) {
32
+			$session->set($key, null);
33 33
 		}
34 34
 	}
35 35
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * @return mixed Value associated to the requested key. If no value for the
43 43
 	 *	key is found in the cache, the given default value is returned
44 44
 	 */
45
-	protected function getBasketCached( $key, $default = null )
45
+	protected function getBasketCached($key, $default = null)
46 46
 	{
47
-		return $this->getContext()->getSession()->get( $key, $default );
47
+		return $this->getContext()->getSession()->get($key, $default);
48 48
 	}
49 49
 
50 50
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * @param string $key Path the cache entry should be stored in
55 55
 	 * @param mixed $value Value stored in the cache for the path
56 56
 	 */
57
-	protected function setBasketCached( $key, $value )
57
+	protected function setBasketCached($key, $value)
58 58
 	{
59 59
 		$context = $this->getContext();
60 60
 
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
 		 * @category Developer
73 73
 		 * @since 2014.11
74 74
 		 */
75
-		if( $context->getConfig()->get( 'client/html/basket/cache/enable', true ) != false )
75
+		if ($context->getConfig()->get('client/html/basket/cache/enable', true) != false)
76 76
 		{
77 77
 			$session = $context->getSession();
78 78
 
79
-			$cached = $session->get( 'aimeos/basket/cache', array() ) + array( $key => true );
80
-			$session->set( 'aimeos/basket/cache', $cached );
81
-			$session->set( $key, $value );
79
+			$cached = $session->get('aimeos/basket/cache', array()) + array($key => true);
80
+			$session->set('aimeos/basket/cache', $cached);
81
+			$session->set($key, $value);
82 82
 		}
83 83
 	}
84 84
 }
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Standard/Coupon/Standard.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68 68
 	 * @return string HTML code
69 69
 	 */
70
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
70
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
71 71
 	{
72
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
72
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
73 73
 
74 74
 		$html = '';
75
-		foreach( $this->getSubClients() as $subclient ) {
76
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
75
+		foreach ($this->getSubClients() as $subclient) {
76
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
77 77
 		}
78 78
 		$view->couponBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/basket/standard/coupon/standard/template-body';
101 101
 		$default = 'basket/standard/coupon-body-default.php';
102 102
 
103
-		return $view->render( $view->config( $tplconf, $default ) );
103
+		return $view->render($view->config($tplconf, $default));
104 104
 	}
105 105
 
106 106
 
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113 113
 	 * @return string|null String including HTML tags for the header on error
114 114
 	 */
115
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
115
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
116 116
 	{
117
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
117
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
118 118
 
119 119
 		$html = '';
120
-		foreach( $this->getSubClients() as $subclient ) {
121
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
120
+		foreach ($this->getSubClients() as $subclient) {
121
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
122 122
 		}
123 123
 		$view->couponHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/basket/standard/coupon/standard/template-header';
147 147
 		$default = 'basket/standard/coupon-header-default.php';
148 148
 
149
-		return $view->render( $view->config( $tplconf, $default ) );
149
+		return $view->render($view->config($tplconf, $default));
150 150
 	}
151 151
 
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** client/html/basket/standard/coupon/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the basket standard coupon html client
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @see client/html/basket/standard/coupon/decorators/excludes
233 233
 		 * @see client/html/basket/standard/coupon/decorators/global
234 234
 		 */
235
-		return $this->createSubClient( 'basket/standard/coupon/' . $type, $name );
235
+		return $this->createSubClient('basket/standard/coupon/'.$type, $name);
236 236
 	}
237 237
 
238 238
 
@@ -246,25 +246,25 @@  discard block
 block discarded – undo
246 246
 		$view = $this->getView();
247 247
 		$context = $this->getContext();
248 248
 
249
-		switch( $view->param( 'b_action' ) )
249
+		switch ($view->param('b_action'))
250 250
 		{
251 251
 			case 'coupon-delete':
252 252
 
253
-				if( ( $coupon = $view->param( 'b_coupon' ) ) != '' )
253
+				if (($coupon = $view->param('b_coupon')) != '')
254 254
 				{
255 255
 					$this->clearCached();
256
-					$cntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
257
-					$cntl->deleteCoupon( $coupon );
256
+					$cntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket');
257
+					$cntl->deleteCoupon($coupon);
258 258
 				}
259 259
 
260 260
 				break;
261 261
 
262 262
 			default:
263 263
 
264
-				if( ( $coupon = $view->param( 'b_coupon' ) ) != '' )
264
+				if (($coupon = $view->param('b_coupon')) != '')
265 265
 				{
266 266
 					$this->clearCached();
267
-					$cntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
267
+					$cntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket');
268 268
 
269 269
 					/** client/html/basket/standard/coupon/allowed
270 270
 					 * Number of coupon codes a customer is allowed to enter
@@ -282,13 +282,13 @@  discard block
 block discarded – undo
282 282
 					 * @category User
283 283
 					 * @category Developer
284 284
 					 */
285
-					$allowed = $context->getConfig()->get( 'client/html/basket/standard/coupon/allowed', 1 );
285
+					$allowed = $context->getConfig()->get('client/html/basket/standard/coupon/allowed', 1);
286 286
 
287
-					if( $allowed <= count( $cntl->get()->getCoupons() ) ) {
288
-						throw new \Aimeos\Client\Html\Exception( sprintf( 'Number of coupon codes exceeds the limit' ) );
287
+					if ($allowed <= count($cntl->get()->getCoupons())) {
288
+						throw new \Aimeos\Client\Html\Exception(sprintf('Number of coupon codes exceeds the limit'));
289 289
 					}
290 290
 
291
-					$cntl->addCoupon( $coupon );
291
+					$cntl->addCoupon($coupon);
292 292
 				}
293 293
 
294 294
 				break;
@@ -305,6 +305,6 @@  discard block
 block discarded – undo
305 305
 	 */
306 306
 	protected function getSubClientNames()
307 307
 	{
308
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
308
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
309 309
 	}
310 310
 }
311 311
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Standard/Detail/Standard.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69 69
 	 * @return string HTML code
70 70
 	 */
71
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
71
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
72 72
 	{
73
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
73
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
74 74
 
75 75
 		$html = '';
76
-		foreach( $this->getSubClients() as $subclient ) {
77
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
76
+		foreach ($this->getSubClients() as $subclient) {
77
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
78 78
 		}
79 79
 		$view->detailBody = $html;
80 80
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		$tplconf = 'client/html/basket/standard/detail/standard/template-body';
103 103
 		$default = 'common/summary/detail-body-default.php';
104 104
 
105
-		return $view->render( $view->config( $tplconf, $default ) );
105
+		return $view->render($view->config($tplconf, $default));
106 106
 	}
107 107
 
108 108
 
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115 115
 	 * @return string|null String including HTML tags for the header on error
116 116
 	 */
117
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
117
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
118 118
 	{
119
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
119
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
120 120
 
121 121
 		$html = '';
122
-		foreach( $this->getSubClients() as $subclient ) {
123
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
122
+		foreach ($this->getSubClients() as $subclient) {
123
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
124 124
 		}
125 125
 		$view->detailHeader = $html;
126 126
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		$tplconf = 'client/html/basket/standard/detail/standard/template-header';
150 150
 		$default = 'common/summary/detail-header-default.php';
151 151
 
152
-		return $view->render( $view->config( $tplconf, $default ) );
152
+		return $view->render($view->config($tplconf, $default));
153 153
 	}
154 154
 
155 155
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 * @param string|null $name Name of the sub-client (Default if null)
161 161
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
162 162
 	 */
163
-	public function getSubClient( $type, $name = null )
163
+	public function getSubClient($type, $name = null)
164 164
 	{
165 165
 		/** client/html/basket/standard/detail/decorators/excludes
166 166
 		 * Excludes decorators added by the "common" option from the basket standard detail html client
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		 * @see client/html/basket/standard/detail/decorators/excludes
236 236
 		 * @see client/html/basket/standard/detail/decorators/global
237 237
 		 */
238
-		return $this->createSubClient( 'basket/standard/detail/' . $type, $name );
238
+		return $this->createSubClient('basket/standard/detail/'.$type, $name);
239 239
 	}
240 240
 
241 241
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	protected function getSubClientNames()
248 248
 	{
249
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
249
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
250 250
 	}
251 251
 
252 252
 
@@ -258,23 +258,23 @@  discard block
 block discarded – undo
258 258
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
259 259
 	 * @return \Aimeos\MW\View\Iface Modified view object
260 260
 	 */
261
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
261
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
262 262
 	{
263
-		$view = parent::setViewParams( $view );
263
+		$view = parent::setViewParams($view);
264 264
 
265
-		if( !isset( $this->cache ) )
265
+		if (!isset($this->cache))
266 266
 		{
267 267
 			$basket = $view->standardBasket;
268 268
 
269
-			$target = $view->config( 'client/html/checkout/standard/url/target' );
270
-			$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
271
-			$action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
272
-			$config = $view->config( 'client/html/checkout/standard/url/config', array() );
269
+			$target = $view->config('client/html/checkout/standard/url/target');
270
+			$cntl = $view->config('client/html/checkout/standard/url/controller', 'checkout');
271
+			$action = $view->config('client/html/checkout/standard/url/action', 'index');
272
+			$config = $view->config('client/html/checkout/standard/url/config', array());
273 273
 
274
-			$view->summaryParams = $view->get( 'standardParams', array() );
275
-			$view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config );
276
-			$view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config );
277
-			$view->summaryTaxRates = $this->getTaxRates( $basket );
274
+			$view->summaryParams = $view->get('standardParams', array());
275
+			$view->summaryUrlServicePayment = $view->url($target, $cntl, $action, array('c_step' => 'payment'), array(), $config);
276
+			$view->summaryUrlServiceDelivery = $view->url($target, $cntl, $action, array('c_step' => 'delivery'), array(), $config);
277
+			$view->summaryTaxRates = $this->getTaxRates($basket);
278 278
 			$view->summaryEnableModify = true;
279 279
 			$view->summaryBasket = $basket;
280 280
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Standard/Factory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface
32 32
 	 * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails
33 33
 	 */
34
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null )
34
+	public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null)
35 35
 	{
36 36
 		/** client/html/basket/standard/name
37 37
 		 * Class name of the used basket standard client implementation
@@ -66,22 +66,22 @@  discard block
 block discarded – undo
66 66
 		 * @since 2014.03
67 67
 		 * @category Developer
68 68
 		 */
69
-		if( $name === null ) {
70
-			$name = $context->getConfig()->get( 'client/html/basket/standard/name', 'Standard' );
69
+		if ($name === null) {
70
+			$name = $context->getConfig()->get('client/html/basket/standard/name', 'Standard');
71 71
 		}
72 72
 
73
-		if( ctype_alnum( $name ) === false )
73
+		if (ctype_alnum($name) === false)
74 74
 		{
75
-			$classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Basket\\Standard\\' . $name : '<not a string>';
76
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
75
+			$classname = is_string($name) ? '\\Aimeos\\Client\\Html\\Basket\\Standard\\'.$name : '<not a string>';
76
+			throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
77 77
 		}
78 78
 
79 79
 		$iface = '\\Aimeos\\Client\\Html\\Iface';
80
-		$classname = '\\Aimeos\\Client\\Html\\Basket\\Standard\\' . $name;
80
+		$classname = '\\Aimeos\\Client\\Html\\Basket\\Standard\\'.$name;
81 81
 
82
-		$client = self::createClientBase( $context, $classname, $iface, $templatePaths );
82
+		$client = self::createClientBase($context, $classname, $iface, $templatePaths);
83 83
 
84
-		return self::addClientDecorators( $context, $client, $templatePaths, 'basket/standard' );
84
+		return self::addClientDecorators($context, $client, $templatePaths, 'basket/standard');
85 85
 	}
86 86
 }
87 87
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Related/Bought/Standard.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68 68
 	 * @return string HTML code
69 69
 	 */
70
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
70
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
71 71
 	{
72
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
72
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
73 73
 
74 74
 		$html = '';
75
-		foreach( $this->getSubClients() as $subclient ) {
76
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
75
+		foreach ($this->getSubClients() as $subclient) {
76
+			$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
77 77
 		}
78 78
 		$view->boughtBody = $html;
79 79
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$tplconf = 'client/html/basket/related/bought/standard/template-body';
101 101
 		$default = 'basket/related/bought-body-default.php';
102 102
 
103
-		return $view->render( $view->config( $tplconf, $default ) );
103
+		return $view->render($view->config($tplconf, $default));
104 104
 	}
105 105
 
106 106
 
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113 113
 	 * @return string|null String including HTML tags for the header on error
114 114
 	 */
115
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
115
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
116 116
 	{
117
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
117
+		$view = $this->setViewParams($this->getView(), $tags, $expire);
118 118
 
119 119
 		$html = '';
120
-		foreach( $this->getSubClients() as $subclient ) {
121
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
120
+		foreach ($this->getSubClients() as $subclient) {
121
+			$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
122 122
 		}
123 123
 		$view->boughtHeader = $html;
124 124
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$tplconf = 'client/html/basket/related/bought/standard/template-header';
147 147
 		$default = 'basket/related/bought-header-default.php';
148 148
 
149
-		return $view->render( $view->config( $tplconf, $default ) );
149
+		return $view->render($view->config($tplconf, $default));
150 150
 	}
151 151
 
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param string|null $name Name of the sub-client (Default if null)
158 158
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
159 159
 	 */
160
-	public function getSubClient( $type, $name = null )
160
+	public function getSubClient($type, $name = null)
161 161
 	{
162 162
 		/** client/html/basket/related/bought/decorators/excludes
163 163
 		 * Excludes decorators added by the "common" option from the basket related bought html client
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		 * @see client/html/basket/related/bought/decorators/global
234 234
 		 */
235 235
 
236
-		return $this->createSubClient( 'basket/related/bought/' . $type, $name );
236
+		return $this->createSubClient('basket/related/bought/'.$type, $name);
237 237
 	}
238 238
 
239 239
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	protected function getSubClientNames()
246 246
 	{
247
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
247
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
248 248
 	}
249 249
 
250 250
 
@@ -256,31 +256,31 @@  discard block
 block discarded – undo
256 256
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
257 257
 	 * @return \Aimeos\MW\View\Iface Modified view object
258 258
 	 */
259
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
259
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
260 260
 	{
261
-		if( !isset( $this->cache ) )
261
+		if (!isset($this->cache))
262 262
 		{
263
-			if( isset( $view->relatedBasket ) )
263
+			if (isset($view->relatedBasket))
264 264
 			{
265 265
 				$refIds = $items = array();
266 266
 				$context = $this->getContext();
267 267
 
268
-				$prodIds = $this->getProductIdsFromBasket( $view->relatedBasket );
268
+				$prodIds = $this->getProductIdsFromBasket($view->relatedBasket);
269 269
 
270
-				foreach( $this->getListItems( $prodIds ) as $listItem )
270
+				foreach ($this->getListItems($prodIds) as $listItem)
271 271
 				{
272 272
 					$refId = $listItem->getRefId();
273 273
 
274
-					if( !isset( $prodIds[$refId] ) ) {
274
+					if (!isset($prodIds[$refId])) {
275 275
 						$refIds[$refId] = $refId;
276 276
 					}
277 277
 				}
278 278
 
279
-				$products = $this->getProductItems( $refIds );
279
+				$products = $this->getProductItems($refIds);
280 280
 
281
-				foreach( $refIds as $id )
281
+				foreach ($refIds as $id)
282 282
 				{
283
-					if( isset( $products[$id] ) ) {
283
+					if (isset($products[$id])) {
284 284
 						$items[$id] = $products[$id];
285 285
 					}
286 286
 				}
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
 				 * @param integer Number of products
301 301
 				 * @since 2014.09
302 302
 				 */
303
-				$size = $context->getConfig()->get( 'client/html/basket/related/bought/standard/limit', 6 );
303
+				$size = $context->getConfig()->get('client/html/basket/related/bought/standard/limit', 6);
304 304
 
305 305
 
306
-				$view->boughtItems = array_slice( $items, 0, $size, true );
306
+				$view->boughtItems = array_slice($items, 0, $size, true);
307 307
 			}
308 308
 
309 309
 			$this->cache = $view;
@@ -319,22 +319,22 @@  discard block
 block discarded – undo
319 319
 	 * @param string[] $prodIds List of product IDs
320 320
 	 * @return \Aimeos\MShop\Product\Item\Lists\Iface[] List of product list items
321 321
 	 */
322
-	protected function getListItems( array $prodIds )
322
+	protected function getListItems(array $prodIds)
323 323
 	{
324
-		$typeItem = $this->getTypeItem( 'product/lists/type', 'product', 'bought-together' );
325
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/lists' );
324
+		$typeItem = $this->getTypeItem('product/lists/type', 'product', 'bought-together');
325
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/lists');
326 326
 
327
-		$search = $manager->createSearch( true );
327
+		$search = $manager->createSearch(true);
328 328
 		$expr = array(
329
-				$search->compare( '==', 'product.lists.parentid', $prodIds ),
330
-				$search->compare( '==', 'product.lists.typeid', $typeItem->getId() ),
331
-				$search->compare( '==', 'product.lists.domain', 'product' ),
329
+				$search->compare('==', 'product.lists.parentid', $prodIds),
330
+				$search->compare('==', 'product.lists.typeid', $typeItem->getId()),
331
+				$search->compare('==', 'product.lists.domain', 'product'),
332 332
 				$search->getConditions(),
333 333
 		);
334
-		$search->setConditions( $search->combine( '&&', $expr ) );
335
-		$search->setSortations( array( $search->sort( '+', 'product.lists.position' ) ) );
334
+		$search->setConditions($search->combine('&&', $expr));
335
+		$search->setSortations(array($search->sort('+', 'product.lists.position')));
336 336
 
337
-		return $manager->searchItems( $search );
337
+		return $manager->searchItems($search);
338 338
 	}
339 339
 
340 340
 
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
 	 * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object
345 345
 	 * @return string[] List of product IDs
346 346
 	 */
347
-	protected function getProductIdsFromBasket( \Aimeos\MShop\Order\Item\Base\Iface $basket )
347
+	protected function getProductIdsFromBasket(\Aimeos\MShop\Order\Item\Base\Iface $basket)
348 348
 	{
349 349
 		$list = array();
350 350
 
351
-		foreach( $basket->getProducts() as $orderProduct )
351
+		foreach ($basket->getProducts() as $orderProduct)
352 352
 		{
353
-			$list[ $orderProduct->getProductId() ] = true;
353
+			$list[$orderProduct->getProductId()] = true;
354 354
 
355
-			foreach( $orderProduct->getProducts() as $subProduct ) {
356
-				$list[ $subProduct->getProductId() ] = true;
355
+			foreach ($orderProduct->getProducts() as $subProduct) {
356
+				$list[$subProduct->getProductId()] = true;
357 357
 			}
358 358
 		}
359 359
 
360
-		return array_keys( $list );
360
+		return array_keys($list);
361 361
 	}
362 362
 
363 363
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 	 * @param string[] $ids List of product IDs
368 368
 	 * @return \Aimeos\MShop\Product\Item\Iface[] List of product items
369 369
 	 */
370
-	protected function getProductItems( array $ids )
370
+	protected function getProductItems(array $ids)
371 371
 	{
372 372
 		$context = $this->getContext();
373 373
 		$config = $context->getConfig();
@@ -387,11 +387,11 @@  discard block
 block discarded – undo
387 387
 		 * @since 2014.09
388 388
 		 * @category Developer
389 389
 		 */
390
-		$domains = array( 'text', 'price', 'media' );
391
-		$domains = $config->get( 'client/html/basket/related/bought/standard/domains', $domains );
390
+		$domains = array('text', 'price', 'media');
391
+		$domains = $config->get('client/html/basket/related/bought/standard/domains', $domains);
392 392
 
393
-		$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
393
+		$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
394 394
 
395
-		return $controller->getProductItems( $ids, $domains );
395
+		return $controller->getProductItems($ids, $domains);
396 396
 	}
397 397
 }
398 398
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Related/Factory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface
31 31
 	 * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails
32 32
 	 */
33
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null )
33
+	public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null)
34 34
 	{
35 35
 		/** client/html/basket/related/name
36 36
 		 * Class name of the used basket related client implementation
@@ -65,22 +65,22 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.03
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'client/html/basket/related/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('client/html/basket/related/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Basket\\Related\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Client\\Html\\Basket\\Related\\'.$name : '<not a string>';
75
+			throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Client\\Html\\Iface';
79
-		$classname = '\\Aimeos\\Client\\Html\\Basket\\Related\\' . $name;
79
+		$classname = '\\Aimeos\\Client\\Html\\Basket\\Related\\'.$name;
80 80
 
81
-		$client = self::createClientBase( $context, $classname, $iface, $templatePaths );
81
+		$client = self::createClientBase($context, $classname, $iface, $templatePaths);
82 82
 
83
-		return self::addClientDecorators( $context, $client, $templatePaths, 'basket/related' );
83
+		return self::addClientDecorators($context, $client, $templatePaths, 'basket/related');
84 84
 	}
85 85
 }
86 86
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Basket/Related/Standard.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 * @since 2014.09
67 67
 	 * @category Developer
68 68
 	 */
69
-	private $subPartNames = array( 'bought' );
69
+	private $subPartNames = array('bought');
70 70
 	private $cache;
71 71
 
72 72
 
@@ -78,42 +78,42 @@  discard block
 block discarded – undo
78 78
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
79 79
 	 * @return string HTML code
80 80
 	 */
81
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
81
+	public function getBody($uid = '', array &$tags = array(), &$expire = null)
82 82
 	{
83 83
 		$context = $this->getContext();
84 84
 		$view = $this->getView();
85 85
 
86 86
 		try
87 87
 		{
88
-			$view = $this->setViewParams( $view, $tags, $expire );
88
+			$view = $this->setViewParams($view, $tags, $expire);
89 89
 
90 90
 			$html = '';
91
-			foreach( $this->getSubClients() as $subclient ) {
92
-				$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
91
+			foreach ($this->getSubClients() as $subclient) {
92
+				$html .= $subclient->setView($view)->getBody($uid, $tags, $expire);
93 93
 			}
94 94
 			$view->relatedBody = $html;
95 95
 		}
96
-		catch( \Aimeos\Client\Html\Exception $e )
96
+		catch (\Aimeos\Client\Html\Exception $e)
97 97
 		{
98
-			$error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) );
99
-			$view->relatedErrorList = $view->get( 'relatedErrorList', array() ) + $error;
98
+			$error = array($this->getContext()->getI18n()->dt('client', $e->getMessage()));
99
+			$view->relatedErrorList = $view->get('relatedErrorList', array()) + $error;
100 100
 		}
101
-		catch( \Aimeos\Controller\Frontend\Exception $e )
101
+		catch (\Aimeos\Controller\Frontend\Exception $e)
102 102
 		{
103
-			$error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
104
-			$view->relatedErrorList = $view->get( 'relatedErrorList', array() ) + $error;
103
+			$error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage()));
104
+			$view->relatedErrorList = $view->get('relatedErrorList', array()) + $error;
105 105
 		}
106
-		catch( \Aimeos\MShop\Exception $e )
106
+		catch (\Aimeos\MShop\Exception $e)
107 107
 		{
108
-			$error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
109
-			$view->relatedErrorList = $view->get( 'relatedErrorList', array() ) + $error;
108
+			$error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
109
+			$view->relatedErrorList = $view->get('relatedErrorList', array()) + $error;
110 110
 		}
111
-		catch( \Exception $e )
111
+		catch (\Exception $e)
112 112
 		{
113
-			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
113
+			$context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
114 114
 
115
-			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
116
-			$view->relatedErrorList = $view->get( 'relatedErrorList', array() ) + $error;
115
+			$error = array($context->getI18n()->dt('client', 'A non-recoverable error occured'));
116
+			$view->relatedErrorList = $view->get('relatedErrorList', array()) + $error;
117 117
 		}
118 118
 
119 119
 		/** client/html/basket/related/standard/template-body
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		$tplconf = 'client/html/basket/related/standard/template-body';
140 140
 		$default = 'basket/related/body-default.php';
141 141
 
142
-		return $view->render( $view->config( $tplconf, $default ) );
142
+		return $view->render($view->config($tplconf, $default));
143 143
 	}
144 144
 
145 145
 
@@ -151,21 +151,21 @@  discard block
 block discarded – undo
151 151
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
152 152
 	 * @return string|null String including HTML tags for the header on error
153 153
 	 */
154
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
154
+	public function getHeader($uid = '', array &$tags = array(), &$expire = null)
155 155
 	{
156 156
 		try
157 157
 		{
158
-			$view = $this->setViewParams( $this->getView(), $tags, $expire );
158
+			$view = $this->setViewParams($this->getView(), $tags, $expire);
159 159
 
160 160
 			$html = '';
161
-			foreach( $this->getSubClients() as $subclient ) {
162
-				$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
161
+			foreach ($this->getSubClients() as $subclient) {
162
+				$html .= $subclient->setView($view)->getHeader($uid, $tags, $expire);
163 163
 			}
164 164
 			$view->relatedHeader = $html;
165 165
 		}
166
-		catch( \Exception $e )
166
+		catch (\Exception $e)
167 167
 		{
168
-			$this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
168
+			$this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString());
169 169
 			return '';
170 170
 		}
171 171
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$tplconf = 'client/html/basket/related/standard/template-header';
194 194
 		$default = 'basket/related/header-default.php';
195 195
 
196
-		return $view->render( $view->config( $tplconf, $default ) );
196
+		return $view->render($view->config($tplconf, $default));
197 197
 	}
198 198
 
199 199
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 * @param string|null $name Name of the sub-client (Default if null)
205 205
 	 * @return \Aimeos\Client\Html\Iface Sub-client object
206 206
 	 */
207
-	public function getSubClient( $type, $name = null )
207
+	public function getSubClient($type, $name = null)
208 208
 	{
209 209
 		/** client/html/basket/related/decorators/excludes
210 210
 		 * Excludes decorators added by the "common" option from the basket related html client
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		 * @see client/html/basket/related/decorators/global
281 281
 		 */
282 282
 
283
-		return $this->createSubClient( 'basket/related/' . $type, $name );
283
+		return $this->createSubClient('basket/related/'.$type, $name);
284 284
 	}
285 285
 
286 286
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	 */
292 292
 	protected function getSubClientNames()
293 293
 	{
294
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
294
+		return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames);
295 295
 	}
296 296
 
297 297
 
@@ -303,13 +303,13 @@  discard block
 block discarded – undo
303 303
 	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
304 304
 	 * @return \Aimeos\MW\View\Iface Modified view object
305 305
 	 */
306
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
306
+	protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
307 307
 	{
308
-		if( !isset( $this->cache ) )
308
+		if (!isset($this->cache))
309 309
 		{
310 310
 			$context = $this->getContext();
311 311
 
312
-			$view->relatedBasket = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' )->get();
312
+			$view->relatedBasket = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket')->get();
313 313
 
314 314
 			$this->cache = $view;
315 315
 		}
Please login to merge, or discard this patch.