@@ -476,7 +476,7 @@ |
||
| 476 | 476 | /** |
| 477 | 477 | * Constructs the data array for the view from the given item |
| 478 | 478 | * |
| 479 | - * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object |
|
| 479 | + * @param \Aimeos\MShop\Locale\Item\Language\Iface $item Locale item object |
|
| 480 | 480 | * @return string[] Multi-dimensional associative list of item data |
| 481 | 481 | */ |
| 482 | 482 | protected function toArray( \Aimeos\MShop\Locale\Item\Language\Iface $item, $copy = false ) |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | namespace Aimeos\Admin\JQAdm\Locale\Language; |
| 12 | 12 | |
| 13 | -sprintf( 'locale/language' ); // for translation |
|
| 13 | +sprintf('locale/language'); // for translation |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | try |
| 37 | 37 | { |
| 38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
| 39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
| 38 | + if (($id = $view->param('id')) === null) { |
|
| 39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
| 43 | - $view->item = $manager->getItem( $id ); |
|
| 42 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
| 43 | + $view->item = $manager->getItem($id); |
|
| 44 | 44 | |
| 45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
| 45 | + $view->itemData = $this->toArray($view->item, true); |
|
| 46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
| 47 | 47 | $view->itemBody = ''; |
| 48 | 48 | |
| 49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
| 49 | + foreach ($this->getSubClients() as $idx => $client) |
|
| 50 | 50 | { |
| 51 | 51 | $view->tabindex = ++$idx + 1; |
| 52 | 52 | $view->itemBody .= $client->copy(); |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 55 | + catch (\Aimeos\MShop\Exception $e) |
|
| 56 | 56 | { |
| 57 | - $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 59 | - $this->logException( $e ); |
|
| 57 | + $error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 58 | + $view->errors = $view->get('errors', []) + $error; |
|
| 59 | + $this->logException($e); |
|
| 60 | 60 | } |
| 61 | - catch( \Exception $e ) |
|
| 61 | + catch (\Exception $e) |
|
| 62 | 62 | { |
| 63 | - $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 65 | - $this->logException( $e ); |
|
| 63 | + $error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 64 | + $view->errors = $view->get('errors', []) + $error; |
|
| 65 | + $this->logException($e); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - return $this->render( $view ); |
|
| 68 | + return $this->render($view); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -81,36 +81,36 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | try |
| 83 | 83 | { |
| 84 | - $data = $view->param( 'item', [] ); |
|
| 84 | + $data = $view->param('item', []); |
|
| 85 | 85 | |
| 86 | - if( !isset( $view->item ) ) { |
|
| 87 | - $view->item = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' )->createItem(); |
|
| 86 | + if (!isset($view->item)) { |
|
| 87 | + $view->item = \Aimeos\MShop\Factory::createManager($context, 'locale/language')->createItem(); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $view->itemSubparts = $this->getSubClientNames(); |
| 91 | 91 | $view->itemData = $data; |
| 92 | 92 | $view->itemBody = ''; |
| 93 | 93 | |
| 94 | - foreach( $this->getSubClients() as $idx => $client ) |
|
| 94 | + foreach ($this->getSubClients() as $idx => $client) |
|
| 95 | 95 | { |
| 96 | 96 | $view->tabindex = ++$idx + 1; |
| 97 | 97 | $view->itemBody .= $client->create(); |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 100 | + catch (\Aimeos\MShop\Exception $e) |
|
| 101 | 101 | { |
| 102 | - $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 103 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 104 | - $this->logException( $e ); |
|
| 102 | + $error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 103 | + $view->errors = $view->get('errors', []) + $error; |
|
| 104 | + $this->logException($e); |
|
| 105 | 105 | } |
| 106 | - catch( \Exception $e ) |
|
| 106 | + catch (\Exception $e) |
|
| 107 | 107 | { |
| 108 | - $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 109 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 110 | - $this->logException( $e ); |
|
| 108 | + $error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 109 | + $view->errors = $view->get('errors', []) + $error; |
|
| 110 | + $this->logException($e); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - return $this->render( $view ); |
|
| 113 | + return $this->render($view); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -124,38 +124,38 @@ discard block |
||
| 124 | 124 | $view = $this->getView(); |
| 125 | 125 | $context = $this->getContext(); |
| 126 | 126 | |
| 127 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
| 127 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
| 128 | 128 | $manager->begin(); |
| 129 | 129 | |
| 130 | 130 | try |
| 131 | 131 | { |
| 132 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
| 133 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
| 132 | + if (($id = $view->param('id')) === null) { |
|
| 133 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $view->item = $manager->getItem( $id ); |
|
| 136 | + $view->item = $manager->getItem($id); |
|
| 137 | 137 | |
| 138 | - foreach( $this->getSubClients() as $client ) { |
|
| 138 | + foreach ($this->getSubClients() as $client) { |
|
| 139 | 139 | $client->delete(); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $manager->deleteItem( $id ); |
|
| 142 | + $manager->deleteItem($id); |
|
| 143 | 143 | $manager->commit(); |
| 144 | 144 | |
| 145 | - $this->nextAction( $view, 'search', 'locale/language', null, 'delete' ); |
|
| 145 | + $this->nextAction($view, 'search', 'locale/language', null, 'delete'); |
|
| 146 | 146 | return; |
| 147 | 147 | } |
| 148 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 148 | + catch (\Aimeos\MShop\Exception $e) |
|
| 149 | 149 | { |
| 150 | - $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 151 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 152 | - $this->logException( $e ); |
|
| 150 | + $error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 151 | + $view->errors = $view->get('errors', []) + $error; |
|
| 152 | + $this->logException($e); |
|
| 153 | 153 | } |
| 154 | - catch( \Exception $e ) |
|
| 154 | + catch (\Exception $e) |
|
| 155 | 155 | { |
| 156 | - $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 157 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 158 | - $this->logException( $e ); |
|
| 156 | + $error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 157 | + $view->errors = $view->get('errors', []) + $error; |
|
| 158 | + $this->logException($e); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | $manager->rollback(); |
@@ -176,37 +176,37 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | try |
| 178 | 178 | { |
| 179 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
| 180 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
| 179 | + if (($id = $view->param('id')) === null) { |
|
| 180 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
| 183 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
| 184 | 184 | |
| 185 | - $view->item = $manager->getItem( $id ); |
|
| 185 | + $view->item = $manager->getItem($id); |
|
| 186 | 186 | $view->itemSubparts = $this->getSubClientNames(); |
| 187 | - $view->itemData = $this->toArray( $view->item ); |
|
| 187 | + $view->itemData = $this->toArray($view->item); |
|
| 188 | 188 | $view->itemBody = ''; |
| 189 | 189 | |
| 190 | - foreach( $this->getSubClients() as $idx => $client ) |
|
| 190 | + foreach ($this->getSubClients() as $idx => $client) |
|
| 191 | 191 | { |
| 192 | 192 | $view->tabindex = ++$idx + 1; |
| 193 | 193 | $view->itemBody .= $client->get(); |
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 196 | + catch (\Aimeos\MShop\Exception $e) |
|
| 197 | 197 | { |
| 198 | - $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 199 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 200 | - $this->logException( $e ); |
|
| 198 | + $error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 199 | + $view->errors = $view->get('errors', []) + $error; |
|
| 200 | + $this->logException($e); |
|
| 201 | 201 | } |
| 202 | - catch( \Exception $e ) |
|
| 202 | + catch (\Exception $e) |
|
| 203 | 203 | { |
| 204 | - $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 205 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 206 | - $this->logException( $e ); |
|
| 204 | + $error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 205 | + $view->errors = $view->get('errors', []) + $error; |
|
| 206 | + $this->logException($e); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - return $this->render( $view ); |
|
| 209 | + return $this->render($view); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
@@ -220,40 +220,40 @@ discard block |
||
| 220 | 220 | $view = $this->getView(); |
| 221 | 221 | $context = $this->getContext(); |
| 222 | 222 | |
| 223 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
| 223 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
| 224 | 224 | $manager->begin(); |
| 225 | 225 | |
| 226 | 226 | try |
| 227 | 227 | { |
| 228 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
| 229 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
| 228 | + $item = $this->fromArray($view->param('item', [])); |
|
| 229 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
| 230 | 230 | $view->itemBody = ''; |
| 231 | 231 | |
| 232 | - foreach( $this->getSubClients() as $client ) { |
|
| 232 | + foreach ($this->getSubClients() as $client) { |
|
| 233 | 233 | $view->itemBody .= $client->save(); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - $manager->saveItem( clone $view->item ); |
|
| 236 | + $manager->saveItem(clone $view->item); |
|
| 237 | 237 | $manager->commit(); |
| 238 | 238 | |
| 239 | - $this->nextAction( $view, $view->param( 'next' ), 'locale/language', $view->item->getId(), 'save' ); |
|
| 239 | + $this->nextAction($view, $view->param('next'), 'locale/language', $view->item->getId(), 'save'); |
|
| 240 | 240 | return; |
| 241 | 241 | } |
| 242 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
| 242 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
| 243 | 243 | { |
| 244 | 244 | // fall through to create |
| 245 | 245 | } |
| 246 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 246 | + catch (\Aimeos\MShop\Exception $e) |
|
| 247 | 247 | { |
| 248 | - $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 249 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 250 | - $this->logException( $e ); |
|
| 248 | + $error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 249 | + $view->errors = $view->get('errors', []) + $error; |
|
| 250 | + $this->logException($e); |
|
| 251 | 251 | } |
| 252 | - catch( \Exception $e ) |
|
| 252 | + catch (\Exception $e) |
|
| 253 | 253 | { |
| 254 | - $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 255 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 256 | - $this->logException( $e ); |
|
| 254 | + $error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 255 | + $view->errors = $view->get('errors', []) + $error; |
|
| 256 | + $this->logException($e); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | $manager->rollback(); |
@@ -275,34 +275,34 @@ discard block |
||
| 275 | 275 | try |
| 276 | 276 | { |
| 277 | 277 | $total = 0; |
| 278 | - $params = $this->storeSearchParams( $view->param(), 'locale/language' ); |
|
| 279 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
| 278 | + $params = $this->storeSearchParams($view->param(), 'locale/language'); |
|
| 279 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
| 280 | 280 | |
| 281 | 281 | $search = $manager->createSearch(); |
| 282 | - $search->setSortations( [$search->sort( '-', 'locale.language.status'), $search->sort( '+', 'locale.language.id')] ); |
|
| 283 | - $search = $this->initCriteria( $search, $params ); |
|
| 282 | + $search->setSortations([$search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.id')]); |
|
| 283 | + $search = $this->initCriteria($search, $params); |
|
| 284 | 284 | |
| 285 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
| 286 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
| 285 | + $view->items = $manager->searchItems($search, [], $total); |
|
| 286 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
| 287 | 287 | $view->filterOperators = $search->getOperators(); |
| 288 | 288 | $view->total = $total; |
| 289 | 289 | $view->itemBody = ''; |
| 290 | 290 | |
| 291 | - foreach( $this->getSubClients() as $client ) { |
|
| 291 | + foreach ($this->getSubClients() as $client) { |
|
| 292 | 292 | $view->itemBody .= $client->search(); |
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 295 | + catch (\Aimeos\MShop\Exception $e) |
|
| 296 | 296 | { |
| 297 | - $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 298 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 299 | - $this->logException( $e ); |
|
| 297 | + $error = array('locale-language-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 298 | + $view->errors = $view->get('errors', []) + $error; |
|
| 299 | + $this->logException($e); |
|
| 300 | 300 | } |
| 301 | - catch( \Exception $e ) |
|
| 301 | + catch (\Exception $e) |
|
| 302 | 302 | { |
| 303 | - $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 304 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 305 | - $this->logException( $e ); |
|
| 303 | + $error = array('locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 304 | + $view->errors = $view->get('errors', []) + $error; |
|
| 305 | + $this->logException($e); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /** admin/jqadm/locale/language/template-list |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $tplconf = 'admin/jqadm/locale/language/template-list'; |
| 328 | 328 | $default = 'locale/language/list-standard'; |
| 329 | 329 | |
| 330 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 330 | + return $view->render($view->config($tplconf, $default)); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | * @param string|null $name Name of the sub-client (Default if null) |
| 339 | 339 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
| 340 | 340 | */ |
| 341 | - public function getSubClient( $type, $name = null ) |
|
| 341 | + public function getSubClient($type, $name = null) |
|
| 342 | 342 | { |
| 343 | 343 | /** admin/jqadm/locale/language/decorators/excludes |
| 344 | 344 | * Excludes decorators added by the "common" option from the locale JQAdm client |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | * @see admin/jqadm/locale/language/decorators/excludes |
| 414 | 414 | * @see admin/jqadm/locale/language/decorators/global |
| 415 | 415 | */ |
| 416 | - return $this->createSubClient( 'locale/language' . $type, $name ); |
|
| 416 | + return $this->createSubClient('locale/language' . $type, $name); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | * @since 2017.10 |
| 458 | 458 | * @category Developer |
| 459 | 459 | */ |
| 460 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/locale/language/standard/subparts', [] ); |
|
| 460 | + return $this->getContext()->getConfig()->get('admin/jqadm/locale/language/standard/subparts', []); |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | |
@@ -468,17 +468,17 @@ discard block |
||
| 468 | 468 | * @param string[] Data array |
| 469 | 469 | * @return \Aimeos\MShop\Locale\Item\Iface New locale item object |
| 470 | 470 | */ |
| 471 | - protected function fromArray( array $data ) |
|
| 471 | + protected function fromArray(array $data) |
|
| 472 | 472 | { |
| 473 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/language' ); |
|
| 473 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/language'); |
|
| 474 | 474 | |
| 475 | - if( isset( $data['locale.language.id'] ) && $data['locale.language.id'] != '' ) { |
|
| 476 | - $item = $manager->getItem( $data['locale.language.id'] ); |
|
| 475 | + if (isset($data['locale.language.id']) && $data['locale.language.id'] != '') { |
|
| 476 | + $item = $manager->getItem($data['locale.language.id']); |
|
| 477 | 477 | } else { |
| 478 | 478 | $item = $manager->createItem(); |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - $item->fromArray( $data ); |
|
| 481 | + $item->fromArray($data); |
|
| 482 | 482 | |
| 483 | 483 | return $item; |
| 484 | 484 | } |
@@ -490,11 +490,11 @@ discard block |
||
| 490 | 490 | * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object |
| 491 | 491 | * @return string[] Multi-dimensional associative list of item data |
| 492 | 492 | */ |
| 493 | - protected function toArray( \Aimeos\MShop\Locale\Item\Language\Iface $item, $copy = false ) |
|
| 493 | + protected function toArray(\Aimeos\MShop\Locale\Item\Language\Iface $item, $copy = false) |
|
| 494 | 494 | { |
| 495 | - $data = $item->toArray( true ); |
|
| 495 | + $data = $item->toArray(true); |
|
| 496 | 496 | |
| 497 | - if( $copy === true ) |
|
| 497 | + if ($copy === true) |
|
| 498 | 498 | { |
| 499 | 499 | $data['locale.language.id'] = ''; |
| 500 | 500 | $data['locale.language.code'] = ''; |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
| 511 | 511 | * @return string HTML output |
| 512 | 512 | */ |
| 513 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
| 513 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
| 514 | 514 | { |
| 515 | 515 | /** admin/jqadm/locale/language/template-item |
| 516 | 516 | * Relative path to the HTML body template for the locale item. |
@@ -534,6 +534,6 @@ discard block |
||
| 534 | 534 | $tplconf = 'admin/jqadm/locale/language/template-item'; |
| 535 | 535 | $default = 'locale/language/item-standard'; |
| 536 | 536 | |
| 537 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 537 | + return $view->render($view->config($tplconf, $default)); |
|
| 538 | 538 | } |
| 539 | 539 | } |
@@ -51,14 +51,12 @@ discard block |
||
| 51 | 51 | $view->tabindex = ++$idx + 1; |
| 52 | 52 | $view->itemBody .= $client->copy(); |
| 53 | 53 | } |
| 54 | - } |
|
| 55 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 54 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 56 | 55 | { |
| 57 | 56 | $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 58 | 57 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 59 | 58 | $this->logException( $e ); |
| 60 | - } |
|
| 61 | - catch( \Exception $e ) |
|
| 59 | + } catch( \Exception $e ) |
|
| 62 | 60 | { |
| 63 | 61 | $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 64 | 62 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -96,14 +94,12 @@ discard block |
||
| 96 | 94 | $view->tabindex = ++$idx + 1; |
| 97 | 95 | $view->itemBody .= $client->create(); |
| 98 | 96 | } |
| 99 | - } |
|
| 100 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 97 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 101 | 98 | { |
| 102 | 99 | $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 103 | 100 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 104 | 101 | $this->logException( $e ); |
| 105 | - } |
|
| 106 | - catch( \Exception $e ) |
|
| 102 | + } catch( \Exception $e ) |
|
| 107 | 103 | { |
| 108 | 104 | $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 109 | 105 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -144,14 +140,12 @@ discard block |
||
| 144 | 140 | |
| 145 | 141 | $this->nextAction( $view, 'search', 'locale/language', null, 'delete' ); |
| 146 | 142 | return; |
| 147 | - } |
|
| 148 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 143 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 149 | 144 | { |
| 150 | 145 | $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 151 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 152 | 147 | $this->logException( $e ); |
| 153 | - } |
|
| 154 | - catch( \Exception $e ) |
|
| 148 | + } catch( \Exception $e ) |
|
| 155 | 149 | { |
| 156 | 150 | $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 157 | 151 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -192,14 +186,12 @@ discard block |
||
| 192 | 186 | $view->tabindex = ++$idx + 1; |
| 193 | 187 | $view->itemBody .= $client->get(); |
| 194 | 188 | } |
| 195 | - } |
|
| 196 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 189 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 197 | 190 | { |
| 198 | 191 | $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 199 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 200 | 193 | $this->logException( $e ); |
| 201 | - } |
|
| 202 | - catch( \Exception $e ) |
|
| 194 | + } catch( \Exception $e ) |
|
| 203 | 195 | { |
| 204 | 196 | $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 205 | 197 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -238,18 +230,15 @@ discard block |
||
| 238 | 230 | |
| 239 | 231 | $this->nextAction( $view, $view->param( 'next' ), 'locale/language', $view->item->getId(), 'save' ); |
| 240 | 232 | return; |
| 241 | - } |
|
| 242 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
| 233 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
| 243 | 234 | { |
| 244 | 235 | // fall through to create |
| 245 | - } |
|
| 246 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 236 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 247 | 237 | { |
| 248 | 238 | $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 249 | 239 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 250 | 240 | $this->logException( $e ); |
| 251 | - } |
|
| 252 | - catch( \Exception $e ) |
|
| 241 | + } catch( \Exception $e ) |
|
| 253 | 242 | { |
| 254 | 243 | $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 255 | 244 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -291,14 +280,12 @@ discard block |
||
| 291 | 280 | foreach( $this->getSubClients() as $client ) { |
| 292 | 281 | $view->itemBody .= $client->search(); |
| 293 | 282 | } |
| 294 | - } |
|
| 295 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 283 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 296 | 284 | { |
| 297 | 285 | $error = array( 'locale-language-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 298 | 286 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 299 | 287 | $this->logException( $e ); |
| 300 | - } |
|
| 301 | - catch( \Exception $e ) |
|
| 288 | + } catch( \Exception $e ) |
|
| 302 | 289 | { |
| 303 | 290 | $error = array( 'locale-language-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 304 | 291 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -479,7 +479,7 @@ |
||
| 479 | 479 | /** |
| 480 | 480 | * Constructs the data array for the view from the given item |
| 481 | 481 | * |
| 482 | - * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object |
|
| 482 | + * @param \Aimeos\MShop\Locale\Item\Currency\Iface $item Locale item object |
|
| 483 | 483 | * @return string[] Multi-dimensional associative list of item data |
| 484 | 484 | */ |
| 485 | 485 | protected function toArray( \Aimeos\MShop\Locale\Item\Currency\Iface $item, $copy = false ) |
@@ -88,14 +88,12 @@ discard block |
||
| 88 | 88 | $view->tabindex = ++$idx + 1; |
| 89 | 89 | $view->itemBody .= $client->copy(); |
| 90 | 90 | } |
| 91 | - } |
|
| 92 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 93 | 92 | { |
| 94 | 93 | $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 96 | 95 | $this->logException( $e ); |
| 97 | - } |
|
| 98 | - catch( \Exception $e ) |
|
| 96 | + } catch( \Exception $e ) |
|
| 99 | 97 | { |
| 100 | 98 | $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -135,14 +133,12 @@ discard block |
||
| 135 | 133 | $view->tabindex = ++$idx + 1; |
| 136 | 134 | $view->itemBody .= $client->create(); |
| 137 | 135 | } |
| 138 | - } |
|
| 139 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 136 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 140 | 137 | { |
| 141 | 138 | $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 142 | 139 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 143 | 140 | $this->logException( $e ); |
| 144 | - } |
|
| 145 | - catch( \Exception $e ) |
|
| 141 | + } catch( \Exception $e ) |
|
| 146 | 142 | { |
| 147 | 143 | $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 148 | 144 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -183,14 +179,12 @@ discard block |
||
| 183 | 179 | |
| 184 | 180 | $this->nextAction( $view, 'search', 'locale/currency', null, 'delete' ); |
| 185 | 181 | return; |
| 186 | - } |
|
| 187 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 182 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 188 | 183 | { |
| 189 | 184 | $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 190 | 185 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 191 | 186 | $this->logException( $e ); |
| 192 | - } |
|
| 193 | - catch( \Exception $e ) |
|
| 187 | + } catch( \Exception $e ) |
|
| 194 | 188 | { |
| 195 | 189 | $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 196 | 190 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -231,14 +225,12 @@ discard block |
||
| 231 | 225 | $view->tabindex = ++$idx + 1; |
| 232 | 226 | $view->itemBody .= $client->get(); |
| 233 | 227 | } |
| 234 | - } |
|
| 235 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 228 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 236 | 229 | { |
| 237 | 230 | $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 238 | 231 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 239 | 232 | $this->logException( $e ); |
| 240 | - } |
|
| 241 | - catch( \Exception $e ) |
|
| 233 | + } catch( \Exception $e ) |
|
| 242 | 234 | { |
| 243 | 235 | $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 244 | 236 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -275,18 +267,15 @@ discard block |
||
| 275 | 267 | |
| 276 | 268 | $this->nextAction( $view, $view->param( 'next' ), 'locale/currency', $view->item->getId(), 'save' ); |
| 277 | 269 | return; |
| 278 | - } |
|
| 279 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
| 270 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
| 280 | 271 | { |
| 281 | 272 | // fall through to create |
| 282 | - } |
|
| 283 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 273 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 284 | 274 | { |
| 285 | 275 | $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 286 | 276 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 287 | 277 | $this->logException( $e ); |
| 288 | - } |
|
| 289 | - catch( \Exception $e ) |
|
| 278 | + } catch( \Exception $e ) |
|
| 290 | 279 | { |
| 291 | 280 | $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 292 | 281 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -328,14 +317,12 @@ discard block |
||
| 328 | 317 | foreach( $this->getSubClients() as $client ) { |
| 329 | 318 | $view->itemBody .= $client->search(); |
| 330 | 319 | } |
| 331 | - } |
|
| 332 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 320 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 333 | 321 | { |
| 334 | 322 | $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
| 335 | 323 | $view->errors = $view->get( 'errors', [] ) + $error; |
| 336 | 324 | $this->logException( $e ); |
| 337 | - } |
|
| 338 | - catch( \Exception $e ) |
|
| 325 | + } catch( \Exception $e ) |
|
| 339 | 326 | { |
| 340 | 327 | $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
| 341 | 328 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | namespace Aimeos\Admin\JQAdm\Locale\Currency; |
| 12 | 12 | |
| 13 | -sprintf( 'locale/currency' ); // for translation |
|
| 13 | +sprintf('locale/currency'); // for translation |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | try |
| 37 | 37 | { |
| 38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
| 39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
| 38 | + if (($id = $view->param('id')) === null) { |
|
| 39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' ); |
|
| 43 | - $view->item = $manager->getItem( $id ); |
|
| 42 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/currency'); |
|
| 43 | + $view->item = $manager->getItem($id); |
|
| 44 | 44 | |
| 45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
| 45 | + $view->itemData = $this->toArray($view->item, true); |
|
| 46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
| 47 | 47 | $view->itemBody = ''; |
| 48 | 48 | |
| 49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
| 49 | + foreach ($this->getSubClients() as $idx => $client) |
|
| 50 | 50 | { |
| 51 | 51 | $view->tabindex = ++$idx + 1; |
| 52 | 52 | $view->itemBody .= $client->copy(); |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 55 | + catch (\Aimeos\MShop\Exception $e) |
|
| 56 | 56 | { |
| 57 | - $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 59 | - $this->logException( $e ); |
|
| 57 | + $error = array('locale-currency-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 58 | + $view->errors = $view->get('errors', []) + $error; |
|
| 59 | + $this->logException($e); |
|
| 60 | 60 | } |
| 61 | - catch( \Exception $e ) |
|
| 61 | + catch (\Exception $e) |
|
| 62 | 62 | { |
| 63 | - $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 65 | - $this->logException( $e ); |
|
| 63 | + $error = array('locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 64 | + $view->errors = $view->get('errors', []) + $error; |
|
| 65 | + $this->logException($e); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - return $this->render( $view ); |
|
| 68 | + return $this->render($view); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -81,36 +81,36 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | try |
| 83 | 83 | { |
| 84 | - $data = $view->param( 'item', [] ); |
|
| 84 | + $data = $view->param('item', []); |
|
| 85 | 85 | |
| 86 | - if( !isset( $view->item ) ) { |
|
| 87 | - $view->item = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' )->createItem(); |
|
| 86 | + if (!isset($view->item)) { |
|
| 87 | + $view->item = \Aimeos\MShop\Factory::createManager($context, 'locale/currency')->createItem(); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $view->itemSubparts = $this->getSubClientNames(); |
| 91 | 91 | $view->itemData = $data; |
| 92 | 92 | $view->itemBody = ''; |
| 93 | 93 | |
| 94 | - foreach( $this->getSubClients() as $idx => $client ) |
|
| 94 | + foreach ($this->getSubClients() as $idx => $client) |
|
| 95 | 95 | { |
| 96 | 96 | $view->tabindex = ++$idx + 1; |
| 97 | 97 | $view->itemBody .= $client->create(); |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 100 | + catch (\Aimeos\MShop\Exception $e) |
|
| 101 | 101 | { |
| 102 | - $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 103 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 104 | - $this->logException( $e ); |
|
| 102 | + $error = array('locale-currency-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 103 | + $view->errors = $view->get('errors', []) + $error; |
|
| 104 | + $this->logException($e); |
|
| 105 | 105 | } |
| 106 | - catch( \Exception $e ) |
|
| 106 | + catch (\Exception $e) |
|
| 107 | 107 | { |
| 108 | - $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 109 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 110 | - $this->logException( $e ); |
|
| 108 | + $error = array('locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 109 | + $view->errors = $view->get('errors', []) + $error; |
|
| 110 | + $this->logException($e); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - return $this->render( $view ); |
|
| 113 | + return $this->render($view); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -124,38 +124,38 @@ discard block |
||
| 124 | 124 | $view = $this->getView(); |
| 125 | 125 | $context = $this->getContext(); |
| 126 | 126 | |
| 127 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' ); |
|
| 127 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/currency'); |
|
| 128 | 128 | $manager->begin(); |
| 129 | 129 | |
| 130 | 130 | try |
| 131 | 131 | { |
| 132 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
| 133 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
| 132 | + if (($id = $view->param('id')) === null) { |
|
| 133 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $view->item = $manager->getItem( $id ); |
|
| 136 | + $view->item = $manager->getItem($id); |
|
| 137 | 137 | |
| 138 | - foreach( $this->getSubClients() as $client ) { |
|
| 138 | + foreach ($this->getSubClients() as $client) { |
|
| 139 | 139 | $client->delete(); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $manager->deleteItem( $id ); |
|
| 142 | + $manager->deleteItem($id); |
|
| 143 | 143 | $manager->commit(); |
| 144 | 144 | |
| 145 | - $this->nextAction( $view, 'search', 'locale/currency', null, 'delete' ); |
|
| 145 | + $this->nextAction($view, 'search', 'locale/currency', null, 'delete'); |
|
| 146 | 146 | return; |
| 147 | 147 | } |
| 148 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 148 | + catch (\Aimeos\MShop\Exception $e) |
|
| 149 | 149 | { |
| 150 | - $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 151 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 152 | - $this->logException( $e ); |
|
| 150 | + $error = array('locale-currency-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 151 | + $view->errors = $view->get('errors', []) + $error; |
|
| 152 | + $this->logException($e); |
|
| 153 | 153 | } |
| 154 | - catch( \Exception $e ) |
|
| 154 | + catch (\Exception $e) |
|
| 155 | 155 | { |
| 156 | - $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 157 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 158 | - $this->logException( $e ); |
|
| 156 | + $error = array('locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 157 | + $view->errors = $view->get('errors', []) + $error; |
|
| 158 | + $this->logException($e); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | $manager->rollback(); |
@@ -176,37 +176,37 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | try |
| 178 | 178 | { |
| 179 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
| 180 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
| 179 | + if (($id = $view->param('id')) === null) { |
|
| 180 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' ); |
|
| 183 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/currency'); |
|
| 184 | 184 | |
| 185 | - $view->item = $manager->getItem( $id ); |
|
| 185 | + $view->item = $manager->getItem($id); |
|
| 186 | 186 | $view->itemSubparts = $this->getSubClientNames(); |
| 187 | - $view->itemData = $this->toArray( $view->item ); |
|
| 187 | + $view->itemData = $this->toArray($view->item); |
|
| 188 | 188 | $view->itemBody = ''; |
| 189 | 189 | |
| 190 | - foreach( $this->getSubClients() as $idx => $client ) |
|
| 190 | + foreach ($this->getSubClients() as $idx => $client) |
|
| 191 | 191 | { |
| 192 | 192 | $view->tabindex = ++$idx + 1; |
| 193 | 193 | $view->itemBody .= $client->get(); |
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 196 | + catch (\Aimeos\MShop\Exception $e) |
|
| 197 | 197 | { |
| 198 | - $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 199 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 200 | - $this->logException( $e ); |
|
| 198 | + $error = array('locale-currency-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 199 | + $view->errors = $view->get('errors', []) + $error; |
|
| 200 | + $this->logException($e); |
|
| 201 | 201 | } |
| 202 | - catch( \Exception $e ) |
|
| 202 | + catch (\Exception $e) |
|
| 203 | 203 | { |
| 204 | - $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 205 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 206 | - $this->logException( $e ); |
|
| 204 | + $error = array('locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 205 | + $view->errors = $view->get('errors', []) + $error; |
|
| 206 | + $this->logException($e); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - return $this->render( $view ); |
|
| 209 | + return $this->render($view); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
@@ -220,40 +220,40 @@ discard block |
||
| 220 | 220 | $view = $this->getView(); |
| 221 | 221 | $context = $this->getContext(); |
| 222 | 222 | |
| 223 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' ); |
|
| 223 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/currency'); |
|
| 224 | 224 | $manager->begin(); |
| 225 | 225 | |
| 226 | 226 | try |
| 227 | 227 | { |
| 228 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
| 229 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
| 228 | + $item = $this->fromArray($view->param('item', [])); |
|
| 229 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
| 230 | 230 | $view->itemBody = ''; |
| 231 | 231 | |
| 232 | - foreach( $this->getSubClients() as $client ) { |
|
| 232 | + foreach ($this->getSubClients() as $client) { |
|
| 233 | 233 | $view->itemBody .= $client->save(); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - $manager->saveItem( clone $view->item ); |
|
| 236 | + $manager->saveItem(clone $view->item); |
|
| 237 | 237 | $manager->commit(); |
| 238 | 238 | |
| 239 | - $this->nextAction( $view, $view->param( 'next' ), 'locale/currency', $view->item->getId(), 'save' ); |
|
| 239 | + $this->nextAction($view, $view->param('next'), 'locale/currency', $view->item->getId(), 'save'); |
|
| 240 | 240 | return; |
| 241 | 241 | } |
| 242 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
| 242 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
| 243 | 243 | { |
| 244 | 244 | // fall through to create |
| 245 | 245 | } |
| 246 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 246 | + catch (\Aimeos\MShop\Exception $e) |
|
| 247 | 247 | { |
| 248 | - $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 249 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 250 | - $this->logException( $e ); |
|
| 248 | + $error = array('locale-currency-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 249 | + $view->errors = $view->get('errors', []) + $error; |
|
| 250 | + $this->logException($e); |
|
| 251 | 251 | } |
| 252 | - catch( \Exception $e ) |
|
| 252 | + catch (\Exception $e) |
|
| 253 | 253 | { |
| 254 | - $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 255 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 256 | - $this->logException( $e ); |
|
| 254 | + $error = array('locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 255 | + $view->errors = $view->get('errors', []) + $error; |
|
| 256 | + $this->logException($e); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | $manager->rollback(); |
@@ -275,34 +275,34 @@ discard block |
||
| 275 | 275 | try |
| 276 | 276 | { |
| 277 | 277 | $total = 0; |
| 278 | - $params = $this->storeSearchParams( $view->param(), 'locale/currency' ); |
|
| 279 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/currency' ); |
|
| 278 | + $params = $this->storeSearchParams($view->param(), 'locale/currency'); |
|
| 279 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/currency'); |
|
| 280 | 280 | |
| 281 | 281 | $search = $manager->createSearch(); |
| 282 | - $search->setSortations( [$search->sort( '-', 'locale.currency.status'), $search->sort( '+', 'locale.currency.id')] ); |
|
| 283 | - $search = $this->initCriteria( $search, $params ); |
|
| 282 | + $search->setSortations([$search->sort('-', 'locale.currency.status'), $search->sort('+', 'locale.currency.id')]); |
|
| 283 | + $search = $this->initCriteria($search, $params); |
|
| 284 | 284 | |
| 285 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
| 286 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
| 285 | + $view->items = $manager->searchItems($search, [], $total); |
|
| 286 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
| 287 | 287 | $view->filterOperators = $search->getOperators(); |
| 288 | 288 | $view->total = $total; |
| 289 | 289 | $view->itemBody = ''; |
| 290 | 290 | |
| 291 | - foreach( $this->getSubClients() as $client ) { |
|
| 291 | + foreach ($this->getSubClients() as $client) { |
|
| 292 | 292 | $view->itemBody .= $client->search(); |
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 295 | + catch (\Aimeos\MShop\Exception $e) |
|
| 296 | 296 | { |
| 297 | - $error = array( 'locale-currency-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 298 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 299 | - $this->logException( $e ); |
|
| 297 | + $error = array('locale-currency-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 298 | + $view->errors = $view->get('errors', []) + $error; |
|
| 299 | + $this->logException($e); |
|
| 300 | 300 | } |
| 301 | - catch( \Exception $e ) |
|
| 301 | + catch (\Exception $e) |
|
| 302 | 302 | { |
| 303 | - $error = array( 'locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
| 304 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
| 305 | - $this->logException( $e ); |
|
| 303 | + $error = array('locale-currency-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
| 304 | + $view->errors = $view->get('errors', []) + $error; |
|
| 305 | + $this->logException($e); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /** admin/jqadm/locale/currency/template-list |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $tplconf = 'admin/jqadm/locale/currency/template-list'; |
| 328 | 328 | $default = 'locale/currency/list-standard'; |
| 329 | 329 | |
| 330 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 330 | + return $view->render($view->config($tplconf, $default)); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | * @param string|null $name Name of the sub-client (Default if null) |
| 339 | 339 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
| 340 | 340 | */ |
| 341 | - public function getSubClient( $type, $name = null ) |
|
| 341 | + public function getSubClient($type, $name = null) |
|
| 342 | 342 | { |
| 343 | 343 | /** admin/jqadm/locale/currency/decorators/excludes |
| 344 | 344 | * Excludes decorators added by the "common" option from the locale JQAdm client |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | * @see admin/jqadm/locale/currency/decorators/excludes |
| 414 | 414 | * @see admin/jqadm/locale/currency/decorators/global |
| 415 | 415 | */ |
| 416 | - return $this->createSubClient( 'locale/currency' . $type, $name ); |
|
| 416 | + return $this->createSubClient('locale/currency' . $type, $name); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | * @since 2017.10 |
| 458 | 458 | * @category Developer |
| 459 | 459 | */ |
| 460 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/locale/currency/standard/subparts', [] ); |
|
| 460 | + return $this->getContext()->getConfig()->get('admin/jqadm/locale/currency/standard/subparts', []); |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | |
@@ -468,17 +468,17 @@ discard block |
||
| 468 | 468 | * @param string[] Data array |
| 469 | 469 | * @return \Aimeos\MShop\Locale\Item\Iface New locale item object |
| 470 | 470 | */ |
| 471 | - protected function fromArray( array $data ) |
|
| 471 | + protected function fromArray(array $data) |
|
| 472 | 472 | { |
| 473 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/currency' ); |
|
| 473 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/currency'); |
|
| 474 | 474 | |
| 475 | - if( isset( $data['locale.currency.id'] ) && $data['locale.currency.id'] != '' ) { |
|
| 476 | - $item = $manager->getItem( $data['locale.currency.id'] ); |
|
| 475 | + if (isset($data['locale.currency.id']) && $data['locale.currency.id'] != '') { |
|
| 476 | + $item = $manager->getItem($data['locale.currency.id']); |
|
| 477 | 477 | } else { |
| 478 | 478 | $item = $manager->createItem(); |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - $item->fromArray( $data ); |
|
| 481 | + $item->fromArray($data); |
|
| 482 | 482 | |
| 483 | 483 | return $item; |
| 484 | 484 | } |
@@ -490,11 +490,11 @@ discard block |
||
| 490 | 490 | * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object |
| 491 | 491 | * @return string[] Multi-dimensional associative list of item data |
| 492 | 492 | */ |
| 493 | - protected function toArray( \Aimeos\MShop\Locale\Item\Currency\Iface $item, $copy = false ) |
|
| 493 | + protected function toArray(\Aimeos\MShop\Locale\Item\Currency\Iface $item, $copy = false) |
|
| 494 | 494 | { |
| 495 | - $data = $item->toArray( true ); |
|
| 495 | + $data = $item->toArray(true); |
|
| 496 | 496 | |
| 497 | - if( $copy === true ) |
|
| 497 | + if ($copy === true) |
|
| 498 | 498 | { |
| 499 | 499 | $data['locale.currency.id'] = ''; |
| 500 | 500 | $data['locale.currency.code'] = ''; |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
| 511 | 511 | * @return string HTML output |
| 512 | 512 | */ |
| 513 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
| 513 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
| 514 | 514 | { |
| 515 | 515 | /** admin/jqadm/locale/currency/template-item |
| 516 | 516 | * Relative path to the HTML body template for the locale item. |
@@ -534,6 +534,6 @@ discard block |
||
| 534 | 534 | $tplconf = 'admin/jqadm/locale/currency/template-item'; |
| 535 | 535 | $default = 'locale/currency/item-standard'; |
| 536 | 536 | |
| 537 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 537 | + return $view->render($view->config($tplconf, $default)); |
|
| 538 | 538 | } |
| 539 | 539 | } |
@@ -13,63 +13,63 @@ discard block |
||
| 13 | 13 | public static function bootstrap() |
| 14 | 14 | { |
| 15 | 15 | self::getAimeos(); |
| 16 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 16 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
| 20 | - public static function getContext( $site = 'unittest' ) |
|
| 20 | + public static function getContext($site = 'unittest') |
|
| 21 | 21 | { |
| 22 | - if( !isset( self::$context[$site] ) ) { |
|
| 23 | - self::$context[$site] = self::createContext( $site ); |
|
| 22 | + if (!isset(self::$context[$site])) { |
|
| 23 | + self::$context[$site] = self::createContext($site); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | return clone self::$context[$site]; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | - public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null ) |
|
| 30 | + public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null) |
|
| 31 | 31 | { |
| 32 | - if( $config === null ) { |
|
| 33 | - $config = self::getContext( $site )->getConfig(); |
|
| 32 | + if ($config === null) { |
|
| 33 | + $config = self::getContext($site)->getConfig(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() ); |
|
| 36 | + $view = new \Aimeos\MW\View\Standard(self::getTemplatePaths()); |
|
| 37 | 37 | |
| 38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, ['site' => 'unittest'] ); |
|
| 39 | - $view->addHelper( 'param', $helper ); |
|
| 38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, ['site' => 'unittest']); |
|
| 39 | + $view->addHelper('param', $helper); |
|
| 40 | 40 | |
| 41 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
| 42 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
| 43 | - $view->addHelper( 'translate', $helper ); |
|
| 41 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
| 42 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
| 43 | + $view->addHelper('translate', $helper); |
|
| 44 | 44 | |
| 45 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
| 46 | - $view->addHelper( 'url', $helper ); |
|
| 45 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
| 46 | + $view->addHelper('url', $helper); |
|
| 47 | 47 | |
| 48 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
| 49 | - $view->addHelper( 'number', $helper ); |
|
| 48 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
| 49 | + $view->addHelper('number', $helper); |
|
| 50 | 50 | |
| 51 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
| 52 | - $view->addHelper( 'date', $helper ); |
|
| 51 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
| 52 | + $view->addHelper('date', $helper); |
|
| 53 | 53 | |
| 54 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin', 'client/html', 'controller/jsonadm' ) ); |
|
| 55 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 56 | - $view->addHelper( 'config', $helper ); |
|
| 54 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin', 'client/html', 'controller/jsonadm')); |
|
| 55 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 56 | + $view->addHelper('config', $helper); |
|
| 57 | 57 | |
| 58 | - $helper = new \Aimeos\MW\View\Helper\Session\Standard( $view, new \Aimeos\MW\Session\None() ); |
|
| 59 | - $view->addHelper( 'session', $helper ); |
|
| 58 | + $helper = new \Aimeos\MW\View\Helper\Session\Standard($view, new \Aimeos\MW\Session\None()); |
|
| 59 | + $view->addHelper('session', $helper); |
|
| 60 | 60 | |
| 61 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, new \Zend\Diactoros\ServerRequest() ); |
|
| 62 | - $view->addHelper( 'request', $helper ); |
|
| 61 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, new \Zend\Diactoros\ServerRequest()); |
|
| 62 | + $view->addHelper('request', $helper); |
|
| 63 | 63 | |
| 64 | - $helper = new \Aimeos\MW\View\Helper\Response\Standard( $view, new \Zend\Diactoros\Response() ); |
|
| 65 | - $view->addHelper( 'response', $helper ); |
|
| 64 | + $helper = new \Aimeos\MW\View\Helper\Response\Standard($view, new \Zend\Diactoros\Response()); |
|
| 65 | + $view->addHelper('response', $helper); |
|
| 66 | 66 | |
| 67 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' ); |
|
| 68 | - $view->addHelper( 'csrf', $helper ); |
|
| 67 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value'); |
|
| 68 | + $view->addHelper('csrf', $helper); |
|
| 69 | 69 | |
| 70 | - $fcn = function() { return array( 'admin' ); }; |
|
| 71 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn ); |
|
| 72 | - $view->addHelper( 'access', $helper ); |
|
| 70 | + $fcn = function() { return array('admin'); }; |
|
| 71 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn); |
|
| 72 | + $view->addHelper('access', $helper); |
|
| 73 | 73 | |
| 74 | 74 | $view->pageSitePath = []; |
| 75 | 75 | |
@@ -79,19 +79,19 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public static function getTemplatePaths() |
| 81 | 81 | { |
| 82 | - return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 82 | + return self::getAimeos()->getCustomPaths('admin/jqadm/templates'); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | public static function getAimeos() |
| 87 | 87 | { |
| 88 | - if( !isset( self::$aimeos ) ) |
|
| 88 | + if (!isset(self::$aimeos)) |
|
| 89 | 89 | { |
| 90 | 90 | require_once 'Bootstrap.php'; |
| 91 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 91 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
| 92 | 92 | |
| 93 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
| 94 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
| 93 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
| 94 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return self::$aimeos; |
@@ -101,57 +101,57 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * @param string $site |
| 103 | 103 | */ |
| 104 | - private static function createContext( $site ) |
|
| 104 | + private static function createContext($site) |
|
| 105 | 105 | { |
| 106 | 106 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 107 | 107 | $aimeos = self::getAimeos(); |
| 108 | 108 | |
| 109 | 109 | |
| 110 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 110 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
| 111 | 111 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
| 112 | 112 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
| 113 | - $local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) ); |
|
| 113 | + $local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp'))); |
|
| 114 | 114 | |
| 115 | - $conf = new \Aimeos\MW\Config\PHPArray( $local, $paths ); |
|
| 116 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 117 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 118 | - $ctx->setConfig( $conf ); |
|
| 115 | + $conf = new \Aimeos\MW\Config\PHPArray($local, $paths); |
|
| 116 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
| 117 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
| 118 | + $ctx->setConfig($conf); |
|
| 119 | 119 | |
| 120 | 120 | |
| 121 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 122 | - $ctx->setDatabaseManager( $dbm ); |
|
| 121 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 122 | + $ctx->setDatabaseManager($dbm); |
|
| 123 | 123 | |
| 124 | 124 | |
| 125 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
| 126 | - $ctx->setFilesystemManager( $fs ); |
|
| 125 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf); |
|
| 126 | + $ctx->setFilesystemManager($fs); |
|
| 127 | 127 | |
| 128 | 128 | |
| 129 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf ); |
|
| 130 | - $ctx->setMessageQueueManager( $mq ); |
|
| 129 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($conf); |
|
| 130 | + $ctx->setMessageQueueManager($mq); |
|
| 131 | 131 | |
| 132 | 132 | |
| 133 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 134 | - $ctx->setLogger( $logger ); |
|
| 133 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 134 | + $ctx->setLogger($logger); |
|
| 135 | 135 | |
| 136 | 136 | |
| 137 | 137 | $cache = new \Aimeos\MW\Cache\None(); |
| 138 | - $ctx->setCache( $cache ); |
|
| 138 | + $ctx->setCache($cache); |
|
| 139 | 139 | |
| 140 | 140 | |
| 141 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 142 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 141 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
| 142 | + $ctx->setI18n(array('de' => $i18n)); |
|
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | $session = new \Aimeos\MW\Session\None(); |
| 146 | - $ctx->setSession( $session ); |
|
| 146 | + $ctx->setSession($session); |
|
| 147 | 147 | |
| 148 | 148 | |
| 149 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 150 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
| 151 | - $ctx->setLocale( $locale ); |
|
| 149 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 150 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
| 151 | + $ctx->setLocale($locale); |
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | - $ctx->setEditor( 'ai-admin-jqadm:admin/jqadm' ); |
|
| 154 | + $ctx->setEditor('ai-admin-jqadm:admin/jqadm'); |
|
| 155 | 155 | |
| 156 | 156 | return $ctx; |
| 157 | 157 | } |
@@ -19,52 +19,52 @@ |
||
| 19 | 19 | { |
| 20 | 20 | $this->aimeos = \TestHelperJqadm::getAimeos(); |
| 21 | 21 | $this->context = \TestHelperJqadm::getContext(); |
| 22 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 22 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | public function testCreateClient() |
| 27 | 27 | { |
| 28 | - $this->context->getConfig()->set( 'admin/jqadm/resources', ['product'] ); |
|
| 29 | - $client = \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'product' ); |
|
| 30 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 28 | + $this->context->getConfig()->set('admin/jqadm/resources', ['product']); |
|
| 29 | + $client = \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'product'); |
|
| 30 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | public function testCreateClientName() |
| 35 | 35 | { |
| 36 | - $this->context->getConfig()->set( 'admin/jqadm/resources', ['product'] ); |
|
| 37 | - $client = \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'product', 'Standard' ); |
|
| 38 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 36 | + $this->context->getConfig()->set('admin/jqadm/resources', ['product']); |
|
| 37 | + $client = \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'product', 'Standard'); |
|
| 38 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | public function testCreateSubClient() |
| 43 | 43 | { |
| 44 | - $this->context->getConfig()->set( 'admin/jqadm/resources', ['locale/site'] ); |
|
| 45 | - $client = \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'locale/site' ); |
|
| 46 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 44 | + $this->context->getConfig()->set('admin/jqadm/resources', ['locale/site']); |
|
| 45 | + $client = \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'locale/site'); |
|
| 46 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testCreateClientNameEmpty() |
| 51 | 51 | { |
| 52 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 53 | - \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, '' ); |
|
| 52 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 53 | + \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, ''); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testCreateClientNameInvalid() |
| 58 | 58 | { |
| 59 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 60 | - \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, '%product' ); |
|
| 59 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 60 | + \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, '%product'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testCreateClientNameNotFound() |
| 65 | 65 | { |
| 66 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 67 | - \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'unknown' ); |
|
| 66 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 67 | + \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'unknown'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | } |
@@ -126,12 +126,19 @@ |
||
| 126 | 126 | return self::addDecorators( $context, $client, $decorators, $classprefix ); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | + /** |
|
| 130 | + * @param string $path |
|
| 131 | + */ |
|
| 129 | 132 | public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
| 130 | 133 | \Aimeos\Admin\JQAdm\Iface $client, $path ) |
| 131 | 134 | { |
| 132 | 135 | return self::addClientDecorators( $context, $client, $path ); |
| 133 | 136 | } |
| 134 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $classname |
|
| 140 | + * @param string $interface |
|
| 141 | + */ |
|
| 135 | 142 | public static function createClientBasePublic( \Aimeos\MShop\Context\Item\Iface $context, |
| 136 | 143 | $classname, $interface ) |
| 137 | 144 | { |
@@ -17,102 +17,102 @@ discard block |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
| 20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 21 | 21 | |
| 22 | 22 | $config = $this->context->getConfig(); |
| 23 | - $config->set( 'admin/jqadm/common/decorators/default', [] ); |
|
| 24 | - $config->set( 'admin/jqadm/product/decorators/global', [] ); |
|
| 25 | - $config->set( 'admin/jqadm/product/decorators/local', [] ); |
|
| 23 | + $config->set('admin/jqadm/common/decorators/default', []); |
|
| 24 | + $config->set('admin/jqadm/product/decorators/global', []); |
|
| 25 | + $config->set('admin/jqadm/product/decorators/local', []); |
|
| 26 | 26 | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | public function testInjectClient() |
| 31 | 31 | { |
| 32 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 33 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
| 32 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 33 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
| 34 | 34 | |
| 35 | - $iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 35 | + $iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 36 | 36 | |
| 37 | - $this->assertSame( $client, $iClient ); |
|
| 37 | + $this->assertSame($client, $iClient); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | public function testInjectClientReset() |
| 42 | 42 | { |
| 43 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 44 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
| 45 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null ); |
|
| 43 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 44 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
| 45 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null); |
|
| 46 | 46 | |
| 47 | - $new = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 47 | + $new = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 48 | 48 | |
| 49 | - $this->assertNotSame( $client, $new ); |
|
| 49 | + $this->assertNotSame($client, $new); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | public function testAddDecorators() |
| 54 | 54 | { |
| 55 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 55 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 56 | 56 | |
| 57 | - $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
| 58 | - [], array( 'Cache' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
| 57 | + $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
| 58 | + [], array('Cache'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
| 59 | 59 | |
| 60 | - $this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result ); |
|
| 60 | + $this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testAddDecoratorsInvalidName() |
| 65 | 65 | { |
| 66 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 66 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 67 | 67 | |
| 68 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 69 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, ['$'], 'Test' ); |
|
| 68 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 69 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, ['$'], 'Test'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | public function testAddDecoratorsInvalidClass() |
| 74 | 74 | { |
| 75 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 75 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 76 | 76 | |
| 77 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 78 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
| 79 | - array( 'Test' ), 'TestDecorator' ); |
|
| 77 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 78 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
| 79 | + array('Test'), 'TestDecorator'); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | public function testAddDecoratorsInvalidInterface() |
| 84 | 84 | { |
| 85 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 85 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 86 | 86 | |
| 87 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 88 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
| 89 | - array( 'Test' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
| 87 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 88 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
| 89 | + array('Test'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | public function testAddClientDecoratorsExcludes() |
| 94 | 94 | { |
| 95 | - $this->context->getConfig()->set( 'admin/jqadm/decorators/excludes', array( 'TestDecorator' ) ); |
|
| 96 | - $this->context->getConfig()->set( 'admin/jqadm/common/decorators/default', array( 'TestDecorator' ) ); |
|
| 95 | + $this->context->getConfig()->set('admin/jqadm/decorators/excludes', array('TestDecorator')); |
|
| 96 | + $this->context->getConfig()->set('admin/jqadm/common/decorators/default', array('TestDecorator')); |
|
| 97 | 97 | |
| 98 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 99 | - \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 98 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 99 | + \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | public function testAddClientDecoratorsEmptyPath() |
| 104 | 104 | { |
| 105 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, 'Standard' ); |
|
| 105 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, 'Standard'); |
|
| 106 | 106 | |
| 107 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 108 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic( $this->context, $client, '' ); |
|
| 107 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 108 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic($this->context, $client, ''); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | public function testCreateClientBase() |
| 113 | 113 | { |
| 114 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 115 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic( $this->context, 'Test', 'Test' ); |
|
| 114 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 115 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic($this->context, 'Test', 'Test'); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -120,22 +120,22 @@ discard block |
||
| 120 | 120 | class TestAbstract |
| 121 | 121 | extends \Aimeos\Admin\JQAdm\Common\Factory\Base |
| 122 | 122 | { |
| 123 | - public static function addDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
| 124 | - \Aimeos\Admin\JQAdm\Iface $client, array $decorators, $classprefix ) |
|
| 123 | + public static function addDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
| 124 | + \Aimeos\Admin\JQAdm\Iface $client, array $decorators, $classprefix) |
|
| 125 | 125 | { |
| 126 | - return self::addDecorators( $context, $client, $decorators, $classprefix ); |
|
| 126 | + return self::addDecorators($context, $client, $decorators, $classprefix); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
| 130 | - \Aimeos\Admin\JQAdm\Iface $client, $path ) |
|
| 129 | + public static function addClientDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
| 130 | + \Aimeos\Admin\JQAdm\Iface $client, $path) |
|
| 131 | 131 | { |
| 132 | - return self::addClientDecorators( $context, $client, $path ); |
|
| 132 | + return self::addClientDecorators($context, $client, $path); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - public static function createClientBasePublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
| 136 | - $classname, $interface ) |
|
| 135 | + public static function createClientBasePublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
| 136 | + $classname, $interface) |
|
| 137 | 137 | { |
| 138 | - return self::createClientBase( $context, $classname, $interface ); |
|
| 138 | + return self::createClientBase($context, $classname, $interface); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
@@ -17,42 +17,42 @@ |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
| 20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testCreateClient() |
| 25 | 25 | { |
| 26 | - $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context ); |
|
| 27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 26 | + $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context); |
|
| 27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testCreateClientName() |
| 32 | 32 | { |
| 33 | - $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, 'Standard' ); |
|
| 34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 33 | + $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, 'Standard'); |
|
| 34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testCreateClientNameEmpty() |
| 39 | 39 | { |
| 40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 41 | - \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, '' ); |
|
| 40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 41 | + \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, ''); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testCreateClientNameInvalid() |
| 46 | 46 | { |
| 47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 48 | - \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, '%order' ); |
|
| 47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 48 | + \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, '%order'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testCreateClientNameNotFound() |
| 53 | 53 | { |
| 54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 55 | - \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, 'test' ); |
|
| 54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 55 | + \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, 'test'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
| 20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testCreateClient() |
| 25 | 25 | { |
| 26 | - $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context ); |
|
| 27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 26 | + $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context); |
|
| 27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testCreateClientName() |
| 32 | 32 | { |
| 33 | - $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, 'Standard' ); |
|
| 34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 33 | + $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, 'Standard'); |
|
| 34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testCreateClientNameEmpty() |
| 39 | 39 | { |
| 40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 41 | - \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, '' ); |
|
| 40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 41 | + \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, ''); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testCreateClientNameInvalid() |
| 46 | 46 | { |
| 47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 48 | - \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, '%plugin' ); |
|
| 47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 48 | + \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, '%plugin'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testCreateClientNameNotFound() |
| 53 | 53 | { |
| 54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 55 | - \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, 'test' ); |
|
| 54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 55 | + \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, 'test'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
| 20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testCreateClient() |
| 25 | 25 | { |
| 26 | - $client = \Aimeos\Admin\JQAdm\Coupon\Factory::createClient( $this->context ); |
|
| 27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 26 | + $client = \Aimeos\Admin\JQAdm\Coupon\Factory::createClient($this->context); |
|
| 27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testCreateClientName() |
| 32 | 32 | { |
| 33 | - $client = \Aimeos\Admin\JQAdm\Coupon\Factory::createClient( $this->context, 'Standard' ); |
|
| 34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 33 | + $client = \Aimeos\Admin\JQAdm\Coupon\Factory::createClient($this->context, 'Standard'); |
|
| 34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testCreateClientNameEmpty() |
| 39 | 39 | { |
| 40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 41 | - \Aimeos\Admin\JQAdm\Coupon\Factory::createClient( $this->context, '' ); |
|
| 40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 41 | + \Aimeos\Admin\JQAdm\Coupon\Factory::createClient($this->context, ''); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testCreateClientNameInvalid() |
| 46 | 46 | { |
| 47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 48 | - \Aimeos\Admin\JQAdm\Coupon\Factory::createClient( $this->context, '%coupon' ); |
|
| 47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 48 | + \Aimeos\Admin\JQAdm\Coupon\Factory::createClient($this->context, '%coupon'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testCreateClientNameNotFound() |
| 53 | 53 | { |
| 54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 55 | - \Aimeos\Admin\JQAdm\Coupon\Factory::createClient( $this->context, 'test' ); |
|
| 54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 55 | + \Aimeos\Admin\JQAdm\Coupon\Factory::createClient($this->context, 'test'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
| 20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testCreateClient() |
| 25 | 25 | { |
| 26 | - $client = \Aimeos\Admin\JQAdm\Customer\Factory::createClient( $this->context ); |
|
| 27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 26 | + $client = \Aimeos\Admin\JQAdm\Customer\Factory::createClient($this->context); |
|
| 27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testCreateClientName() |
| 32 | 32 | { |
| 33 | - $client = \Aimeos\Admin\JQAdm\Customer\Factory::createClient( $this->context, 'Standard' ); |
|
| 34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 33 | + $client = \Aimeos\Admin\JQAdm\Customer\Factory::createClient($this->context, 'Standard'); |
|
| 34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testCreateClientNameEmpty() |
| 39 | 39 | { |
| 40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 41 | - \Aimeos\Admin\JQAdm\Customer\Factory::createClient( $this->context, '' ); |
|
| 40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 41 | + \Aimeos\Admin\JQAdm\Customer\Factory::createClient($this->context, ''); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testCreateClientNameInvalid() |
| 46 | 46 | { |
| 47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 48 | - \Aimeos\Admin\JQAdm\Customer\Factory::createClient( $this->context, '%customer' ); |
|
| 47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 48 | + \Aimeos\Admin\JQAdm\Customer\Factory::createClient($this->context, '%customer'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testCreateClientNameNotFound() |
| 53 | 53 | { |
| 54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 55 | - \Aimeos\Admin\JQAdm\Customer\Factory::createClient( $this->context, 'test' ); |
|
| 54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 55 | + \Aimeos\Admin\JQAdm\Customer\Factory::createClient($this->context, 'test'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |