@@ -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] ); |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | -$entryFcn = function( \Aimeos\MShop\Service\Item\Iface $item, array $prices, array $feConfig ) use ( $fields, $target, $cntl, $action, $config ) |
|
29 | -{ |
|
28 | +$entryFcn = function( \Aimeos\MShop\Service\Item\Iface $item, array $prices, array $feConfig ) use ( $fields, $target, $cntl, $action, $config ) { |
|
30 | 29 | $metadata = []; |
31 | 30 | $id = $item->getId(); |
32 | 31 | $type = $item->getResourceType(); |
@@ -119,8 +118,7 @@ discard block |
||
119 | 118 | $data[] = $entryFcn( $item, $prices, $feConfig ); |
120 | 119 | $included = array_merge( $included, $this->included( $item, $fields ) ); |
121 | 120 | } |
122 | - } |
|
123 | - else |
|
121 | + } else |
|
124 | 122 | { |
125 | 123 | $data = $entryFcn( $this->items, $prices, $feConfig ); |
126 | 124 | $included = $this->included( $this->items, $fields ); |
@@ -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' ); |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | -$entryFcn = function( \Aimeos\MShop\Stock\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
39 | -{ |
|
38 | +$entryFcn = function( \Aimeos\MShop\Stock\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
40 | 39 | $id = $item->getId(); |
41 | 40 | $type = $item->getResourceType(); |
42 | 41 | $params = array( 'resource' => $type, 'id' => $id ); |
@@ -111,8 +110,7 @@ discard block |
||
111 | 110 | foreach( $items as $item ) { |
112 | 111 | $data[] = $entryFcn( $item ); |
113 | 112 | } |
114 | - } |
|
115 | - else |
|
113 | + } else |
|
116 | 114 | { |
117 | 115 | $data = $entryFcn( $items ); |
118 | 116 | } |
@@ -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] ); |
@@ -101,8 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | |
104 | -$entryFcn = function( \Aimeos\MShop\Product\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
105 | -{ |
|
104 | +$entryFcn = function( \Aimeos\MShop\Product\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
106 | 105 | $id = $item->getId(); |
107 | 106 | $attributes = $item->toArray(); |
108 | 107 | $type = $item->getResourceType(); |
@@ -195,8 +194,7 @@ discard block |
||
195 | 194 | $data[] = $entryFcn( $item ); |
196 | 195 | $included = array_merge( $included, $this->included( $item, $fields ) ); |
197 | 196 | } |
198 | - } |
|
199 | - else |
|
197 | + } else |
|
200 | 198 | { |
201 | 199 | $data = $entryFcn( $items ); |
202 | 200 | $included = $this->included( $items, $fields ); |
@@ -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' ); |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | -$entryFcn = function( \Aimeos\MShop\Attribute\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
39 | -{ |
|
38 | +$entryFcn = function( \Aimeos\MShop\Attribute\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
40 | 39 | $id = $item->getId(); |
41 | 40 | $type = $item->getResourceType(); |
42 | 41 | $params = array( 'resource' => $type, 'id' => $id ); |
@@ -128,8 +127,7 @@ discard block |
||
128 | 127 | $data[] = $entryFcn( $item ); |
129 | 128 | $included = array_merge( $included, $this->included( $item, $fields ) ); |
130 | 129 | } |
131 | - } |
|
132 | - else |
|
130 | + } else |
|
133 | 131 | { |
134 | 132 | $data = $entryFcn( $items ); |
135 | 133 | $included = $this->included( $items, $fields ); |
@@ -99,8 +99,7 @@ |
||
99 | 99 | $decorators = $config->get( 'client/jsonapi/' . $dpath . 'decorators/local', [] ); |
100 | 100 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); |
101 | 101 | } |
102 | - } |
|
103 | - else |
|
102 | + } else |
|
104 | 103 | { |
105 | 104 | $classprefix = '\\Aimeos\\Client\\JsonApi\\Common\\Decorator\\'; |
106 | 105 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); |
@@ -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' ); |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | -$entryFcn = function( \Aimeos\MShop\Supplier\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
39 | -{ |
|
38 | +$entryFcn = function( \Aimeos\MShop\Supplier\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
40 | 39 | $id = $item->getId(); |
41 | 40 | $type = $item->getResourceType(); |
42 | 41 | $params = array( 'resource' => $type, 'id' => $id ); |
@@ -129,8 +128,7 @@ discard block |
||
129 | 128 | $data[] = $entryFcn( $item ); |
130 | 129 | $included = array_merge( $included, $this->included( $item, $fields ) ); |
131 | 130 | } |
132 | - } |
|
133 | - else |
|
131 | + } else |
|
134 | 132 | { |
135 | 133 | $data = $entryFcn( $items ); |
136 | 134 | $included = $this->included( $items, $fields ); |
@@ -374,7 +374,7 @@ |
||
374 | 374 | $baseManager = \Aimeos\MShop::create( $this->context, 'order/base' ); |
375 | 375 | |
376 | 376 | $search = $baseManager->createSearch(); |
377 | - $search->setConditions( $search->compare( '==', 'order.base.price', '672.00') ); |
|
377 | + $search->setConditions( $search->compare( '==', 'order.base.price', '672.00' ) ); |
|
378 | 378 | |
379 | 379 | $items = $baseManager->searchItems( $search ); |
380 | 380 |
@@ -59,8 +59,7 @@ |
||
59 | 59 | if( ( $client = @call_user_func_array( [$factory, 'create'], [$context, $path, $name] ) ) === false ) { |
60 | 60 | throw new \Aimeos\Client\JsonApi\Exception( sprintf( 'Invalid factory "%1$s"', $factory ), 400 ); |
61 | 61 | } |
62 | - } |
|
63 | - else |
|
62 | + } else |
|
64 | 63 | { |
65 | 64 | $client = self::createRoot( $context, $path, $name ); |
66 | 65 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | else |
88 | 88 | { |
89 | 89 | $total = 0; |
90 | - $items = $cntl->slice( $view->param( 'page/offset', 0), $view->param( 'page/limit', 25 ) ) |
|
90 | + $items = $cntl->slice( $view->param( 'page/offset', 0 ), $view->param( 'page/limit', 25 ) ) |
|
91 | 91 | ->sort( $view->param( 'sort' ) )->parse( $view->param( 'filter', [] ) )->search( $total ); |
92 | 92 | |
93 | 93 | $view->items = $items; |
@@ -83,8 +83,7 @@ |
||
83 | 83 | { |
84 | 84 | $view->items = $cntl->get( $id ); |
85 | 85 | $view->total = 1; |
86 | - } |
|
87 | - else |
|
86 | + } else |
|
88 | 87 | { |
89 | 88 | $total = 0; |
90 | 89 | $items = $cntl->slice( $view->param( 'page/offset', 0), $view->param( 'page/limit', 25 ) ) |