@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | 'undefined' => '$undefined', |
78 | 78 | ); |
79 | 79 | |
80 | - $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'listitem', array('a', 'b', 'c') ); |
|
80 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'listitem', array( 'a', 'b', 'c' ) ); |
|
81 | 81 | $this->assertEquals( "( \$listitem == 'a' || \$listitem == 'b' || \$listitem == 'c' )", $expr->toString( $types, $translations ) ); |
82 | 82 | |
83 | - $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'listitem', array('a', 'b') ); |
|
83 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'listitem', array( 'a', 'b' ) ); |
|
84 | 84 | $this->assertEquals( "( \$listitem != 'a' && \$listitem != 'b' )", $expr->toString( $types, $translations ) ); |
85 | 85 | |
86 | 86 | $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'stringvar', 'value' ); |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '<', 'floatvar', 0.1 ); |
90 | 90 | $this->assertEquals( '$floatvar < 0.1', $expr->toString( $types, $translations ) ); |
91 | 91 | |
92 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>', 'intvar', 10 ); |
|
92 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>', 'intvar', 10 ); |
|
93 | 93 | $this->assertEquals( '$intvar > 10', $expr->toString( $types, $translations ) ); |
94 | 94 | |
95 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'boolvar', true ); |
|
95 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'boolvar', true ); |
|
96 | 96 | $this->assertEquals( '$boolvar == 1', $expr->toString( $types, $translations ) ); |
97 | 97 | |
98 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'undefined', null ); |
|
98 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '!=', 'undefined', null ); |
|
99 | 99 | $this->assertEquals( '$undefined !== null', $expr->toString( $types, $translations ) ); |
100 | 100 | |
101 | - $expr= new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'undefined', null ); |
|
101 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '==', 'undefined', null ); |
|
102 | 102 | $this->assertEquals( '$undefined === null', $expr->toString( $types, $translations ) ); |
103 | 103 | |
104 | 104 | |
@@ -124,15 +124,15 @@ discard block |
||
124 | 124 | 'undefined' => '$undefined', |
125 | 125 | ); |
126 | 126 | |
127 | - $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>=', 'listitem', array('a', 'b') ); |
|
128 | - $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
127 | + $expr = new \Aimeos\MW\Criteria\Expression\Compare\PHP( '>=', 'listitem', array( 'a', 'b' ) ); |
|
128 | + $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
129 | 129 | $expr->toString( $types, $translations ); |
130 | 130 | } |
131 | 131 | |
132 | 132 | public function testToStringExcept2() |
133 | 133 | { |
134 | - $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
135 | - new \Aimeos\MW\Criteria\Expression\Compare\PHP('=', 'undefined', null); |
|
134 | + $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
135 | + new \Aimeos\MW\Criteria\Expression\Compare\PHP( '=', 'undefined', null ); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | public function testToStringFunction() |
@@ -78,8 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $this->execute( $stmts['index'] ); |
80 | 80 | $this->status( 'dropped' ); |
81 | - } |
|
82 | - else |
|
81 | + } else |
|
83 | 82 | { |
84 | 83 | $this->status( 'OK' ); |
85 | 84 | } |
@@ -125,8 +124,7 @@ discard block |
||
125 | 124 | } else { |
126 | 125 | $this->status( 'OK' ); |
127 | 126 | } |
128 | - } |
|
129 | - else |
|
127 | + } else |
|
130 | 128 | { |
131 | 129 | $this->status( 'OK' ); |
132 | 130 | } |
@@ -19,8 +19,8 @@ |
||
19 | 19 | |
20 | 20 | $servManager = \Aimeos\MShop\Service\Manager\Factory::createManager( $this->context ); |
21 | 21 | $search = $servManager->createSearch(); |
22 | - $search->setConditions($search->compare('==', 'service.provider', 'Standard')); |
|
23 | - $result = $servManager->searchItems($search, array('price')); |
|
22 | + $search->setConditions( $search->compare( '==', 'service.provider', 'Standard' ) ); |
|
23 | + $result = $servManager->searchItems( $search, array( 'price' ) ); |
|
24 | 24 | |
25 | 25 | if( ( $item = reset( $result ) ) === false ) { |
26 | 26 | throw new \RuntimeException( 'No order base item found' ); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | * Creates the catalog item objects. |
66 | 66 | * |
67 | 67 | * @param array $itemMap Associative list of catalog ID / tree node pairs |
68 | - * @param array $domains List of domains (e.g. text, media) whose items should be attached to the catalog items |
|
68 | + * @param string[] $domains List of domains (e.g. text, media) whose items should be attached to the catalog items |
|
69 | 69 | * @param string $prefix Domain prefix |
70 | 70 | * @param array $local Associative list of IDs as keys and the associative array of items as values |
71 | 71 | * @return array List of items implementing \Aimeos\MShop\Catalog\Item\Iface |
@@ -132,9 +132,9 @@ |
||
132 | 132 | && ( $count += substr_count( $pr, '\'' ) ) % 2 !== 0 ) |
133 | 133 | { |
134 | 134 | if( ( $part = next( $parts ) ) === false ) { |
135 | - throw new \Aimeos\MW\DB\Exception( 'Number of apostrophes don\'t match: ' . $sql ); |
|
135 | + throw new \Aimeos\MW\DB\Exception( 'Number of apostrophes don\'t match: '.$sql ); |
|
136 | 136 | } |
137 | - $temp .= '?' . $part; |
|
137 | + $temp .= '?'.$part; |
|
138 | 138 | } |
139 | 139 | $result[] = $temp; |
140 | 140 | } |
@@ -174,7 +174,7 @@ |
||
174 | 174 | * Reconnects to the database server if not in a transaction |
175 | 175 | * |
176 | 176 | * @param \Exception $e Exception to throw if a transaction is running |
177 | - * @return \Aimeos\MW\DB\Statement\Iface Object for method chaining |
|
177 | + * @return Base Object for method chaining |
|
178 | 178 | * @throws \Exception If a transaction is running |
179 | 179 | */ |
180 | 180 | protected function reconnect( \Exception $e ) |
@@ -335,7 +335,7 @@ |
||
335 | 335 | |
336 | 336 | public function testSearchItemsDefault() |
337 | 337 | { |
338 | - $search = $this->object->createSearch( true ); |
|
338 | + $search = $this->object->createSearch( true ); |
|
339 | 339 | $items = $this->object->searchItems( $search ); |
340 | 340 | |
341 | 341 | $this->assertEquals( 0, count( $items ) ); |
@@ -200,6 +200,7 @@ |
||
200 | 200 | * @param \Aimeos\MW\Criteria\Iface $search Search criteria object |
201 | 201 | * @param string[] $ref List of domains to fetch list items and referenced items for |
202 | 202 | * @param integer|null &$total Number of items that are available in total |
203 | + * @param integer $total |
|
203 | 204 | * @return array List of type items implementing \Aimeos\MShop\Common\Item\Type\Iface |
204 | 205 | */ |
205 | 206 | public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function createItem() |
62 | 62 | { |
63 | 63 | $values = array( |
64 | - $this->prefix . 'siteid' => $this->getContext()->getLocale()->getSiteId(), |
|
64 | + $this->prefix.'siteid' => $this->getContext()->getLocale()->getSiteId(), |
|
65 | 65 | ); |
66 | 66 | return $this->createItemBase( $values ); |
67 | 67 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | $time = date( 'Y-m-d H:i:s', time() ); |
117 | - $stmt = $conn->create( $this->getSqlConfig( $this->getConfigPath() . $type ) ); |
|
117 | + $stmt = $conn->create( $this->getSqlConfig( $this->getConfigPath().$type ) ); |
|
118 | 118 | |
119 | 119 | $stmt->bind( 1, $item->getCode(), \Aimeos\MW\DB\Statement\Base::PARAM_STR ); |
120 | 120 | $stmt->bind( 2, $item->getDomain(), \Aimeos\MW\DB\Statement\Base::PARAM_STR ); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | if( $fetch === true ) |
136 | 136 | { |
137 | 137 | if( $id === null ) { |
138 | - $item->setId( $this->newId( $conn, $this->getConfigPath() . 'newid' ) ); |
|
138 | + $item->setId( $this->newId( $conn, $this->getConfigPath().'newid' ) ); |
|
139 | 139 | } else { |
140 | 140 | $item->setId( $id ); // modified false |
141 | 141 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function deleteItems( array $ids ) |
160 | 160 | { |
161 | - $this->deleteItemsBase( $ids, $this->getConfigPath() . 'delete' ); |
|
161 | + $this->deleteItemsBase( $ids, $this->getConfigPath().'delete' ); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | public function findItem( $code, array $ref = [], $domain = 'product', $type = null ) |
175 | 175 | { |
176 | 176 | $find = array( |
177 | - $this->prefix . 'code' => $code, |
|
178 | - $this->prefix . 'domain' => $domain, |
|
177 | + $this->prefix.'code' => $code, |
|
178 | + $this->prefix.'domain' => $domain, |
|
179 | 179 | ); |
180 | 180 | return $this->findItemBase( $find, $ref ); |
181 | 181 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function getItem( $id, array $ref = [], $default = false ) |
193 | 193 | { |
194 | - return $this->getItemBase( $this->prefix . 'id', $id, $ref, $default ); |
|
194 | + return $this->getItemBase( $this->prefix.'id', $id, $ref, $default ); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | |
@@ -220,13 +220,13 @@ discard block |
||
220 | 220 | } |
221 | 221 | |
222 | 222 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
223 | - $cfgPathSearch = $this->getConfigPath() . 'search'; |
|
224 | - $cfgPathCount = $this->getConfigPath() . 'count'; |
|
223 | + $cfgPathSearch = $this->getConfigPath().'search'; |
|
224 | + $cfgPathCount = $this->getConfigPath().'count'; |
|
225 | 225 | $required = array( trim( $this->prefix, '.' ) ); |
226 | 226 | |
227 | 227 | $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level ); |
228 | 228 | while( ( $row = $results->fetch() ) !== false ) { |
229 | - $items[$row[$this->prefix . 'id']] = $this->createItemBase( $row ); |
|
229 | + $items[$row[$this->prefix.'id']] = $this->createItemBase( $row ); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | $dbm->release( $conn, $dbname ); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function getSubManager( $manager, $name = null ) |
252 | 252 | { |
253 | - return $this->getSubManagerBase( 'common', 'type/' . $manager, $name ); |
|
253 | + return $this->getSubManagerBase( 'common', 'type/'.$manager, $name ); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 |
@@ -180,7 +180,7 @@ |
||
180 | 180 | * Processes the order |
181 | 181 | * |
182 | 182 | * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice object to process |
183 | - * @param array $params Request parameter if available |
|
183 | + * @param string[] $params Request parameter if available |
|
184 | 184 | * @return \Aimeos\MShop\Common\Item\Helper\Form\Standard|null Form object or null |
185 | 185 | */ |
186 | 186 | public function process( \Aimeos\MShop\Order\Item\Iface $order, array $params = [] ) |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | if( !isset( self::$aimeos ) ) |
50 | 50 | { |
51 | - require_once dirname( dirname( dirname( __DIR__ ) ) ) . DIRECTORY_SEPARATOR . 'Bootstrap.php'; |
|
51 | + require_once dirname( dirname( dirname( __DIR__ ) ) ).DIRECTORY_SEPARATOR.'Bootstrap.php'; |
|
52 | 52 | |
53 | 53 | self::$aimeos = new \Aimeos\Bootstrap( [], false ); |
54 | 54 | } |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | |
71 | 71 | |
72 | 72 | $paths = $aimeos->getConfigPaths(); |
73 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
74 | - $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
|
73 | + $paths[] = __DIR__.DIRECTORY_SEPARATOR.'config'; |
|
74 | + $file = __DIR__.DIRECTORY_SEPARATOR.'confdoc.ser'; |
|
75 | 75 | |
76 | 76 | $conf = new \Aimeos\MW\Config\PHPArray( [], $paths ); |
77 | 77 | $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |