Completed
Push — master ( 36c1ed...275037 )
by Aimeos
01:49
created
controller/frontend/src/Controller/Frontend/Catalog/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys
38 38
 	 * @since 2017.03
39 39
 	 */
40
-	public function getPath( $id, array $domains = array( 'text', 'media' ) );
40
+	public function getPath($id, array $domains = array('text', 'media'));
41 41
 
42 42
 
43 43
 	/**
@@ -51,6 +51,6 @@  discard block
 block discarded – undo
51 51
 	 * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant
52 52
 	 * @since 2017.03
53 53
 	 */
54
-	public function getTree( $id = null, array $domains = array( 'text', 'media' ),
55
-		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null );
54
+	public function getTree($id = null, array $domains = array('text', 'media'),
55
+		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null);
56 56
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Basket/Decorator/Select.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -121,10 +121,11 @@  discard block
 block discarded – undo
121 121
 		{
122 122
 			$msg = $context->getI18n()->dt( 'controller/frontend', 'No unique article found for selected attributes and product ID "%1$s"' );
123 123
 			throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( $msg, $productItem->getId() ) );
124
-		}
125
-		else if( ( $result = reset( $productItems ) ) !== false ) // count == 1
124
+		} else if( ( $result = reset( $productItems ) ) !== false ) {
125
+			// count == 1
126 126
 		{
127 127
 			$productItem = $result;
128
+		}
128 129
 			$orderBaseProductItem->setProductCode( $productItem->getCode() );
129 130
 
130 131
 			$subprices = $productItem->getRefItems( 'price', 'default', 'default' );
@@ -150,10 +151,11 @@  discard block
 block discarded – undo
150 151
 
151 152
 				$attr[] = $orderAttributeItem;
152 153
 			}
153
-		}
154
-		else if( $requireVariant != false ) // count == 0
154
+		} else if( $requireVariant != false ) {
155
+			// count == 0
155 156
 		{
156 157
 			$msg = $context->getI18n()->dt( 'controller/frontend', 'No article found for selected attributes and product ID "%1$s"' );
158
+		}
157 159
 			throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( $msg, $productItem->getId() ) );
158 160
 		}
159 161
 
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -36,14 +36,14 @@  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' );
44
-		$productItem = $productManager->getItem( $prodid, [], true );
43
+		$productManager = \Aimeos\MShop::create($context, 'product');
44
+		$productItem = $productManager->getItem($prodid, [], true);
45 45
 
46
-		if( $productManager->getItem( $prodid, [], true )->getType() !== 'select' )
46
+		if ($productManager->getItem($prodid, [], true)->getType() !== 'select')
47 47
 		{
48 48
 			return $this->getController()->addProduct(
49 49
 				$prodid, $quantity, $stocktype, $variantAttributeIds,
@@ -51,30 +51,30 @@  discard block
 block discarded – undo
51 51
 			);
52 52
 		}
53 53
 
54
-		$productItem = $productManager->getItem( $prodid, ['attribute', 'media', 'supplier', 'price', 'product', 'text'], true );
55
-		$prices = $productItem->getRefItems( 'price', 'default', 'default' );
56
-		$hidden = $productItem->getRefItems( 'attribute', null, 'hidden' );
54
+		$productItem = $productManager->getItem($prodid, ['attribute', 'media', 'supplier', 'price', 'product', 'text'], true);
55
+		$prices = $productItem->getRefItems('price', 'default', 'default');
56
+		$hidden = $productItem->getRefItems('attribute', null, 'hidden');
57 57
 
58
-		$orderBaseProductItem = \Aimeos\MShop::create( $context, 'order/base/product' )->createItem();
59
-		$orderBaseProductItem->copyFrom( $productItem )->setQuantity( $quantity )->setStockType( $stocktype );
58
+		$orderBaseProductItem = \Aimeos\MShop::create($context, 'order/base/product')->createItem();
59
+		$orderBaseProductItem->copyFrom($productItem)->setQuantity($quantity)->setStockType($stocktype);
60 60
 
61
-		$attr = $this->getVariantDetails( $orderBaseProductItem, $productItem, $prices, $variantAttributeIds );
62
-		$hidden += $productItem->getRefItems( 'attribute', null, 'hidden' );
61
+		$attr = $this->getVariantDetails($orderBaseProductItem, $productItem, $prices, $variantAttributeIds);
62
+		$hidden += $productItem->getRefItems('attribute', null, 'hidden');
63 63
 
64 64
 		$attributeMap = [
65
-			'custom' => array_keys( $customAttributeValues ),
66
-			'config' => array_keys( $configAttributeIds ),
65
+			'custom' => array_keys($customAttributeValues),
66
+			'config' => array_keys($configAttributeIds),
67 67
 		];
68
-		$this->checkListRef( array( $prodid, $productItem->getId() ), 'attribute', $attributeMap );
68
+		$this->checkListRef(array($prodid, $productItem->getId()), 'attribute', $attributeMap);
69 69
 
70
-		$custAttr = $this->getOrderProductAttributes( 'custom', array_keys( $customAttributeValues ), $customAttributeValues );
71
-		$confAttr = $this->getOrderProductAttributes( 'config', array_keys( $configAttributeIds ), [], $configAttributeIds );
72
-		$attr = array_merge( $attr, $custAttr, $confAttr, $this->getOrderProductAttributes( 'hidden', array_keys( $hidden ) ) );
70
+		$custAttr = $this->getOrderProductAttributes('custom', array_keys($customAttributeValues), $customAttributeValues);
71
+		$confAttr = $this->getOrderProductAttributes('config', array_keys($configAttributeIds), [], $configAttributeIds);
72
+		$attr = array_merge($attr, $custAttr, $confAttr, $this->getOrderProductAttributes('hidden', array_keys($hidden)));
73 73
 
74
-		$orderBaseProductItem->setAttributeItems( $attr );
75
-		$orderBaseProductItem->setPrice( $this->calcPrice( $orderBaseProductItem, $prices, $quantity ) );
74
+		$orderBaseProductItem->setAttributeItems($attr);
75
+		$orderBaseProductItem->setPrice($this->calcPrice($orderBaseProductItem, $prices, $quantity));
76 76
 
77
-		$this->getController()->get()->addProduct( $orderBaseProductItem );
77
+		$this->getController()->get()->addProduct($orderBaseProductItem);
78 78
 		$this->getController()->save();
79 79
 	}
80 80
 
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 	 * @return \Aimeos\MShop\Order\Item\Base\Product\Attribute\Iface[] List of order product attributes
90 90
 	 * @throws \Aimeos\Controller\Frontend\Basket\Exception If no product variant is found
91 91
 	 */
92
-	protected function getVariantDetails( \Aimeos\MShop\Order\Item\Base\Product\Iface $orderBaseProductItem,
93
-		\Aimeos\MShop\Product\Item\Iface &$productItem, array &$prices, array $variantAttributeIds )
92
+	protected function getVariantDetails(\Aimeos\MShop\Order\Item\Base\Product\Iface $orderBaseProductItem,
93
+		\Aimeos\MShop\Product\Item\Iface &$productItem, array &$prices, array $variantAttributeIds)
94 94
 	{
95 95
 		$attr = [];
96 96
 		$context = $this->getContext();
97
-		$productItems = $this->getProductVariants( $productItem, $variantAttributeIds );
97
+		$productItems = $this->getProductVariants($productItem, $variantAttributeIds);
98 98
 
99 99
 		/** controller/frontend/basket/require-variant
100 100
 		 * A variant of a selection product must be chosen
@@ -115,47 +115,47 @@  discard block
 block discarded – undo
115 115
 		 * @category Developer
116 116
 		 * @category User
117 117
 		 */
118
-		$requireVariant = $context->getConfig()->get( 'controller/frontend/basket/require-variant', true );
118
+		$requireVariant = $context->getConfig()->get('controller/frontend/basket/require-variant', true);
119 119
 
120 120
 
121
-		if( count( $productItems ) > 1 )
121
+		if (count($productItems) > 1)
122 122
 		{
123
-			$msg = $context->getI18n()->dt( 'controller/frontend', 'No unique article found for selected attributes and product ID "%1$s"' );
124
-			throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( $msg, $productItem->getId() ) );
123
+			$msg = $context->getI18n()->dt('controller/frontend', 'No unique article found for selected attributes and product ID "%1$s"');
124
+			throw new \Aimeos\Controller\Frontend\Basket\Exception(sprintf($msg, $productItem->getId()));
125 125
 		}
126
-		else if( ( $result = reset( $productItems ) ) !== false ) // count == 1
126
+		else if (($result = reset($productItems)) !== false) // count == 1
127 127
 		{
128 128
 			$productItem = $result;
129
-			$orderBaseProductItem->setProductCode( $productItem->getCode() );
129
+			$orderBaseProductItem->setProductCode($productItem->getCode());
130 130
 
131
-			$subprices = $productItem->getRefItems( 'price', 'default', 'default' );
131
+			$subprices = $productItem->getRefItems('price', 'default', 'default');
132 132
 
133
-			if( !empty( $subprices ) ) {
133
+			if (!empty($subprices)) {
134 134
 				$prices = $subprices;
135 135
 			}
136 136
 
137
-			$submedia = $productItem->getRefItems( 'media', 'default', 'default' );
137
+			$submedia = $productItem->getRefItems('media', 'default', 'default');
138 138
 
139
-			if( ( $mediaItem = reset( $submedia ) ) !== false ) {
140
-				$orderBaseProductItem->setMediaUrl( $mediaItem->getPreview() );
139
+			if (($mediaItem = reset($submedia)) !== false) {
140
+				$orderBaseProductItem->setMediaUrl($mediaItem->getPreview());
141 141
 			}
142 142
 
143
-			$orderProductAttrManager = \Aimeos\MShop::create( $this->getContext(), 'order/base/product/attribute' );
144
-			$variantAttributes = $productItem->getRefItems( 'attribute', null, 'variant' );
143
+			$orderProductAttrManager = \Aimeos\MShop::create($this->getContext(), 'order/base/product/attribute');
144
+			$variantAttributes = $productItem->getRefItems('attribute', null, 'variant');
145 145
 
146
-			foreach( $this->getAttributes( array_keys( $variantAttributes ), array( 'text' ) ) as $attrItem )
146
+			foreach ($this->getAttributes(array_keys($variantAttributes), array('text')) as $attrItem)
147 147
 			{
148 148
 				$orderAttributeItem = $orderProductAttrManager->createItem();
149
-				$orderAttributeItem->copyFrom( $attrItem );
150
-				$orderAttributeItem->setType( 'variant' );
149
+				$orderAttributeItem->copyFrom($attrItem);
150
+				$orderAttributeItem->setType('variant');
151 151
 
152 152
 				$attr[] = $orderAttributeItem;
153 153
 			}
154 154
 		}
155
-		else if( $requireVariant != false ) // count == 0
155
+		else if ($requireVariant != false) // count == 0
156 156
 		{
157
-			$msg = $context->getI18n()->dt( 'controller/frontend', 'No article found for selected attributes and product ID "%1$s"' );
158
-			throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( $msg, $productItem->getId() ) );
157
+			$msg = $context->getI18n()->dt('controller/frontend', 'No article found for selected attributes and product ID "%1$s"');
158
+			throw new \Aimeos\Controller\Frontend\Basket\Exception(sprintf($msg, $productItem->getId()));
159 159
 		}
160 160
 
161 161
 		return $attr;
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Subscription/Decorator/Base.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
 	/**
134 134
 	 * Returns the frontend controller
135 135
 	 *
136
-	 * @return \Aimeos\Controller\Frontend\Subscription\Iface Frontend controller object
136
+	 * @return \Aimeos\Controller\Frontend\Iface Frontend controller object
137 137
 	 */
138 138
 	protected function getController()
139 139
 	{
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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\\Subscription\\Iface', $controller );
35
+		\Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Frontend\\Subscription\\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
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 * @param string $id Unique subscription ID
61 61
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Canceled subscription item
62 62
 	 */
63
-	public function cancel( $id )
63
+	public function cancel($id)
64 64
 	{
65
-		return $this->controller->cancel( $id );
65
+		return $this->controller->cancel($id);
66 66
 	}
67 67
 
68 68
 
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
 	 * @param string $id Unique subscription ID
95 95
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Subscription object
96 96
 	 */
97
-	public function getItem( $id )
97
+	public function getItem($id)
98 98
 	{
99
-		return $this->controller->getItem( $id );
99
+		return $this->controller->getItem($id);
100 100
 	}
101 101
 
102 102
 
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 	 * @param \Aimeos\MShop\Subscription\Item\Iface $item Subscription object
107 107
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Saved subscription item
108 108
 	 */
109
-	public function saveItem( \Aimeos\MShop\Subscription\Item\Iface $item )
109
+	public function saveItem(\Aimeos\MShop\Subscription\Item\Iface $item)
110 110
 	{
111
-		return $this->controller->saveItem( $item );
111
+		return $this->controller->saveItem($item);
112 112
 	}
113 113
 
114 114
 
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 	 * @param integer &$total|null Variable that will contain the total number of available items
120 120
 	 * @return \Aimeos\MShop\Subscription\Item\Iface[] Associative list of IDs as keys and subscription objects as values
121 121
 	 */
122
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
122
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
123 123
 	{
124
-		return $this->controller->searchItems( $filter, $total );
124
+		return $this->controller->searchItems($filter, $total);
125 125
 	}
126 126
 
127 127
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Subscription/Iface.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @param string $id Unique subscription ID
26 26
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Canceled subscription item
27 27
 	 */
28
-	public function cancel( $id );
28
+	public function cancel($id);
29 29
 
30 30
 	/**
31 31
 	 * Returns the filter for searching items
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * @param string $id Unique subscription ID
48 48
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Subscription object
49 49
 	 */
50
-	public function getItem( $id );
50
+	public function getItem($id);
51 51
 
52 52
 	/**
53 53
 	 * Saves the modified subscription item
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * @param \Aimeos\MShop\Subscription\Item\Iface $item Subscription object
56 56
 	 * @return \Aimeos\MShop\Subscription\Item\Iface Saved subscription item
57 57
 	 */
58
-	public function saveItem( \Aimeos\MShop\Subscription\Item\Iface $item );
58
+	public function saveItem(\Aimeos\MShop\Subscription\Item\Iface $item);
59 59
 
60 60
 	/**
61 61
 	 * Returns the subscription items based on the given filter that belong to the current user
@@ -64,5 +64,5 @@  discard block
 block discarded – undo
64 64
 	 * @param integer &$total|null Variable that will contain the total number of available items
65 65
 	 * @return \Aimeos\MShop\Subscription\Item\Iface[] Associative list of IDs as keys and subscription objects as values
66 66
 	 */
67
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null );
67
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null);
68 68
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Subscription/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @param string|null $name Name of the controller implementaton (default: "Standard")
29 29
 	 * @return \Aimeos\Controller\Frontend\Subscription\Iface Controller object
30 30
 	 */
31
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null )
31
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null)
32 32
 	{
33 33
 		/** controller/frontend/subscription/name
34 34
 		 * Class name of the used subscription frontend controller implementation
@@ -63,19 +63,19 @@  discard block
 block discarded – undo
63 63
 		 * @since 2018.04
64 64
 		 * @category Developer
65 65
 		 */
66
-		if( $name === null ) {
67
-			$name = $context->getConfig()->get( 'controller/frontend/subscription/name', 'Standard' );
66
+		if ($name === null) {
67
+			$name = $context->getConfig()->get('controller/frontend/subscription/name', 'Standard');
68 68
 		}
69 69
 
70
-		if( ctype_alnum( $name ) === false ) {
71
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Subscription\\' . $name : '<not a string>';
72
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
70
+		if (ctype_alnum($name) === false) {
71
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Subscription\\' . $name : '<not a string>';
72
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
73 73
 		}
74 74
 
75 75
 		$iface = '\\Aimeos\\Controller\\Frontend\\Subscription\\Iface';
76 76
 		$classname = '\\Aimeos\\Controller\\Frontend\\Subscription\\' . $name;
77 77
 
78
-		$manager = self::createControllerBase( $context, $classname, $iface );
78
+		$manager = self::createControllerBase($context, $classname, $iface);
79 79
 
80 80
 		/** controller/frontend/subscription/decorators/excludes
81 81
 		 * Excludes decorators added by the "common" option from the subscription frontend controllers
@@ -151,6 +151,6 @@  discard block
 block discarded – undo
151 151
 		 * @see controller/frontend/subscription/decorators/excludes
152 152
 		 * @see controller/frontend/subscription/decorators/global
153 153
 		 */
154
-		return self::addControllerDecorators( $context, $manager, 'subscription' );
154
+		return self::addControllerDecorators($context, $manager, 'subscription');
155 155
 	}
156 156
 }
Please login to merge, or discard this patch.
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/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @param string|null $name Name of the controller implementaton (default: "Standard")
29 29
 	 * @return \Aimeos\Controller\Frontend\Supplier\Iface Controller object
30 30
 	 */
31
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null )
31
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null)
32 32
 	{
33 33
 		/** controller/frontend/supplier/name
34 34
 		 * Class name of the used supplier frontend controller implementation
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 		 * @since 2018.07
64 64
 		 * @category Developer
65 65
 		 */
66
-		if( $name === null ) {
67
-			$name = $context->getConfig()->get( 'controller/frontend/supplier/name', 'Standard' );
66
+		if ($name === null) {
67
+			$name = $context->getConfig()->get('controller/frontend/supplier/name', 'Standard');
68 68
 		}
69 69
 
70
-		if( ctype_alnum( $name ) === false )
70
+		if (ctype_alnum($name) === false)
71 71
 		{
72
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Supplier\\' . $name : '<not a string>';
73
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
72
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Supplier\\' . $name : '<not a string>';
73
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
74 74
 		}
75 75
 
76 76
 		$iface = '\\Aimeos\\Controller\\Frontend\\Supplier\\Iface';
77 77
 		$classname = '\\Aimeos\\Controller\\Frontend\\Supplier\\' . $name;
78 78
 
79
-		$manager = self::createControllerBase( $context, $classname, $iface );
79
+		$manager = self::createControllerBase($context, $classname, $iface);
80 80
 
81 81
 		/** controller/frontend/supplier/decorators/excludes
82 82
 		 * Excludes decorators added by the "common" option from the supplier frontend controllers
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		 * @see controller/frontend/supplier/decorators/excludes
153 153
 		 * @see controller/frontend/supplier/decorators/global
154 154
 		 */
155
-		return self::addControllerDecorators( $context, $manager, 'supplier' );
155
+		return self::addControllerDecorators($context, $manager, 'supplier');
156 156
 	}
157 157
 
158 158
 }
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/src/Controller/Frontend/Common/Factory/Base.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @param string $classname Full name of the class for which the object should be returned
32 32
 	 * @param \Aimeos\Controller\Frontend\Iface|null $controller Frontend controller object
33 33
 	 */
34
-	public static function injectController( $classname, \Aimeos\Controller\Frontend\Iface $controller = null )
34
+	public static function injectController($classname, \Aimeos\Controller\Frontend\Iface $controller = null)
35 35
 	{
36 36
 		self::$objects[$classname] = $controller;
37 37
 	}
@@ -46,26 +46,26 @@  discard block
 block discarded – undo
46 46
 	 * @param string $classprefix Decorator class prefix, e.g. "\Aimeos\Controller\Frontend\Basket\Decorator\"
47 47
 	 * @return \Aimeos\Controller\Frontend\Common\Iface Controller object
48 48
 	 */
49
-	protected static function addDecorators( \Aimeos\MShop\Context\Item\Iface $context,
50
-		\Aimeos\Controller\Frontend\Iface $controller, array $decorators, $classprefix )
49
+	protected static function addDecorators(\Aimeos\MShop\Context\Item\Iface $context,
50
+		\Aimeos\Controller\Frontend\Iface $controller, array $decorators, $classprefix)
51 51
 	{
52
-		foreach( $decorators as $name )
52
+		foreach ($decorators as $name)
53 53
 		{
54
-			if( ctype_alnum( $name ) === false )
54
+			if (ctype_alnum($name) === false)
55 55
 			{
56
-				$classname = is_string( $name ) ? $classprefix . $name : '<not a string>';
57
-				throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
56
+				$classname = is_string($name) ? $classprefix . $name : '<not a string>';
57
+				throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
58 58
 			}
59 59
 
60 60
 			$classname = $classprefix . $name;
61 61
 
62
-			if( class_exists( $classname ) === false ) {
63
-				throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
62
+			if (class_exists($classname) === false) {
63
+				throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $classname));
64 64
 			}
65 65
 
66
-			$controller = new $classname( $controller, $context );
66
+			$controller = new $classname($controller, $context);
67 67
 
68
-			\Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\Iface', $controller );
68
+			\Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\Iface', $controller);
69 69
 		}
70 70
 
71 71
 		return $controller;
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
 	 * @param string $domain Domain name in lower case, e.g. "product"
81 81
 	 * @return \Aimeos\Controller\Frontend\Common\Iface Controller object
82 82
 	 */
83
-	protected static function addControllerDecorators( \Aimeos\MShop\Context\Item\Iface $context,
84
-		\Aimeos\Controller\Frontend\Iface $controller, $domain )
83
+	protected static function addControllerDecorators(\Aimeos\MShop\Context\Item\Iface $context,
84
+		\Aimeos\Controller\Frontend\Iface $controller, $domain)
85 85
 	{
86
-		if( !is_string( $domain ) || $domain === '' ) {
87
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid domain "%1$s"', $domain ) );
86
+		if (!is_string($domain) || $domain === '') {
87
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid domain "%1$s"', $domain));
88 88
 		}
89 89
 
90
-		$localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $domain ) ) );
90
+		$localClass = str_replace(' ', '\\', ucwords(str_replace('/', ' ', $domain)));
91 91
 		$config = $context->getConfig();
92 92
 
93 93
 		/** controller/frontend/common/decorators/default
@@ -112,26 +112,26 @@  discard block
 block discarded – undo
112 112
 		 * @since 2014.03
113 113
 		 * @category Developer
114 114
 		 */
115
-		$decorators = $config->get( 'controller/frontend/common/decorators/default', [] );
116
-		$excludes = $config->get( 'controller/frontend/' . $domain . '/decorators/excludes', [] );
115
+		$decorators = $config->get('controller/frontend/common/decorators/default', []);
116
+		$excludes = $config->get('controller/frontend/' . $domain . '/decorators/excludes', []);
117 117
 
118
-		foreach( $decorators as $key => $name )
118
+		foreach ($decorators as $key => $name)
119 119
 		{
120
-			if( in_array( $name, $excludes ) ) {
121
-				unset( $decorators[$key] );
120
+			if (in_array($name, $excludes)) {
121
+				unset($decorators[$key]);
122 122
 			}
123 123
 		}
124 124
 
125 125
 		$classprefix = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\';
126
-		$controller = self::addDecorators( $context, $controller, $decorators, $classprefix );
126
+		$controller = self::addDecorators($context, $controller, $decorators, $classprefix);
127 127
 
128 128
 		$classprefix = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\';
129
-		$decorators = $config->get( 'controller/frontend/' . $domain . '/decorators/global', [] );
130
-		$controller = self::addDecorators( $context, $controller, $decorators, $classprefix );
129
+		$decorators = $config->get('controller/frontend/' . $domain . '/decorators/global', []);
130
+		$controller = self::addDecorators($context, $controller, $decorators, $classprefix);
131 131
 
132
-		$classprefix = '\\Aimeos\\Controller\\Frontend\\' . ucfirst( $localClass ) . '\\Decorator\\';
133
-		$decorators = $config->get( 'controller/frontend/' . $domain . '/decorators/local', [] );
134
-		$controller = self::addDecorators( $context, $controller, $decorators, $classprefix );
132
+		$classprefix = '\\Aimeos\\Controller\\Frontend\\' . ucfirst($localClass) . '\\Decorator\\';
133
+		$decorators = $config->get('controller/frontend/' . $domain . '/decorators/local', []);
134
+		$controller = self::addDecorators($context, $controller, $decorators, $classprefix);
135 135
 
136 136
 		return $controller;
137 137
 	}
@@ -145,19 +145,19 @@  discard block
 block discarded – undo
145 145
 	 * @param string $interface Name of the controller interface
146 146
 	 * @return \Aimeos\Controller\Frontend\Common\Iface Controller object
147 147
 	 */
148
-	protected static function createControllerBase( \Aimeos\MShop\Context\Item\Iface $context, $classname, $interface )
148
+	protected static function createControllerBase(\Aimeos\MShop\Context\Item\Iface $context, $classname, $interface)
149 149
 	{
150
-		if( isset( self::$objects[$classname] ) ) {
150
+		if (isset(self::$objects[$classname])) {
151 151
 			return self::$objects[$classname];
152 152
 		}
153 153
 
154
-		if( class_exists( $classname ) === false ) {
155
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
154
+		if (class_exists($classname) === false) {
155
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $classname));
156 156
 		}
157 157
 
158
-		$controller = new $classname( $context );
158
+		$controller = new $classname($context);
159 159
 
160
-		\Aimeos\MW\Common\Base::checkClass( $interface, $controller );
160
+		\Aimeos\MW\Common\Base::checkClass($interface, $controller);
161 161
 
162 162
 		return $controller;
163 163
 	}
Please login to merge, or discard this patch.