Completed
Push — master ( 3df36a...73a491 )
by Aimeos
03:04
created
src/Aimeos/Shop/Controller/JqadmController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,8 +207,7 @@
 block discarded – undo
207 207
 			$localeItem = $localeManager->bootstrap( $sitecode, '', '', false );
208 208
 			$localeItem->setLanguageId( null );
209 209
 			$localeItem->setCurrencyId( null );
210
-		}
211
-		catch( \Aimeos\MShop\Locale\Exception $e )
210
+		} catch( \Aimeos\MShop\Locale\Exception $e )
212 211
 		{
213 212
 			$localeItem = $localeManager->createItem();
214 213
 		}
Please login to merge, or discard this patch.
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	/**
76 76
 	 * Returns the HTML code for a copy of a resource object
77 77
 	 *
78
-	 * @return string Generated output
78
+	 * @return \Illuminate\Contracts\View\View Generated output
79 79
 	 */
80 80
 	public function copyAction()
81 81
 	{
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	/**
92 92
 	 * Returns the HTML code for a new resource object
93 93
 	 *
94
-	 * @return string Generated output
94
+	 * @return \Illuminate\Contracts\View\View Generated output
95 95
 	 */
96 96
 	public function createAction()
97 97
 	{
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	/**
108 108
 	 * Deletes the resource object or a list of resource objects
109 109
 	 *
110
-	 * @return string Generated output
110
+	 * @return \Illuminate\Contracts\View\View Generated output
111 111
 	 */
112 112
 	public function deleteAction()
113 113
 	{
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	/**
124 124
 	 * Returns the HTML code for the requested resource object
125 125
 	 *
126
-	 * @return string Generated output
126
+	 * @return \Illuminate\Contracts\View\View Generated output
127 127
 	 */
128 128
 	public function getAction()
129 129
 	{
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	/**
140 140
 	 * Saves a new resource object
141 141
 	 *
142
-	 * @return string Generated output
142
+	 * @return \Illuminate\Contracts\View\View Generated output
143 143
 	 */
144 144
 	public function saveAction()
145 145
 	{
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	/**
156 156
 	 * Returns the HTML code for a list of resource objects
157 157
 	 *
158
-	 * @return string Generated output
158
+	 * @return \Illuminate\Contracts\View\View Generated output
159 159
 	 */
160 160
 	public function searchAction()
161 161
 	{
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -34,38 +34,38 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function fileAction()
36 36
 	{
37
-		if( config( 'shop.authorize', true ) ) {
38
-			$this->authorize( 'admin' );
37
+		if (config('shop.authorize', true)) {
38
+			$this->authorize('admin');
39 39
 		}
40 40
 
41 41
 		$contents = '';
42 42
 		$files = array();
43
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
44
-		$type = Route::input( 'type', Input::get( 'type', 'js' ) );
43
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
44
+		$type = Route::input('type', Input::get('type', 'js'));
45 45
 
46
-		foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths )
46
+		foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths)
47 47
 		{
48
-			foreach( $paths as $path )
48
+			foreach ($paths as $path)
49 49
 			{
50 50
 				$jsbAbsPath = $base . '/' . $path;
51
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
52
-				$files = array_merge( $files, $jsb2->getFiles( $type ) );
51
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
52
+				$files = array_merge($files, $jsb2->getFiles($type));
53 53
 			}
54 54
 		}
55 55
 
56
-		foreach( $files as $file )
56
+		foreach ($files as $file)
57 57
 		{
58
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
58
+			if (($content = file_get_contents($file)) !== false) {
59 59
 				$contents .= $content;
60 60
 			}
61 61
 		}
62 62
 
63
-		$response = response( $contents );
63
+		$response = response($contents);
64 64
 
65
-		if( $type === 'js' ) {
66
-			$response->header( 'Content-Type', 'application/javascript' );
67
-		} elseif( $type === 'css' ) {
68
-			$response->header( 'Content-Type', 'text/css' );
65
+		if ($type === 'js') {
66
+			$response->header('Content-Type', 'application/javascript');
67
+		} elseif ($type === 'css') {
68
+			$response->header('Content-Type', 'text/css');
69 69
 		}
70 70
 
71 71
 		return $response;
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function copyAction()
81 81
 	{
82
-		if( config( 'shop.authorize', true ) ) {
83
-			$this->authorize( 'admin' );
82
+		if (config('shop.authorize', true)) {
83
+			$this->authorize('admin');
84 84
 		}
85 85
 
86 86
 		$cntl = $this->createClient();
87
-		return $this->getHtml( $cntl->copy() );
87
+		return $this->getHtml($cntl->copy());
88 88
 	}
89 89
 
90 90
 
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function createAction()
97 97
 	{
98
-		if( config( 'shop.authorize', true ) ) {
99
-			$this->authorize( 'admin' );
98
+		if (config('shop.authorize', true)) {
99
+			$this->authorize('admin');
100 100
 		}
101 101
 
102 102
 		$cntl = $this->createClient();
103
-		return $this->getHtml( $cntl->create() );
103
+		return $this->getHtml($cntl->create());
104 104
 	}
105 105
 
106 106
 
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function deleteAction()
113 113
 	{
114
-		if( config( 'shop.authorize', true ) ) {
115
-			$this->authorize( 'admin' );
114
+		if (config('shop.authorize', true)) {
115
+			$this->authorize('admin');
116 116
 		}
117 117
 
118 118
 		$cntl = $this->createClient();
119
-		return $this->getHtml( $cntl->delete() . $cntl->search() );
119
+		return $this->getHtml($cntl->delete() . $cntl->search());
120 120
 	}
121 121
 
122 122
 
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function getAction()
129 129
 	{
130
-		if( config( 'shop.authorize', true ) ) {
131
-			$this->authorize( 'admin' );
130
+		if (config('shop.authorize', true)) {
131
+			$this->authorize('admin');
132 132
 		}
133 133
 
134 134
 		$cntl = $this->createClient();
135
-		return $this->getHtml( $cntl->get() );
135
+		return $this->getHtml($cntl->get());
136 136
 	}
137 137
 
138 138
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public function saveAction()
145 145
 	{
146
-		if( config( 'shop.authorize', true ) ) {
147
-			$this->authorize( 'admin' );
146
+		if (config('shop.authorize', true)) {
147
+			$this->authorize('admin');
148 148
 		}
149 149
 
150 150
 		$cntl = $this->createClient();
151
-		return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) );
151
+		return $this->getHtml(($cntl->save() ?: $cntl->search()));
152 152
 	}
153 153
 
154 154
 
@@ -159,12 +159,12 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function searchAction()
161 161
 	{
162
-		if( config( 'shop.authorize', true ) ) {
163
-			$this->authorize( 'admin' );
162
+		if (config('shop.authorize', true)) {
163
+			$this->authorize('admin');
164 164
 		}
165 165
 
166 166
 		$cntl = $this->createClient();
167
-		return $this->getHtml( $cntl->search() );
167
+		return $this->getHtml($cntl->search());
168 168
 	}
169 169
 
170 170
 
@@ -175,20 +175,20 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	protected function createClient()
177 177
 	{
178
-		$site = Route::input( 'site', Input::get( 'site', 'default' ) );
179
-		$lang = Input::get( 'lang', config( 'app.locale', 'en' ) );
180
-		$resource = Route::input( 'resource' );
178
+		$site = Route::input('site', Input::get('site', 'default'));
179
+		$lang = Input::get('lang', config('app.locale', 'en'));
180
+		$resource = Route::input('resource');
181 181
 
182
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
183
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' );
182
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
183
+		$templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates');
184 184
 
185
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
186
-		$context = $this->setLocale( $context, $site, $lang );
185
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
186
+		$context = $this->setLocale($context, $site, $lang);
187 187
 
188
-		$view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang );
189
-		$context->setView( $view );
188
+		$view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang);
189
+		$context->setView($view);
190 190
 
191
-		return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource );
191
+		return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource);
192 192
 	}
193 193
 
194 194
 
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
 	 * @param string $content Content from admin client
199 199
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
200 200
 	 */
201
-	protected function getHtml( $content )
201
+	protected function getHtml($content)
202 202
 	{
203
-		$version = app( '\Aimeos\Shop\Base\Aimeos' )->getVersion();
204
-		$content = str_replace( ['{type}', '{version}'], ['Laravel', $version], $content );
203
+		$version = app('\Aimeos\Shop\Base\Aimeos')->getVersion();
204
+		$content = str_replace(['{type}', '{version}'], ['Laravel', $version], $content);
205 205
 
206
-		return View::make( 'shop::jqadm.index', array( 'content' => $content ) );
206
+		return View::make('shop::jqadm.index', array('content' => $content));
207 207
 	}
208 208
 
209 209
 
@@ -215,23 +215,23 @@  discard block
 block discarded – undo
215 215
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
216 216
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
217 217
 	 */
218
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site, $lang )
218
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site, $lang)
219 219
 	{
220
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
220
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
221 221
 
222 222
 		try
223 223
 		{
224
-			$localeItem = $localeManager->bootstrap( $site, '', '', false );
225
-			$localeItem->setLanguageId( null );
226
-			$localeItem->setCurrencyId( null );
224
+			$localeItem = $localeManager->bootstrap($site, '', '', false);
225
+			$localeItem->setLanguageId(null);
226
+			$localeItem->setCurrencyId(null);
227 227
 		}
228
-		catch( \Aimeos\MShop\Locale\Exception $e )
228
+		catch (\Aimeos\MShop\Locale\Exception $e)
229 229
 		{
230 230
 			$localeItem = $localeManager->createItem();
231 231
 		}
232 232
 
233
-		$context->setLocale( $localeItem );
234
-		$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang, 'en' ) ) );
233
+		$context->setLocale($localeItem);
234
+		$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang, 'en')));
235 235
 
236 236
 		return $context;
237 237
 	}
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/Support.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param \Aimeos\Shop\Base\Context $context Context object
31 31
 	 */
32
-	public function __construct( \Aimeos\Shop\Base\Context $context )
32
+	public function __construct(\Aimeos\Shop\Base\Context $context)
33 33
 	{
34 34
 		$this->context = $context;
35 35
 	}
@@ -42,21 +42,21 @@  discard block
 block discarded – undo
42 42
 	 * @param string $groupcode Unique user/customer group code
43 43
 	 * @return boolean True if user is part of the group, false if not
44 44
 	 */
45
-	public function checkGroup( $userid, $groupcode )
45
+	public function checkGroup($userid, $groupcode)
46 46
 	{
47 47
 		$context = $this->context->get();
48
-		$group = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' )->findItem( $groupcode );
49
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
48
+		$group = \Aimeos\MShop\Factory::createManager($context, 'customer/group')->findItem($groupcode);
49
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
50 50
 
51 51
 		$search = $manager->createSearch();
52 52
 		$expr = array(
53
-			$search->compare( '==', 'customer.lists.parentid', $userid ),
54
-			$search->compare( '==', 'customer.lists.refid', $group->getId() ),
55
-			$search->compare( '==', 'customer.lists.domain', 'customer/group' ),
53
+			$search->compare('==', 'customer.lists.parentid', $userid),
54
+			$search->compare('==', 'customer.lists.refid', $group->getId()),
55
+			$search->compare('==', 'customer.lists.domain', 'customer/group'),
56 56
 		);
57
-		$search->setConditions( $search->combine( '&&', $expr ) );
58
-		$search->setSlice( 0, 1 );
57
+		$search->setConditions($search->combine('&&', $expr));
58
+		$search->setSlice(0, 1);
59 59
 
60
-		return (bool) count( $manager->searchItems( $search ) );
60
+		return (bool) count($manager->searchItems($search));
61 61
 	}
62 62
 }
63 63
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/ExtadmController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
 	 * Creates a list of all available translations.
136 136
 	 *
137 137
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
138
-	 * @return array List of language IDs with labels
138
+	 * @return string List of language IDs with labels
139 139
 	 */
140 140
 	protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context )
141 141
 	{
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -34,63 +34,63 @@  discard block
 block discarded – undo
34 34
 	 * @param \Illuminate\Http\Request $request Laravel request object
35 35
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
36 36
 	 */
37
-	public function indexAction( Request $request )
37
+	public function indexAction(Request $request)
38 38
 	{
39
-		if( config( 'shop.authorize', true ) ) {
40
-			$this->authorize( 'admin' );
39
+		if (config('shop.authorize', true)) {
40
+			$this->authorize('admin');
41 41
 		}
42 42
 
43
-		$site = Route::input( 'site', 'default' );
44
-		$lang = Input::get( 'lang', config( 'app.locale', 'en' ) );
43
+		$site = Route::input('site', 'default');
44
+		$lang = Input::get('lang', config('app.locale', 'en'));
45 45
 
46
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' );
46
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos');
47 47
 
48 48
 		$bootstrap = $aimeos->get();
49
-		$cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' );
49
+		$cntlPaths = $bootstrap->getCustomPaths('controller/extjs');
50 50
 
51
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
52
-		$context = $this->setLocale( $context, $site, $lang );
51
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
52
+		$context = $this->setLocale($context, $site, $lang);
53 53
 
54
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
54
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
55 55
 		$cssFiles = array();
56 56
 
57
-		foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths )
57
+		foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths)
58 58
 		{
59
-			foreach( $paths as $path )
59
+			foreach ($paths as $path)
60 60
 			{
61 61
 				$jsbAbsPath = $base . '/' . $path;
62 62
 
63
-				if( !is_file( $jsbAbsPath ) ) {
64
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
63
+				if (!is_file($jsbAbsPath)) {
64
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
65 65
 				}
66 66
 
67
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
68
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
67
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
68
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
69 69
 			}
70 70
 		}
71 71
 
72
-		$jqadmUrl = route( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) );
73
-		$jsonUrl = route( 'aimeos_shop_extadm_json', array( 'site' => $site, '_token' => csrf_token() ) );
74
-		$adminUrl = route( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) );
72
+		$jqadmUrl = route('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product'));
73
+		$jsonUrl = route('aimeos_shop_extadm_json', array('site' => $site, '_token' => csrf_token()));
74
+		$adminUrl = route('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>'));
75 75
 
76 76
 		$vars = array(
77 77
 			'lang' => $lang,
78 78
 			'cssFiles' => $cssFiles,
79
-			'languages' => $this->getJsonLanguages( $context),
80
-			'config' => $this->getJsonClientConfig( $context ),
81
-			'site' => $this->getJsonSiteItem( $context, $site ),
82
-			'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ),
79
+			'languages' => $this->getJsonLanguages($context),
80
+			'config' => $this->getJsonClientConfig($context),
81
+			'site' => $this->getJsonSiteItem($context, $site),
82
+			'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang),
83 83
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
84 84
 			'itemSchemas' => $controller->getJsonItemSchemas(),
85
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
86
-			'urlTemplate' => str_replace( ['<', '>'], ['{', '}'], urldecode( $adminUrl ) ),
87
-			'uploaddir' => config( 'shop::uploaddir' ),
88
-			'activeTab' => Input::get( 'tab', 0 ),
85
+			'smd' => $controller->getJsonSmd($jsonUrl),
86
+			'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)),
87
+			'uploaddir' => config('shop::uploaddir'),
88
+			'activeTab' => Input::get('tab', 0),
89 89
 			'version' => $aimeos->getVersion(),
90 90
 			'jqadmurl' => $jqadmUrl,
91 91
 		);
92 92
 
93
-		return View::make( 'shop::extadm.index', $vars );
93
+		return View::make('shop::extadm.index', $vars);
94 94
 	}
95 95
 
96 96
 
@@ -100,23 +100,23 @@  discard block
 block discarded – undo
100 100
 	 * @param \Illuminate\Http\Request $request Laravel request object
101 101
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
102 102
 	 */
103
-	public function doAction( Request $request )
103
+	public function doAction(Request $request)
104 104
 	{
105
-		if( config( 'shop.authorize', true ) ) {
106
-			$this->authorize( 'admin' );
105
+		if (config('shop.authorize', true)) {
106
+			$this->authorize('admin');
107 107
 		}
108 108
 
109
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
110
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
109
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
110
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
111 111
 
112
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
113
-		$context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), array() ) );
114
-		$context = $this->setLocale( $context );
112
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
113
+		$context->setView(app('\Aimeos\Shop\Base\View')->create($context->getConfig(), array()));
114
+		$context = $this->setLocale($context);
115 115
 
116
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
116
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
117 117
 
118
-		$response = $controller->process( Input::instance()->request->all(), $request->getContent() );
119
-		return View::make( 'shop::extadm.do', array( 'output' => $response ) );
118
+		$response = $controller->process(Input::instance()->request->all(), $request->getContent());
119
+		return View::make('shop::extadm.do', array('output' => $response));
120 120
 	}
121 121
 
122 122
 
@@ -127,32 +127,32 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function fileAction()
129 129
 	{
130
-		if( config( 'shop.authorize', true ) ) {
131
-			$this->authorize( 'admin' );
130
+		if (config('shop.authorize', true)) {
131
+			$this->authorize('admin');
132 132
 		}
133 133
 
134 134
 		$contents = '';
135 135
 		$jsFiles = array();
136
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
136
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
137 137
 
138
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
138
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
139 139
 		{
140
-			foreach( $paths as $path )
140
+			foreach ($paths as $path)
141 141
 			{
142 142
 				$jsbAbsPath = $base . '/' . $path;
143
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
144
-				$jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) );
143
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
144
+				$jsFiles = array_merge($jsFiles, $jsb2->getFiles('js'));
145 145
 			}
146 146
 		}
147 147
 
148
-		foreach( $jsFiles as $file )
148
+		foreach ($jsFiles as $file)
149 149
 		{
150
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
150
+			if (($content = file_get_contents($file)) !== false) {
151 151
 				$contents .= $content;
152 152
 			}
153 153
 		}
154 154
 
155
-		return response( $contents )->header( 'Content-Type', 'application/javascript' );
155
+		return response($contents)->header('Content-Type', 'application/javascript');
156 156
 	}
157 157
 
158 158
 
@@ -162,15 +162,15 @@  discard block
 block discarded – undo
162 162
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
163 163
 	 * @return array List of language IDs with labels
164 164
 	 */
165
-	protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context )
165
+	protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context)
166 166
 	{
167 167
 		$result = array();
168 168
 
169
-		foreach( app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nList( 'admin' ) as $id ) {
170
-			$result[] = array( 'id' => $id, 'label' => $id );
169
+		foreach (app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nList('admin') as $id) {
170
+			$result[] = array('id' => $id, 'label' => $id);
171 171
 		}
172 172
 
173
-		return json_encode( $result );
173
+		return json_encode($result);
174 174
 	}
175 175
 
176 176
 
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
181 181
 	 * @return string JSON encoded configuration object
182 182
 	 */
183
-	protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
183
+	protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
184 184
 	{
185
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
186
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
185
+		$config = $context->getConfig()->get('admin/extjs', array());
186
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
187 187
 	}
188 188
 
189 189
 
@@ -194,16 +194,16 @@  discard block
 block discarded – undo
194 194
 	 * @param string $lang ISO language code like "en" or "en_GB"
195 195
 	 * @return string JSON encoded translation object
196 196
 	 */
197
-	protected function getJsonClientI18n( array $i18nPaths, $lang )
197
+	protected function getJsonClientI18n(array $i18nPaths, $lang)
198 198
 	{
199
-		$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang );
199
+		$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang);
200 200
 
201 201
 		$content = array(
202
-			'admin' => $i18n->getAll( 'admin' ),
203
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
202
+			'admin' => $i18n->getAll('admin'),
203
+			'admin/ext' => $i18n->getAll('admin/ext'),
204 204
 		);
205 205
 
206
-		return json_encode( $content, JSON_FORCE_OBJECT );
206
+		return json_encode($content, JSON_FORCE_OBJECT);
207 207
 	}
208 208
 
209 209
 
@@ -215,19 +215,19 @@  discard block
 block discarded – undo
215 215
 	 * @return string JSON encoded site item object
216 216
 	 * @throws Exception If no site item was found for the code
217 217
 	 */
218
-	protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
218
+	protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
219 219
 	{
220
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
220
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
221 221
 
222 222
 		$criteria = $manager->createSearch();
223
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
224
-		$items = $manager->searchItems( $criteria );
223
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
224
+		$items = $manager->searchItems($criteria);
225 225
 
226
-		if( ( $item = reset( $items ) ) === false ) {
227
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
226
+		if (($item = reset($items)) === false) {
227
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
228 228
 		}
229 229
 
230
-		return json_encode( $item->toArray() );
230
+		return json_encode($item->toArray());
231 231
 	}
232 232
 
233 233
 
@@ -239,17 +239,17 @@  discard block
 block discarded – undo
239 239
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
240 240
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
241 241
 	 */
242
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
242
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
243 243
 	{
244
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
244
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
245 245
 
246 246
 		try {
247
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
248
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
247
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
248
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
249 249
 			$localeItem = $localeManager->createItem();
250 250
 		}
251 251
 
252
-		$context->setLocale( $localeItem );
252
+		$context->setLocale($localeItem);
253 253
 
254 254
 		return $context;
255 255
 	}
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/AdminController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,18 +36,18 @@
 block discarded – undo
36 36
 	 * @param \Illuminate\Http\Request $request Laravel request object
37 37
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
38 38
 	 */
39
-	public function indexAction( Request $request )
39
+	public function indexAction(Request $request)
40 40
 	{
41
-		if( config( 'shop.authorize', true ) && !( Auth::check() && $request->user()->can( 'admin' ) ) ) {
42
-			return View::make( 'shop::admin.index' );
41
+		if (config('shop.authorize', true) && !(Auth::check() && $request->user()->can('admin'))) {
42
+			return View::make('shop::admin.index');
43 43
 		}
44 44
 
45 45
 		$param = array(
46 46
 			'resource' => 'product',
47
-			'site' => Route::input( 'site', 'default' ),
48
-			'lang' => Input::get( 'lang', config( 'app.locale', 'en' ) ),
47
+			'site' => Route::input('site', 'default'),
48
+			'lang' => Input::get('lang', config('app.locale', 'en')),
49 49
 		);
50 50
 
51
-		return redirect()->route( 'aimeos_shop_jqadm_search', $param );
51
+		return redirect()->route('aimeos_shop_jqadm_search', $param);
52 52
 	}
53 53
 }
54 54
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/Aimeos.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
36 36
 	 */
37
-	public function __construct( \Illuminate\Contracts\Config\Repository $config )
37
+	public function __construct(\Illuminate\Contracts\Config\Repository $config)
38 38
 	{
39 39
 		$this->config = $config;
40 40
 	}
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function get()
49 49
 	{
50
-		if( $this->object === null )
50
+		if ($this->object === null)
51 51
 		{
52
-			$extDirs = (array) $this->config->get( 'shop.extdir', array() );
53
-			$this->object = new \Aimeos\Bootstrap( $extDirs, false );
52
+			$extDirs = (array) $this->config->get('shop.extdir', array());
53
+			$this->object = new \Aimeos\Bootstrap($extDirs, false);
54 54
 		}
55 55
 
56 56
 		return $this->object;
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function getVersion()
66 66
 	{
67
-		if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false
68
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
67
+		if (($content = @file_get_contents(base_path('composer.lock'))) !== false
68
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
69 69
 		) {
70
-			foreach( (array) $content['packages'] as $item )
70
+			foreach ((array) $content['packages'] as $item)
71 71
 			{
72
-				if( $item['name'] === 'aimeos/aimeos-laravel' ) {
72
+				if ($item['name'] === 'aimeos/aimeos-laravel') {
73 73
 					return $item['version'];
74 74
 				}
75 75
 			}
Please login to merge, or discard this patch.
src/views/extadm/index.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
         <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/adapter/ext/ext-base.js"></script>
47 47
         <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/ext-all.js"></script>
48
-        <script type="text/javascript" src="<?= route( 'aimeos_shop_extadm_file', array( 'site' => 'default' ) ); ?>"></script>
48
+        <script type="text/javascript" src="<?= route('aimeos_shop_extadm_file', array('site' => 'default')); ?>"></script>
49 49
 
50 50
     </head>
51 51
     <body>
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/AccountController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function indexAction()
32 32
 	{
33
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'account-index' );
33
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('account-index');
34 34
 		return View::make('shop::account.index', $params);
35 35
 	}
36 36
 
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function downloadAction()
44 44
 	{
45
-		$context = app( '\Aimeos\Shop\Base\Context' )->get();
45
+		$context = app('\Aimeos\Shop\Base\Context')->get();
46 46
 		$langid = $context->getLocale()->getLanguageId();
47 47
 
48
-		$view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), array(), $langid );
49
-		$context->setView( $view );
48
+		$view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), array(), $langid);
49
+		$context->setView($view);
50 50
 
51
-		$client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' );
52
-		$client->setView( $view );
51
+		$client = \Aimeos\Client\Html\Factory::createClient($context, array(), 'account/download');
52
+		$client->setView($view);
53 53
 		$client->process();
54 54
 
55 55
 		$response = $view->response();
56
-		return Response::make( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() );
56
+		return Response::make((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders());
57 57
 	}
58 58
 }
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/I18n.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @param \Aimeos\Shop\Base\Aimeos $aimeos Aimeos object
41 41
 	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
42 42
 	 */
43
-	public function __construct( \Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config )
43
+	public function __construct(\Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config)
44 44
 	{
45 45
 		$this->aimeos = $aimeos;
46 46
 		$this->config = $config;
@@ -53,22 +53,22 @@  discard block
 block discarded – undo
53 53
 	 * @param array $languageIds List of two letter ISO language IDs
54 54
 	 * @return \Aimeos\MW\Translation\Iface[] List of translation objects
55 55
 	 */
56
-	public function get( array $languageIds )
56
+	public function get(array $languageIds)
57 57
 	{
58 58
 		$i18nPaths = $this->aimeos->get()->getI18nPaths();
59 59
 
60
-		foreach( $languageIds as $langid )
60
+		foreach ($languageIds as $langid)
61 61
 		{
62
-			if( !isset( $this->i18n[$langid] ) )
62
+			if (!isset($this->i18n[$langid]))
63 63
 			{
64
-				$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid );
64
+				$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid);
65 65
 
66
-				if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) {
67
-					$i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $this->config->get( 'shop.apc_prefix', 'laravel:' ) );
66
+				if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) {
67
+					$i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $this->config->get('shop.apc_prefix', 'laravel:'));
68 68
 				}
69 69
 
70
-				if( $this->config->has( 'shop.i18n.' . $langid ) ) {
71
-					$i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $this->config->get( 'shop.i18n.' . $langid ) );
70
+				if ($this->config->has('shop.i18n.' . $langid)) {
71
+					$i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $this->config->get('shop.i18n.' . $langid));
72 72
 				}
73 73
 
74 74
 				$this->i18n[$langid] = $i18n;
Please login to merge, or discard this patch.