@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | 'required' => false, |
39 | 39 | ); |
40 | 40 | |
41 | - $this->object = new \Aimeos\MW\Criteria\Attribute\Standard($values); |
|
41 | + $this->object = new \Aimeos\MW\Criteria\Attribute\Standard( $values ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -54,48 +54,48 @@ discard block |
||
54 | 54 | |
55 | 55 | public function testGetType() |
56 | 56 | { |
57 | - $this->assertEquals('attribute_type', $this->object->getType()); |
|
57 | + $this->assertEquals( 'attribute_type', $this->object->getType() ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | public function testGetInternalType() |
62 | 62 | { |
63 | - $this->assertEquals('internaltype', $this->object->getInternalType()); |
|
63 | + $this->assertEquals( 'internaltype', $this->object->getInternalType() ); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function testGetCode() |
67 | 67 | { |
68 | - $this->assertEquals('attribute_code', $this->object->getCode()); |
|
68 | + $this->assertEquals( 'attribute_code', $this->object->getCode() ); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function testGetInternalCode() |
72 | 72 | { |
73 | - $this->assertEquals('internalcode', $this->object->getInternalCode()); |
|
73 | + $this->assertEquals( 'internalcode', $this->object->getInternalCode() ); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function testGetInternalDeps() |
77 | 77 | { |
78 | - $this->assertEquals(array( 'test' ), $this->object->getInternalDeps()); |
|
78 | + $this->assertEquals( array( 'test' ), $this->object->getInternalDeps() ); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function testGetLabel() |
82 | 82 | { |
83 | - $this->assertEquals('labelname', $this->object->getLabel()); |
|
83 | + $this->assertEquals( 'labelname', $this->object->getLabel() ); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function testGetDefault() |
87 | 87 | { |
88 | - $this->assertEquals('default value', $this->object->getDefault()); |
|
88 | + $this->assertEquals( 'default value', $this->object->getDefault() ); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | public function testIsPublic() |
92 | 92 | { |
93 | - $this->assertEquals(false, $this->object->isPublic()); |
|
93 | + $this->assertEquals( false, $this->object->isPublic() ); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | public function testIsRequired() |
97 | 97 | { |
98 | - $this->assertEquals(false, $this->object->isRequired()); |
|
98 | + $this->assertEquals( false, $this->object->isRequired() ); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | public function testToArray() |
@@ -109,6 +109,6 @@ discard block |
||
109 | 109 | 'required' => false, |
110 | 110 | ); |
111 | 111 | |
112 | - $this->assertEquals($expected, $this->object->toArray()); |
|
112 | + $this->assertEquals( $expected, $this->object->toArray() ); |
|
113 | 113 | } |
114 | 114 | } |
@@ -97,10 +97,10 @@ discard block |
||
97 | 97 | 'bool' => 't.bool', |
98 | 98 | ); |
99 | 99 | |
100 | - $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '==', 'list', array('a', 'b', 'c') ); |
|
100 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '==', 'list', array( 'a', 'b', 'c' ) ); |
|
101 | 101 | $this->assertEquals( "t.list IN ('a','b','c')", $expr->toString( $types, $translations ) ); |
102 | 102 | |
103 | - $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '!=', 'list', array('a', 'b', 'c') ); |
|
103 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '!=', 'list', array( 'a', 'b', 'c' ) ); |
|
104 | 104 | $this->assertEquals( "t.list NOT IN ('a','b','c')", $expr->toString( $types, $translations ) ); |
105 | 105 | |
106 | 106 | $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '~=', 'string', 'value' ); |
@@ -109,19 +109,19 @@ discard block |
||
109 | 109 | $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '<', 'float', 0.1 ); |
110 | 110 | $this->assertEquals( "t.float < 0.1", $expr->toString( $types, $translations ) ); |
111 | 111 | |
112 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '>', 'int', 10 ); |
|
112 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '>', 'int', 10 ); |
|
113 | 113 | $this->assertEquals( "t.int > 10", $expr->toString( $types, $translations ) ); |
114 | 114 | |
115 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '!=', 'undefined', null ); |
|
115 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '!=', 'undefined', null ); |
|
116 | 116 | $this->assertEquals( "t.undefined IS NOT NULL", $expr->toString( $types, $translations ) ); |
117 | 117 | |
118 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '==', 'bool', true ); |
|
118 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '==', 'bool', true ); |
|
119 | 119 | $this->assertEquals( "t.bool = 1", $expr->toString( $types, $translations ) ); |
120 | 120 | |
121 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '&', 'int', 0x2 ); |
|
121 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '&', 'int', 0x2 ); |
|
122 | 122 | $this->assertEquals( "t.int & 2", $expr->toString( $types, $translations ) ); |
123 | 123 | |
124 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '|', 'int', 0x4 ); |
|
124 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $this->conn, '|', 'int', 0x4 ); |
|
125 | 125 | $this->assertEquals( "t.int | 4", $expr->toString( $types, $translations ) ); |
126 | 126 | } |
127 | 127 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * @param \Aimeos\MShop\Coupon\Item\Iface $couponItem Coupon item with configuration for the provider |
34 | 34 | * @param string $code Coupon code entered by the customer |
35 | 35 | */ |
36 | - public function __construct( \Aimeos\MShop\Coupon\Provider\Iface $provider, |
|
36 | + public function __construct( \Aimeos\MShop\Coupon\Provider\Iface $provider, |
|
37 | 37 | \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Coupon\Item\Iface $couponItem, $code ) |
38 | 38 | { |
39 | 39 | $this->provider = $provider; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $this->orderBase = new \Aimeos\MShop\Order\Item\Base\Standard( $priceManager->createItem(), $context->getLocale() ); |
36 | 36 | |
37 | 37 | $provider = new \Aimeos\MShop\Coupon\Provider\Example( $context, $item, 'abcd' ); |
38 | - $this->object = new \Aimeos\MShop\Coupon\Provider\Decorator\Example( $provider, $context, $item, 'abcd'); |
|
38 | + $this->object = new \Aimeos\MShop\Coupon\Provider\Decorator\Example( $provider, $context, $item, 'abcd' ); |
|
39 | 39 | $this->object->setObject( $this->object ); |
40 | 40 | } |
41 | 41 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $this->couponItem = \Aimeos\MShop\Coupon\Manager\Factory::createManager( $context )->createItem(); |
34 | 34 | |
35 | 35 | $provider = new \Aimeos\MShop\Coupon\Provider\Example( $context, $this->couponItem, 'abcd' ); |
36 | - $this->object = new \Aimeos\MShop\Coupon\Provider\Decorator\Required( $provider, $context, $this->couponItem, 'abcd'); |
|
36 | + $this->object = new \Aimeos\MShop\Coupon\Provider\Decorator\Required( $provider, $context, $this->couponItem, 'abcd' ); |
|
37 | 37 | $this->object->setObject( $this->object ); |
38 | 38 | |
39 | 39 | $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ); |
@@ -152,7 +152,7 @@ |
||
152 | 152 | * @return self |
153 | 153 | * @throws \InvalidArgumentException for invalid header names or values. |
154 | 154 | */ |
155 | - public function withHeader($name, $value ) |
|
155 | + public function withHeader( $name, $value ) |
|
156 | 156 | { |
157 | 157 | $this->response = $this->response->withHeader( $name, $value ); |
158 | 158 | return $this; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @param string $version HTTP protocol version |
105 | 105 | * @return self |
106 | - */ |
|
106 | + */ |
|
107 | 107 | public function withProtocolVersion( $version ) |
108 | 108 | { |
109 | 109 | $this->response = $this->response->withProtocolVersion( $version ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @return string[][] Returns an associative array of the message's headers. |
118 | 118 | * Each key MUST be a header name, and each value MUST be an array of |
119 | 119 | * strings for that header. |
120 | - */ |
|
120 | + */ |
|
121 | 121 | public function getHeaders() |
122 | 122 | { |
123 | 123 | return $this->response->getHeaders(); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - if ($this->checkWeightScale( $this->getWeight( $prodMap ) ) === false) { |
|
108 | + if( $this->checkWeightScale( $this->getWeight( $prodMap ) ) === false ) { |
|
109 | 109 | return false; |
110 | 110 | } |
111 | 111 | |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | $min = $this->getConfigValue( array( 'weight.min' ) ); |
125 | 125 | $max = $this->getConfigValue( array( 'weight.max' ) ); |
126 | 126 | |
127 | - if( $min !== null && ( (float) $min) > $basketWeight ) { |
|
127 | + if( $min !== null && ( (float) $min ) > $basketWeight ) { |
|
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | |
131 | - if( $max !== null && ( (float) $max) < $basketWeight ) { |
|
131 | + if( $max !== null && ( (float) $max ) < $basketWeight ) { |
|
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $search->setSlice( 0, 0x7fffffff ); // if more than 100 products are in the basket |
175 | 175 | |
176 | 176 | foreach( $propertyManager->searchItems( $search ) as $property ) { |
177 | - $weight += ((float) $property->getValue()) * $prodMap[$prodIds[$property->getParentId()]]; |
|
177 | + $weight += ( (float) $property->getValue() ) * $prodMap[$prodIds[$property->getParentId()]]; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 |
@@ -97,9 +97,11 @@ |
||
97 | 97 | $code = $basketItem->getProductCode(); |
98 | 98 | $prodMap[$code] = ( isset( $prodMap[$code] ) ? $prodMap[$code] + $qty : $qty ); |
99 | 99 | |
100 | - foreach( $basketItem->getProducts() as $prodItem ) // calculate bundled products |
|
100 | + foreach( $basketItem->getProducts() as $prodItem ) { |
|
101 | + // calculate bundled products |
|
101 | 102 | { |
102 | 103 | $qty = $prodItem->getQuantity(); |
104 | + } |
|
103 | 105 | $code = $prodItem->getProductCode(); |
104 | 106 | $prodMap[$code] = ( isset( $prodMap[$code] ) ? $prodMap[$code] + $qty : $qty ); |
105 | 107 | } |
@@ -32,9 +32,12 @@ discard block |
||
32 | 32 | { |
33 | 33 | parent::__construct( $config ); |
34 | 34 | |
35 | - try { |
|
35 | + try |
|
36 | + { |
|
36 | 37 | $this->conn = $this->createConnection(); |
37 | - } catch( \Aimeos\MW\DB\Exception $e ) { |
|
38 | + } |
|
39 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
40 | + { |
|
38 | 41 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
39 | 42 | } |
40 | 43 | } |
@@ -85,8 +88,7 @@ discard block |
||
85 | 88 | { |
86 | 89 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
87 | 90 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
88 | - } |
|
89 | - else |
|
91 | + } else |
|
90 | 92 | { |
91 | 93 | $dsn .= ';unix_socket=' . $sock; |
92 | 94 | } |
@@ -81,15 +81,15 @@ |
||
81 | 81 | $dbase = $this->getConfig( 'db/database', 'aimeos' ); |
82 | 82 | $persist = $this->getConfig( 'db/opt-persistent', false ); |
83 | 83 | |
84 | - $dsn = $adapter . ':dbname=' . $dbase; |
|
84 | + $dsn = $adapter.':dbname='.$dbase; |
|
85 | 85 | if( $sock == null ) |
86 | 86 | { |
87 | - $dsn .= isset( $host ) ? ';host=' . $host : ''; |
|
88 | - $dsn .= isset( $port ) ? ';port=' . $port : ''; |
|
87 | + $dsn .= isset( $host ) ? ';host='.$host : ''; |
|
88 | + $dsn .= isset( $port ) ? ';port='.$port : ''; |
|
89 | 89 | } |
90 | 90 | else |
91 | 91 | { |
92 | - $dsn .= ';unix_socket=' . $sock; |
|
92 | + $dsn .= ';unix_socket='.$sock; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | $params = array( $dsn, $user, $pass, array( \PDO::ATTR_PERSISTENT => $persist ) ); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $this->additional->setEditor( 'core:unittest' ); |
61 | 61 | |
62 | 62 | $ds = DIRECTORY_SEPARATOR; |
63 | - $path = __DIR__ . $ds . 'data' . $ds . 'attribute.php'; |
|
63 | + $path = __DIR__.$ds.'data'.$ds.'attribute.php'; |
|
64 | 64 | |
65 | 65 | if( ( $testdata = include( $path ) ) == false ) { |
66 | 66 | throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for attribute domain', $path ) ); |