@@ -101,8 +101,7 @@ |
||
| 101 | 101 | foreach( $items as $item ) { |
| 102 | 102 | $data[] = $entryFcn( $item ); |
| 103 | 103 | } |
| 104 | - } |
|
| 105 | - else |
|
| 104 | + } else |
|
| 106 | 105 | { |
| 107 | 106 | $data = $entryFcn( $items ); |
| 108 | 107 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $first = ( $offset > 0 ? 0 : null ); |
| 24 | 24 | $prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); |
| 25 | 25 | $next = ( $offset + $limit < $total ? $offset + $limit : null ); |
| 26 | -$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); |
|
| 26 | +$last = ( ( (int) ( $total / $limit ) ) * $limit > $offset ? ( (int) ( $total / $limit ) ) * $limit : null ); |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | $ref = array( 'resource', 'id', 'related', 'relatedid', 'filter', 'page', 'sort', 'include', 'fields' ); |
@@ -244,8 +244,7 @@ |
||
| 244 | 244 | $data[] = $entryFcn( $item ); |
| 245 | 245 | $included = array_merge( $included, $refFcn( $item ) ); |
| 246 | 246 | } |
| 247 | - } |
|
| 248 | - else |
|
| 247 | + } else |
|
| 249 | 248 | { |
| 250 | 249 | $data = $entryFcn( $items ); |
| 251 | 250 | $included = $refFcn( $items ); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $first = ( $offset > 0 ? 0 : null ); |
| 90 | 90 | $prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); |
| 91 | 91 | $next = ( $offset + $limit < $total ? $offset + $limit : null ); |
| 92 | -$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); |
|
| 92 | +$last = ( ( (int) ( $total / $limit ) ) * $limit > $offset ? ( (int) ( $total / $limit ) ) * $limit : null ); |
|
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | $ref = array( 'resource', 'id', 'related', 'relatedid', 'filter', 'page', 'sort', 'include', 'fields' ); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $type = $item->getResourceType(); |
| 110 | 110 | |
| 111 | 111 | $params = array( 'resource' => $type, 'id' => $id ); |
| 112 | - $basketParams = [ 'resource' => 'basket', 'id' => 'default', 'related' => 'product' ]; |
|
| 112 | + $basketParams = ['resource' => 'basket', 'id' => 'default', 'related' => 'product']; |
|
| 113 | 113 | |
| 114 | 114 | if( isset( $fields[$type] ) ) { |
| 115 | 115 | $attributes = array_intersect_key( $attributes, $fields[$type] ); |
@@ -145,8 +145,7 @@ |
||
| 145 | 145 | $data[] = $entryFcn( $attrItem ); |
| 146 | 146 | $included = array_merge( $included, $refFcn( $attrItem ) ); |
| 147 | 147 | } |
| 148 | - } |
|
| 149 | - else |
|
| 148 | + } else |
|
| 150 | 149 | { |
| 151 | 150 | $data = $entryFcn( $items ); |
| 152 | 151 | $included = $refFcn( $items ); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $first = ( $offset > 0 ? 0 : null ); |
| 24 | 24 | $prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); |
| 25 | 25 | $next = ( $offset + $limit < $total ? $offset + $limit : null ); |
| 26 | -$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); |
|
| 26 | +$last = ( ( (int) ( $total / $limit ) ) * $limit > $offset ? ( (int) ( $total / $limit ) ) * $limit : null ); |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | $ref = array( 'resource', 'id', 'related', 'relatedid', 'filter', 'page', 'sort', 'include', 'fields' ); |
@@ -287,7 +287,7 @@ |
||
| 287 | 287 | { |
| 288 | 288 | $total = 0; |
| 289 | 289 | $map = []; |
| 290 | - $direction = '+'; |
|
| 290 | + $direction = '+'; |
|
| 291 | 291 | |
| 292 | 292 | $ref = $view->param( 'include', [] ); |
| 293 | 293 | $size = $view->param( 'page/limit', 48 ); |
@@ -46,13 +46,11 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $status = 200; |
| 49 | - } |
|
| 50 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 49 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 51 | 50 | { |
| 52 | 51 | $status = 404; |
| 53 | 52 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 54 | - } |
|
| 55 | - catch( \Exception $e ) |
|
| 53 | + } catch( \Exception $e ) |
|
| 56 | 54 | { |
| 57 | 55 | $status = 500; |
| 58 | 56 | $view->errors = $this->getErrorDetails( $e ); |
@@ -81,8 +79,7 @@ discard block |
||
| 81 | 79 | */ |
| 82 | 80 | $tplconf = 'client/jsonapi/product/standard/template-aggregate'; |
| 83 | 81 | $default = 'aggregate-standard.php'; |
| 84 | - } |
|
| 85 | - else |
|
| 82 | + } else |
|
| 86 | 83 | { |
| 87 | 84 | /** client/jsonapi/product/standard/template |
| 88 | 85 | * Relative path to the product JSON API template |
@@ -262,10 +262,13 @@ |
||
| 262 | 262 | "href": "<?= $this->url( $target, $cntl, $action, ['resource' => 'basket', 'id' => $basketId, 'related' => 'coupon'], [], $config ); ?>", |
| 263 | 263 | "allow": ["POST"] |
| 264 | 264 | } |
| 265 | - <?php else : ?> |
|
| 265 | + <?php else { |
|
| 266 | + : ?> |
|
| 266 | 267 | , |
| 267 | 268 | "order": { |
| 268 | - "href": "<?= $this->url( $target, $cntl, $action, ['resource' => 'order'], [], $config ); ?>", |
|
| 269 | + "href": "<?= $this->url( $target, $cntl, $action, ['resource' => 'order'], [], $config ); |
|
| 270 | +} |
|
| 271 | +?>", |
|
| 269 | 272 | "allow": ["POST"] |
| 270 | 273 | } |
| 271 | 274 | <?php endif; ?> |
@@ -28,9 +28,12 @@ |
||
| 28 | 28 | |
| 29 | 29 | "errors": <?= json_encode( $this->errors, JSON_PRETTY_PRINT ); ?> |
| 30 | 30 | |
| 31 | - <?php else : ?> |
|
| 31 | + <?php else { |
|
| 32 | + : ?> |
|
| 32 | 33 | |
| 33 | - "data": <?= json_encode( $entries ); ?> |
|
| 34 | + "data": <?= json_encode( $entries ); |
|
| 35 | +} |
|
| 36 | +?> |
|
| 34 | 37 | |
| 35 | 38 | <?php endif; ?> |
| 36 | 39 | } |
@@ -77,25 +77,21 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $this->controller->deleteAddressItem( $entry->id ); |
| 79 | 79 | } |
| 80 | - } |
|
| 81 | - else |
|
| 80 | + } else |
|
| 82 | 81 | { |
| 83 | 82 | $this->controller->deleteAddressItem( $relId ); |
| 84 | 83 | } |
| 85 | 84 | |
| 86 | 85 | $status = 200; |
| 87 | - } |
|
| 88 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 86 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 89 | 87 | { |
| 90 | 88 | $status = 403; |
| 91 | 89 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 92 | - } |
|
| 93 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 90 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 94 | 91 | { |
| 95 | 92 | $status = 404; |
| 96 | 93 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 97 | - } |
|
| 98 | - catch( \Exception $e ) |
|
| 94 | + } catch( \Exception $e ) |
|
| 99 | 95 | { |
| 100 | 96 | $status = 500; |
| 101 | 97 | $view->errors = $this->getErrorDetails( $e ); |
@@ -129,18 +125,15 @@ discard block |
||
| 129 | 125 | |
| 130 | 126 | $view->total = count( $view->items ); |
| 131 | 127 | $status = 200; |
| 132 | - } |
|
| 133 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 128 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 134 | 129 | { |
| 135 | 130 | $status = 403; |
| 136 | 131 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 137 | - } |
|
| 138 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 132 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 139 | 133 | { |
| 140 | 134 | $status = 404; |
| 141 | 135 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 142 | - } |
|
| 143 | - catch( \Exception $e ) |
|
| 136 | + } catch( \Exception $e ) |
|
| 144 | 137 | { |
| 145 | 138 | $status = 500; |
| 146 | 139 | $view->errors = $this->getErrorDetails( $e ); |
@@ -174,18 +167,15 @@ discard block |
||
| 174 | 167 | $view->items = $cntl->editAddressItem( $view->param( 'relatedid' ), (array) $payload->data->attributes ); |
| 175 | 168 | $view->total = 1; |
| 176 | 169 | $status = 200; |
| 177 | - } |
|
| 178 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 170 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 179 | 171 | { |
| 180 | 172 | $status = 403; |
| 181 | 173 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 182 | - } |
|
| 183 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 174 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 184 | 175 | { |
| 185 | 176 | $status = 404; |
| 186 | 177 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 187 | - } |
|
| 188 | - catch( \Exception $e ) |
|
| 178 | + } catch( \Exception $e ) |
|
| 189 | 179 | { |
| 190 | 180 | $status = 500; |
| 191 | 181 | $view->errors = $this->getErrorDetails( $e ); |
@@ -232,18 +222,15 @@ discard block |
||
| 232 | 222 | $view->total = count( $list ); |
| 233 | 223 | $view->items = $list; |
| 234 | 224 | $status = 201; |
| 235 | - } |
|
| 236 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 225 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 237 | 226 | { |
| 238 | 227 | $status = 403; |
| 239 | 228 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 240 | - } |
|
| 241 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 229 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 242 | 230 | { |
| 243 | 231 | $status = 404; |
| 244 | 232 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 245 | - } |
|
| 246 | - catch( \Exception $e ) |
|
| 233 | + } catch( \Exception $e ) |
|
| 247 | 234 | { |
| 248 | 235 | $status = 500; |
| 249 | 236 | $view->errors = $this->getErrorDetails( $e ); |
@@ -40,18 +40,15 @@ discard block |
||
| 40 | 40 | $cntl = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'customer' ); |
| 41 | 41 | $cntl->deleteItem( $view->param( 'id' ) ); |
| 42 | 42 | $status = 200; |
| 43 | - } |
|
| 44 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 43 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 45 | 44 | { |
| 46 | 45 | $status = 403; |
| 47 | 46 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 48 | - } |
|
| 49 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 47 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 50 | 48 | { |
| 51 | 49 | $status = 404; |
| 52 | 50 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 53 | - } |
|
| 54 | - catch( \Exception $e ) |
|
| 51 | + } catch( \Exception $e ) |
|
| 55 | 52 | { |
| 56 | 53 | $status = 500; |
| 57 | 54 | $view->errors = $this->getErrorDetails( $e ); |
@@ -84,18 +81,15 @@ discard block |
||
| 84 | 81 | |
| 85 | 82 | $view->item = $cntl->getItem( $view->param( 'id' ), $ref ); |
| 86 | 83 | $status = 200; |
| 87 | - } |
|
| 88 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 84 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 89 | 85 | { |
| 90 | 86 | $status = 403; |
| 91 | 87 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 92 | - } |
|
| 93 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 88 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 94 | 89 | { |
| 95 | 90 | $status = 404; |
| 96 | 91 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 97 | - } |
|
| 98 | - catch( \Exception $e ) |
|
| 92 | + } catch( \Exception $e ) |
|
| 99 | 93 | { |
| 100 | 94 | $status = 500; |
| 101 | 95 | $view->errors = $this->getErrorDetails( $e ); |
@@ -128,18 +122,15 @@ discard block |
||
| 128 | 122 | |
| 129 | 123 | $view->item = $cntl->editItem( $view->param( 'id' ), (array) $payload->data->attributes ); |
| 130 | 124 | $status = 200; |
| 131 | - } |
|
| 132 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 125 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 133 | 126 | { |
| 134 | 127 | $status = 403; |
| 135 | 128 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 136 | - } |
|
| 137 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 129 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 138 | 130 | { |
| 139 | 131 | $status = 404; |
| 140 | 132 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 141 | - } |
|
| 142 | - catch( \Exception $e ) |
|
| 133 | + } catch( \Exception $e ) |
|
| 143 | 134 | { |
| 144 | 135 | $status = 500; |
| 145 | 136 | $view->errors = $this->getErrorDetails( $e ); |
@@ -172,18 +163,15 @@ discard block |
||
| 172 | 163 | |
| 173 | 164 | $view->item = $cntl->addItem( (array) $payload->data->attributes ); |
| 174 | 165 | $status = 201; |
| 175 | - } |
|
| 176 | - catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 166 | + } catch( \Aimeos\Controller\Frontend\Customer\Exception $e ) |
|
| 177 | 167 | { |
| 178 | 168 | $status = 403; |
| 179 | 169 | $view->errors = $this->getErrorDetails( $e, 'controller/frontend' ); |
| 180 | - } |
|
| 181 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 170 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 182 | 171 | { |
| 183 | 172 | $status = 404; |
| 184 | 173 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 185 | - } |
|
| 186 | - catch( \Exception $e ) |
|
| 174 | + } catch( \Exception $e ) |
|
| 187 | 175 | { |
| 188 | 176 | $status = 500; |
| 189 | 177 | $view->errors = $this->getErrorDetails( $e ); |
@@ -39,13 +39,11 @@ |
||
| 39 | 39 | { |
| 40 | 40 | $response = $this->getItem( $view, $request, $response ); |
| 41 | 41 | $status = 200; |
| 42 | - } |
|
| 43 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 42 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 44 | 43 | { |
| 45 | 44 | $status = 404; |
| 46 | 45 | $view->errors = $this->getErrorDetails( $e, 'mshop' ); |
| 47 | - } |
|
| 48 | - catch( \Exception $e ) |
|
| 46 | + } catch( \Exception $e ) |
|
| 49 | 47 | { |
| 50 | 48 | $status = 500; |
| 51 | 49 | $view->errors = $this->getErrorDetails( $e ); |