@@ -110,30 +110,30 @@ discard block |
||
| 110 | 110 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
| 111 | 111 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
| 112 | 112 | */ |
| 113 | - public function get( ServerRequestInterface $request, ResponseInterface $response ) |
|
| 113 | + public function get(ServerRequestInterface $request, ResponseInterface $response) |
|
| 114 | 114 | { |
| 115 | 115 | $view = $this->getView(); |
| 116 | 116 | |
| 117 | 117 | try |
| 118 | 118 | { |
| 119 | - $response = $this->getItems( $view, $request, $response ); |
|
| 119 | + $response = $this->getItems($view, $request, $response); |
|
| 120 | 120 | $status = 200; |
| 121 | 121 | } |
| 122 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 122 | + catch (\Aimeos\MShop\Exception $e) |
|
| 123 | 123 | { |
| 124 | 124 | $status = 404; |
| 125 | - $view->errors = array( array( |
|
| 126 | - 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
|
| 125 | + $view->errors = array(array( |
|
| 126 | + 'title' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()), |
|
| 127 | 127 | 'detail' => $e->getTraceAsString(), |
| 128 | - ) ); |
|
| 128 | + )); |
|
| 129 | 129 | } |
| 130 | - catch( \Exception $e ) |
|
| 130 | + catch (\Exception $e) |
|
| 131 | 131 | { |
| 132 | 132 | $status = 500; |
| 133 | - $view->errors = array( array( |
|
| 133 | + $view->errors = array(array( |
|
| 134 | 134 | 'title' => $e->getMessage(), |
| 135 | 135 | 'detail' => $e->getTraceAsString(), |
| 136 | - ) ); |
|
| 136 | + )); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** admin/jsonadm/service/config/template-get |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | $tplconf = 'admin/jsonadm/service/config/template-get'; |
| 159 | 159 | $default = 'config-default.php'; |
| 160 | 160 | |
| 161 | - $body = $view->render( $view->config( $tplconf, $default ) ); |
|
| 161 | + $body = $view->render($view->config($tplconf, $default)); |
|
| 162 | 162 | |
| 163 | - return $response->withHeader( 'Content-Type', 'application/vnd.api+json; supported-ext="bulk"' ) |
|
| 164 | - ->withBody( $view->response()->createStreamFromString( $body ) ) |
|
| 165 | - ->withStatus( $status ); |
|
| 163 | + return $response->withHeader('Content-Type', 'application/vnd.api+json; supported-ext="bulk"') |
|
| 164 | + ->withBody($view->response()->createStreamFromString($body)) |
|
| 165 | + ->withStatus($status); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
@@ -174,16 +174,16 @@ discard block |
||
| 174 | 174 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
| 175 | 175 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
| 176 | 176 | */ |
| 177 | - protected function getItems( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response ) |
|
| 177 | + protected function getItems(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response) |
|
| 178 | 178 | { |
| 179 | - if( ( $id = $view->param( 'id' ) ) == null ) { |
|
| 180 | - throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'No ID given' ), 400 ); |
|
| 179 | + if (($id = $view->param('id')) == null) { |
|
| 180 | + throw new \Aimeos\Admin\JsonAdm\Exception(sprintf('No ID given'), 400); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
| 184 | - $item = $manager->createItem()->setProvider( $id ); |
|
| 183 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
| 184 | + $item = $manager->createItem()->setProvider($id); |
|
| 185 | 185 | |
| 186 | - $view->configItems = $manager->getProvider( $item, $view->param( 'type', 'payment' ) )->getConfigBE(); |
|
| 186 | + $view->configItems = $manager->getProvider($item, $view->param('type', 'payment'))->getConfigBE(); |
|
| 187 | 187 | |
| 188 | 188 | return $response; |
| 189 | 189 | } |
@@ -110,30 +110,30 @@ discard block |
||
| 110 | 110 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
| 111 | 111 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
| 112 | 112 | */ |
| 113 | - public function get( ServerRequestInterface $request, ResponseInterface $response ) |
|
| 113 | + public function get(ServerRequestInterface $request, ResponseInterface $response) |
|
| 114 | 114 | { |
| 115 | 115 | $view = $this->getView(); |
| 116 | 116 | |
| 117 | 117 | try |
| 118 | 118 | { |
| 119 | - $response = $this->getItems( $view, $request, $response ); |
|
| 119 | + $response = $this->getItems($view, $request, $response); |
|
| 120 | 120 | $status = 200; |
| 121 | 121 | } |
| 122 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 122 | + catch (\Aimeos\MShop\Exception $e) |
|
| 123 | 123 | { |
| 124 | 124 | $status = 404; |
| 125 | - $view->errors = array( array( |
|
| 126 | - 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
|
| 125 | + $view->errors = array(array( |
|
| 126 | + 'title' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()), |
|
| 127 | 127 | 'detail' => $e->getTraceAsString(), |
| 128 | - ) ); |
|
| 128 | + )); |
|
| 129 | 129 | } |
| 130 | - catch( \Exception $e ) |
|
| 130 | + catch (\Exception $e) |
|
| 131 | 131 | { |
| 132 | 132 | $status = 500; |
| 133 | - $view->errors = array( array( |
|
| 133 | + $view->errors = array(array( |
|
| 134 | 134 | 'title' => $e->getMessage(), |
| 135 | 135 | 'detail' => $e->getTraceAsString(), |
| 136 | - ) ); |
|
| 136 | + )); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** admin/jsonadm/plugin/config/template-get |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | $tplconf = 'admin/jsonadm/plugin/config/template-get'; |
| 159 | 159 | $default = 'config-default.php'; |
| 160 | 160 | |
| 161 | - $body = $view->render( $view->config( $tplconf, $default ) ); |
|
| 161 | + $body = $view->render($view->config($tplconf, $default)); |
|
| 162 | 162 | |
| 163 | - return $response->withHeader( 'Content-Type', 'application/vnd.api+json; supported-ext="bulk"' ) |
|
| 164 | - ->withBody( $view->response()->createStreamFromString( $body ) ) |
|
| 165 | - ->withStatus( $status ); |
|
| 163 | + return $response->withHeader('Content-Type', 'application/vnd.api+json; supported-ext="bulk"') |
|
| 164 | + ->withBody($view->response()->createStreamFromString($body)) |
|
| 165 | + ->withStatus($status); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
@@ -174,16 +174,16 @@ discard block |
||
| 174 | 174 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
| 175 | 175 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
| 176 | 176 | */ |
| 177 | - protected function getItems( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response ) |
|
| 177 | + protected function getItems(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response) |
|
| 178 | 178 | { |
| 179 | - if( ( $id = $view->param( 'id' ) ) == null ) { |
|
| 180 | - throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'No ID given' ), 400 ); |
|
| 179 | + if (($id = $view->param('id')) == null) { |
|
| 180 | + throw new \Aimeos\Admin\JsonAdm\Exception(sprintf('No ID given'), 400); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'plugin' ); |
|
| 184 | - $item = $manager->createItem()->setProvider( $id ); |
|
| 183 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'plugin'); |
|
| 184 | + $item = $manager->createItem()->setProvider($id); |
|
| 185 | 185 | |
| 186 | - $view->configItems = $manager->getProvider( $item, 'order' )->getConfigBE(); |
|
| 186 | + $view->configItems = $manager->getProvider($item, 'order')->getConfigBE(); |
|
| 187 | 187 | |
| 188 | 188 | return $response; |
| 189 | 189 | } |