Completed
Push — master ( 9d91b3...a20ebf )
by Aimeos
06:04
created
src/Aimeos/Shop/ShopServiceProvider.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,31 +28,31 @@
 block discarded – undo
28 28
 	 */
29 29
 	public function boot()
30 30
 	{
31
-		$basedir = dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR;
31
+		$basedir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR;
32 32
 
33
-		$this->mergeConfigFrom(dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.'config/shop.php', 'shop');
33
+		$this->mergeConfigFrom(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'config/shop.php', 'shop');
34 34
 
35
-		$this->loadViewsFrom($basedir.'views', 'shop');
35
+		$this->loadViewsFrom($basedir . 'views', 'shop');
36 36
 
37 37
 
38 38
 		$this->publishes(array(
39
-			$basedir.'config/shop.php' => config_path('shop.php'),
39
+			$basedir . 'config/shop.php' => config_path('shop.php'),
40 40
 		), 'config');
41 41
 
42 42
 		$this->publishes(array(
43
-			$basedir.'database/migrations' => base_path('database/migrations'),
43
+			$basedir . 'database/migrations' => base_path('database/migrations'),
44 44
 		), 'migrations');
45 45
 
46 46
 		$this->publishes(array(
47
-			$basedir.'views' => base_path('resources/views/vendor/shop'),
47
+			$basedir . 'views' => base_path('resources/views/vendor/shop'),
48 48
 		), 'views');
49 49
 
50 50
 		$this->publishes(array(
51
-			dirname($basedir).DIRECTORY_SEPARATOR.'public' => public_path('packages/aimeos/shop'),
51
+			dirname($basedir) . DIRECTORY_SEPARATOR . 'public' => public_path('packages/aimeos/shop'),
52 52
 		), 'public');
53 53
 
54 54
 
55
-		require $basedir.'routes.php';
55
+		require $basedir . 'routes.php';
56 56
 	}
57 57
 
58 58
 
Please login to merge, or discard this patch.
src/config/shop.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 return array(
4 4
 	'apc_enabled' => false,
5 5
 	'apc_prefix' => 'laravel:',
6
-	'extdir' => ( is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext' ),
6
+	'extdir' => (is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext'),
7 7
 	'uploaddir' => '/',
8 8
 
9 9
 	'routes' => array(
@@ -14,16 +14,16 @@  discard block
 block discarded – undo
14 14
 	),
15 15
 
16 16
 	'page' => array(
17
-		'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
18
-		'basket-index' => array( 'basket/standard','basket/related' ),
19
-		'catalog-count' => array( 'catalog/count' ),
20
-		'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
21
-		'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
22
-		'catalog-stock' => array( 'catalog/stock' ),
23
-		'catalog-suggest' => array( 'catalog/suggest' ),
24
-		'checkout-confirm' => array( 'checkout/confirm' ),
25
-		'checkout-index' => array( 'checkout/standard' ),
26
-		'checkout-update' => array( 'checkout/update'),
17
+		'account-index' => array('account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'),
18
+		'basket-index' => array('basket/standard', 'basket/related'),
19
+		'catalog-count' => array('catalog/count'),
20
+		'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'),
21
+		'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'),
22
+		'catalog-stock' => array('catalog/stock'),
23
+		'catalog-suggest' => array('catalog/suggest'),
24
+		'checkout-confirm' => array('checkout/confirm'),
25
+		'checkout-index' => array('checkout/standard'),
26
+		'checkout-update' => array('checkout/update'),
27 27
 	),
28 28
 
29 29
 	'resource' => array(
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 			'database' => env('DB_DATABASE', 'laravel'),
35 35
 			'username' => env('DB_USERNAME', 'root'),
36 36
 			'password' => env('DB_PASSWORD', ''),
37
-			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
37
+			'stmt' => array("SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'"),
38 38
 			'opt-persistent' => 0,
39 39
 			'limit' => 2,
40 40
 		),
41 41
 		'fs' => array(
42 42
 			'adapter' => 'Standard',
43 43
 			'basedir' => public_path(),
44
-			'tempdir' => storage_path( 'aimeos' ),
44
+			'tempdir' => storage_path('aimeos'),
45 45
 		),
46 46
 		'fs-admin' => array(
47 47
 			'adapter' => 'Standard',
48
-			'basedir' => public_path( 'uploads' ),
49
-			'tempdir' => storage_path( 'aimeos' ),
48
+			'basedir' => public_path('uploads'),
49
+			'tempdir' => storage_path('aimeos'),
50 50
 		),
51 51
 		/* 'fs-media' => array(
52 52
 			'adapter' => 'Standard',
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 				'default' => array(
192 192
 					'mimeicon' => array(
193 193
 						# Directory where icons for the mime types stored
194
-						'directory' => public_path( '/packages/aimeos/shop/mimeicons' ),
194
+						'directory' => public_path('/packages/aimeos/shop/mimeicons'),
195 195
 						# File extension of mime type icons
196 196
 						'extension' => '.png'
197 197
 					),
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 						# in the "maxwidth" parameter
235 235
 						# maxheight: 280
236 236
 					),
237
-					'tempdir' => storage_path( 'aimeos' ),
237
+					'tempdir' => storage_path('aimeos'),
238 238
 				),
239 239
 			),
240 240
 			'product' => array(
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/JsonadmController.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -35,19 +35,19 @@  discard block
 block discarded – undo
35 35
 	 * @param integer|null $id Unique resource ID
36 36
 	 * @return \Illuminate\Http\Response Response object containing the generated output
37 37
 	 */
38
-	public function deleteAction( Request $request, $site = 'default', $resource, $id = null )
38
+	public function deleteAction(Request $request, $site = 'default', $resource, $id = null)
39 39
 	{
40
-		if( config( 'shop.authorize', true ) ) {
41
-			$this->authorize( 'admin' );
40
+		if (config('shop.authorize', true)) {
41
+			$this->authorize('admin');
42 42
 		}
43 43
 
44 44
 		$status = 500;
45 45
 		$header = $request->headers->all();
46 46
 
47
-		$cntl = $this->createController( $site, $resource );
48
-		$result = $cntl->delete( $request->getContent(), $header, $status );
47
+		$cntl = $this->createController($site, $resource);
48
+		$result = $cntl->delete($request->getContent(), $header, $status);
49 49
 
50
-		return $this->createResponse( $result, $status, $header );
50
+		return $this->createResponse($result, $status, $header);
51 51
 	}
52 52
 
53 53
 
@@ -60,19 +60,19 @@  discard block
 block discarded – undo
60 60
 	 * @param integer|null $id Unique resource ID
61 61
 	 * @return \Illuminate\Http\Response Response object containing the generated output
62 62
 	 */
63
-	public function getAction( Request $request, $site = 'default', $resource, $id = null )
63
+	public function getAction(Request $request, $site = 'default', $resource, $id = null)
64 64
 	{
65
-		if( config( 'shop.authorize', true ) ) {
66
-			$this->authorize( 'admin' );
65
+		if (config('shop.authorize', true)) {
66
+			$this->authorize('admin');
67 67
 		}
68 68
 
69 69
 		$status = 500;
70 70
 		$header = $request->headers->all();
71 71
 
72
-		$cntl = $this->createController( $site, $resource );
73
-		$result = $cntl->get( $request->getContent(), $header, $status );
72
+		$cntl = $this->createController($site, $resource);
73
+		$result = $cntl->get($request->getContent(), $header, $status);
74 74
 
75
-		return $this->createResponse( $result, $status, $header );
75
+		return $this->createResponse($result, $status, $header);
76 76
 	}
77 77
 
78 78
 
@@ -85,19 +85,19 @@  discard block
 block discarded – undo
85 85
 	 * @param integer|null $id Unique resource ID
86 86
 	 * @return \Illuminate\Http\Response Response object containing the generated output
87 87
 	 */
88
-	public function patchAction( Request $request, $site = 'default', $resource, $id = null )
88
+	public function patchAction(Request $request, $site = 'default', $resource, $id = null)
89 89
 	{
90
-		if( config( 'shop.authorize', true ) ) {
91
-			$this->authorize( 'admin' );
90
+		if (config('shop.authorize', true)) {
91
+			$this->authorize('admin');
92 92
 		}
93 93
 
94 94
 		$status = 500;
95 95
 		$header = $request->headers->all();
96 96
 
97
-		$cntl = $this->createController( $site, $resource );
98
-		$result = $cntl->patch( $request->getContent(), $header, $status );
97
+		$cntl = $this->createController($site, $resource);
98
+		$result = $cntl->patch($request->getContent(), $header, $status);
99 99
 
100
-		return $this->createResponse( $result, $status, $header );
100
+		return $this->createResponse($result, $status, $header);
101 101
 	}
102 102
 
103 103
 
@@ -110,19 +110,19 @@  discard block
 block discarded – undo
110 110
 	 * @param integer $id Unique ID of the resource
111 111
 	 * @return \Illuminate\Http\Response Response object containing the generated output
112 112
 	 */
113
-	public function postAction( Request $request, $site = 'default', $resource, $id = null )
113
+	public function postAction(Request $request, $site = 'default', $resource, $id = null)
114 114
 	{
115
-		if( config( 'shop.authorize', true ) ) {
116
-			$this->authorize( 'admin' );
115
+		if (config('shop.authorize', true)) {
116
+			$this->authorize('admin');
117 117
 		}
118 118
 
119 119
 		$status = 500;
120 120
 		$header = $request->headers->all();
121 121
 
122
-		$cntl = $this->createController( $site, $resource );
123
-		$result = $cntl->post( $request->getContent(), $header, $status );
122
+		$cntl = $this->createController($site, $resource);
123
+		$result = $cntl->post($request->getContent(), $header, $status);
124 124
 
125
-		return $this->createResponse( $result, $status, $header );
125
+		return $this->createResponse($result, $status, $header);
126 126
 	}
127 127
 
128 128
 
@@ -135,19 +135,19 @@  discard block
 block discarded – undo
135 135
 	 * @param integer|null $id Unique resource ID
136 136
 	 * @return \Illuminate\Http\Response Response object containing the generated output
137 137
 	 */
138
-	public function putAction( Request $request, $site = 'default', $resource, $id = null )
138
+	public function putAction(Request $request, $site = 'default', $resource, $id = null)
139 139
 	{
140
-		if( config( 'shop.authorize', true ) ) {
141
-			$this->authorize( 'admin' );
140
+		if (config('shop.authorize', true)) {
141
+			$this->authorize('admin');
142 142
 		}
143 143
 
144 144
 		$status = 500;
145 145
 		$header = $request->headers->all();
146 146
 
147
-		$cntl = $this->createController( $site, $resource );
148
-		$result = $cntl->put( $request->getContent(), $header, $status );
147
+		$cntl = $this->createController($site, $resource);
148
+		$result = $cntl->put($request->getContent(), $header, $status);
149 149
 
150
-		return $this->createResponse( $result, $status, $header );
150
+		return $this->createResponse($result, $status, $header);
151 151
 	}
152 152
 
153 153
 
@@ -159,19 +159,19 @@  discard block
 block discarded – undo
159 159
 	 * @param string $sitecode Unique site code
160 160
 	 * @return \Illuminate\Http\Response Response object containing the generated output
161 161
 	 */
162
-	public function optionsAction( Request $request, $site = 'default', $resource = '' )
162
+	public function optionsAction(Request $request, $site = 'default', $resource = '')
163 163
 	{
164
-		if( config( 'shop.authorize', true ) ) {
165
-			$this->authorize( 'admin' );
164
+		if (config('shop.authorize', true)) {
165
+			$this->authorize('admin');
166 166
 		}
167 167
 
168 168
 		$status = 500;
169 169
 		$header = $request->headers->all();
170 170
 
171
-		$cntl = $this->createController( $site, $resource );
172
-		$result = $cntl->options( $request->getContent(), $header, $status );
171
+		$cntl = $this->createController($site, $resource);
172
+		$result = $cntl->options($request->getContent(), $header, $status);
173 173
 
174
-		return $this->createResponse( $result, $status, $header );
174
+		return $this->createResponse($result, $status, $header);
175 175
 	}
176 176
 
177 177
 
@@ -181,20 +181,20 @@  discard block
 block discarded – undo
181 181
 	 * @param string $sitecode Unique site code
182 182
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
183 183
 	 */
184
-	protected function createController( $sitecode, $resource )
184
+	protected function createController($sitecode, $resource)
185 185
 	{
186
-		$lang = \Input::get( 'lang', config( 'app.locale', 'en' ) );
186
+		$lang = \Input::get('lang', config('app.locale', 'en'));
187 187
 
188
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
189
-		$templatePaths = $aimeos->getCustomPaths( 'controller/jsonadm/templates' );
188
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
189
+		$templatePaths = $aimeos->getCustomPaths('controller/jsonadm/templates');
190 190
 
191
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
192
-		$context = $this->setLocale( $context, $sitecode, $lang );
191
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
192
+		$context = $this->setLocale($context, $sitecode, $lang);
193 193
 
194
-		$view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang );
195
-		$context->setView( $view );
194
+		$view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang);
195
+		$context->setView($view);
196 196
 
197
-		return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource );
197
+		return \Aimeos\Controller\JsonAdm\Factory::createController($context, $templatePaths, $resource);
198 198
 	}
199 199
 
200 200
 
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
 	 * @param array $header List of HTTP headers
207 207
 	 * @return \Illuminate\Http\Response HTTP response object
208 208
 	 */
209
-	protected function createResponse( $content, $status, array $header )
209
+	protected function createResponse($content, $status, array $header)
210 210
 	{
211
-		$response = \Response::make( $content, $status );
211
+		$response = \Response::make($content, $status);
212 212
 
213
-		foreach( $header as $key => $value ) {
214
-			$response->header( $key, $value );
213
+		foreach ($header as $key => $value) {
214
+			$response->header($key, $value);
215 215
 		}
216 216
 
217 217
 		return $response;
@@ -226,23 +226,23 @@  discard block
 block discarded – undo
226 226
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
227 227
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
228 228
 	 */
229
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang )
229
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang)
230 230
 	{
231
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
231
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
232 232
 
233 233
 		try
234 234
 		{
235
-			$localeItem = $localeManager->bootstrap( $sitecode, '', '', false );
236
-			$localeItem->setLanguageId( null );
237
-			$localeItem->setCurrencyId( null );
235
+			$localeItem = $localeManager->bootstrap($sitecode, '', '', false);
236
+			$localeItem->setLanguageId(null);
237
+			$localeItem->setCurrencyId(null);
238 238
 		}
239
-		catch( \Aimeos\MShop\Locale\Exception $e )
239
+		catch (\Aimeos\MShop\Locale\Exception $e)
240 240
 		{
241 241
 			$localeItem = $localeManager->createItem();
242 242
 		}
243 243
 
244
-		$context->setLocale( $localeItem );
245
-		$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) );
244
+		$context->setLocale($localeItem);
245
+		$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang)));
246 246
 
247 247
 		return $context;
248 248
 	}
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@  discard block
 block discarded – undo
2 2
 
3 3
 Route::group(config('shop.routes.admin', ['middleware' => 'auth']), function() {
4 4
 
5
-	Route::match( array( 'GET' ), 'admin/file', array(
5
+	Route::match(array('GET'), 'admin/file', array(
6 6
 		'as' => 'aimeos_shop_admin_file',
7 7
 		'uses' => 'Aimeos\Shop\Controller\AdminController@fileAction'
8 8
 	));
9
-	Route::match( array( 'POST' ), 'admin/do', array(
9
+	Route::match(array('POST'), 'admin/do', array(
10 10
 		'as' => 'aimeos_shop_admin_json',
11 11
 		'uses' => 'Aimeos\Shop\Controller\AdminController@doAction'
12 12
 	));
13
-	Route::match( array( 'GET' ), 'admin', array(
13
+	Route::match(array('GET'), 'admin', array(
14 14
 		'as' => 'aimeos_shop_admin',
15 15
 		'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction'
16 16
 	));
@@ -20,85 +20,85 @@  discard block
 block discarded – undo
20 20
 
21 21
 Route::group(config('shop.routes.jqadm', ['middleware' => 'auth']), function() {
22 22
 
23
-	Route::match( array( 'GET', 'POST' ), 'jqadm/copy/{resource}/{id}', array(
23
+	Route::match(array('GET', 'POST'), 'jqadm/copy/{resource}/{id}', array(
24 24
 		'as' => 'aimeos_shop_jqadm_copy',
25 25
 		'uses' => 'Aimeos\Shop\Controller\JqadmController@copyAction'
26
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
26
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
27 27
 
28
-	Route::match( array( 'GET', 'POST' ), 'jqadm/create/{resource}', array(
28
+	Route::match(array('GET', 'POST'), 'jqadm/create/{resource}', array(
29 29
 		'as' => 'aimeos_shop_jqadm_create',
30 30
 		'uses' => 'Aimeos\Shop\Controller\JqadmController@createAction'
31
-	))->where( array( 'resource' => '[^0-9]+' ) );
31
+	))->where(array('resource' => '[^0-9]+'));
32 32
 
33
-	Route::match( array( 'GET', 'POST' ), 'jqadm/delete/{resource}/{id}', array(
33
+	Route::match(array('GET', 'POST'), 'jqadm/delete/{resource}/{id}', array(
34 34
 		'as' => 'aimeos_shop_jqadm_delete',
35 35
 		'uses' => 'Aimeos\Shop\Controller\JqadmController@deleteAction'
36
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
36
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
37 37
 
38
-	Route::match( array( 'GET' ), 'jqadm/get/{resource}/{id}', array(
38
+	Route::match(array('GET'), 'jqadm/get/{resource}/{id}', array(
39 39
 		'as' => 'aimeos_shop_jqadm_get',
40 40
 		'uses' => 'Aimeos\Shop\Controller\JqadmController@getAction'
41
-	))->where( array( 'resource' => '[^0-9]*', 'id' => '[0-9]*' ) );
41
+	))->where(array('resource' => '[^0-9]*', 'id' => '[0-9]*'));
42 42
 
43
-	Route::match( array( 'POST' ), 'jqadm/save/{resource}', array(
43
+	Route::match(array('POST'), 'jqadm/save/{resource}', array(
44 44
 		'as' => 'aimeos_shop_jqadm_save',
45 45
 		'uses' => 'Aimeos\Shop\Controller\JqadmController@saveAction'
46
-	))->where( array( 'resource' => '[^0-9]+' ) );
46
+	))->where(array('resource' => '[^0-9]+'));
47 47
 
48
-	Route::match( array( 'GET', 'POST' ), 'jqadm/search/{resource}', array(
48
+	Route::match(array('GET', 'POST'), 'jqadm/search/{resource}', array(
49 49
 		'as' => 'aimeos_shop_jqadm_search',
50 50
 		'uses' => 'Aimeos\Shop\Controller\JqadmController@searchAction'
51
-	))->where( array( 'resource' => '[^0-9]+' ) );
51
+	))->where(array('resource' => '[^0-9]+'));
52 52
 
53 53
 });
54 54
 
55 55
 
56 56
 Route::group(config('shop.routes.jsonadm', ['middleware' => 'auth']), function() {
57 57
 
58
-	Route::match( array( 'DELETE' ), 'jsonadm/{resource}/{id?}', array(
58
+	Route::match(array('DELETE'), 'jsonadm/{resource}/{id?}', array(
59 59
 		'as' => 'aimeos_shop_jsonadm_delete',
60 60
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@deleteAction'
61
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
61
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
62 62
 
63
-	Route::match( array( 'GET' ), 'jsonadm/{resource}/{id?}', array(
63
+	Route::match(array('GET'), 'jsonadm/{resource}/{id?}', array(
64 64
 		'as' => 'aimeos_shop_jsonadm_get',
65 65
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@getAction'
66
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
66
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
67 67
 
68
-	Route::match( array( 'PATCH' ), 'jsonadm/{resource}/{id?}', array(
68
+	Route::match(array('PATCH'), 'jsonadm/{resource}/{id?}', array(
69 69
 		'as' => 'aimeos_shop_jsonadm_patch',
70 70
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@patchAction'
71
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
71
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
72 72
 
73
-	Route::match( array( 'POST' ), 'jsonadm/{resource}/{id?}', array(
73
+	Route::match(array('POST'), 'jsonadm/{resource}/{id?}', array(
74 74
 		'as' => 'aimeos_shop_jsonadm_post',
75 75
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@postAction'
76
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
76
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
77 77
 
78
-	Route::match( array( 'PUT' ), 'jsonadm/{resource}/{id?}', array(
78
+	Route::match(array('PUT'), 'jsonadm/{resource}/{id?}', array(
79 79
 		'as' => 'aimeos_shop_jsonadm_put',
80 80
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@putAction'
81
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
81
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
82 82
 
83
-	Route::match( array( 'OPTIONS' ), 'jsonadm/{resource?}', array(
83
+	Route::match(array('OPTIONS'), 'jsonadm/{resource?}', array(
84 84
 		'as' => 'aimeos_shop_jsonadm_options',
85 85
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@optionsAction'
86
-	))->where( array( 'resource' => '[^0-9]*' ) );
86
+	))->where(array('resource' => '[^0-9]*'));
87 87
 
88 88
 });
89 89
 
90 90
 
91 91
 Route::group(config('shop.routes.account', ['middleware' => 'auth']), function() {
92 92
 
93
-	Route::match( array( 'GET', 'POST' ), 'myaccount', array(
93
+	Route::match(array('GET', 'POST'), 'myaccount', array(
94 94
 		'as' => 'aimeos_shop_account',
95 95
 		'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction'
96 96
 	));
97
-	Route::match( array( 'GET', 'POST' ), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
97
+	Route::match(array('GET', 'POST'), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
98 98
 		'as' => 'aimeos_shop_account_favorite',
99 99
 		'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction'
100 100
 	));
101
-	Route::match( array( 'GET', 'POST' ), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
101
+	Route::match(array('GET', 'POST'), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
102 102
 		'as' => 'aimeos_shop_account_watch',
103 103
 		'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction'
104 104
 	));
@@ -108,45 +108,45 @@  discard block
 block discarded – undo
108 108
 
109 109
 Route::group(config('shop.routes.default', []), function() {
110 110
 
111
-	Route::match( array( 'GET', 'POST' ), 'basket', array(
111
+	Route::match(array('GET', 'POST'), 'basket', array(
112 112
 		'as' => 'aimeos_shop_basket',
113 113
 		'uses' => 'Aimeos\Shop\Controller\BasketController@indexAction'
114 114
 	));
115 115
 
116
-	Route::match( array( 'GET', 'POST' ), 'count', array(
116
+	Route::match(array('GET', 'POST'), 'count', array(
117 117
 		'as' => 'aimeos_shop_count',
118 118
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@countAction'
119 119
 	));
120
-	Route::match( array( 'GET', 'POST' ), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array(
120
+	Route::match(array('GET', 'POST'), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array(
121 121
 		'as' => 'aimeos_shop_detail',
122 122
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction'
123 123
 	));
124
-	Route::match( array( 'GET', 'POST' ), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
124
+	Route::match(array('GET', 'POST'), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
125 125
 		'as' => 'aimeos_shop_session_pinned',
126 126
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction'
127 127
 	));
128
-	Route::match( array( 'GET', 'POST' ), 'list', array(
128
+	Route::match(array('GET', 'POST'), 'list', array(
129 129
 		'as' => 'aimeos_shop_list',
130 130
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@listAction'
131 131
 	));
132
-	Route::match( array( 'GET', 'POST' ), 'suggest', array(
132
+	Route::match(array('GET', 'POST'), 'suggest', array(
133 133
 		'as' => 'aimeos_shop_suggest',
134 134
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@suggestAction'
135 135
 	));
136
-	Route::match( array( 'GET', 'POST' ), 'stock', array(
136
+	Route::match(array('GET', 'POST'), 'stock', array(
137 137
 		'as' => 'aimeos_shop_stock',
138 138
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@stockAction'
139 139
 	));
140 140
 
141
-	Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array(
141
+	Route::match(array('GET', 'POST'), 'checkout/{c_step?}', array(
142 142
 		'as' => 'aimeos_shop_checkout',
143 143
 		'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction'
144 144
 	));
145
-	Route::match( array( 'GET', 'POST' ), 'confirm', array(
145
+	Route::match(array('GET', 'POST'), 'confirm', array(
146 146
 		'as' => 'aimeos_shop_confirm',
147 147
 		'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction'
148 148
 	));
149
-	Route::match( array( 'GET', 'POST' ), 'update', array(
149
+	Route::match(array('GET', 'POST'), 'update', array(
150 150
 		'as' => 'aimeos_shop_update',
151 151
 		'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction'
152 152
 	));
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/Context.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
46 46
 	 * @param \Illuminate\Session\Store $session Laravel session object
47 47
 	 */
48
-	public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session )
48
+	public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session)
49 49
 	{
50 50
 		$this->config = $config;
51 51
 		$this->session = $session;
@@ -58,48 +58,48 @@  discard block
 block discarded – undo
58 58
 	 * @param boolean $locale True to add locale object to context, false if not
59 59
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
60 60
 	 */
61
-	public function get( $locale = true )
61
+	public function get($locale = true)
62 62
 	{
63
-		if( self::$context === null )
63
+		if (self::$context === null)
64 64
 		{
65 65
 			$context = new \Aimeos\MShop\Context\Item\Standard();
66 66
 
67 67
 			$config = $this->getConfig();
68
-			$context->setConfig( $config );
68
+			$context->setConfig($config);
69 69
 
70
-			$dbm = new \Aimeos\MW\DB\Manager\PDO( $config );
71
-			$context->setDatabaseManager( $dbm );
70
+			$dbm = new \Aimeos\MW\DB\Manager\PDO($config);
71
+			$context->setDatabaseManager($dbm);
72 72
 
73
-			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) );
74
-			$context->setFilesystemManager( $fs );
73
+			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos'));
74
+			$context->setFilesystemManager($fs);
75 75
 
76
-			$mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } );
77
-			$context->setMail( $mail );
76
+			$mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } );
77
+			$context->setMail($mail);
78 78
 
79
-			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
80
-			$context->setLogger( $logger );
79
+			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context);
80
+			$context->setLogger($logger);
81 81
 
82
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context );
83
-			$context->setCache( $cache );
82
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
83
+			$context->setCache($cache);
84 84
 
85 85
 			self::$context = $context;
86 86
 		}
87 87
 
88 88
 		$context = self::$context;
89 89
 
90
-		if( $locale === true )
90
+		if ($locale === true)
91 91
 		{
92
-			$localeItem = $this->getLocale( $context );
92
+			$localeItem = $this->getLocale($context);
93 93
 			$langid = $localeItem->getLanguageId();
94 94
 
95
-			$context->setLocale( $localeItem );
96
-			$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) );
95
+			$context->setLocale($localeItem);
96
+			$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid)));
97 97
 		}
98 98
 
99
-		$session = new \Aimeos\MW\Session\Laravel5( $this->session );
100
-		$context->setSession( $session );
99
+		$session = new \Aimeos\MW\Session\Laravel5($this->session);
100
+		$context->setSession($session);
101 101
 
102
-		$this->addUser( $context );
102
+		$this->addUser($context);
103 103
 
104 104
 		return $context;
105 105
 	}
@@ -110,20 +110,20 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
112 112
 	 */
113
-	protected function addUser( \Aimeos\MShop\Context\Item\Iface $context )
113
+	protected function addUser(\Aimeos\MShop\Context\Item\Iface $context)
114 114
 	{
115
-		if( ( $userid = \Auth::id() ) !== null )
115
+		if (($userid = \Auth::id()) !== null)
116 116
 		{
117
-			$context->setUserId( $userid );
118
-			$context->setGroupIds( function() use ( $context, $userid )
117
+			$context->setUserId($userid);
118
+			$context->setGroupIds(function() use ($context, $userid)
119 119
 			{
120
-				$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
121
-				return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups();
120
+				$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
121
+				return $manager->getItem($userid, array('customer/group'))->getGroups();
122 122
 			} );
123 123
 		}
124 124
 
125
-		if( ( $user = \Auth::user() ) !== null ) {
126
-			$context->setEditor( $user->name );
125
+		if (($user = \Auth::user()) !== null) {
126
+			$context->setEditor($user->name);
127 127
 		}
128 128
 	}
129 129
 
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	protected function getConfig()
137 137
 	{
138
-		$conf = $this->config->get( 'shop' );
138
+		$conf = $this->config->get('shop');
139 139
 
140
-		$configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths( 'mysql' );
141
-		$config = new \Aimeos\MW\Config\PHPArray( $conf, $configPaths );
140
+		$configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths('mysql');
141
+		$config = new \Aimeos\MW\Config\PHPArray($conf, $configPaths);
142 142
 
143
-		if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) {
144
-			$config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) );
143
+		if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) {
144
+			$config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:'));
145 145
 		}
146 146
 
147 147
 		return $config;
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
155 155
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
156 156
 	 */
157
-	protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context )
157
+	protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context)
158 158
 	{
159
-		if( $this->locale === null )
159
+		if ($this->locale === null)
160 160
 		{
161
-			if( \Route::current() !== null )
161
+			if (\Route::current() !== null)
162 162
 			{
163
-				$site = \Route::input( 'site', 'default' );
164
-				$lang = \Route::input( 'locale', '' );
165
-				$currency = \Route::input( 'currency', '' );
163
+				$site = \Route::input('site', 'default');
164
+				$lang = \Route::input('locale', '');
165
+				$currency = \Route::input('currency', '');
166 166
 			}
167 167
 			else
168 168
 			{
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 				$lang = $currency = '';
171 171
 			}
172 172
 
173
-			$disableSites = $this->config->has( 'shop.disableSites' );
173
+			$disableSites = $this->config->has('shop.disableSites');
174 174
 
175
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
176
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites );
175
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
176
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites);
177 177
 		}
178 178
 
179 179
 		return $this->locale;
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/Page.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 * @param \Aimeos\Shop\Base\Context $context Context object
48 48
 	 * @param \Aimeos\Shop\Base\View $view View object
49 49
 	 */
50
-	public function __construct( \Illuminate\Contracts\Config\Repository $config,
51
-		\Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view )
50
+	public function __construct(\Illuminate\Contracts\Config\Repository $config,
51
+		\Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view)
52 52
 	{
53 53
 		$this->config = $config;
54 54
 		$this->aimeos = $aimeos;
@@ -63,23 +63,23 @@  discard block
 block discarded – undo
63 63
 	 * @param string $pageName Name of the configured page
64 64
 	 * @return array Associative list with body and header output separated by client name
65 65
 	 */
66
-	public function getSections( $pageName )
66
+	public function getSections($pageName)
67 67
 	{
68 68
 		$context = $this->context->get();
69 69
 		$langid = $context->getLocale()->getLanguageId();
70
-		$tmplPaths = $this->aimeos->get()->getCustomPaths( 'client/html/templates' );
71
-		$view = $this->view->create( $context->getConfig(), $tmplPaths, $langid );
72
-		$context->setView( $view );
70
+		$tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates');
71
+		$view = $this->view->create($context->getConfig(), $tmplPaths, $langid);
72
+		$context->setView($view);
73 73
 
74
-		$pagesConfig = $this->config->get( 'shop.page', array() );
75
-		$result = array( 'aibody' => array(), 'aiheader' => array() );
74
+		$pagesConfig = $this->config->get('shop.page', array());
75
+		$result = array('aibody' => array(), 'aiheader' => array());
76 76
 
77
-		if( isset( $pagesConfig[$pageName] ) )
77
+		if (isset($pagesConfig[$pageName]))
78 78
 		{
79
-			foreach( (array) $pagesConfig[$pageName] as $clientName )
79
+			foreach ((array) $pagesConfig[$pageName] as $clientName)
80 80
 			{
81
-				$client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName );
82
-				$client->setView( clone $view );
81
+				$client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName);
82
+				$client->setView(clone $view);
83 83
 				$client->process();
84 84
 
85 85
 				$result['aibody'][$clientName] = $client->getBody();
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/View.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -26,48 +26,48 @@  discard block
 block discarded – undo
26 26
 	 * @param string|null $locale Code of the current language or null for no translation
27 27
 	 * @return \Aimeos\MW\View\Iface View object
28 28
 	 */
29
-	public function create( \Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null )
29
+	public function create(\Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null)
30 30
 	{
31 31
 		$params = $fixed = array();
32 32
 
33
-		if( $locale !== null )
33
+		if ($locale !== null)
34 34
 		{
35 35
 			$params = \Route::current()->parameters() + \Input::all();
36 36
 			$fixed = $this->getFixedParams();
37 37
 
38
-			$i18n = app('\Aimeos\Shop\Base\I18n')->get( array( $locale ) );
38
+			$i18n = app('\Aimeos\Shop\Base\I18n')->get(array($locale));
39 39
 			$translation = $i18n[$locale];
40 40
 		}
41 41
 		else
42 42
 		{
43
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
43
+			$translation = new \Aimeos\MW\Translation\None('en');
44 44
 		}
45 45
 
46 46
 
47
-		$view = new \Aimeos\MW\View\Standard( $templatePaths );
47
+		$view = new \Aimeos\MW\View\Standard($templatePaths);
48 48
 
49
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
50
-		$view->addHelper( 'translate', $helper );
49
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
50
+		$view->addHelper('translate', $helper);
51 51
 
52
-		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed );
53
-		$view->addHelper( 'url', $helper );
52
+		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed);
53
+		$view->addHelper('url', $helper);
54 54
 
55
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
56
-		$view->addHelper( 'param', $helper );
55
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
56
+		$view->addHelper('param', $helper);
57 57
 
58
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
59
-		$view->addHelper( 'config', $helper );
58
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
59
+		$view->addHelper('config', $helper);
60 60
 
61
-		$sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' );
62
-		$sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' );
63
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 );
64
-		$view->addHelper( 'number', $helper );
61
+		$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
62
+		$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
63
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000);
64
+		$view->addHelper('number', $helper);
65 65
 
66
-		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, \Request::instance() );
67
-		$view->addHelper( 'request', $helper );
66
+		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, \Request::instance());
67
+		$view->addHelper('request', $helper);
68 68
 
69
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() );
70
-		$view->addHelper( 'csrf', $helper );
69
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token());
70
+		$view->addHelper('csrf', $helper);
71 71
 
72 72
 		return $view;
73 73
 	}
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
 	{
83 83
 		$fixed = array();
84 84
 
85
-		if( ( $value = \Route::input( 'site' ) ) !== null ) {
85
+		if (($value = \Route::input('site')) !== null) {
86 86
 			$fixed['site'] = $value;
87 87
 		}
88 88
 
89
-		if( ( $value = \Route::input( 'locale' ) ) !== null ) {
89
+		if (($value = \Route::input('locale')) !== null) {
90 90
 			$fixed['locale'] = $value;
91 91
 		}
92 92
 
93
-		if( ( $value = \Route::input( 'currency' ) ) !== null ) {
93
+		if (($value = \Route::input('currency')) !== null) {
94 94
 			$fixed['currency'] = $value;
95 95
 		}
96 96
 
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/AdminController.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -32,54 +32,54 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	public function indexAction()
34 34
 	{
35
-		if( config( 'shop.authorize', true ) ) {
36
-			$this->authorize( 'admin' );
35
+		if (config('shop.authorize', true)) {
36
+			$this->authorize('admin');
37 37
 		}
38 38
 
39
-		$site = \Input::get( 'site', 'default' );
40
-		$lang = \Input::get( 'lang', config( 'app.locale', 'en' ) );
39
+		$site = \Input::get('site', 'default');
40
+		$lang = \Input::get('lang', config('app.locale', 'en'));
41 41
 
42
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
43
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
42
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
43
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
44 44
 
45
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
46
-		$context = $this->setLocale( $context, $site, $lang );
45
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
46
+		$context = $this->setLocale($context, $site, $lang);
47 47
 
48
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
48
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
49 49
 		$cssFiles = array();
50 50
 
51
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
51
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
52 52
 		{
53
-			foreach( $paths as $path )
53
+			foreach ($paths as $path)
54 54
 			{
55 55
 				$jsbAbsPath = $base . '/' . $path;
56 56
 
57
-				if( !is_file( $jsbAbsPath ) ) {
58
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
57
+				if (!is_file($jsbAbsPath)) {
58
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
59 59
 				}
60 60
 
61
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
62
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
61
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
62
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
63 63
 			}
64 64
 		}
65 65
 
66
-		$params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' );
67
-		$adminUrl = route( 'aimeos_shop_admin', $params );
68
-		$jsonUrl = route( 'aimeos_shop_admin_json', array( '_token' => csrf_token() ) );
66
+		$params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
67
+		$adminUrl = route('aimeos_shop_admin', $params);
68
+		$jsonUrl = route('aimeos_shop_admin_json', array('_token' => csrf_token()));
69 69
 
70 70
 		$vars = array(
71 71
 			'lang' => $lang,
72 72
 			'cssFiles' => $cssFiles,
73
-			'languages' => $this->getJsonLanguages( $context),
74
-			'config' => $this->getJsonClientConfig( $context ),
75
-			'site' => $this->getJsonSiteItem( $context, \Input::get( 'site', 'default' ) ),
76
-			'i18nContent' => $this->getJsonClientI18n( $aimeos->getI18nPaths(), $lang ),
73
+			'languages' => $this->getJsonLanguages($context),
74
+			'config' => $this->getJsonClientConfig($context),
75
+			'site' => $this->getJsonSiteItem($context, \Input::get('site', 'default')),
76
+			'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang),
77 77
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
78 78
 			'itemSchemas' => $controller->getJsonItemSchemas(),
79
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
80
-			'urlTemplate' => urldecode( $adminUrl ),
81
-			'uploaddir' => \Config::get( 'shop::uploaddir' ),
82
-			'activeTab' => \Input::get( 'tab', 0 ),
79
+			'smd' => $controller->getJsonSmd($jsonUrl),
80
+			'urlTemplate' => urldecode($adminUrl),
81
+			'uploaddir' => \Config::get('shop::uploaddir'),
82
+			'activeTab' => \Input::get('tab', 0),
83 83
 			'version' => $this->getVersion(),
84 84
 		);
85 85
 
@@ -94,20 +94,20 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function doAction()
96 96
 	{
97
-		if( config( 'shop.authorize', true ) ) {
98
-			$this->authorize( 'admin' );
97
+		if (config('shop.authorize', true)) {
98
+			$this->authorize('admin');
99 99
 		}
100 100
 
101
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
102
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
101
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
102
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
103 103
 
104
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
105
-		$context = $this->setLocale( $context );
104
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
105
+		$context = $this->setLocale($context);
106 106
 
107
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
107
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
108 108
 
109
-		$response = $controller->process( \Input::instance()->request->all(), 'php://input' );
110
-		return \View::make('shop::admin.do', array( 'output' => $response ));
109
+		$response = $controller->process(\Input::instance()->request->all(), 'php://input');
110
+		return \View::make('shop::admin.do', array('output' => $response));
111 111
 	}
112 112
 
113 113
 
@@ -118,32 +118,32 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function fileAction()
120 120
 	{
121
-		if( config( 'shop.authorize', true ) ) {
122
-			$this->authorize( 'admin' );
121
+		if (config('shop.authorize', true)) {
122
+			$this->authorize('admin');
123 123
 		}
124 124
 
125 125
 		$contents = '';
126 126
 		$jsFiles = array();
127
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
127
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
128 128
 
129
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
129
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
130 130
 		{
131
-			foreach( $paths as $path )
131
+			foreach ($paths as $path)
132 132
 			{
133 133
 				$jsbAbsPath = $base . '/' . $path;
134
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
135
-				$jsFiles = array_merge( $jsFiles, $jsb2->getUrls( 'js', '' ) );
134
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
135
+				$jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', ''));
136 136
 			}
137 137
 		}
138 138
 
139
-		foreach( $jsFiles as $file )
139
+		foreach ($jsFiles as $file)
140 140
 		{
141
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
141
+			if (($content = file_get_contents($file)) !== false) {
142 142
 				$contents .= $content;
143 143
 			}
144 144
 		}
145 145
 
146
-		return response( $contents )->header( 'Content-Type', 'application/javascript' );
146
+		return response($contents)->header('Content-Type', 'application/javascript');
147 147
 	}
148 148
 
149 149
 
@@ -153,30 +153,30 @@  discard block
 block discarded – undo
153 153
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
154 154
 	 * @return array List of language IDs with labels
155 155
 	 */
156
-	protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context )
156
+	protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context)
157 157
 	{
158
-		$paths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nPaths();
158
+		$paths = app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nPaths();
159 159
 		$langs = array();
160 160
 
161
-		if( !isset( $paths['admin'] ) ) {
162
-			return json_encode( array() );
161
+		if (!isset($paths['admin'])) {
162
+			return json_encode(array());
163 163
 		}
164 164
 
165
-		foreach( $paths['admin'] as $path )
165
+		foreach ($paths['admin'] as $path)
166 166
 		{
167
-			$iter = new \DirectoryIterator( $path );
167
+			$iter = new \DirectoryIterator($path);
168 168
 
169
-			foreach( $iter as $file )
169
+			foreach ($iter as $file)
170 170
 			{
171 171
 				$name = $file->getFilename();
172 172
 
173
-				if( preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name ) ) {
173
+				if (preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name)) {
174 174
 					$langs[$name] = null;
175 175
 				}
176 176
 			}
177 177
 		}
178 178
 
179
-		return json_encode( $this->getLanguages( $context, array_keys( $langs ) ) );
179
+		return json_encode($this->getLanguages($context, array_keys($langs)));
180 180
 	}
181 181
 
182 182
 
@@ -186,10 +186,10 @@  discard block
 block discarded – undo
186 186
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
187 187
 	 * @return string JSON encoded configuration object
188 188
 	 */
189
-	protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
189
+	protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
190 190
 	{
191
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
192
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
191
+		$config = $context->getConfig()->get('admin/extjs', array());
192
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
193 193
 	}
194 194
 
195 195
 
@@ -200,16 +200,16 @@  discard block
 block discarded – undo
200 200
 	 * @param string $lang ISO language code like "en" or "en_GB"
201 201
 	 * @return string JSON encoded translation object
202 202
 	 */
203
-	protected function getJsonClientI18n( array $i18nPaths, $lang )
203
+	protected function getJsonClientI18n(array $i18nPaths, $lang)
204 204
 	{
205
-		$i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) );
205
+		$i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true));
206 206
 
207 207
 		$content = array(
208
-			'admin' => $i18n->getAll( 'admin' ),
209
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
208
+			'admin' => $i18n->getAll('admin'),
209
+			'admin/ext' => $i18n->getAll('admin/ext'),
210 210
 		);
211 211
 
212
-		return json_encode( $content, JSON_FORCE_OBJECT );
212
+		return json_encode($content, JSON_FORCE_OBJECT);
213 213
 	}
214 214
 
215 215
 
@@ -221,19 +221,19 @@  discard block
 block discarded – undo
221 221
 	 * @return string JSON encoded site item object
222 222
 	 * @throws Exception If no site item was found for the code
223 223
 	 */
224
-	protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
224
+	protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
225 225
 	{
226
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
226
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
227 227
 
228 228
 		$criteria = $manager->createSearch();
229
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
230
-		$items = $manager->searchItems( $criteria );
229
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
230
+		$items = $manager->searchItems($criteria);
231 231
 
232
-		if( ( $item = reset( $items ) ) === false ) {
233
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
232
+		if (($item = reset($items)) === false) {
233
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
234 234
 		}
235 235
 
236
-		return json_encode( $item->toArray() );
236
+		return json_encode($item->toArray());
237 237
 	}
238 238
 
239 239
 
@@ -244,18 +244,18 @@  discard block
 block discarded – undo
244 244
 	 * @param array $langIds List of language IDs
245 245
 	 * @return array List of associative lists with "id" and "label" as keys
246 246
 	 */
247
-	protected function getLanguages( \Aimeos\MShop\Context\Item\Iface $context, array $langIds )
247
+	protected function getLanguages(\Aimeos\MShop\Context\Item\Iface $context, array $langIds)
248 248
 	{
249
-		$languageManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' );
249
+		$languageManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language');
250 250
 		$result = array();
251 251
 
252 252
 		$search = $languageManager->createSearch();
253
-		$search->setConditions( $search->compare('==', 'locale.language.id', $langIds ) );
254
-		$search->setSortations( array( $search->sort( '-', 'locale.language.status' ), $search->sort( '+', 'locale.language.label' ) ) );
255
-		$langItems = $languageManager->searchItems( $search );
253
+		$search->setConditions($search->compare('==', 'locale.language.id', $langIds));
254
+		$search->setSortations(array($search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.label')));
255
+		$langItems = $languageManager->searchItems($search);
256 256
 
257
-		foreach( $langItems as $id => $item ) {
258
-			$result[] = array( 'id' => $id, 'label' => $item->getLabel() );
257
+		foreach ($langItems as $id => $item) {
258
+			$result[] = array('id' => $id, 'label' => $item->getLabel());
259 259
 		}
260 260
 
261 261
 		return $result;
@@ -269,12 +269,12 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	protected function getVersion()
271 271
 	{
272
-		if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false
273
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
272
+		if (($content = @file_get_contents(base_path('composer.lock'))) !== false
273
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
274 274
 		) {
275
-			foreach( (array) $content['packages'] as $item )
275
+			foreach ((array) $content['packages'] as $item)
276 276
 			{
277
-				if( $item['name'] === 'aimeos/aimeos-laravel' ) {
277
+				if ($item['name'] === 'aimeos/aimeos-laravel') {
278 278
 					return $item['version'];
279 279
 				}
280 280
 			}
@@ -292,17 +292,17 @@  discard block
 block discarded – undo
292 292
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
293 293
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
294 294
 	 */
295
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
295
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
296 296
 	{
297
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
297
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
298 298
 
299 299
 		try {
300
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
301
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
300
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
301
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
302 302
 			$localeItem = $localeManager->createItem();
303 303
 		}
304 304
 
305
-		$context->setLocale( $localeItem );
305
+		$context->setLocale($localeItem);
306 306
 
307 307
 		return $context;
308 308
 	}
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/JqadmController.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@  discard block
 block discarded – undo
33 33
 	 * @param integer $id Unique resource ID
34 34
 	 * @return string Generated output
35 35
 	 */
36
-	public function copyAction( $site = 'default', $resource, $id )
36
+	public function copyAction($site = 'default', $resource, $id)
37 37
 	{
38
-		if( config( 'shop.authorize', true ) ) {
39
-			$this->authorize( 'admin' );
38
+		if (config('shop.authorize', true)) {
39
+			$this->authorize('admin');
40 40
 		}
41 41
 
42
-		$cntl = $this->createClient( $site, $resource );
43
-		$content = $cntl->copy( $id );
42
+		$cntl = $this->createClient($site, $resource);
43
+		$content = $cntl->copy($id);
44 44
 
45
-		$url = route( 'aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource] );
46
-		return \View::make('shop::admin.jqadm', array( 'content' => $content, 'jsonadmurl' => $url ) );
45
+		$url = route('aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource]);
46
+		return \View::make('shop::admin.jqadm', array('content' => $content, 'jsonadmurl' => $url));
47 47
 	}
48 48
 
49 49
 
@@ -54,17 +54,17 @@  discard block
 block discarded – undo
54 54
 	 * @param string $sitecode Unique site code
55 55
 	 * @return string Generated output
56 56
 	 */
57
-	public function createAction( $site = 'default', $resource )
57
+	public function createAction($site = 'default', $resource)
58 58
 	{
59
-		if( config( 'shop.authorize', true ) ) {
60
-			$this->authorize( 'admin' );
59
+		if (config('shop.authorize', true)) {
60
+			$this->authorize('admin');
61 61
 		}
62 62
 
63
-		$cntl = $this->createClient( $site, $resource );
63
+		$cntl = $this->createClient($site, $resource);
64 64
 		$content = $cntl->create();
65 65
 
66
-		$url = route( 'aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource] );
67
-		return \View::make('shop::admin.jqadm', array( 'content' => $content, 'jsonadmurl' => $url ) );
66
+		$url = route('aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource]);
67
+		return \View::make('shop::admin.jqadm', array('content' => $content, 'jsonadmurl' => $url));
68 68
 	}
69 69
 
70 70
 
@@ -76,17 +76,17 @@  discard block
 block discarded – undo
76 76
 	 * @param integer $id Unique resource ID
77 77
 	 * @return string Generated output
78 78
 	 */
79
-	public function deleteAction( $site = 'default', $resource, $id )
79
+	public function deleteAction($site = 'default', $resource, $id)
80 80
 	{
81
-		if( config( 'shop.authorize', true ) ) {
82
-			$this->authorize( 'admin' );
81
+		if (config('shop.authorize', true)) {
82
+			$this->authorize('admin');
83 83
 		}
84 84
 
85
-		$cntl = $this->createClient( $site, $resource );
86
-		$content = $cntl->delete( $id ) . $cntl->search();
85
+		$cntl = $this->createClient($site, $resource);
86
+		$content = $cntl->delete($id) . $cntl->search();
87 87
 
88
-		$url = route( 'aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource] );
89
-		return \View::make('shop::admin.jqadm', array( 'content' => $content, 'jsonadmurl' => $url ) );
88
+		$url = route('aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource]);
89
+		return \View::make('shop::admin.jqadm', array('content' => $content, 'jsonadmurl' => $url));
90 90
 	}
91 91
 
92 92
 
@@ -98,17 +98,17 @@  discard block
 block discarded – undo
98 98
 	 * @param integer $id Unique resource ID
99 99
 	 * @return string Generated output
100 100
 	 */
101
-	public function getAction( $site = 'default', $resource, $id )
101
+	public function getAction($site = 'default', $resource, $id)
102 102
 	{
103
-		if( config( 'shop.authorize', true ) ) {
104
-			$this->authorize( 'admin' );
103
+		if (config('shop.authorize', true)) {
104
+			$this->authorize('admin');
105 105
 		}
106 106
 
107
-		$cntl = $this->createClient( $site, $resource );
108
-		$content = $cntl->get( $id );
107
+		$cntl = $this->createClient($site, $resource);
108
+		$content = $cntl->get($id);
109 109
 
110
-		$url = route( 'aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource] );
111
-		return \View::make('shop::admin.jqadm', array( 'content' => $content, 'jsonadmurl' => $url ) );
110
+		$url = route('aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource]);
111
+		return \View::make('shop::admin.jqadm', array('content' => $content, 'jsonadmurl' => $url));
112 112
 	}
113 113
 
114 114
 
@@ -119,17 +119,17 @@  discard block
 block discarded – undo
119 119
 	 * @param string $sitecode Unique site code
120 120
 	 * @return string Generated output
121 121
 	 */
122
-	public function saveAction( $site = 'default', $resource )
122
+	public function saveAction($site = 'default', $resource)
123 123
 	{
124
-		if( config( 'shop.authorize', true ) ) {
125
-			$this->authorize( 'admin' );
124
+		if (config('shop.authorize', true)) {
125
+			$this->authorize('admin');
126 126
 		}
127 127
 
128
-		$cntl = $this->createClient( $site, $resource );
129
-		$content = ( $cntl->save() ? : $cntl->search() );
128
+		$cntl = $this->createClient($site, $resource);
129
+		$content = ($cntl->save() ?: $cntl->search());
130 130
 
131
-		$url = route( 'aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource] );
132
-		return \View::make('shop::admin.jqadm', array( 'content' => $content, 'jsonadmurl' => $url ) );
131
+		$url = route('aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource]);
132
+		return \View::make('shop::admin.jqadm', array('content' => $content, 'jsonadmurl' => $url));
133 133
 	}
134 134
 
135 135
 
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
 	 * @param string $sitecode Unique site code
141 141
 	 * @return string Generated output
142 142
 	 */
143
-	public function searchAction( $site = 'default', $resource )
143
+	public function searchAction($site = 'default', $resource)
144 144
 	{
145
-		if( config( 'shop.authorize', true ) ) {
146
-			$this->authorize( 'admin' );
145
+		if (config('shop.authorize', true)) {
146
+			$this->authorize('admin');
147 147
 		}
148 148
 
149
-		$cntl = $this->createClient( $site, $resource );
149
+		$cntl = $this->createClient($site, $resource);
150 150
 		$content = $cntl->search();
151 151
 
152
-		$url = route( 'aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource] );
153
-		return \View::make('shop::admin.jqadm', array( 'content' => $content, 'jsonadmurl' => $url ) );
152
+		$url = route('aimeos_shop_jsonadm_options', ['site' => $site, 'resource' => $resource]);
153
+		return \View::make('shop::admin.jqadm', array('content' => $content, 'jsonadmurl' => $url));
154 154
 	}
155 155
 
156 156
 
@@ -160,20 +160,20 @@  discard block
 block discarded – undo
160 160
 	 * @param string $sitecode Unique site code
161 161
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
162 162
 	 */
163
-	protected function createClient( $sitecode, $resource )
163
+	protected function createClient($sitecode, $resource)
164 164
 	{
165
-		$lang = \Input::get( 'lang', config( 'app.locale', 'en' ) );
165
+		$lang = \Input::get('lang', config('app.locale', 'en'));
166 166
 
167
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
168
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' );
167
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
168
+		$templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates');
169 169
 
170
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
171
-		$context = $this->setLocale( $context, $sitecode, $lang );
170
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
171
+		$context = $this->setLocale($context, $sitecode, $lang);
172 172
 
173
-		$view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang );
174
-		$context->setView( $view );
173
+		$view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang);
174
+		$context->setView($view);
175 175
 
176
-		return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource );
176
+		return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource);
177 177
 	}
178 178
 
179 179
 
@@ -185,23 +185,23 @@  discard block
 block discarded – undo
185 185
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
186 186
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
187 187
 	 */
188
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang )
188
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang)
189 189
 	{
190
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
190
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
191 191
 
192 192
 		try
193 193
 		{
194
-			$localeItem = $localeManager->bootstrap( $sitecode, '', '', false );
195
-			$localeItem->setLanguageId( null );
196
-			$localeItem->setCurrencyId( null );
194
+			$localeItem = $localeManager->bootstrap($sitecode, '', '', false);
195
+			$localeItem->setLanguageId(null);
196
+			$localeItem->setCurrencyId(null);
197 197
 		}
198
-		catch( \Aimeos\MShop\Locale\Exception $e )
198
+		catch (\Aimeos\MShop\Locale\Exception $e)
199 199
 		{
200 200
 			$localeItem = $localeManager->createItem();
201 201
 		}
202 202
 
203
-		$context->setLocale( $localeItem );
204
-		$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) );
203
+		$context->setLocale($localeItem);
204
+		$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang)));
205 205
 
206 206
 		return $context;
207 207
 	}
Please login to merge, or discard this patch.