Completed
Push — master ( 6cc301...f9d00a )
by Aimeos
04:42
created
src/Aimeos/Shop/Controller/AdminController.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -28,50 +28,50 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function indexAction()
30 30
 	{
31
-		$site = \Input::get( 'site', 'default' );
32
-		$lang = \Input::get( 'lang', 'en' );
31
+		$site = \Input::get('site', 'default');
32
+		$lang = \Input::get('lang', 'en');
33 33
 
34
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
35
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
34
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
35
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
36 36
 
37
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
38
-		$context = $this->setLocale( $context, $site, $lang );
37
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
38
+		$context = $this->setLocale($context, $site, $lang);
39 39
 
40
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
40
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
41 41
 		$cssFiles = array();
42 42
 
43
-		foreach( $aimeos->getCustomPaths( 'client/extjs' ) as $base => $paths )
43
+		foreach ($aimeos->getCustomPaths('client/extjs') as $base => $paths)
44 44
 		{
45
-			foreach( $paths as $path )
45
+			foreach ($paths as $path)
46 46
 			{
47 47
 				$jsbAbsPath = $base . '/' . $path;
48 48
 
49
-				if( !is_file( $jsbAbsPath ) ) {
50
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
49
+				if (!is_file($jsbAbsPath)) {
50
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
51 51
 				}
52 52
 
53
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
54
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
53
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
54
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
55 55
 			}
56 56
 		}
57 57
 
58
-		$params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' );
59
-		$adminUrl = route( 'aimeos_shop_admin', $params );
60
-		$jsonUrl = route( 'aimeos_shop_admin_json', array( '_token' => csrf_token() ) );
58
+		$params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
59
+		$adminUrl = route('aimeos_shop_admin', $params);
60
+		$jsonUrl = route('aimeos_shop_admin_json', array('_token' => csrf_token()));
61 61
 
62 62
 		$vars = array(
63 63
 			'lang' => $lang,
64 64
 			'cssFiles' => $cssFiles,
65
-			'languages' => $this->getJsonLanguages( $context),
66
-			'config' => $this->getJsonClientConfig( $context ),
67
-			'site' => $this->getJsonSiteItem( $context, \Input::get( 'site', 'default' ) ),
68
-			'i18nContent' => $this->getJsonClientI18n( $aimeos->getI18nPaths(), $lang ),
65
+			'languages' => $this->getJsonLanguages($context),
66
+			'config' => $this->getJsonClientConfig($context),
67
+			'site' => $this->getJsonSiteItem($context, \Input::get('site', 'default')),
68
+			'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang),
69 69
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
70 70
 			'itemSchemas' => $controller->getJsonItemSchemas(),
71
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
72
-			'urlTemplate' => urldecode( $adminUrl ),
73
-			'uploaddir' => \Config::get( 'shop::uploaddir' ),
74
-			'activeTab' => \Input::get( 'tab', 0 ),
71
+			'smd' => $controller->getJsonSmd($jsonUrl),
72
+			'urlTemplate' => urldecode($adminUrl),
73
+			'uploaddir' => \Config::get('shop::uploaddir'),
74
+			'activeTab' => \Input::get('tab', 0),
75 75
 			'version' => $this->getVersion(),
76 76
 		);
77 77
 
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function doAction()
88 88
 	{
89
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
90
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
89
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
90
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
91 91
 
92
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
93
-		$context = $this->setLocale( $context );
92
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
93
+		$context = $this->setLocale($context);
94 94
 
95
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
95
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
96 96
 
97
-		$response = $controller->process( \Input::instance()->request->all(), 'php://input' );
98
-		return \View::make('shop::admin.do', array( 'output' => $response ));
97
+		$response = $controller->process(\Input::instance()->request->all(), 'php://input');
98
+		return \View::make('shop::admin.do', array('output' => $response));
99 99
 	}
100 100
 
101 101
 
@@ -108,26 +108,26 @@  discard block
 block discarded – undo
108 108
 	{
109 109
 		$contents = '';
110 110
 		$jsFiles = array();
111
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
111
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
112 112
 
113
-		foreach( $aimeos->getCustomPaths( 'client/extjs' ) as $base => $paths )
113
+		foreach ($aimeos->getCustomPaths('client/extjs') as $base => $paths)
114 114
 		{
115
-			foreach( $paths as $path )
115
+			foreach ($paths as $path)
116 116
 			{
117 117
 				$jsbAbsPath = $base . '/' . $path;
118
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
119
-				$jsFiles = array_merge( $jsFiles, $jsb2->getUrls( 'js', '' ) );
118
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
119
+				$jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', ''));
120 120
 			}
121 121
 		}
122 122
 
123
-		foreach( $jsFiles as $file )
123
+		foreach ($jsFiles as $file)
124 124
 		{
125
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
125
+			if (($content = file_get_contents($file)) !== false) {
126 126
 				$contents .= $content;
127 127
 			}
128 128
 		}
129 129
 
130
-		return response( $contents )->header( 'Content-Type', 'application/javascript' );
130
+		return response($contents)->header('Content-Type', 'application/javascript');
131 131
 	}
132 132
 
133 133
 
@@ -137,30 +137,30 @@  discard block
 block discarded – undo
137 137
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
138 138
 	 * @return array List of language IDs with labels
139 139
 	 */
140
-	protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context )
140
+	protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context)
141 141
 	{
142
-		$paths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nPaths();
142
+		$paths = app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nPaths();
143 143
 		$langs = array();
144 144
 
145
-		if( !isset( $paths['client/extjs'] ) ) {
146
-			return json_encode( array() );
145
+		if (!isset($paths['client/extjs'])) {
146
+			return json_encode(array());
147 147
 		}
148 148
 
149
-		foreach( $paths['client/extjs'] as $path )
149
+		foreach ($paths['client/extjs'] as $path)
150 150
 		{
151
-			$iter = new \DirectoryIterator( $path );
151
+			$iter = new \DirectoryIterator($path);
152 152
 
153
-			foreach( $iter as $file )
153
+			foreach ($iter as $file)
154 154
 			{
155 155
 				$name = $file->getFilename();
156 156
 
157
-				if( preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name ) ) {
157
+				if (preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name)) {
158 158
 					$langs[$name] = null;
159 159
 				}
160 160
 			}
161 161
 		}
162 162
 
163
-		return json_encode( $this->getLanguages( $context, array_keys( $langs ) ) );
163
+		return json_encode($this->getLanguages($context, array_keys($langs)));
164 164
 	}
165 165
 
166 166
 
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
171 171
 	 * @return string JSON encoded configuration object
172 172
 	 */
173
-	protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
173
+	protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
174 174
 	{
175
-		$config = $context->getConfig()->get( 'client/extjs', array() );
176
-		return json_encode( array( 'client' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
175
+		$config = $context->getConfig()->get('client/extjs', array());
176
+		return json_encode(array('client' => array('extjs' => $config)), JSON_FORCE_OBJECT);
177 177
 	}
178 178
 
179 179
 
@@ -184,16 +184,16 @@  discard block
 block discarded – undo
184 184
 	 * @param string $lang ISO language code like "en" or "en_GB"
185 185
 	 * @return string JSON encoded translation object
186 186
 	 */
187
-	protected function getJsonClientI18n( array $i18nPaths, $lang )
187
+	protected function getJsonClientI18n(array $i18nPaths, $lang)
188 188
 	{
189
-		$i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) );
189
+		$i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true));
190 190
 
191 191
 		$content = array(
192
-			'client/extjs' => $i18n->getAll( 'client/extjs' ),
193
-			'client/extjs/ext' => $i18n->getAll( 'client/extjs/ext' ),
192
+			'client/extjs' => $i18n->getAll('client/extjs'),
193
+			'client/extjs/ext' => $i18n->getAll('client/extjs/ext'),
194 194
 		);
195 195
 
196
-		return json_encode( $content, JSON_FORCE_OBJECT );
196
+		return json_encode($content, JSON_FORCE_OBJECT);
197 197
 	}
198 198
 
199 199
 
@@ -205,19 +205,19 @@  discard block
 block discarded – undo
205 205
 	 * @return string JSON encoded site item object
206 206
 	 * @throws Exception If no site item was found for the code
207 207
 	 */
208
-	protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
208
+	protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
209 209
 	{
210
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
210
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
211 211
 
212 212
 		$criteria = $manager->createSearch();
213
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
214
-		$items = $manager->searchItems( $criteria );
213
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
214
+		$items = $manager->searchItems($criteria);
215 215
 
216
-		if( ( $item = reset( $items ) ) === false ) {
217
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
216
+		if (($item = reset($items)) === false) {
217
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
218 218
 		}
219 219
 
220
-		return json_encode( $item->toArray() );
220
+		return json_encode($item->toArray());
221 221
 	}
222 222
 
223 223
 
@@ -228,18 +228,18 @@  discard block
 block discarded – undo
228 228
 	 * @param array $langIds List of language IDs
229 229
 	 * @return array List of associative lists with "id" and "label" as keys
230 230
 	 */
231
-	protected function getLanguages( \Aimeos\MShop\Context\Item\Iface $context, array $langIds )
231
+	protected function getLanguages(\Aimeos\MShop\Context\Item\Iface $context, array $langIds)
232 232
 	{
233
-		$languageManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' );
233
+		$languageManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language');
234 234
 		$result = array();
235 235
 
236 236
 		$search = $languageManager->createSearch();
237
-		$search->setConditions( $search->compare('==', 'locale.language.id', $langIds ) );
238
-		$search->setSortations( array( $search->sort( '-', 'locale.language.status' ), $search->sort( '+', 'locale.language.label' ) ) );
239
-		$langItems = $languageManager->searchItems( $search );
237
+		$search->setConditions($search->compare('==', 'locale.language.id', $langIds));
238
+		$search->setSortations(array($search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.label')));
239
+		$langItems = $languageManager->searchItems($search);
240 240
 
241
-		foreach( $langItems as $id => $item ) {
242
-			$result[] = array( 'id' => $id, 'label' => $item->getLabel() );
241
+		foreach ($langItems as $id => $item) {
242
+			$result[] = array('id' => $id, 'label' => $item->getLabel());
243 243
 		}
244 244
 
245 245
 		return $result;
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	protected function getVersion()
255 255
 	{
256
-		if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false
257
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
256
+		if (($content = @file_get_contents(base_path('composer.lock'))) !== false
257
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
258 258
 		) {
259
-			foreach( (array) $content['packages'] as $item )
259
+			foreach ((array) $content['packages'] as $item)
260 260
 			{
261
-				if( $item['name'] === 'aimeos/aimeos-laravel' ) {
261
+				if ($item['name'] === 'aimeos/aimeos-laravel') {
262 262
 					return $item['version'];
263 263
 				}
264 264
 			}
@@ -276,17 +276,17 @@  discard block
 block discarded – undo
276 276
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
277 277
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
278 278
 	 */
279
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
279
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
280 280
 	{
281
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
281
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
282 282
 
283 283
 		try {
284
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
285
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
284
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
285
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
286 286
 			$localeItem = $localeManager->createItem();
287 287
 		}
288 288
 
289
-		$context->setLocale( $localeItem );
289
+		$context->setLocale($localeItem);
290 290
 
291 291
 		return $context;
292 292
 	}
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/BasketController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	 */
29 29
 	public function indexAction()
30 30
 	{
31
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'basket-index' );
31
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('basket-index');
32 32
 		return \View::make('shop::basket.index', $params);
33 33
 	}
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/CatalogController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function countAction()
30 30
 	{
31
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'catalog-count' );
31
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('catalog-count');
32 32
 		$contents = \View::make('shop::catalog.count', $params);
33 33
 
34 34
 		$response = \Response::make($contents, 200);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function detailAction()
47 47
 	{
48
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-detail' );
48
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-detail');
49 49
 		return \View::make('shop::catalog.detail', $params);
50 50
 	}
51 51
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function listAction()
59 59
 	{
60
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-list' );
60
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-list');
61 61
 		return \View::make('shop::catalog.list', $params);
62 62
 	}
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function stockAction()
71 71
 	{
72
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-stock' );
72
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-stock');
73 73
 		$contents = \View::make('shop::catalog.stock', $params);
74 74
 
75 75
 		$response = \Response::make($contents, 200);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function suggestAction()
88 88
 	{
89
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-suggest' );
89
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-suggest');
90 90
 		$contents = \View::make('shop::catalog.suggest', $params);
91 91
 
92 92
 		$response = \Response::make($contents, 200);
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/CheckoutController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function confirmAction()
30 30
 	{
31
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-confirm' );
31
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-confirm');
32 32
 		return \View::make('shop::checkout.confirm', $params);
33 33
 	}
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function indexAction()
42 42
 	{
43
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-index' );
43
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-index');
44 44
 		return \View::make('shop::checkout.index', $params);
45 45
 	}
46 46
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function updateAction()
54 54
 	{
55
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-update' );
55
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-update');
56 56
 		return \View::make('shop::checkout.update', $params);
57 57
 	}
58 58
 }
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/JsonadmController.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	 * @param integer|null $id Unique resource ID
32 32
 	 * @return \Illuminate\Http\Response Response object containing the generated output
33 33
 	 */
34
-	public function deleteAction( Request $request, $site = 'default', $resource, $id = null )
34
+	public function deleteAction(Request $request, $site = 'default', $resource, $id = null)
35 35
 	{
36 36
 		$status = 500;
37 37
 		$header = $request->headers->all();
38 38
 
39
-		$cntl = $this->createController( $site, $resource );
40
-		$result = $cntl->delete( $request->getContent(), $header, $status );
39
+		$cntl = $this->createController($site, $resource);
40
+		$result = $cntl->delete($request->getContent(), $header, $status);
41 41
 
42
-		return $this->createResponse( $result, $status, $header );
42
+		return $this->createResponse($result, $status, $header);
43 43
 	}
44 44
 
45 45
 
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
 	 * @param integer|null $id Unique resource ID
53 53
 	 * @return \Illuminate\Http\Response Response object containing the generated output
54 54
 	 */
55
-	public function getAction( Request $request, $site = 'default', $resource, $id = null )
55
+	public function getAction(Request $request, $site = 'default', $resource, $id = null)
56 56
 	{
57 57
 		$status = 500;
58 58
 		$header = $request->headers->all();
59 59
 
60
-		$cntl = $this->createController( $site, $resource );
61
-		$result = $cntl->get( $request->getContent(), $header, $status );
60
+		$cntl = $this->createController($site, $resource);
61
+		$result = $cntl->get($request->getContent(), $header, $status);
62 62
 
63
-		return $this->createResponse( $result, $status, $header );
63
+		return $this->createResponse($result, $status, $header);
64 64
 	}
65 65
 
66 66
 
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 	 * @param integer|null $id Unique resource ID
74 74
 	 * @return \Illuminate\Http\Response Response object containing the generated output
75 75
 	 */
76
-	public function patchAction( Request $request, $site = 'default', $resource, $id = null )
76
+	public function patchAction(Request $request, $site = 'default', $resource, $id = null)
77 77
 	{
78 78
 		$status = 500;
79 79
 		$header = $request->headers->all();
80 80
 
81
-		$cntl = $this->createController( $site, $resource );
82
-		$result = $cntl->patch( $request->getContent(), $header, $status );
81
+		$cntl = $this->createController($site, $resource);
82
+		$result = $cntl->patch($request->getContent(), $header, $status);
83 83
 
84
-		return $this->createResponse( $result, $status, $header );
84
+		return $this->createResponse($result, $status, $header);
85 85
 	}
86 86
 
87 87
 
@@ -94,15 +94,15 @@  discard block
 block discarded – undo
94 94
 	 * @param integer $id Unique ID of the resource
95 95
 	 * @return \Illuminate\Http\Response Response object containing the generated output
96 96
 	 */
97
-	public function postAction( Request $request, $site = 'default', $resource, $id = null )
97
+	public function postAction(Request $request, $site = 'default', $resource, $id = null)
98 98
 	{
99 99
 		$status = 500;
100 100
 		$header = $request->headers->all();
101 101
 
102
-		$cntl = $this->createController( $site, $resource );
103
-		$result = $cntl->post( $request->getContent(), $header, $status );
102
+		$cntl = $this->createController($site, $resource);
103
+		$result = $cntl->post($request->getContent(), $header, $status);
104 104
 
105
-		return $this->createResponse( $result, $status, $header );
105
+		return $this->createResponse($result, $status, $header);
106 106
 	}
107 107
 
108 108
 
@@ -115,15 +115,15 @@  discard block
 block discarded – undo
115 115
 	 * @param integer|null $id Unique resource ID
116 116
 	 * @return \Illuminate\Http\Response Response object containing the generated output
117 117
 	 */
118
-	public function putAction( Request $request, $site = 'default', $resource, $id = null )
118
+	public function putAction(Request $request, $site = 'default', $resource, $id = null)
119 119
 	{
120 120
 		$status = 500;
121 121
 		$header = $request->headers->all();
122 122
 
123
-		$cntl = $this->createController( $site, $resource );
124
-		$result = $cntl->put( $request->getContent(), $header, $status );
123
+		$cntl = $this->createController($site, $resource);
124
+		$result = $cntl->put($request->getContent(), $header, $status);
125 125
 
126
-		return $this->createResponse( $result, $status, $header );
126
+		return $this->createResponse($result, $status, $header);
127 127
 	}
128 128
 
129 129
 
@@ -135,15 +135,15 @@  discard block
 block discarded – undo
135 135
 	 * @param string $sitecode Unique site code
136 136
 	 * @return \Illuminate\Http\Response Response object containing the generated output
137 137
 	 */
138
-	public function optionsAction( Request $request, $site = 'default', $resource = '' )
138
+	public function optionsAction(Request $request, $site = 'default', $resource = '')
139 139
 	{
140 140
 		$status = 500;
141 141
 		$header = $request->headers->all();
142 142
 
143
-		$cntl = $this->createController( $site, $resource );
144
-		$result = $cntl->options( $request->getContent(), $header, $status );
143
+		$cntl = $this->createController($site, $resource);
144
+		$result = $cntl->options($request->getContent(), $header, $status);
145 145
 
146
-		return $this->createResponse( $result, $status, $header );
146
+		return $this->createResponse($result, $status, $header);
147 147
 	}
148 148
 
149 149
 
@@ -153,20 +153,20 @@  discard block
 block discarded – undo
153 153
 	 * @param string $sitecode Unique site code
154 154
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
155 155
 	 */
156
-	protected function createController( $sitecode, $resource )
156
+	protected function createController($sitecode, $resource)
157 157
 	{
158
-		$lang = \Input::get( 'lang', 'en' );
158
+		$lang = \Input::get('lang', 'en');
159 159
 
160
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
161
-		$templatePaths = $aimeos->getCustomPaths( 'controller/jsonadm/templates' );
160
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
161
+		$templatePaths = $aimeos->getCustomPaths('controller/jsonadm/templates');
162 162
 
163
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
164
-		$context = $this->setLocale( $context, $sitecode, $lang );
163
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
164
+		$context = $this->setLocale($context, $sitecode, $lang);
165 165
 
166
-		$view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang );
167
-		$context->setView( $view );
166
+		$view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang);
167
+		$context->setView($view);
168 168
 
169
-		return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource );
169
+		return \Aimeos\Controller\JsonAdm\Factory::createController($context, $templatePaths, $resource);
170 170
 	}
171 171
 
172 172
 
@@ -178,12 +178,12 @@  discard block
 block discarded – undo
178 178
 	 * @param array $header List of HTTP headers
179 179
 	 * @return \Illuminate\Http\Response HTTP response object
180 180
 	 */
181
-	protected function createResponse( $content, $status, array $header )
181
+	protected function createResponse($content, $status, array $header)
182 182
 	{
183
-		$response = \Response::make( $content, $status );
183
+		$response = \Response::make($content, $status);
184 184
 
185
-		foreach( $header as $key => $value ) {
186
-			$response->header( $key, $value );
185
+		foreach ($header as $key => $value) {
186
+			$response->header($key, $value);
187 187
 		}
188 188
 
189 189
 		return $response;
@@ -198,23 +198,23 @@  discard block
 block discarded – undo
198 198
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
199 199
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
200 200
 	 */
201
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang )
201
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang)
202 202
 	{
203
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
203
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
204 204
 
205 205
 		try
206 206
 		{
207
-			$localeItem = $localeManager->bootstrap( $sitecode, '', '', false );
208
-			$localeItem->setLanguageId( null );
209
-			$localeItem->setCurrencyId( null );
207
+			$localeItem = $localeManager->bootstrap($sitecode, '', '', false);
208
+			$localeItem->setLanguageId(null);
209
+			$localeItem->setCurrencyId(null);
210 210
 		}
211
-		catch( \Aimeos\MShop\Locale\Exception $e )
211
+		catch (\Aimeos\MShop\Locale\Exception $e)
212 212
 		{
213 213
 			$localeItem = $localeManager->createItem();
214 214
 		}
215 215
 
216
-		$context->setLocale( $localeItem );
217
-		$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) );
216
+		$context->setLocale($localeItem);
217
+		$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang)));
218 218
 
219 219
 		return $context;
220 220
 	}
Please login to merge, or discard this patch.
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   +18 added lines, -18 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,7 +34,7 @@  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
 		),
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 				'import' => array(
159 159
 					'text' => array(
160 160
 						'default' => array(
161
-							'uploaddir' => public_path( 'uploads' ),
161
+							'uploaddir' => public_path('uploads'),
162 162
 							'fileperms' => '0660',
163 163
 						),
164 164
 					),
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 				'export' => array(
167 167
 					'text' => array(
168 168
 						'default' => array(
169
-							'exportdir' => public_path( 'uploads' ),
169
+							'exportdir' => public_path('uploads'),
170 170
 							'downloaddir' => 'uploads',
171 171
 						),
172 172
 					),
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 				'import' => array(
177 177
 					'text' => array(
178 178
 						'default' => array(
179
-							'uploaddir' => public_path( 'uploads' ),
179
+							'uploaddir' => public_path('uploads'),
180 180
 							'fileperms' => '0660',
181 181
 						),
182 182
 					),
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 				'export' => array(
185 185
 					'text' => array(
186 186
 						'default' => array(
187
-							'exportdir' => public_path( 'uploads' ),
187
+							'exportdir' => public_path('uploads'),
188 188
 							'downloaddir' => 'uploads',
189 189
 						),
190 190
 					),
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 				'import' => array(
255 255
 					'text' => array(
256 256
 						'default' => array(
257
-							'uploaddir' => public_path( 'uploads' ),
257
+							'uploaddir' => public_path('uploads'),
258 258
 							'fileperms' => '0660',
259 259
 						),
260 260
 					),
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 				'export' => array(
263 263
 					'text' => array(
264 264
 						'default' => array(
265
-							'exportdir' => public_path( 'uploads' ),
265
+							'exportdir' => public_path('uploads'),
266 266
 							'downloaddir' => 'uploads',
267 267
 						),
268 268
 					),
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +28 added lines, -28 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', []), 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,50 +20,50 @@  discard block
 block discarded – undo
20 20
 
21 21
 Route::group(config('shop.routes.jsonadm', []), function() {
22 22
 
23
-	Route::match( array( 'DELETE' ), 'jsonadm/{resource}/{id?}', array(
23
+	Route::match(array('DELETE'), 'jsonadm/{resource}/{id?}', array(
24 24
 		'as' => 'aimeos_shop_jsonadm_delete',
25 25
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@deleteAction'
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' ), 'jsonadm/{resource}/{id?}', array(
28
+	Route::match(array('GET'), 'jsonadm/{resource}/{id?}', array(
29 29
 		'as' => 'aimeos_shop_jsonadm_get',
30 30
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@getAction'
31
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
31
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
32 32
 
33
-	Route::match( array( 'PATCH' ), 'jsonadm/{resource}/{id?}', array(
33
+	Route::match(array('PATCH'), 'jsonadm/{resource}/{id?}', array(
34 34
 		'as' => 'aimeos_shop_jsonadm_patch',
35 35
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@patchAction'
36
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
36
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
37 37
 
38
-	Route::match( array( 'POST' ), 'jsonadm/{resource}/{id?}', array(
38
+	Route::match(array('POST'), 'jsonadm/{resource}/{id?}', array(
39 39
 		'as' => 'aimeos_shop_jsonadm_post',
40 40
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@postAction'
41
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
41
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
42 42
 
43
-	Route::match( array( 'PUT' ), 'jsonadm/{resource}/{id?}', array(
43
+	Route::match(array('PUT'), 'jsonadm/{resource}/{id?}', array(
44 44
 		'as' => 'aimeos_shop_jsonadm_put',
45 45
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@putAction'
46
-	))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) );
46
+	))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*'));
47 47
 
48
-	Route::match( array( 'OPTIONS' ), 'jsonadm/{resource?}', array(
48
+	Route::match(array('OPTIONS'), 'jsonadm/{resource?}', array(
49 49
 		'as' => 'aimeos_shop_jsonadm_options',
50 50
 		'uses' => 'Aimeos\Shop\Controller\JsonadmController@optionsAction'
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.account', ['middleware' => 'auth']), function() {
57 57
 
58
-	Route::match( array( 'GET', 'POST' ), 'myaccount', array(
58
+	Route::match(array('GET', 'POST'), 'myaccount', array(
59 59
 		'as' => 'aimeos_shop_account',
60 60
 		'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction'
61 61
 	));
62
-	Route::match( array( 'GET', 'POST' ), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
62
+	Route::match(array('GET', 'POST'), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
63 63
 		'as' => 'aimeos_shop_account_favorite',
64 64
 		'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction'
65 65
 	));
66
-	Route::match( array( 'GET', 'POST' ), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
66
+	Route::match(array('GET', 'POST'), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
67 67
 		'as' => 'aimeos_shop_account_watch',
68 68
 		'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction'
69 69
 	));
@@ -73,45 +73,45 @@  discard block
 block discarded – undo
73 73
 
74 74
 Route::group(config('shop.routes.default', []), function() {
75 75
 
76
-	Route::match( array( 'GET', 'POST' ), 'basket', array(
76
+	Route::match(array('GET', 'POST'), 'basket', array(
77 77
 		'as' => 'aimeos_shop_basket',
78 78
 		'uses' => 'Aimeos\Shop\Controller\BasketController@indexAction'
79 79
 	));
80 80
 
81
-	Route::match( array( 'GET', 'POST' ), 'count', array(
81
+	Route::match(array('GET', 'POST'), 'count', array(
82 82
 		'as' => 'aimeos_shop_count',
83 83
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@countAction'
84 84
 	));
85
-	Route::match( array( 'GET', 'POST' ), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array(
85
+	Route::match(array('GET', 'POST'), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array(
86 86
 		'as' => 'aimeos_shop_detail',
87 87
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction'
88 88
 	));
89
-	Route::match( array( 'GET', 'POST' ), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
89
+	Route::match(array('GET', 'POST'), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array(
90 90
 		'as' => 'aimeos_shop_session_pinned',
91 91
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction'
92 92
 	));
93
-	Route::match( array( 'GET', 'POST' ), 'list', array(
93
+	Route::match(array('GET', 'POST'), 'list', array(
94 94
 		'as' => 'aimeos_shop_list',
95 95
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@listAction'
96 96
 	));
97
-	Route::match( array( 'GET', 'POST' ), 'suggest', array(
97
+	Route::match(array('GET', 'POST'), 'suggest', array(
98 98
 		'as' => 'aimeos_shop_suggest',
99 99
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@suggestAction'
100 100
 	));
101
-	Route::match( array( 'GET', 'POST' ), 'stock', array(
101
+	Route::match(array('GET', 'POST'), 'stock', array(
102 102
 		'as' => 'aimeos_shop_stock',
103 103
 		'uses' => 'Aimeos\Shop\Controller\CatalogController@stockAction'
104 104
 	));
105 105
 
106
-	Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array(
106
+	Route::match(array('GET', 'POST'), 'checkout/{c_step?}', array(
107 107
 		'as' => 'aimeos_shop_checkout',
108 108
 		'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction'
109 109
 	));
110
-	Route::match( array( 'GET', 'POST' ), 'confirm', array(
110
+	Route::match(array('GET', 'POST'), 'confirm', array(
111 111
 		'as' => 'aimeos_shop_confirm',
112 112
 		'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction'
113 113
 	));
114
-	Route::match( array( 'GET', 'POST' ), 'update', array(
114
+	Route::match(array('GET', 'POST'), 'update', array(
115 115
 		'as' => 'aimeos_shop_update',
116 116
 		'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction'
117 117
 	));
Please login to merge, or discard this patch.