@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | $view->items = $provider->getServiceItem(); |
| 59 | 59 | $view->total = 1; |
| 60 | 60 | } |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $attributes = $prices = $items = []; |
| 65 | 64 | $type = $view->param( 'filter/cs_type' ); |
@@ -81,16 +80,14 @@ discard block |
||
| 81 | 80 | } |
| 82 | 81 | |
| 83 | 82 | $status = 200; |
| 84 | - } |
|
| 85 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 83 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 86 | 84 | { |
| 87 | 85 | $status = 404; |
| 88 | 86 | $view->errors = array( array( |
| 89 | 87 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 90 | 88 | 'detail' => $e->getTraceAsString(), |
| 91 | 89 | ) ); |
| 92 | - } |
|
| 93 | - catch( \Exception $e ) |
|
| 90 | + } catch( \Exception $e ) |
|
| 94 | 91 | { |
| 95 | 92 | $status = 500; |
| 96 | 93 | $view->errors = array( array( |
@@ -156,8 +156,7 @@ |
||
| 156 | 156 | $data[] = $entryFcn( $item, $prices, $feConfig ); |
| 157 | 157 | $included = array_merge( $included, $refFcn( $item ) ); |
| 158 | 158 | } |
| 159 | - } |
|
| 160 | - else |
|
| 159 | + } else |
|
| 161 | 160 | { |
| 162 | 161 | $data = $entryFcn( $this->items, $prices, $feConfig ); |
| 163 | 162 | $included = $refFcn( $this->items ); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | unset( $attributes['service.config'] ); // don't expose private information |
| 42 | 42 | |
| 43 | 43 | $params = array( 'resource' => $type, 'id' => $id ); |
| 44 | - $basketParams = [ 'resource' => 'basket', 'id' => 'default', 'related' => 'service', 'relatedid' => $item->getType() ]; |
|
| 44 | + $basketParams = ['resource' => 'basket', 'id' => 'default', 'related' => 'service', 'relatedid' => $item->getType()]; |
|
| 45 | 45 | |
| 46 | 46 | if( isset( $fields[$type] ) ) { |
| 47 | 47 | $attributes = array_intersect_key( $attributes, $fields[$type] ); |
@@ -313,6 +313,9 @@ |
||
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | |
| 316 | + /** |
|
| 317 | + * @param string $name |
|
| 318 | + */ |
|
| 316 | 319 | protected function access( $name ) |
| 317 | 320 | { |
| 318 | 321 | $class = new \ReflectionClass( '\Aimeos\Client\JsonApi\Order\Standard' ); |
@@ -268,7 +268,7 @@ |
||
| 268 | 268 | $baseManager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' ); |
| 269 | 269 | |
| 270 | 270 | $search = $baseManager->createSearch(); |
| 271 | - $search->setConditions( $search->compare( '==', 'order.base.price', '672.00') ); |
|
| 271 | + $search->setConditions( $search->compare( '==', 'order.base.price', '672.00' ) ); |
|
| 272 | 272 | |
| 273 | 273 | $items = $baseManager->searchItems( $search ); |
| 274 | 274 | |
@@ -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 | } |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $view->items = $cntl->getItem( $id ); |
| 45 | 45 | $view->total = 1; |
| 46 | - } |
|
| 47 | - else |
|
| 46 | + } else |
|
| 48 | 47 | { |
| 49 | 48 | $total = 0; |
| 50 | 49 | $filter = $cntl->createFilter(); |
@@ -55,24 +54,21 @@ discard block |
||
| 55 | 54 | } |
| 56 | 55 | |
| 57 | 56 | $status = 200; |
| 58 | - } |
|
| 59 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 57 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 60 | 58 | { |
| 61 | 59 | $status = 403; |
| 62 | 60 | $view->errors = array( array( |
| 63 | 61 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 64 | 62 | 'detail' => $e->getTraceAsString(), |
| 65 | 63 | ) ); |
| 66 | - } |
|
| 67 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 64 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 68 | 65 | { |
| 69 | 66 | $status = 404; |
| 70 | 67 | $view->errors = array( array( |
| 71 | 68 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 72 | 69 | 'detail' => $e->getTraceAsString(), |
| 73 | 70 | ) ); |
| 74 | - } |
|
| 75 | - catch( \Exception $e ) |
|
| 71 | + } catch( \Exception $e ) |
|
| 76 | 72 | { |
| 77 | 73 | $status = 500; |
| 78 | 74 | $view->errors = array( array( |
@@ -116,32 +112,28 @@ discard block |
||
| 116 | 112 | $view->total = 1; |
| 117 | 113 | |
| 118 | 114 | $status = 201; |
| 119 | - } |
|
| 120 | - catch( \Aimeos\Client\JsonApi\Exception $e ) |
|
| 115 | + } catch( \Aimeos\Client\JsonApi\Exception $e ) |
|
| 121 | 116 | { |
| 122 | 117 | $status = $e->getCode(); |
| 123 | 118 | $view->errors = array( array( |
| 124 | 119 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 125 | 120 | 'detail' => $e->getTraceAsString(), |
| 126 | 121 | ) ); |
| 127 | - } |
|
| 128 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 122 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 129 | 123 | { |
| 130 | 124 | $status = 403; |
| 131 | 125 | $view->errors = array( array( |
| 132 | 126 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 133 | 127 | 'detail' => $e->getTraceAsString(), |
| 134 | 128 | ) ); |
| 135 | - } |
|
| 136 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 129 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 137 | 130 | { |
| 138 | 131 | $status = 404; |
| 139 | 132 | $view->errors = array( array( |
| 140 | 133 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 141 | 134 | 'detail' => $e->getTraceAsString(), |
| 142 | 135 | ) ); |
| 143 | - } |
|
| 144 | - catch( \Exception $e ) |
|
| 136 | + } catch( \Exception $e ) |
|
| 145 | 137 | { |
| 146 | 138 | $status = 500; |
| 147 | 139 | $view->errors = array( array( |
@@ -59,16 +59,14 @@ discard block |
||
| 59 | 59 | $status = 200; |
| 60 | 60 | $type = $view->param( 'id', 'default' ); |
| 61 | 61 | $view->item = $this->controller->setType( $type )->clear()->get(); |
| 62 | - } |
|
| 63 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 62 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 64 | 63 | { |
| 65 | 64 | $status = 404; |
| 66 | 65 | $view->errors = array( array( |
| 67 | 66 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 68 | 67 | 'detail' => $e->getTraceAsString(), |
| 69 | 68 | ) ); |
| 70 | - } |
|
| 71 | - catch( \Exception $e ) |
|
| 69 | + } catch( \Exception $e ) |
|
| 72 | 70 | { |
| 73 | 71 | $status = 500; |
| 74 | 72 | $view->errors = array( array( |
@@ -99,24 +97,21 @@ discard block |
||
| 99 | 97 | try |
| 100 | 98 | { |
| 101 | 99 | $view->item = $this->controller->load( $id, $this->getParts( $view ) ); |
| 102 | - } |
|
| 103 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 100 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 104 | 101 | { |
| 105 | 102 | $view->item = $this->controller->setType( $id )->get(); |
| 106 | 103 | $allow = true; |
| 107 | 104 | } |
| 108 | 105 | |
| 109 | 106 | $status = 200; |
| 110 | - } |
|
| 111 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 107 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 112 | 108 | { |
| 113 | 109 | $status = 404; |
| 114 | 110 | $view->errors = array( array( |
| 115 | 111 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 116 | 112 | 'detail' => $e->getTraceAsString(), |
| 117 | 113 | ) ); |
| 118 | - } |
|
| 119 | - catch( \Exception $e ) |
|
| 114 | + } catch( \Exception $e ) |
|
| 120 | 115 | { |
| 121 | 116 | $status = 500; |
| 122 | 117 | $view->errors = array( array( |
@@ -153,16 +148,14 @@ discard block |
||
| 153 | 148 | |
| 154 | 149 | $view->item = $basket; |
| 155 | 150 | $status = 200; |
| 156 | - } |
|
| 157 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 151 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 158 | 152 | { |
| 159 | 153 | $status = 404; |
| 160 | 154 | $view->errors = array( array( |
| 161 | 155 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 162 | 156 | 'detail' => $e->getTraceAsString(), |
| 163 | 157 | ) ); |
| 164 | - } |
|
| 165 | - catch( \Exception $e ) |
|
| 158 | + } catch( \Exception $e ) |
|
| 166 | 159 | { |
| 167 | 160 | $status = 500; |
| 168 | 161 | $view->errors = array( array( |
@@ -193,16 +186,14 @@ discard block |
||
| 193 | 186 | |
| 194 | 187 | $view->item = $item; |
| 195 | 188 | $status = 200; |
| 196 | - } |
|
| 197 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 189 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 198 | 190 | { |
| 199 | 191 | $status = 404; |
| 200 | 192 | $view->errors = array( array( |
| 201 | 193 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 202 | 194 | 'detail' => $e->getTraceAsString(), |
| 203 | 195 | ) ); |
| 204 | - } |
|
| 205 | - catch( \Exception $e ) |
|
| 196 | + } catch( \Exception $e ) |
|
| 206 | 197 | { |
| 207 | 198 | $status = 500; |
| 208 | 199 | $view->errors = array( array( |
@@ -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 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | $first = ( $offset > 0 ? 0 : null ); |
| 32 | 32 | $prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); |
| 33 | 33 | $next = ( $offset + $limit < $total ? $offset + $limit : null ); |
| 34 | -$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); |
|
| 34 | +$last = ( ( (int) ( $total / $limit ) ) * $limit > $offset ? ( (int) ( $total / $limit ) ) * $limit : null ); |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | $fields = $this->param( '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 ); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $first = ( $offset > 0 ? 0 : null ); |
| 98 | 98 | $prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); |
| 99 | 99 | $next = ( $offset + $limit < $total ? $offset + $limit : null ); |
| 100 | -$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); |
|
| 100 | +$last = ( ( (int) ( $total / $limit ) ) * $limit > $offset ? ( (int) ( $total / $limit ) ) * $limit : null ); |
|
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | $map = $this->get( 'itemMap', [] ); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $type = $item->getResourceType(); |
| 116 | 116 | |
| 117 | 117 | $params = array( 'resource' => $type, 'id' => $id ); |
| 118 | - $basketParams = [ 'resource' => 'basket', 'id' => 'default', 'related' => 'product' ]; |
|
| 118 | + $basketParams = ['resource' => 'basket', 'id' => 'default', 'related' => 'product']; |
|
| 119 | 119 | |
| 120 | 120 | if( isset( $fields[$type] ) ) { |
| 121 | 121 | $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 ); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $first = ( $offset > 0 ? 0 : null ); |
| 33 | 33 | $prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); |
| 34 | 34 | $next = ( $offset + $limit < $total ? $offset + $limit : null ); |
| 35 | -$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); |
|
| 35 | +$last = ( ( (int) ( $total / $limit ) ) * $limit > $offset ? ( (int) ( $total / $limit ) ) * $limit : null ); |
|
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | $fields = $this->param( 'fields', [] ); |