@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | -$entryFcn = function( \Aimeos\MShop\Attribute\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
41 | -{ |
|
40 | +$entryFcn = function( \Aimeos\MShop\Attribute\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
42 | 41 | $id = $item->getId(); |
43 | 42 | $type = $item->getResourceType(); |
44 | 43 | $params = array( 'resource' => $type, 'id' => $id ); |
@@ -130,8 +129,7 @@ discard block |
||
130 | 129 | $data[] = $entryFcn( $item ); |
131 | 130 | $included = array_merge( $included, $this->jincluded( $item, $fields ) ); |
132 | 131 | } |
133 | - } |
|
134 | - else |
|
132 | + } else |
|
135 | 133 | { |
136 | 134 | $data = $entryFcn( $items ); |
137 | 135 | $included = $this->jincluded( $items, $fields ); |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | -$entryFcn = function( \Aimeos\MShop\Catalog\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
33 | -{ |
|
32 | +$entryFcn = function( \Aimeos\MShop\Catalog\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
34 | 33 | if( $item->isAvailable() === false ) { |
35 | 34 | return []; |
36 | 35 | } |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | }; |
81 | 80 | |
82 | 81 | |
83 | -$catFcn = function( \Aimeos\MShop\Catalog\Item\Iface $item, array $entry ) use ( $target, $cntl, $action, $config ) |
|
84 | -{ |
|
82 | +$catFcn = function( \Aimeos\MShop\Catalog\Item\Iface $item, array $entry ) use ( $target, $cntl, $action, $config ) { |
|
85 | 83 | $params = ['resource' => 'catalog', 'id' => $item->getId()]; |
86 | 84 | $entry['links'] = [ |
87 | 85 | 'self' => [ |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | -$entryFcn = function( \Aimeos\MShop\Customer\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
31 | -{ |
|
30 | +$entryFcn = function( \Aimeos\MShop\Customer\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
32 | 31 | $id = $item->getId(); |
33 | 32 | $type = $item->getResourceType(); |
34 | 33 | $params = array( 'resource' => $type, 'id' => $id ); |
@@ -94,8 +93,7 @@ discard block |
||
94 | 93 | }; |
95 | 94 | |
96 | 95 | |
97 | -$custAddrFcn = function( \Aimeos\MShop\Customer\Item\Address\Iface $item, array $entry ) use ( $target, $cntl, $action, $config ) |
|
98 | -{ |
|
96 | +$custAddrFcn = function( \Aimeos\MShop\Customer\Item\Address\Iface $item, array $entry ) use ( $target, $cntl, $action, $config ) { |
|
99 | 97 | $id = $item->getId(); |
100 | 98 | $type = $item->getResourceType(); |
101 | 99 |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | -$entryFcn = function( \Aimeos\MShop\Service\Item\Iface $item, array $prices, array $feConfig ) use ( $fields, $target, $cntl, $action, $config ) |
|
31 | -{ |
|
30 | +$entryFcn = function( \Aimeos\MShop\Service\Item\Iface $item, array $prices, array $feConfig ) use ( $fields, $target, $cntl, $action, $config ) { |
|
32 | 31 | $metadata = []; |
33 | 32 | $id = $item->getId(); |
34 | 33 | $type = $item->getResourceType(); |
@@ -121,8 +120,7 @@ discard block |
||
121 | 120 | $data[] = $entryFcn( $item, $prices, $feConfig ); |
122 | 121 | $included = array_merge( $included, $this->jincluded( $item, $fields ) ); |
123 | 122 | } |
124 | - } |
|
125 | - else |
|
123 | + } else |
|
126 | 124 | { |
127 | 125 | $data = $entryFcn( $this->items, $prices, $feConfig ); |
128 | 126 | $included = $this->jincluded( $this->items, $fields ); |
@@ -23,7 +23,7 @@ discard block |
||
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' ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | "self": "<?php $params['page']['offset'] = $offset; echo $this->url( $target, $cntl, $action, $params, [], $config ); ?>" |
118 | 118 | } |
119 | 119 | <?php if( isset( $this->errors ) ) : ?> |
120 | - ,"errors": <?= json_encode( $this->errors, $pretty); ?> |
|
120 | + ,"errors": <?= json_encode( $this->errors, $pretty ); ?> |
|
121 | 121 | |
122 | 122 | <?php elseif( isset( $this->items ) ) : ?> |
123 | 123 | <?php |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | -$entryFcn = function( \Aimeos\MShop\Supplier\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
41 | -{ |
|
40 | +$entryFcn = function( \Aimeos\MShop\Supplier\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
42 | 41 | $id = $item->getId(); |
43 | 42 | $type = $item->getResourceType(); |
44 | 43 | $params = array( 'resource' => $type, 'id' => $id ); |
@@ -131,8 +130,7 @@ discard block |
||
131 | 130 | $data[] = $entryFcn( $item ); |
132 | 131 | $included = array_merge( $included, $this->jincluded( $item, $fields ) ); |
133 | 132 | } |
134 | - } |
|
135 | - else |
|
133 | + } else |
|
136 | 134 | { |
137 | 135 | $data = $entryFcn( $items ); |
138 | 136 | $included = $this->jincluded( $items, $fields ); |
@@ -103,8 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | |
106 | -$entryFcn = function( \Aimeos\MShop\Product\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
107 | -{ |
|
106 | +$entryFcn = function( \Aimeos\MShop\Product\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
108 | 107 | $id = $item->getId(); |
109 | 108 | $attributes = $item->toArray(); |
110 | 109 | $type = $item->getResourceType(); |
@@ -197,8 +196,7 @@ discard block |
||
197 | 196 | $data[] = $entryFcn( $item ); |
198 | 197 | $included = array_merge( $included, $this->jincluded( $item, $fields ) ); |
199 | 198 | } |
200 | - } |
|
201 | - else |
|
199 | + } else |
|
202 | 200 | { |
203 | 201 | $data = $entryFcn( $items ); |
204 | 202 | $included = $this->jincluded( $items, $fields ); |