| @@ -115,7 +115,6 @@ | ||
| 115 | 115 | * | 
| 116 | 116 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object | 
| 117 | 117 | * @param \Psr\Http\Message\ResponseInterface $response Response object | 
| 118 | - * @param string|null $prefix Form parameter prefix when nesting parameters is required | |
| 119 | 118 | * @return \Psr\Http\Message\ResponseInterface Modified response object | 
| 120 | 119 | */ | 
| 121 | 120 | public function put( ServerRequestInterface $request, ResponseInterface $response ) | 
| @@ -39,16 +39,14 @@ | ||
| 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 = array( array( | 
| 47 | 46 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), | 
| 48 | 47 | 'detail' => $e->getTraceAsString(), | 
| 49 | 48 | ) ); | 
| 50 | - } | |
| 51 | - catch( \Exception $e ) | |
| 49 | + } catch( \Exception $e ) | |
| 52 | 50 |  		{ | 
| 53 | 51 | $status = 500; | 
| 54 | 52 | $view->errors = array( array( | 
| @@ -101,8 +101,7 @@ | ||
| 101 | 101 | $decorators = $config->get( 'client/jsonapi/' . $dpath . 'decorators/local', array() ); | 
| 102 | 102 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $view, $templatePaths, $path ); | 
| 103 | 103 | } | 
| 104 | - } | |
| 105 | - else | |
| 104 | + } else | |
| 106 | 105 |  		{ | 
| 107 | 106 | $classprefix = '\\Aimeos\\Client\\JsonApi\\Common\\Decorator\\'; | 
| 108 | 107 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $view, $templatePaths, $path ); | 
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | /** | 
| 41 | 41 | * Adds the decorators to the JSON API client object | 
| 42 | 42 | * | 
| 43 | - * @param \Aimeos\Client\JsonApi\Common\Iface $client Client object | |
| 43 | + * @param \Aimeos\Client\JsonApi\Iface $client Client object | |
| 44 | 44 | * @param \Aimeos\MShop\Context\Item\Iface $context Context instance with necessary objects | 
| 45 | 45 | * @param \Aimeos\MW\View\Iface $view View object | 
| 46 | 46 | * @param array $templatePaths List of file system paths where the templates are stored | 
| @@ -44,16 +44,14 @@ | ||
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | 46 | $status = 200; | 
| 47 | - } | |
| 48 | - catch( \Aimeos\MShop\Exception $e ) | |
| 47 | + } catch( \Aimeos\MShop\Exception $e ) | |
| 49 | 48 |  		{ | 
| 50 | 49 | $status = 404; | 
| 51 | 50 | $view->errors = array( array( | 
| 52 | 51 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), | 
| 53 | 52 | 'detail' => $e->getTraceAsString(), | 
| 54 | 53 | ) ); | 
| 55 | - } | |
| 56 | - catch( \Exception $e ) | |
| 54 | + } catch( \Exception $e ) | |
| 57 | 55 |  		{ | 
| 58 | 56 | $status = 500; | 
| 59 | 57 | $view->errors = array( array( | 
| @@ -60,8 +60,7 @@ | ||
| 60 | 60 | $view->resources = (array) $resources; | 
| 61 | 61 | $view->prefix = $prefix; | 
| 62 | 62 | $status = 200; | 
| 63 | - } | |
| 64 | - catch( \Exception $e ) | |
| 63 | + } catch( \Exception $e ) | |
| 65 | 64 |  		{ | 
| 66 | 65 | $status = 500; | 
| 67 | 66 | $view->errors = array( array( | 
| @@ -136,8 +136,7 @@ | ||
| 136 | 136 |  			if( ( $client = @call_user_func_array( array( $factory, 'createClient' ), $args ) ) === false ) { | 
| 137 | 137 | throw new \Aimeos\Client\JsonApi\Exception( sprintf( 'Invalid factory "%1$s"', $factory ), 400 ); | 
| 138 | 138 | } | 
| 139 | - } | |
| 140 | - else | |
| 139 | + } else | |
| 141 | 140 |  		{ | 
| 142 | 141 | $client = self::createClientRoot( $context, $view, $templatePaths, $path, $name ); | 
| 143 | 142 | } | 
| @@ -44,16 +44,14 @@ | ||
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | 46 | $status = 200; | 
| 47 | - } | |
| 48 | - catch( \Aimeos\MShop\Exception $e ) | |
| 47 | + } catch( \Aimeos\MShop\Exception $e ) | |
| 49 | 48 |  		{ | 
| 50 | 49 | $status = 404; | 
| 51 | 50 | $view->errors = array( array( | 
| 52 | 51 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), | 
| 53 | 52 | 'detail' => $e->getTraceAsString(), | 
| 54 | 53 | ) ); | 
| 55 | - } | |
| 56 | - catch( \Exception $e ) | |
| 54 | + } catch( \Exception $e ) | |
| 57 | 55 |  		{ | 
| 58 | 56 | $status = 500; | 
| 59 | 57 | $view->errors = array( array( | 
| @@ -44,16 +44,14 @@ | ||
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | 46 | $status = 200; | 
| 47 | - } | |
| 48 | - catch( \Aimeos\MShop\Exception $e ) | |
| 47 | + } catch( \Aimeos\MShop\Exception $e ) | |
| 49 | 48 |  		{ | 
| 50 | 49 | $status = 404; | 
| 51 | 50 | $view->errors = array( array( | 
| 52 | 51 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), | 
| 53 | 52 | 'detail' => $e->getTraceAsString(), | 
| 54 | 53 | ) ); | 
| 55 | - } | |
| 56 | - catch( \Exception $e ) | |
| 54 | + } catch( \Exception $e ) | |
| 57 | 55 |  		{ | 
| 58 | 56 | $status = 500; | 
| 59 | 57 | $view->errors = array( array( | 
| @@ -199,6 +199,9 @@ | ||
| 199 | 199 | } | 
| 200 | 200 | |
| 201 | 201 | |
| 202 | + /** | |
| 203 | + * @param string $code | |
| 204 | + */ | |
| 202 | 205 | protected function addProduct( $code ) | 
| 203 | 206 |  	{ | 
| 204 | 207 | $prodId = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( $code )->getId(); |