@@ -154,12 +154,10 @@ |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | return \Aimeos\MW\DB\Statement\Base::PARAM_STR; |
157 | - } |
|
158 | - else if( strpos( $item, '.' ) !== false ) |
|
157 | + } else if( strpos( $item, '.' ) !== false ) |
|
159 | 158 | { |
160 | 159 | return \Aimeos\MW\DB\Statement\Base::PARAM_FLOAT; |
161 | - } |
|
162 | - else if( ctype_digit( $item ) !== false ) |
|
160 | + } else if( ctype_digit( $item ) !== false ) |
|
163 | 161 | { |
164 | 162 | return \Aimeos\MW\DB\Statement\Base::PARAM_INT; |
165 | 163 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | protected function createTerm( $name, $type, $value ) |
66 | 66 | { |
67 | - return $name . ' ' . self::$operators[$this->getOperator()] . ' ' . $this->escape( $this->getOperator(), $type, $value ); |
|
67 | + return $name.' '.self::$operators[$this->getOperator()].' '.$this->escape( $this->getOperator(), $type, $value ); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | switch( $this->getOperator() ) |
80 | 80 | { |
81 | 81 | case '==': |
82 | - return $name . ' IS NULL'; |
|
82 | + return $name.' IS NULL'; |
|
83 | 83 | case '!=': |
84 | - return $name . ' IS NOT NULL'; |
|
84 | + return $name.' IS NOT NULL'; |
|
85 | 85 | default: |
86 | 86 | throw new \Aimeos\MW\Common\Exception( sprintf( 'NULL value not allowed for operator "%1$s"', $this->getOperator() ) ); |
87 | 87 | } |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | switch( $this->getOperator() ) |
101 | 101 | { |
102 | 102 | case '==': |
103 | - return $name . ' IN ' . $this->createValueList( $type, (array) $this->getValue() ); |
|
103 | + return $name.' IN '.$this->createValueList( $type, (array) $this->getValue() ); |
|
104 | 104 | case '!=': |
105 | - return $name . ' NOT IN ' . $this->createValueList( $type, (array) $this->getValue() ); |
|
105 | + return $name.' NOT IN '.$this->createValueList( $type, (array) $this->getValue() ); |
|
106 | 106 | default: |
107 | 107 | $terms = array(); |
108 | 108 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $terms[] = $this->createTerm( $name, $type, $val ); |
111 | 111 | } |
112 | 112 | |
113 | - return '(' . implode( ' OR ', $terms ) . ')'; |
|
113 | + return '('.implode( ' OR ', $terms ).')'; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $values[$key] = $this->escape( $operator, $type, $value ); |
135 | 135 | } |
136 | 136 | |
137 | - return '(' . implode(',', $values) . ')'; |
|
137 | + return '('.implode( ',', $values ).')'; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | $value = (float) $value; break; |
161 | 161 | case \Aimeos\MW\DB\Statement\Base::PARAM_STR: |
162 | 162 | if( $operator == '~=' ) { |
163 | - $value = '\'%' . $this->conn->escape( $value ) . '%\''; break; |
|
163 | + $value = '\'%'.$this->conn->escape( $value ).'%\''; break; |
|
164 | 164 | } |
165 | 165 | if( $operator == '=~' ) { |
166 | - $value = '\'' . $this->conn->escape( $value ) . '%\''; break; |
|
166 | + $value = '\''.$this->conn->escape( $value ).'%\''; break; |
|
167 | 167 | } |
168 | 168 | default: |
169 | - $value = '\'' . $this->conn->escape( $value ) . '\''; |
|
169 | + $value = '\''.$this->conn->escape( $value ).'\''; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | return $value; |
@@ -154,12 +154,10 @@ |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | return \Aimeos\MW\DB\Statement\Base::PARAM_STR; |
157 | - } |
|
158 | - else if( strpos( $item, '.' ) !== false ) |
|
157 | + } else if( strpos( $item, '.' ) !== false ) |
|
159 | 158 | { |
160 | 159 | return \Aimeos\MW\DB\Statement\Base::PARAM_FLOAT; |
161 | - } |
|
162 | - else if( ctype_digit( $item ) !== false ) |
|
160 | + } else if( ctype_digit( $item ) !== false ) |
|
163 | 161 | { |
164 | 162 | return \Aimeos\MW\DB\Statement\Base::PARAM_INT; |
165 | 163 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Invalid name "%1$s"', $name ) ); |
100 | 100 | } |
101 | 101 | |
102 | - return self::$operators[$this->operator] . '(' . $transname . ');'; |
|
102 | + return self::$operators[$this->operator].'('.$transname.');'; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 |
@@ -67,8 +67,7 @@ |
||
67 | 67 | $this->setCode( $key ); |
68 | 68 | $this->values['id'] = $this->values['code']; |
69 | 69 | $this->modified = false; |
70 | - } |
|
71 | - else |
|
70 | + } else |
|
72 | 71 | { |
73 | 72 | $this->values['id'] = null; |
74 | 73 | $this->modified = true; |
@@ -106,9 +106,12 @@ |
||
106 | 106 | */ |
107 | 107 | public function scan( $path = null ) |
108 | 108 | { |
109 | - try { |
|
109 | + try |
|
110 | + { |
|
110 | 111 | return new \DirectoryIterator( $this->basepath . $path ); |
111 | - } catch( \Exception $e ) { |
|
112 | + } |
|
113 | + catch( \Exception $e ) |
|
114 | + { |
|
112 | 115 | throw new Exception( $e->getMessage(), 0, $e ); |
113 | 116 | } |
114 | 117 | } |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | $ds = DIRECTORY_SEPARATOR; |
50 | - $this->basedir = realpath( str_replace( '/', $ds, rtrim( $config['basedir'], '/' ) ) ) . $ds; |
|
51 | - $this->tempdir = realpath( str_replace( '/', $ds, rtrim( $config['tempdir'], '/' ) ) ) . $ds; |
|
50 | + $this->basedir = realpath( str_replace( '/', $ds, rtrim( $config['basedir'], '/' ) ) ).$ds; |
|
51 | + $this->tempdir = realpath( str_replace( '/', $ds, rtrim( $config['tempdir'], '/' ) ) ).$ds; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -349,6 +349,6 @@ discard block |
||
349 | 349 | throw new Exception( sprintf( 'No ".." allowed in path "%1$s"', $path ) ); |
350 | 350 | } |
351 | 351 | |
352 | - return $this->basedir . str_replace( '/', DIRECTORY_SEPARATOR, $path ); |
|
352 | + return $this->basedir.str_replace( '/', DIRECTORY_SEPARATOR, $path ); |
|
353 | 353 | } |
354 | 354 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | foreach( $basket->getProducts() as $product ) |
86 | 86 | { |
87 | - if( ((bool) count( $product->getAttributes( 'download' ) )) !== $val ) { |
|
87 | + if( ( (bool) count( $product->getAttributes( 'download' ) ) ) !== $val ) { |
|
88 | 88 | return !$val; |
89 | 89 | } |
90 | 90 | } |
@@ -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 |