@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 37 | 37 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 38 | 38 | */ |
| 39 | - public function deleteAction( ServerRequestInterface $request ) |
|
| 39 | + public function deleteAction(ServerRequestInterface $request) |
|
| 40 | 40 | { |
| 41 | - if( config( 'shop.authorize', true ) ) { |
|
| 42 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api']] ); |
|
| 41 | + if (config('shop.authorize', true)) { |
|
| 42 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api']]); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - return $this->createClient()->delete( $request, new Response() ); |
|
| 45 | + return $this->createClient()->delete($request, new Response()); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -52,13 +52,13 @@ discard block |
||
| 52 | 52 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 53 | 53 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 54 | 54 | */ |
| 55 | - public function getAction( ServerRequestInterface $request ) |
|
| 55 | + public function getAction(ServerRequestInterface $request) |
|
| 56 | 56 | { |
| 57 | - if( config( 'shop.authorize', true ) ) { |
|
| 58 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'editor']] ); |
|
| 57 | + if (config('shop.authorize', true)) { |
|
| 58 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'editor']]); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - return $this->createClient()->get( $request, new Response() ); |
|
| 61 | + return $this->createClient()->get($request, new Response()); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 69 | 69 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 70 | 70 | */ |
| 71 | - public function patchAction( ServerRequestInterface $request ) |
|
| 71 | + public function patchAction(ServerRequestInterface $request) |
|
| 72 | 72 | { |
| 73 | - if( config( 'shop.authorize', true ) ) { |
|
| 74 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api']] ); |
|
| 73 | + if (config('shop.authorize', true)) { |
|
| 74 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api']]); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - return $this->createClient()->patch( $request, new Response() ); |
|
| 77 | + return $this->createClient()->patch($request, new Response()); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 85 | 85 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 86 | 86 | */ |
| 87 | - public function postAction( ServerRequestInterface $request ) |
|
| 87 | + public function postAction(ServerRequestInterface $request) |
|
| 88 | 88 | { |
| 89 | - if( config( 'shop.authorize', true ) ) { |
|
| 90 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api']] ); |
|
| 89 | + if (config('shop.authorize', true)) { |
|
| 90 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api']]); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - return $this->createClient()->post( $request, new Response() ); |
|
| 93 | + return $this->createClient()->post($request, new Response()); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 101 | 101 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 102 | 102 | */ |
| 103 | - public function putAction( ServerRequestInterface $request ) |
|
| 103 | + public function putAction(ServerRequestInterface $request) |
|
| 104 | 104 | { |
| 105 | - if( config( 'shop.authorize', true ) ) { |
|
| 106 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api']] ); |
|
| 105 | + if (config('shop.authorize', true)) { |
|
| 106 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api']]); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - return $this->createClient()->put( $request, new Response() ); |
|
| 109 | + return $this->createClient()->put($request, new Response()); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
@@ -116,13 +116,13 @@ discard block |
||
| 116 | 116 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 117 | 117 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 118 | 118 | */ |
| 119 | - public function optionsAction( ServerRequestInterface $request ) |
|
| 119 | + public function optionsAction(ServerRequestInterface $request) |
|
| 120 | 120 | { |
| 121 | - if( config( 'shop.authorize', true ) ) { |
|
| 122 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'editor']] ); |
|
| 121 | + if (config('shop.authorize', true)) { |
|
| 122 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'editor']]); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - return $this->createClient()->options( $request, new Response() ); |
|
| 125 | + return $this->createClient()->options($request, new Response()); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -133,18 +133,18 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | protected function createClient() |
| 135 | 135 | { |
| 136 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
| 137 | - $lang = Input::get( 'locale', config( 'app.locale', 'en' ) ); |
|
| 138 | - $resource = Route::input( 'resource' ); |
|
| 136 | + $site = Route::input('site', Input::get('site', 'default')); |
|
| 137 | + $lang = Input::get('locale', config('app.locale', 'en')); |
|
| 138 | + $resource = Route::input('resource'); |
|
| 139 | 139 | |
| 140 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 141 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' ); |
|
| 140 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 141 | + $templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates'); |
|
| 142 | 142 | |
| 143 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false, 'backend' ); |
|
| 144 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang, 'en' ) ) ); |
|
| 145 | - $context->setLocale( app('\Aimeos\Shop\Base\Locale')->getBackend( $context, $site ) ); |
|
| 146 | - $context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context, $templatePaths, $lang ) ); |
|
| 143 | + $context = app('\Aimeos\Shop\Base\Context')->get(false, 'backend'); |
|
| 144 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang, 'en'))); |
|
| 145 | + $context->setLocale(app('\Aimeos\Shop\Base\Locale')->getBackend($context, $site)); |
|
| 146 | + $context->setView(app('\Aimeos\Shop\Base\View')->create($context, $templatePaths, $lang)); |
|
| 147 | 147 | |
| 148 | - return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 148 | + return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource); |
|
| 149 | 149 | } |
| 150 | 150 | } |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 34 | 34 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 35 | 35 | */ |
| 36 | - public function deleteAction( ServerRequestInterface $request ) |
|
| 36 | + public function deleteAction(ServerRequestInterface $request) |
|
| 37 | 37 | { |
| 38 | - return $this->createClient()->delete( $request, new Response() ); |
|
| 38 | + return $this->createClient()->delete($request, new Response()); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 46 | 46 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 47 | 47 | */ |
| 48 | - public function getAction( ServerRequestInterface $request ) |
|
| 48 | + public function getAction(ServerRequestInterface $request) |
|
| 49 | 49 | { |
| 50 | - return $this->createClient()->get( $request, new Response() ); |
|
| 50 | + return $this->createClient()->get($request, new Response()); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 58 | 58 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 59 | 59 | */ |
| 60 | - public function patchAction( ServerRequestInterface $request ) |
|
| 60 | + public function patchAction(ServerRequestInterface $request) |
|
| 61 | 61 | { |
| 62 | - return $this->createClient()->patch( $request, new Response() ); |
|
| 62 | + return $this->createClient()->patch($request, new Response()); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 70 | 70 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 71 | 71 | */ |
| 72 | - public function postAction( ServerRequestInterface $request ) |
|
| 72 | + public function postAction(ServerRequestInterface $request) |
|
| 73 | 73 | { |
| 74 | - return $this->createClient()->post( $request, new Response() ); |
|
| 74 | + return $this->createClient()->post($request, new Response()); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 82 | 82 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 83 | 83 | */ |
| 84 | - public function putAction( ServerRequestInterface $request ) |
|
| 84 | + public function putAction(ServerRequestInterface $request) |
|
| 85 | 85 | { |
| 86 | - return $this->createClient()->put( $request, new Response() ); |
|
| 86 | + return $this->createClient()->put($request, new Response()); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 94 | 94 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 95 | 95 | */ |
| 96 | - public function optionsAction( ServerRequestInterface $request ) |
|
| 96 | + public function optionsAction(ServerRequestInterface $request) |
|
| 97 | 97 | { |
| 98 | - return $this->createClient()->options( $request, new Response() ); |
|
| 98 | + return $this->createClient()->options($request, new Response()); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -106,16 +106,16 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | protected function createClient() |
| 108 | 108 | { |
| 109 | - $resource = Route::input( 'resource' ); |
|
| 109 | + $resource = Route::input('resource'); |
|
| 110 | 110 | |
| 111 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 112 | - $tmplPaths = $aimeos->getCustomPaths( 'client/jsonapi/templates' ); |
|
| 111 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 112 | + $tmplPaths = $aimeos->getCustomPaths('client/jsonapi/templates'); |
|
| 113 | 113 | |
| 114 | - $context = app( '\Aimeos\Shop\Base\Context' )->get(); |
|
| 114 | + $context = app('\Aimeos\Shop\Base\Context')->get(); |
|
| 115 | 115 | $langid = $context->getLocale()->getLanguageId(); |
| 116 | 116 | |
| 117 | - $context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context, $tmplPaths, $langid ) ); |
|
| 117 | + $context->setView(app('\Aimeos\Shop\Base\View')->create($context, $tmplPaths, $langid)); |
|
| 118 | 118 | |
| 119 | - return \Aimeos\Client\JsonApi\Factory::createClient( $context, $tmplPaths, $resource ); |
|
| 119 | + return \Aimeos\Client\JsonApi\Factory::createClient($context, $tmplPaths, $resource); |
|
| 120 | 120 | } |
| 121 | 121 | } |