@@ -117,8 +117,7 @@ |
||
| 117 | 117 | $value->getClientOriginalName(), |
| 118 | 118 | $value->getClientMimeType() |
| 119 | 119 | ); |
| 120 | - } |
|
| 121 | - elseif( is_array( $value ) ) |
|
| 120 | + } elseif( is_array( $value ) ) |
|
| 122 | 121 | { |
| 123 | 122 | $list[$key] = $this->getFiles( $value ); |
| 124 | 123 | } |
@@ -58,9 +58,12 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function mkdir( $path ) |
| 60 | 60 | { |
| 61 | - try { |
|
| 61 | + try |
|
| 62 | + { |
|
| 62 | 63 | $this->fs->makeDirectory( $path ); |
| 63 | - } catch( \Exception $e ) { |
|
| 64 | + } |
|
| 65 | + catch( \Exception $e ) |
|
| 66 | + { |
|
| 64 | 67 | throw new Exception( $e->getMessage(), 0, $e ); |
| 65 | 68 | } |
| 66 | 69 | } |
@@ -75,9 +78,12 @@ discard block |
||
| 75 | 78 | */ |
| 76 | 79 | public function rmdir( $path ) |
| 77 | 80 | { |
| 78 | - try { |
|
| 81 | + try |
|
| 82 | + { |
|
| 79 | 83 | $this->fs->deleteDirectory( $path ); |
| 80 | - } catch( \Exception $e ) { |
|
| 84 | + } |
|
| 85 | + catch( \Exception $e ) |
|
| 86 | + { |
|
| 81 | 87 | throw new Exception( $e->getMessage(), 0, $e ); |
| 82 | 88 | } |
| 83 | 89 | } |
@@ -94,9 +100,12 @@ discard block |
||
| 94 | 100 | */ |
| 95 | 101 | public function scan( $path = null ) |
| 96 | 102 | { |
| 97 | - try { |
|
| 103 | + try |
|
| 104 | + { |
|
| 98 | 105 | return array_merge( $this->fs->directories( $path ), $this->fs->files( $path ) ); |
| 99 | - } catch( \Exception $e ) { |
|
| 106 | + } |
|
| 107 | + catch( \Exception $e ) |
|
| 108 | + { |
|
| 100 | 109 | throw new Exception( $e->getMessage(), 0, $e ); |
| 101 | 110 | } |
| 102 | 111 | } |
@@ -111,9 +120,12 @@ discard block |
||
| 111 | 120 | */ |
| 112 | 121 | public function size( $path ) |
| 113 | 122 | { |
| 114 | - try { |
|
| 123 | + try |
|
| 124 | + { |
|
| 115 | 125 | return $this->fs->size( $path ); |
| 116 | - } catch( \Exception $e ) { |
|
| 126 | + } |
|
| 127 | + catch( \Exception $e ) |
|
| 128 | + { |
|
| 117 | 129 | throw new Exception( $e->getMessage(), 0, $e ); |
| 118 | 130 | } |
| 119 | 131 | } |
@@ -128,9 +140,12 @@ discard block |
||
| 128 | 140 | */ |
| 129 | 141 | public function time( $path ) |
| 130 | 142 | { |
| 131 | - try { |
|
| 143 | + try |
|
| 144 | + { |
|
| 132 | 145 | return $this->fs->lastModified( $path ); |
| 133 | - } catch( \Exception $e ) { |
|
| 146 | + } |
|
| 147 | + catch( \Exception $e ) |
|
| 148 | + { |
|
| 134 | 149 | throw new Exception( $e->getMessage(), 0, $e ); |
| 135 | 150 | } |
| 136 | 151 | } |
@@ -145,9 +160,12 @@ discard block |
||
| 145 | 160 | */ |
| 146 | 161 | public function rm( $path ) |
| 147 | 162 | { |
| 148 | - try { |
|
| 163 | + try |
|
| 164 | + { |
|
| 149 | 165 | $this->fs->delete( $path ); |
| 150 | - } catch( \Exception $e ) { |
|
| 166 | + } |
|
| 167 | + catch( \Exception $e ) |
|
| 168 | + { |
|
| 151 | 169 | throw new Exception( $e->getMessage(), 0, $e ); |
| 152 | 170 | } |
| 153 | 171 | } |
@@ -176,9 +194,12 @@ discard block |
||
| 176 | 194 | */ |
| 177 | 195 | public function read( $path ) |
| 178 | 196 | { |
| 179 | - try { |
|
| 197 | + try |
|
| 198 | + { |
|
| 180 | 199 | return $this->fs->get( $path ); |
| 181 | - } catch( \Exception $e ) { |
|
| 200 | + } |
|
| 201 | + catch( \Exception $e ) |
|
| 202 | + { |
|
| 182 | 203 | throw new Exception( $e->getMessage(), 0, $e ); |
| 183 | 204 | } |
| 184 | 205 | } |
@@ -216,9 +237,12 @@ discard block |
||
| 216 | 237 | */ |
| 217 | 238 | public function reads( $path ) |
| 218 | 239 | { |
| 219 | - try { |
|
| 240 | + try |
|
| 241 | + { |
|
| 220 | 242 | $content = $this->fs->get( $path ); |
| 221 | - } catch( \Exception $e ) { |
|
| 243 | + } |
|
| 244 | + catch( \Exception $e ) |
|
| 245 | + { |
|
| 222 | 246 | throw new Exception( $e->getMessage(), 0, $e ); |
| 223 | 247 | } |
| 224 | 248 | |
@@ -250,9 +274,12 @@ discard block |
||
| 250 | 274 | */ |
| 251 | 275 | public function write( $path, $content ) |
| 252 | 276 | { |
| 253 | - try { |
|
| 277 | + try |
|
| 278 | + { |
|
| 254 | 279 | $this->fs->put( $path, $content ); |
| 255 | - } catch( \Exception $e ) { |
|
| 280 | + } |
|
| 281 | + catch( \Exception $e ) |
|
| 282 | + { |
|
| 256 | 283 | throw new Exception( $e->getMessage(), 0, $e ); |
| 257 | 284 | } |
| 258 | 285 | } |
@@ -295,9 +322,12 @@ discard block |
||
| 295 | 322 | throw new Exception( $error['message'] ); |
| 296 | 323 | } |
| 297 | 324 | |
| 298 | - try { |
|
| 325 | + try |
|
| 326 | + { |
|
| 299 | 327 | $this->fs->put( $path, $content ); |
| 300 | - } catch( \Exception $e ) { |
|
| 328 | + } |
|
| 329 | + catch( \Exception $e ) |
|
| 330 | + { |
|
| 301 | 331 | throw new Exception( $e->getMessage(), 0, $e ); |
| 302 | 332 | } |
| 303 | 333 | } |
@@ -313,9 +343,12 @@ discard block |
||
| 313 | 343 | */ |
| 314 | 344 | public function move( $from, $to ) |
| 315 | 345 | { |
| 316 | - try { |
|
| 346 | + try |
|
| 347 | + { |
|
| 317 | 348 | $this->fs->move( $from, $to ); |
| 318 | - } catch( \Exception $e ) { |
|
| 349 | + } |
|
| 350 | + catch( \Exception $e ) |
|
| 351 | + { |
|
| 319 | 352 | throw new Exception( $e->getMessage(), 0, $e ); |
| 320 | 353 | } |
| 321 | 354 | } |
@@ -331,9 +364,12 @@ discard block |
||
| 331 | 364 | */ |
| 332 | 365 | public function copy( $from, $to ) |
| 333 | 366 | { |
| 334 | - try { |
|
| 367 | + try |
|
| 368 | + { |
|
| 335 | 369 | $this->fs->copy( $from, $to ); |
| 336 | - } catch( \Exception $e ) { |
|
| 370 | + } |
|
| 371 | + catch( \Exception $e ) |
|
| 372 | + { |
|
| 337 | 373 | throw new Exception( $e->getMessage(), 0, $e ); |
| 338 | 374 | } |
| 339 | 375 | } |
@@ -47,8 +47,7 @@ |
||
| 47 | 47 | $factory = $this->factory; |
| 48 | 48 | $lv = $factory->file( $filename, $values ); |
| 49 | 49 | |
| 50 | - $fcn = function() use ( $factory, $view ) |
|
| 51 | - { |
|
| 50 | + $fcn = function() use ( $factory, $view ) { |
|
| 52 | 51 | foreach( $factory->getSections() as $name => $section ) { |
| 53 | 52 | $view->block()->set( $name, $section ); |
| 54 | 53 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | { |
| 59 | 59 | $this->execute( $stmt ); |
| 60 | 60 | $this->status( 'done' ); |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $this->status( 'OK' ); |
| 65 | 64 | } |
@@ -216,13 +216,13 @@ |
||
| 216 | 216 | $expr[] = $search->compare( '==', 'customer.longitude', '10.0' ); |
| 217 | 217 | $expr[] = $search->compare( '==', 'customer.latitude', '50.0' ); |
| 218 | 218 | |
| 219 | - $param = ['text','default', 0]; |
|
| 219 | + $param = ['text', 'default', 0]; |
|
| 220 | 220 | $expr[] = $search->compare( '==', $search->createFunction( 'customer:has', $param ), null ); |
| 221 | 221 | |
| 222 | - $param = ['text','default', $listItem->getRefId()]; |
|
| 222 | + $param = ['text', 'default', $listItem->getRefId()]; |
|
| 223 | 223 | $expr[] = $search->compare( '!=', $search->createFunction( 'customer:has', $param ), null ); |
| 224 | 224 | |
| 225 | - $param = ['text','default']; |
|
| 225 | + $param = ['text', 'default']; |
|
| 226 | 226 | $expr[] = $search->compare( '!=', $search->createFunction( 'customer:has', $param ), null ); |
| 227 | 227 | |
| 228 | 228 | $param = ['text']; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | protected function tearDown() |
| 29 | 29 | { |
| 30 | - unset($this->object); |
|
| 30 | + unset( $this->object ); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $results = $this->object->searchItems( $search ); |
| 72 | 72 | |
| 73 | - if( ($expected = reset($results) ) === false ) |
|
| 73 | + if( ( $expected = reset( $results ) ) === false ) |
|
| 74 | 74 | { |
| 75 | 75 | throw new \RuntimeException( 'No property type item found.' ); |
| 76 | 76 | } |
@@ -92,13 +92,13 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $search = $this->object->createSearch(); |
| 94 | 94 | $search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) ); |
| 95 | - $results = $this->object->searchItems($search); |
|
| 95 | + $results = $this->object->searchItems( $search ); |
|
| 96 | 96 | |
| 97 | - if( ( $item = reset($results) ) === false ) { |
|
| 97 | + if( ( $item = reset( $results ) ) === false ) { |
|
| 98 | 98 | throw new \RuntimeException( 'No type item found' ); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $item->setId(null); |
|
| 101 | + $item->setId( null ); |
|
| 102 | 102 | $item->setCode( 'unitTestSave' ); |
| 103 | 103 | $resultSaved = $this->object->saveItem( $item ); |
| 104 | 104 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -159,19 +159,19 @@ discard block |
||
| 159 | 159 | $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
| 160 | 160 | $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
| 161 | 161 | |
| 162 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
| 162 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 163 | 163 | $results = $this->object->searchItems( $search, [], $total ); |
| 164 | 164 | $this->assertEquals( 1, count( $results ) ); |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | $search = $this->object->createSearch(); |
| 168 | 168 | $conditions = array( |
| 169 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter'), |
|
| 169 | + $search->compare( '=~', 'customer.property.type.code', 'newsletter' ), |
|
| 170 | 170 | $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
| 171 | 171 | ); |
| 172 | - $search->setConditions( $search->combine('&&', $conditions ) ); |
|
| 173 | - $search->setSlice(0, 1); |
|
| 174 | - $items = $this->object->searchItems( $search, [], $total); |
|
| 172 | + $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 173 | + $search->setSlice( 0, 1 ); |
|
| 174 | + $items = $this->object->searchItems( $search, [], $total ); |
|
| 175 | 175 | |
| 176 | 176 | $this->assertEquals( 1, count( $items ) ); |
| 177 | 177 | $this->assertEquals( 1, $total ); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | public function testGetSubManager() |
| 186 | 186 | { |
| 187 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 188 | - $this->object->getSubManager('unknown'); |
|
| 187 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 188 | + $this->object->getSubManager( 'unknown' ); |
|
| 189 | 189 | } |
| 190 | 190 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | public function testGetItem() |
| 46 | 46 | { |
| 47 | 47 | $search = $this->object->createSearch(); |
| 48 | - $search->setSlice(0, 1); |
|
| 49 | - $results = $this->object->searchItems($search); |
|
| 48 | + $search->setSlice( 0, 1 ); |
|
| 49 | + $results = $this->object->searchItems( $search ); |
|
| 50 | 50 | |
| 51 | - if( ( $expected = reset($results) ) === false ) { |
|
| 51 | + if( ( $expected = reset( $results ) ) === false ) { |
|
| 52 | 52 | throw new \RuntimeException( 'No list type item found' ); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -66,14 +66,14 @@ discard block |
||
| 66 | 66 | public function testSaveUpdateDeleteItem() |
| 67 | 67 | { |
| 68 | 68 | $search = $this->object->createSearch(); |
| 69 | - $search->setSlice(0, 1); |
|
| 70 | - $results = $this->object->searchItems($search); |
|
| 69 | + $search->setSlice( 0, 1 ); |
|
| 70 | + $results = $this->object->searchItems( $search ); |
|
| 71 | 71 | |
| 72 | - if( ( $item = reset($results) ) === false ) { |
|
| 72 | + if( ( $item = reset( $results ) ) === false ) { |
|
| 73 | 73 | throw new \RuntimeException( 'No type item found' ); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - $item->setId(null); |
|
| 76 | + $item->setId( null ); |
|
| 77 | 77 | $item->setCode( 'unitTestInit' ); |
| 78 | 78 | $resultSaved = $this->object->saveItem( $item ); |
| 79 | 79 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Iface::class, $resultSaved ); |
| 113 | 113 | $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Iface::class, $resultUpd ); |
| 114 | 114 | |
| 115 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 115 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 116 | 116 | $this->object->getItem( $itemSaved->getId() ); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
| 136 | 136 | |
| 137 | 137 | $search->setConditions( $search->combine( '&&', $expr ) ); |
| 138 | - $search->setSlice(0, 1); |
|
| 138 | + $search->setSlice( 0, 1 ); |
|
| 139 | 139 | |
| 140 | 140 | $results = $this->object->searchItems( $search, [], $total ); |
| 141 | 141 | $this->assertEquals( 1, count( $results ) ); |
@@ -571,7 +571,7 @@ |
||
| 571 | 571 | } |
| 572 | 572 | catch( \Exception $e ) |
| 573 | 573 | { |
| 574 | - $dbm->release( $conn, $dbname ); |
|
| 574 | + $dbm->release( $conn, $dbname ); |
|
| 575 | 575 | throw $e; |
| 576 | 576 | } |
| 577 | 577 | |
@@ -420,8 +420,7 @@ |
||
| 420 | 420 | */ |
| 421 | 421 | $path = 'mshop/customer/manager/laravel/insert'; |
| 422 | 422 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
| 423 | - } |
|
| 424 | - else |
|
| 423 | + } else |
|
| 425 | 424 | { |
| 426 | 425 | /** mshop/customer/manager/laravel/update |
| 427 | 426 | * Updates an existing customer record in the database |
@@ -44,9 +44,12 @@ discard block |
||
| 44 | 44 | $schema = $this->getSchema( 'db-customer' ); |
| 45 | 45 | $sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = \'users\' AND COLUMN_NAME = \'id\''; |
| 46 | 46 | |
| 47 | - try { |
|
| 47 | + try |
|
| 48 | + { |
|
| 48 | 49 | $type = $this->getValue( $sql, 'COLUMN_TYPE', 'db-customer' ); |
| 49 | - } catch( \Aimeos\MW\Exception $e ) { |
|
| 50 | + } |
|
| 51 | + catch( \Aimeos\MW\Exception $e ) |
|
| 52 | + { |
|
| 50 | 53 | $type = null; |
| 51 | 54 | } |
| 52 | 55 | |
@@ -62,8 +65,7 @@ discard block |
||
| 62 | 65 | { |
| 63 | 66 | $this->execute( 'ALTER TABLE "users_address" DROP FOREIGN KEY "fk_lvuad_pid"', 'db-customer' ); |
| 64 | 67 | $this->status( 'done' ); |
| 65 | - } |
|
| 66 | - else |
|
| 68 | + } else |
|
| 67 | 69 | { |
| 68 | 70 | $this->status( 'OK' ); |
| 69 | 71 | } |
@@ -75,8 +77,7 @@ discard block |
||
| 75 | 77 | { |
| 76 | 78 | $this->execute( 'ALTER TABLE "users_list" DROP FOREIGN KEY "fk_lvuli_pid"', 'db-customer' ); |
| 77 | 79 | $this->status( 'done' ); |
| 78 | - } |
|
| 79 | - else |
|
| 80 | + } else |
|
| 80 | 81 | { |
| 81 | 82 | $this->status( 'OK' ); |
| 82 | 83 | } |
@@ -88,8 +89,7 @@ discard block |
||
| 88 | 89 | { |
| 89 | 90 | $this->execute( 'ALTER TABLE "users_property" DROP FOREIGN KEY "fk_lvupr_pid"', 'db-customer' ); |
| 90 | 91 | $this->status( 'done' ); |
| 91 | - } |
|
| 92 | - else |
|
| 92 | + } else |
|
| 93 | 93 | { |
| 94 | 94 | $this->status( 'OK' ); |
| 95 | 95 | } |