Completed
Push — master ( 86df1c...287b80 )
by Aimeos
17:07
created
src/Controller/Account.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	 * @param array $args Associative list of route parameters
32 32
 	 * @return ResponseInterface $response Modified response object with generated output
33 33
 	 */
34
-	public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
34
+	public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
35 35
 	{
36
-		$contents = $container->get( 'aimeos_page' )->getSections( 'account-index', $request, $response, $args );
37
-		return $container->get( 'view' )->render( $response, 'Account/index.html.twig', $contents );
36
+		$contents = $container->get('aimeos_page')->getSections('account-index', $request, $response, $args);
37
+		return $container->get('view')->render($response, 'Account/index.html.twig', $contents);
38 38
 	}
39 39
 
40 40
 
@@ -47,16 +47,16 @@  discard block
 block discarded – undo
47 47
 	 * @param array $args Associative list of route parameters
48 48
 	 * @return ResponseInterface $response Modified response object with generated output
49 49
 	 */
50
-	public static function downloadAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
50
+	public static function downloadAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
51 51
 	{
52
-		$context = $container->get( 'aimeos_context' )->get( true, $args );
52
+		$context = $container->get('aimeos_context')->get(true, $args);
53 53
 		$langid = $context->getLocale()->getLanguageId();
54 54
 
55
-		$view = $container->get( 'aimeos_view' )->create( $context, $request, $response, $args, array(), $langid );
56
-		$context->setView( $view );
55
+		$view = $container->get('aimeos_view')->create($context, $request, $response, $args, array(), $langid);
56
+		$context->setView($view);
57 57
 
58
-		$client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' );
59
-		$client->setView( $view );
58
+		$client = \Aimeos\Client\Html\Factory::createClient($context, array(), 'account/download');
59
+		$client->setView($view);
60 60
 		$client->process();
61 61
 
62 62
 		return $view->response();
Please login to merge, or discard this patch.
src/Base/Page.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @param ContainerInterface $container Dependency container
32 32
 	 */
33
-	public function __construct( ContainerInterface $container )
33
+	public function __construct(ContainerInterface $container)
34 34
 	{
35 35
 		$this->container = $container;
36 36
 	}
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
 	 * @param array Associative list of URI attributes
46 46
 	 * @return array Associative list with body and header output separated by client name
47 47
 	 */
48
-	public function getSections( $pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr )
48
+	public function getSections($pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr)
49 49
 	{
50
-		$tmplPaths = $this->container->get( 'aimeos' )->getCustomPaths( 'client/html/templates' );
51
-		$context = $this->container->get( 'aimeos_context' )->get( true, $attr );
50
+		$tmplPaths = $this->container->get('aimeos')->getCustomPaths('client/html/templates');
51
+		$context = $this->container->get('aimeos_context')->get(true, $attr);
52 52
 		$langid = $context->getLocale()->getLanguageId();
53 53
 
54
-		$view = $this->container->get( 'aimeos_view' )->create( $context, $request, $response, $attr, $tmplPaths, $langid );
55
-		$context->setView( $view );
54
+		$view = $this->container->get('aimeos_view')->create($context, $request, $response, $attr, $tmplPaths, $langid);
55
+		$context->setView($view);
56 56
 
57
-		$pagesConfig = $this->container->get( 'aimeos_config' )->get()->get( 'page', array() );
58
-		$result = array( 'aibody' => array(), 'aiheader' => array() );
57
+		$pagesConfig = $this->container->get('aimeos_config')->get()->get('page', array());
58
+		$result = array('aibody' => array(), 'aiheader' => array());
59 59
 
60
-		if( isset( $pagesConfig[$pageName] ) )
60
+		if (isset($pagesConfig[$pageName]))
61 61
 		{
62
-			foreach( (array) $pagesConfig[$pageName] as $clientName )
62
+			foreach ((array) $pagesConfig[$pageName] as $clientName)
63 63
 			{
64
-				$client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName );
65
-				$client->setView( clone $view );
64
+				$client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName);
65
+				$client->setView(clone $view);
66 66
 				$client->process();
67 67
 
68 68
 				$result['aibody'][$clientName] = $client->getBody();
Please login to merge, or discard this patch.
src/Base/View.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @param ContainerInterface $container Dependency container
32 32
 	 */
33
-	public function __construct( ContainerInterface $container )
33
+	public function __construct(ContainerInterface $container)
34 34
 	{
35 35
 		$this->container = $container;
36 36
 	}
@@ -47,38 +47,38 @@  discard block
 block discarded – undo
47 47
 	 * @param string|null $locale Code of the current language or null for no translation
48 48
 	 * @return \Aimeos\MW\View\Iface View object
49 49
 	 */
50
-	public function create( \Aimeos\MShop\Context\Item\Iface $context, ServerRequestInterface $request,
51
-		ResponseInterface $response, array $attributes, array $templatePaths, $locale = null )
50
+	public function create(\Aimeos\MShop\Context\Item\Iface $context, ServerRequestInterface $request,
51
+		ResponseInterface $response, array $attributes, array $templatePaths, $locale = null)
52 52
 	{
53 53
 		$iface = 'Slim\Views\Twig';
54 54
 		$params = $attributes + (array) $request->getParsedBody() + (array) $request->getQueryParams();
55 55
 
56
-		if( isset( $this->container['view'] ) && $this->container['view'] instanceof $iface )
56
+		if (isset($this->container['view']) && $this->container['view'] instanceof $iface)
57 57
 		{
58 58
 			$twig = $this->container['view']->getEnvironment();
59
-			$engines = array( '.html.twig' => new \Aimeos\MW\View\Engine\Twig( $twig ) );
59
+			$engines = array('.html.twig' => new \Aimeos\MW\View\Engine\Twig($twig));
60 60
 
61
-			$view = new \Aimeos\MW\View\Standard( $templatePaths, $engines );
62
-			$this->initTwig( $view, $twig );
61
+			$view = new \Aimeos\MW\View\Standard($templatePaths, $engines);
62
+			$this->initTwig($view, $twig);
63 63
 		}
64 64
 		else
65 65
 		{
66
-			$view = new \Aimeos\MW\View\Standard( $templatePaths );
66
+			$view = new \Aimeos\MW\View\Standard($templatePaths);
67 67
 		}
68 68
 
69 69
 		$config = $context->getConfig();
70 70
 		$session = $context->getSession();
71 71
 
72
-		$this->addAccess( $view );
73
-		$this->addConfig( $view, $config );
74
-		$this->addCsrf( $view, $request );
75
-		$this->addNumber( $view, $config );
76
-		$this->addParam( $view, $params );
77
-		$this->addRequest( $view, $request );
78
-		$this->addResponse( $view, $response );
79
-		$this->addSession( $view, $session );
80
-		$this->addTranslate( $view, $locale );
81
-		$this->addUrl( $view, $attributes );
72
+		$this->addAccess($view);
73
+		$this->addConfig($view, $config);
74
+		$this->addCsrf($view, $request);
75
+		$this->addNumber($view, $config);
76
+		$this->addParam($view, $params);
77
+		$this->addRequest($view, $request);
78
+		$this->addResponse($view, $response);
79
+		$this->addSession($view, $session);
80
+		$this->addTranslate($view, $locale);
81
+		$this->addUrl($view, $attributes);
82 82
 
83 83
 		return $view;
84 84
 	}
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	 * @param \Aimeos\MW\View\Iface $view View object
91 91
 	 * @return \Aimeos\MW\View\Iface Modified view object
92 92
 	 */
93
-	protected function addAccess( \Aimeos\MW\View\Iface $view )
93
+	protected function addAccess(\Aimeos\MW\View\Iface $view)
94 94
 	{
95
-		$helper = new \Aimeos\MW\View\Helper\Access\All( $view );
96
-		$view->addHelper( 'access', $helper );
95
+		$helper = new \Aimeos\MW\View\Helper\Access\All($view);
96
+		$view->addHelper('access', $helper);
97 97
 
98 98
 		return $view;
99 99
 	}
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
107 107
 	 * @return \Aimeos\MW\View\Iface Modified view object
108 108
 	 */
109
-	protected function addConfig( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
109
+	protected function addConfig(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
110 110
 	{
111
-		$config = new \Aimeos\MW\Config\Decorator\Protect( clone $config, array( 'admin', 'client' ) );
112
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
113
-		$view->addHelper( 'config', $helper );
111
+		$config = new \Aimeos\MW\Config\Decorator\Protect(clone $config, array('admin', 'client'));
112
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
113
+		$view->addHelper('config', $helper);
114 114
 
115 115
 		return $view;
116 116
 	}
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
 	 * @param ServerRequestInterface $request Request object
124 124
 	 * @return \Aimeos\MW\View\Iface Modified view object
125 125
 	 */
126
-	protected function addCsrf( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request )
126
+	protected function addCsrf(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request)
127 127
 	{
128
-		$name = $request->getAttribute( 'csrf_name' );
129
-		$value = $request->getAttribute( 'csrf_value' );
128
+		$name = $request->getAttribute('csrf_name');
129
+		$value = $request->getAttribute('csrf_value');
130 130
 
131
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, $name, $value );
132
-		$view->addHelper( 'csrf', $helper );
131
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, $name, $value);
132
+		$view->addHelper('csrf', $helper);
133 133
 
134 134
 		return $view;
135 135
 	}
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
143 143
 	 * @return \Aimeos\MW\View\Iface Modified view object
144 144
 	 */
145
-	protected function addNumber( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
145
+	protected function addNumber(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
146 146
 	{
147
-		$sepDec = $config->get( 'client/html/common/format/separatorDecimal', '.' );
148
-		$sep1000 = $config->get( 'client/html/common/format/separator1000', ' ' );
149
-		$decimals = $config->get( 'client/html/common/format/decimals', 2 );
147
+		$sepDec = $config->get('client/html/common/format/separatorDecimal', '.');
148
+		$sep1000 = $config->get('client/html/common/format/separator1000', ' ');
149
+		$decimals = $config->get('client/html/common/format/decimals', 2);
150 150
 
151
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000, $decimals );
152
-		$view->addHelper( 'number', $helper );
151
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000, $decimals);
152
+		$view->addHelper('number', $helper);
153 153
 
154 154
 		return $view;
155 155
 	}
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 	 * @param array $attributes Associative list of request parameters
163 163
 	 * @return \Aimeos\MW\View\Iface Modified view object
164 164
 	 */
165
-	protected static function addParam( \Aimeos\MW\View\Iface $view, array $params )
165
+	protected static function addParam(\Aimeos\MW\View\Iface $view, array $params)
166 166
 	{
167
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
168
-		$view->addHelper( 'param', $helper );
167
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
168
+		$view->addHelper('param', $helper);
169 169
 
170 170
 		return $view;
171 171
 	}
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 	 * @param ServerRequestInterface $request Request object
179 179
 	 * @return \Aimeos\MW\View\Iface Modified view object
180 180
 	 */
181
-	protected static function addRequest( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request )
181
+	protected static function addRequest(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request)
182 182
 	{
183
-		$helper = new \Aimeos\MW\View\Helper\Request\Slim( $view, $request );
184
-		$view->addHelper( 'request', $helper );
183
+		$helper = new \Aimeos\MW\View\Helper\Request\Slim($view, $request);
184
+		$view->addHelper('request', $helper);
185 185
 
186 186
 		return $view;
187 187
 	}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 	 * @param ResponseInterface $response Response object
195 195
 	 * @return \Aimeos\MW\View\Iface Modified view object
196 196
 	 */
197
-	protected static function addResponse( \Aimeos\MW\View\Iface $view, ResponseInterface $response )
197
+	protected static function addResponse(\Aimeos\MW\View\Iface $view, ResponseInterface $response)
198 198
 	{
199
-		$helper = new \Aimeos\MW\View\Helper\Response\Slim( $view, $response );
200
-		$view->addHelper( 'response', $helper );
199
+		$helper = new \Aimeos\MW\View\Helper\Response\Slim($view, $response);
200
+		$view->addHelper('response', $helper);
201 201
 
202 202
 		return $view;
203 203
 	}
@@ -210,10 +210,10 @@  discard block
 block discarded – undo
210 210
 	 * @param \Aimeos\MW\Session\Iface $session Session object
211 211
 	 * @return \Aimeos\MW\View\Iface Modified view object
212 212
 	 */
213
-	protected function addSession( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Session\Iface $session )
213
+	protected function addSession(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Session\Iface $session)
214 214
 	{
215
-		$helper = new \Aimeos\MW\View\Helper\Session\Standard( $view, $session );
216
-		$view->addHelper( 'session', $helper );
215
+		$helper = new \Aimeos\MW\View\Helper\Session\Standard($view, $session);
216
+		$view->addHelper('session', $helper);
217 217
 
218 218
 		return $view;
219 219
 	}
@@ -226,20 +226,20 @@  discard block
 block discarded – undo
226 226
 	 * @param string|null $locale ISO language code, e.g. "de" or "de_CH"
227 227
 	 * @return \Aimeos\MW\View\Iface Modified view object
228 228
 	 */
229
-	protected function addTranslate( \Aimeos\MW\View\Iface $view, $locale )
229
+	protected function addTranslate(\Aimeos\MW\View\Iface $view, $locale)
230 230
 	{
231
-		if( $locale !== null )
231
+		if ($locale !== null)
232 232
 		{
233
-			$i18n = $this->container->get( 'aimeos_i18n' )->get( array( $locale ) );
233
+			$i18n = $this->container->get('aimeos_i18n')->get(array($locale));
234 234
 			$translation = $i18n[$locale];
235 235
 		}
236 236
 		else
237 237
 		{
238
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
238
+			$translation = new \Aimeos\MW\Translation\None('en');
239 239
 		}
240 240
 
241
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
242
-		$view->addHelper( 'translate', $helper );
241
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
242
+		$view->addHelper('translate', $helper);
243 243
 
244 244
 		return $view;
245 245
 	}
@@ -252,24 +252,24 @@  discard block
 block discarded – undo
252 252
 	 * @param array $attributes Associative list of URI parameters
253 253
 	 * @return \Aimeos\MW\View\Iface Modified view object
254 254
 	 */
255
-	protected function addUrl( \Aimeos\MW\View\Iface $view, array $attributes )
255
+	protected function addUrl(\Aimeos\MW\View\Iface $view, array $attributes)
256 256
 	{
257 257
 		$fixed = array();
258 258
 
259
-		if( isset( $attributes['site'] ) ) {
259
+		if (isset($attributes['site'])) {
260 260
 			$fixed['site'] = $attributes['site'];
261 261
 		}
262 262
 
263
-		if( isset( $attributes['locale'] ) ) {
263
+		if (isset($attributes['locale'])) {
264 264
 			$fixed['locale'] = $attributes['locale'];
265 265
 		}
266 266
 
267
-		if( isset( $attributes['currency'] ) ) {
267
+		if (isset($attributes['currency'])) {
268 268
 			$fixed['currency'] = $attributes['currency'];
269 269
 		}
270 270
 
271
-		$helper = new \Aimeos\MW\View\Helper\Url\Slim( $view, $this->container->get( 'router' ), $fixed );
272
-		$view->addHelper( 'url', $helper );
271
+		$helper = new \Aimeos\MW\View\Helper\Url\Slim($view, $this->container->get('router'), $fixed);
272
+		$view->addHelper('url', $helper);
273 273
 
274 274
 		return $view;
275 275
 	}
@@ -281,21 +281,21 @@  discard block
 block discarded – undo
281 281
 	 * @param \Aimeos\MW\View\Iface $view View object
282 282
 	 * @param \Twig_Environment $twig Twig environment object
283 283
 	 */
284
-	protected function initTwig( \Aimeos\MW\View\Iface $view, \Twig_Environment $twig )
284
+	protected function initTwig(\Aimeos\MW\View\Iface $view, \Twig_Environment $twig)
285 285
 	{
286
-		$fcn = function( $key, $default = null ) use ( $view ) {
287
-			return $view->config( $key, $default );
286
+		$fcn = function($key, $default = null) use ($view) {
287
+			return $view->config($key, $default);
288 288
 		};
289
-		$twig->addFunction( new \Twig_SimpleFunction( 'aiconfig', $fcn ) );
289
+		$twig->addFunction(new \Twig_SimpleFunction('aiconfig', $fcn));
290 290
 
291
-		$fcn = function( $singular, array $values = array(), $domain = 'client' ) use ( $view ) {
292
-			return vsprintf( $view->translate( $domain, $singular ), $values );
291
+		$fcn = function($singular, array $values = array(), $domain = 'client') use ($view) {
292
+			return vsprintf($view->translate($domain, $singular), $values);
293 293
 		};
294
-		$twig->addFunction( new \Twig_SimpleFunction( 'aitrans', $fcn ) );
294
+		$twig->addFunction(new \Twig_SimpleFunction('aitrans', $fcn));
295 295
 
296
-		$fcn = function( $singular, $plural, $number, array $values = array(), $domain = 'client' ) use ( $view ) {
297
-			return vsprintf( $view->translate( $domain, $singular, $plural, $number ), $values );
296
+		$fcn = function($singular, $plural, $number, array $values = array(), $domain = 'client') use ($view) {
297
+			return vsprintf($view->translate($domain, $singular, $plural, $number), $values);
298 298
 		};
299
-		$twig->addFunction( new \Twig_SimpleFunction( 'aitransplural', $fcn ) );
299
+		$twig->addFunction(new \Twig_SimpleFunction('aitransplural', $fcn));
300 300
 	}
301 301
 }
Please login to merge, or discard this patch.
src/aimeos-routes.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -1,198 +1,198 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-$app->group( $config( 'routes/admin', '/admin' ), function() use ( $config ) {
4
+$app->group($config('routes/admin', '/admin'), function() use ($config) {
5 5
 
6
-	$this->map(['GET', 'POST'], '', function( $request, $response, $args ) use ( $config ) {
7
-		return $response->withHeader( 'Location', $config( 'routes/jqadm', '/admin/default/jqadm' ) . '/search/dashboard' );
8
-	})->setName( 'aimeos_shop_admin' );
6
+	$this->map(['GET', 'POST'], '', function($request, $response, $args) use ($config) {
7
+		return $response->withHeader('Location', $config('routes/jqadm', '/admin/default/jqadm').'/search/dashboard');
8
+	})->setName('aimeos_shop_admin');
9 9
 
10 10
 });
11 11
 
12 12
 
13
-$app->group( $config( 'routes/extadm', '/admin/{site}/extadm' ), function() use ( $config ) {
13
+$app->group($config('routes/extadm', '/admin/{site}/extadm'), function() use ($config) {
14 14
 
15
-	$this->map(['GET'], '/file', function( $request, $response, $args ) {
16
-		return \Aimeos\Slim\Controller\Extadm::fileAction( $this, $request, $response, $args );
17
-	})->setName( 'aimeos_shop_extadm_file' );
15
+	$this->map(['GET'], '/file', function($request, $response, $args) {
16
+		return \Aimeos\Slim\Controller\Extadm::fileAction($this, $request, $response, $args);
17
+	})->setName('aimeos_shop_extadm_file');
18 18
 
19
-	$this->map(['POST'], '/do', function( $request, $response, $args ) {
20
-		return \Aimeos\Slim\Controller\Extadm::doAction( $this, $request, $response, $args );
21
-	})->setName( 'aimeos_shop_extadm_json' );
19
+	$this->map(['POST'], '/do', function($request, $response, $args) {
20
+		return \Aimeos\Slim\Controller\Extadm::doAction($this, $request, $response, $args);
21
+	})->setName('aimeos_shop_extadm_json');
22 22
 
23
-	$this->map(['GET'], '[/{lang}[/{tab:[0-9]+}]]', function( $request, $response, $args ) {
24
-		return \Aimeos\Slim\Controller\Extadm::indexAction( $this, $request, $response, $args );
25
-	})->setName( 'aimeos_shop_extadm' );
23
+	$this->map(['GET'], '[/{lang}[/{tab:[0-9]+}]]', function($request, $response, $args) {
24
+		return \Aimeos\Slim\Controller\Extadm::indexAction($this, $request, $response, $args);
25
+	})->setName('aimeos_shop_extadm');
26 26
 
27 27
 });
28 28
 
29 29
 
30
-$app->group( $config( 'routes/jqadm', '/admin/{site}/jqadm' ), function() use ( $config ) {
30
+$app->group($config('routes/jqadm', '/admin/{site}/jqadm'), function() use ($config) {
31 31
 
32
-	$this->map(['GET'], '/file/{type}', function( $request, $response, $args ) {
33
-		return \Aimeos\Slim\Controller\Jqadm::fileAction( $this, $request, $response, $args );
34
-	})->setName( 'aimeos_shop_jqadm_file' );
32
+	$this->map(['GET'], '/file/{type}', function($request, $response, $args) {
33
+		return \Aimeos\Slim\Controller\Jqadm::fileAction($this, $request, $response, $args);
34
+	})->setName('aimeos_shop_jqadm_file');
35 35
 
36
-	$this->map(['GET', 'POST'], '/copy/{resource}/{id}', function( $request, $response, $args ) {
37
-		return \Aimeos\Slim\Controller\Jqadm::copyAction( $this, $request, $response, $args );
38
-	})->setName( 'aimeos_shop_jqadm_copy' );
36
+	$this->map(['GET', 'POST'], '/copy/{resource}/{id}', function($request, $response, $args) {
37
+		return \Aimeos\Slim\Controller\Jqadm::copyAction($this, $request, $response, $args);
38
+	})->setName('aimeos_shop_jqadm_copy');
39 39
 
40
-	$this->map(['GET', 'POST'], '/create/{resource}', function( $request, $response, $args ) {
41
-		return \Aimeos\Slim\Controller\Jqadm::createAction( $this, $request, $response, $args );
42
-	})->setName( 'aimeos_shop_jqadm_create' );
40
+	$this->map(['GET', 'POST'], '/create/{resource}', function($request, $response, $args) {
41
+		return \Aimeos\Slim\Controller\Jqadm::createAction($this, $request, $response, $args);
42
+	})->setName('aimeos_shop_jqadm_create');
43 43
 
44
-	$this->map(['GET', 'POST'], '/delete/{resource}/{id}', function( $request, $response, $args ) {
45
-		return \Aimeos\Slim\Controller\Jqadm::deleteAction( $this, $request, $response, $args );
46
-	})->setName( 'aimeos_shop_jqadm_delete' );
44
+	$this->map(['GET', 'POST'], '/delete/{resource}/{id}', function($request, $response, $args) {
45
+		return \Aimeos\Slim\Controller\Jqadm::deleteAction($this, $request, $response, $args);
46
+	})->setName('aimeos_shop_jqadm_delete');
47 47
 
48
-	$this->map(['GET'], '/get/{resource}/{id}', function( $request, $response, $args ) {
49
-		return \Aimeos\Slim\Controller\Jqadm::getAction( $this, $request, $response, $args );
50
-	})->setName( 'aimeos_shop_jqadm_get' );
48
+	$this->map(['GET'], '/get/{resource}/{id}', function($request, $response, $args) {
49
+		return \Aimeos\Slim\Controller\Jqadm::getAction($this, $request, $response, $args);
50
+	})->setName('aimeos_shop_jqadm_get');
51 51
 
52
-	$this->map(['POST'], '/save/{resource}[/{id}]', function( $request, $response, $args ) {
53
-		return \Aimeos\Slim\Controller\Jqadm::saveAction( $this, $request, $response, $args );
54
-	})->setName( 'aimeos_shop_jqadm_save' );
52
+	$this->map(['POST'], '/save/{resource}[/{id}]', function($request, $response, $args) {
53
+		return \Aimeos\Slim\Controller\Jqadm::saveAction($this, $request, $response, $args);
54
+	})->setName('aimeos_shop_jqadm_save');
55 55
 
56
-	$this->map(['GET', 'POST'], '/search/{resource}', function( $request, $response, $args ) {
57
-		return \Aimeos\Slim\Controller\Jqadm::searchAction( $this, $request, $response, $args );
58
-	})->setName( 'aimeos_shop_jqadm_search' );
56
+	$this->map(['GET', 'POST'], '/search/{resource}', function($request, $response, $args) {
57
+		return \Aimeos\Slim\Controller\Jqadm::searchAction($this, $request, $response, $args);
58
+	})->setName('aimeos_shop_jqadm_search');
59 59
 
60 60
 });
61 61
 
62 62
 
63
-$app->group( $config( 'routes/jsonadm', '/admin/{site}/jsonadm' ), function() use ( $config ) {
63
+$app->group($config('routes/jsonadm', '/admin/{site}/jsonadm'), function() use ($config) {
64 64
 
65
-	$this->map(['DELETE'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) {
66
-		return \Aimeos\Slim\Controller\Jsonadm::deleteAction( $this, $request, $response, $args );
67
-	})->setName( 'aimeos_shop_jsonadm_delete' );
65
+	$this->map(['DELETE'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) {
66
+		return \Aimeos\Slim\Controller\Jsonadm::deleteAction($this, $request, $response, $args);
67
+	})->setName('aimeos_shop_jsonadm_delete');
68 68
 
69
-	$this->map(['GET'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) {
70
-		return \Aimeos\Slim\Controller\Jsonadm::getAction( $this, $request, $response, $args );
71
-	})->setName( 'aimeos_shop_jsonadm_get' );
69
+	$this->map(['GET'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) {
70
+		return \Aimeos\Slim\Controller\Jsonadm::getAction($this, $request, $response, $args);
71
+	})->setName('aimeos_shop_jsonadm_get');
72 72
 
73
-	$this->map(['PATCH'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) {
74
-		return \Aimeos\Slim\Controller\Jsonadm::patchAction( $this, $request, $response, $args );
75
-	})->setName( 'aimeos_shop_jsonadm_patch' );
73
+	$this->map(['PATCH'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) {
74
+		return \Aimeos\Slim\Controller\Jsonadm::patchAction($this, $request, $response, $args);
75
+	})->setName('aimeos_shop_jsonadm_patch');
76 76
 
77
-	$this->map(['POST'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) {
78
-		return \Aimeos\Slim\Controller\Jsonadm::postAction( $this, $request, $response, $args );
79
-	})->setName( 'aimeos_shop_jsonadm_post' );
77
+	$this->map(['POST'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) {
78
+		return \Aimeos\Slim\Controller\Jsonadm::postAction($this, $request, $response, $args);
79
+	})->setName('aimeos_shop_jsonadm_post');
80 80
 
81
-	$this->map(['PUT'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) {
82
-		return \Aimeos\Slim\Controller\Jsonadm::putAction( $this, $request, $response, $args );
83
-	})->setName( 'aimeos_shop_jsonadm_put' );
81
+	$this->map(['PUT'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) {
82
+		return \Aimeos\Slim\Controller\Jsonadm::putAction($this, $request, $response, $args);
83
+	})->setName('aimeos_shop_jsonadm_put');
84 84
 
85
-	$this->map(['OPTIONS'], '/[{resource}]', function( $request, $response, $args ) {
86
-		return \Aimeos\Slim\Controller\Jsonadm::optionsAction( $this, $request, $response, $args );
87
-	})->setName( 'aimeos_shop_jsonadm_options' );
85
+	$this->map(['OPTIONS'], '/[{resource}]', function($request, $response, $args) {
86
+		return \Aimeos\Slim\Controller\Jsonadm::optionsAction($this, $request, $response, $args);
87
+	})->setName('aimeos_shop_jsonadm_options');
88 88
 
89 89
 });
90 90
 
91 91
 
92
-$app->group( $config( 'routes/jsonapi', '/jsonapi' ), function() use ( $config ) {
92
+$app->group($config('routes/jsonapi', '/jsonapi'), function() use ($config) {
93 93
 
94
-	$this->map(['DELETE'], '/{resource}', function( $request, $response, $args ) {
95
-		return \Aimeos\Slim\Controller\Jsonapi::deleteAction( $this, $request, $response, $args );
96
-	})->setName( 'aimeos_shop_jsonapi_delete' );
94
+	$this->map(['DELETE'], '/{resource}', function($request, $response, $args) {
95
+		return \Aimeos\Slim\Controller\Jsonapi::deleteAction($this, $request, $response, $args);
96
+	})->setName('aimeos_shop_jsonapi_delete');
97 97
 
98
-	$this->map(['GET'], '/{resource}', function( $request, $response, $args ) {
99
-		return \Aimeos\Slim\Controller\Jsonapi::getAction( $this, $request, $response, $args );
100
-	})->setName( 'aimeos_shop_jsonapi_get' );
98
+	$this->map(['GET'], '/{resource}', function($request, $response, $args) {
99
+		return \Aimeos\Slim\Controller\Jsonapi::getAction($this, $request, $response, $args);
100
+	})->setName('aimeos_shop_jsonapi_get');
101 101
 
102
-	$this->map(['PATCH'], '/{resource}', function( $request, $response, $args ) {
103
-		return \Aimeos\Slim\Controller\Jsonapi::patchAction( $this, $request, $response, $args );
104
-	})->setName( 'aimeos_shop_jsonapi_patch' );
102
+	$this->map(['PATCH'], '/{resource}', function($request, $response, $args) {
103
+		return \Aimeos\Slim\Controller\Jsonapi::patchAction($this, $request, $response, $args);
104
+	})->setName('aimeos_shop_jsonapi_patch');
105 105
 
106
-	$this->map(['POST'], '/{resource}', function( $request, $response, $args ) {
107
-		return \Aimeos\Slim\Controller\Jsonapi::postAction( $this, $request, $response, $args );
108
-	})->setName( 'aimeos_shop_jsonapi_post' );
106
+	$this->map(['POST'], '/{resource}', function($request, $response, $args) {
107
+		return \Aimeos\Slim\Controller\Jsonapi::postAction($this, $request, $response, $args);
108
+	})->setName('aimeos_shop_jsonapi_post');
109 109
 
110
-	$this->map(['PUT'], '/{resource}', function( $request, $response, $args ) {
111
-		return \Aimeos\Slim\Controller\Jsonapi::putAction( $this, $request, $response, $args );
112
-	})->setName( 'aimeos_shop_jsonapi_put' );
110
+	$this->map(['PUT'], '/{resource}', function($request, $response, $args) {
111
+		return \Aimeos\Slim\Controller\Jsonapi::putAction($this, $request, $response, $args);
112
+	})->setName('aimeos_shop_jsonapi_put');
113 113
 
114
-	$this->map(['OPTIONS'], '/[{resource}]', function( $request, $response, $args ) {
115
-		return \Aimeos\Slim\Controller\Jsonapi::optionsAction( $this, $request, $response, $args );
116
-	})->setName( 'aimeos_shop_jsonapi_options' );
114
+	$this->map(['OPTIONS'], '/[{resource}]', function($request, $response, $args) {
115
+		return \Aimeos\Slim\Controller\Jsonapi::optionsAction($this, $request, $response, $args);
116
+	})->setName('aimeos_shop_jsonapi_options');
117 117
 
118 118
 });
119 119
 
120 120
 
121
-$app->group( $config( 'routes/account', '' ), function() {
121
+$app->group($config('routes/account', ''), function() {
122 122
 
123
-	$this->map(['GET', 'POST'], '/myaccount', function( $request, $response, $args ) {
124
-		return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args );
125
-	})->setName( 'aimeos_shop_account' );
123
+	$this->map(['GET', 'POST'], '/myaccount', function($request, $response, $args) {
124
+		return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args);
125
+	})->setName('aimeos_shop_account');
126 126
 
127
-	$this->map(['GET', 'POST'], '/myaccount/favorite[/{fav_action}/{fav_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function( $request, $response, $args ) {
128
-		return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args );
129
-	})->setName( 'aimeos_shop_account_favorite' );
127
+	$this->map(['GET', 'POST'], '/myaccount/favorite[/{fav_action}/{fav_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function($request, $response, $args) {
128
+		return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args);
129
+	})->setName('aimeos_shop_account_favorite');
130 130
 
131
-	$this->map(['GET', 'POST'], '/myaccount/watch[/{wat_action}/{wat_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function( $request, $response, $args ) {
132
-		return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args );
133
-	})->setName( 'aimeos_shop_account_watch' );
131
+	$this->map(['GET', 'POST'], '/myaccount/watch[/{wat_action}/{wat_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function($request, $response, $args) {
132
+		return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args);
133
+	})->setName('aimeos_shop_account_watch');
134 134
 
135
-	$this->map(['GET', 'POST'], '/myaccount/download/{dl_id}', function( $request, $response, $args ) {
136
-		return \Aimeos\Slim\Controller\Account::downloadAction( $this, $request, $response, $args );
137
-	})->setName( 'aimeos_shop_account_download' );
135
+	$this->map(['GET', 'POST'], '/myaccount/download/{dl_id}', function($request, $response, $args) {
136
+		return \Aimeos\Slim\Controller\Account::downloadAction($this, $request, $response, $args);
137
+	})->setName('aimeos_shop_account_download');
138 138
 
139 139
 });
140 140
 
141 141
 
142
-$app->group( $config( 'routes/default', '' ), function() {
142
+$app->group($config('routes/default', ''), function() {
143 143
 
144
-	$this->map(['GET', 'POST'], '/count', function( $request, $response, $args ) {
145
-		return \Aimeos\Slim\Controller\Catalog::countAction( $this, $request, $response, $args );
146
-	})->setName( 'aimeos_shop_count' );
144
+	$this->map(['GET', 'POST'], '/count', function($request, $response, $args) {
145
+		return \Aimeos\Slim\Controller\Catalog::countAction($this, $request, $response, $args);
146
+	})->setName('aimeos_shop_count');
147 147
 
148
-	$this->map(['GET', 'POST'], '/detail/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]', function( $request, $response, $args ) {
149
-		return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args );
150
-	})->setName( 'aimeos_shop_detail' );
148
+	$this->map(['GET', 'POST'], '/detail/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]', function($request, $response, $args) {
149
+		return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args);
150
+	})->setName('aimeos_shop_detail');
151 151
 
152
-	$this->map(['GET', 'POST'], '/detail/pin[/{pin_action}/{pin_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function( $request, $response, $args ) {
153
-		return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args );
154
-	})->setName( 'aimeos_shop_session_pinned' );
152
+	$this->map(['GET', 'POST'], '/detail/pin[/{pin_action}/{pin_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function($request, $response, $args) {
153
+		return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args);
154
+	})->setName('aimeos_shop_session_pinned');
155 155
 
156
-	$this->map(['GET', 'POST'], '/list[/{f_catid:[0-9]+}[/{f_name}]]', function( $request, $response, $args ) {
157
-		return \Aimeos\Slim\Controller\Catalog::listAction( $this, $request, $response, $args );
158
-	})->setName( 'aimeos_shop_list' );
156
+	$this->map(['GET', 'POST'], '/list[/{f_catid:[0-9]+}[/{f_name}]]', function($request, $response, $args) {
157
+		return \Aimeos\Slim\Controller\Catalog::listAction($this, $request, $response, $args);
158
+	})->setName('aimeos_shop_list');
159 159
 
160
-	$this->map(['GET', 'POST'], '/suggest', function( $request, $response, $args ) {
161
-		return \Aimeos\Slim\Controller\Catalog::suggestAction( $this, $request, $response, $args );
162
-	})->setName( 'aimeos_shop_suggest' );
160
+	$this->map(['GET', 'POST'], '/suggest', function($request, $response, $args) {
161
+		return \Aimeos\Slim\Controller\Catalog::suggestAction($this, $request, $response, $args);
162
+	})->setName('aimeos_shop_suggest');
163 163
 
164
-	$this->map(['GET', 'POST'], '/stock', function( $request, $response, $args ) {
165
-		return \Aimeos\Slim\Controller\Catalog::stockAction( $this, $request, $response, $args );
166
-	})->setName( 'aimeos_shop_stock' );
164
+	$this->map(['GET', 'POST'], '/stock', function($request, $response, $args) {
165
+		return \Aimeos\Slim\Controller\Catalog::stockAction($this, $request, $response, $args);
166
+	})->setName('aimeos_shop_stock');
167 167
 
168
-	$this->map(['GET', 'POST'], '/basket', function( $request, $response, $args ) {
169
-		return \Aimeos\Slim\Controller\Basket::indexAction( $this, $request, $response, $args );
170
-	})->setName( 'aimeos_shop_basket' );
168
+	$this->map(['GET', 'POST'], '/basket', function($request, $response, $args) {
169
+		return \Aimeos\Slim\Controller\Basket::indexAction($this, $request, $response, $args);
170
+	})->setName('aimeos_shop_basket');
171 171
 
172
-	$this->map(['GET', 'POST'], '/checkout[/{c_step}]', function( $request, $response, $args ) {
173
-		return \Aimeos\Slim\Controller\Checkout::indexAction( $this, $request, $response, $args );
174
-	})->setName( 'aimeos_shop_checkout' );
172
+	$this->map(['GET', 'POST'], '/checkout[/{c_step}]', function($request, $response, $args) {
173
+		return \Aimeos\Slim\Controller\Checkout::indexAction($this, $request, $response, $args);
174
+	})->setName('aimeos_shop_checkout');
175 175
 
176
-	$this->map(['GET', 'POST'], '/confirm[/{code}]', function( $request, $response, $args ) {
177
-		return \Aimeos\Slim\Controller\Checkout::confirmAction( $this, $request, $response, $args );
178
-	})->setName( 'aimeos_shop_confirm' );
176
+	$this->map(['GET', 'POST'], '/confirm[/{code}]', function($request, $response, $args) {
177
+		return \Aimeos\Slim\Controller\Checkout::confirmAction($this, $request, $response, $args);
178
+	})->setName('aimeos_shop_confirm');
179 179
 
180 180
 });
181 181
 
182 182
 
183
-$app->group( $config( 'routes/update', '' ), function() {
183
+$app->group($config('routes/update', ''), function() {
184 184
 
185
-	$this->map(['GET', 'POST'], '/update', function( $request, $response, $args ) {
186
-		return \Aimeos\Slim\Controller\Checkout::updateAction( $this, $request, $response, $args );
187
-	})->setName( 'aimeos_shop_update' );
185
+	$this->map(['GET', 'POST'], '/update', function($request, $response, $args) {
186
+		return \Aimeos\Slim\Controller\Checkout::updateAction($this, $request, $response, $args);
187
+	})->setName('aimeos_shop_update');
188 188
 
189 189
 });
190 190
 
191 191
 
192
-$app->map(['GET', 'POST'], '/terms', function( $request, $response, $args ) {
192
+$app->map(['GET', 'POST'], '/terms', function($request, $response, $args) {
193 193
 	return 'terms';
194
-})->setName( 'aimeos_shop_terms' );
194
+})->setName('aimeos_shop_terms');
195 195
 
196
-$app->map(['GET', 'POST'], '/privacy', function( $request, $response, $args ) {
196
+$app->map(['GET', 'POST'], '/privacy', function($request, $response, $args) {
197 197
 	return 'privacy';
198
-})->setName( 'aimeos_shop_privacy' );
198
+})->setName('aimeos_shop_privacy');
Please login to merge, or discard this patch.
src/Command/Jobs.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -34,28 +34,28 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @param array $argv Associative array from $_SERVER['argv']
36 36
 	 */
37
-	public static function run( array $argv )
37
+	public static function run(array $argv)
38 38
 	{
39
-		array_shift( $argv );
40
-		$options = self::getOptions( $argv );
39
+		array_shift($argv);
40
+		$options = self::getOptions($argv);
41 41
 
42
-		if( ( $jobs = array_shift( $argv ) ) === null ) {
42
+		if (($jobs = array_shift($argv)) === null) {
43 43
 			throw new \Aimeos\Slim\Command\Exception();
44 44
 		}
45
-		$sites = array_shift( $argv );
45
+		$sites = array_shift($argv);
46 46
 
47
-		$config = self::getConfig( $options );
47
+		$config = self::getConfig($options);
48 48
 
49
-		$app = new \Slim\App( $config );
50
-		$aimeos = new \Aimeos\Slim\Bootstrap( $app, $config );
51
-		$aimeos->setup( ( isset( $options['extdir'] ) ? $options['extdir'] : './ext' ) )
52
-			->routes( ( isset( $options['routes'] ) ? $options['routes'] : './src/aimeos-routes.php' ) );
49
+		$app = new \Slim\App($config);
50
+		$aimeos = new \Aimeos\Slim\Bootstrap($app, $config);
51
+		$aimeos->setup((isset($options['extdir']) ? $options['extdir'] : './ext'))
52
+			->routes((isset($options['routes']) ? $options['routes'] : './src/aimeos-routes.php'));
53 53
 
54 54
 		$container = $app->getContainer();
55
-		$context = self::getContext( $container );
55
+		$context = self::getContext($container);
56 56
 
57
-		$siteItems = self::getSiteItems( $context, $sites );
58
-		self::execute( $container->get( 'aimeos' ), $context, $siteItems, $jobs );
57
+		$siteItems = self::getSiteItems($context, $sites);
58
+		self::execute($container->get('aimeos'), $context, $siteItems, $jobs);
59 59
 	}
60 60
 
61 61
 
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
 	 * @param array $options Associative list of given options
66 66
 	 * @return array Multi-dimensional array of configuration settings
67 67
 	 */
68
-	protected static function getConfig( array $options )
68
+	protected static function getConfig(array $options)
69 69
 	{
70 70
 		$config = array();
71 71
 
72
-		if( isset( $options['config'] ) )
72
+		if (isset($options['config']))
73 73
 		{
74
-			foreach( (array) $options['config'] as $path )
74
+			foreach ((array) $options['config'] as $path)
75 75
 			{
76
-				if( is_file( $path ) ) {
77
-					$config = array_replace_recursive( $config, require $path );
76
+				if (is_file($path)) {
77
+					$config = array_replace_recursive($config, require $path);
78 78
 				}
79 79
 			}
80 80
 		}
@@ -89,25 +89,25 @@  discard block
 block discarded – undo
89 89
 	 * @param \Interop\Container\ContainerInterface $container Dependency injection container
90 90
 	 * @return \Aimeos\MShop\Context\Item\Standard Context object
91 91
 	 */
92
-	protected static function getContext( \Interop\Container\ContainerInterface $container )
92
+	protected static function getContext(\Interop\Container\ContainerInterface $container)
93 93
 	{
94
-		$aimeos = $container->get( 'aimeos' );
95
-		$context = $container->get( 'aimeos_context' )->get( false, array(), 'command' );
94
+		$aimeos = $container->get('aimeos');
95
+		$context = $container->get('aimeos_context')->get(false, array(), 'command');
96 96
 
97 97
 		$env = \Slim\Http\Environment::mock();
98
-		$request = \Slim\Http\Request::createFromEnvironment( $env );
98
+		$request = \Slim\Http\Request::createFromEnvironment($env);
99 99
 		$response = new \Slim\Http\Response();
100 100
 
101
-		$tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' );
102
-		$view = $container->get( 'aimeos_view' )->create( $context, $request, $response, array(), $tmplPaths );
101
+		$tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates');
102
+		$view = $container->get('aimeos_view')->create($context, $request, $response, array(), $tmplPaths);
103 103
 
104
-		$langManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' );
105
-		$langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) );
106
-		$i18n = $container->get( 'aimeos_i18n' )->get( $langids );
104
+		$langManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language');
105
+		$langids = array_keys($langManager->searchItems($langManager->createSearch(true)));
106
+		$i18n = $container->get('aimeos_i18n')->get($langids);
107 107
 
108
-		$context->setEditor( 'aimeos:jobs' );
109
-		$context->setView( $view );
110
-		$context->setI18n( $i18n );
108
+		$context->setEditor('aimeos:jobs');
109
+		$context->setView($view);
110
+		$context->setI18n($i18n);
111 111
 
112 112
 		return $context;
113 113
 	}
@@ -120,28 +120,28 @@  discard block
 block discarded – undo
120 120
 	 * @param \Aimeos\MShop\Context\Item\Iface $ctx Context object
121 121
 	 * @param array $siteItems List of site items implementing \Aimeos\MShop\Locale\Site\Iface
122 122
 	 */
123
-	protected static function execute( \Aimeos\Bootstrap $aimeos, \Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems, $jobs )
123
+	protected static function execute(\Aimeos\Bootstrap $aimeos, \Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems, $jobs)
124 124
 	{
125 125
 		$process = $ctx->getProcess();
126
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
126
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
127 127
 
128
-		foreach( $siteItems as $siteItem )
128
+		foreach ($siteItems as $siteItem)
129 129
 		{
130
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false );
131
-			$localeItem->setLanguageId( null );
132
-			$localeItem->setCurrencyId( null );
130
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false);
131
+			$localeItem->setLanguageId(null);
132
+			$localeItem->setCurrencyId(null);
133 133
 
134
-			$ctx->setLocale( $localeItem );
134
+			$ctx->setLocale($localeItem);
135 135
 
136
-			printf( "Executing the Aimeos jobs for \"%s\"\n", $siteItem->getCode() );
136
+			printf("Executing the Aimeos jobs for \"%s\"\n", $siteItem->getCode());
137 137
 
138
-			foreach( (array) explode( ' ', $jobs ) as $jobname )
138
+			foreach ((array) explode(' ', $jobs) as $jobname)
139 139
 			{
140
-				$fcn = function( $ctx, $aimeos, $jobname ) {
141
-					\Aimeos\Controller\Jobs\Factory::createController( $ctx, $aimeos, $jobname )->run();
140
+				$fcn = function($ctx, $aimeos, $jobname) {
141
+					\Aimeos\Controller\Jobs\Factory::createController($ctx, $aimeos, $jobname)->run();
142 142
 				};
143 143
 
144
-				$process->start( $fcn, [$ctx, $aimeos, $jobname], true );
144
+				$process->start($fcn, [$ctx, $aimeos, $jobname], true);
145 145
 			}
146 146
 		}
147 147
 
Please login to merge, or discard this patch.
src/Controller/Jsonadm.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 	 * @param array $args Associative list of route parameters
33 33
 	 * @return ResponseInterface $response Modified response object with generated output
34 34
 	 */
35
-	public static function deleteAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
35
+	public static function deleteAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
36 36
 	{
37
-		return self::createClient( $container, $request, $response, $args )->delete( $request, $response );
37
+		return self::createClient($container, $request, $response, $args)->delete($request, $response);
38 38
 	}
39 39
 
40 40
 
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	 * @param array $args Associative list of route parameters
48 48
 	 * @return ResponseInterface $response Modified response object with generated output
49 49
 	 */
50
-	public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
50
+	public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
51 51
 	{
52
-		return self::createClient( $container, $request, $response, $args )->get( $request, $response );
52
+		return self::createClient($container, $request, $response, $args)->get($request, $response);
53 53
 	}
54 54
 
55 55
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 * @param array $args Associative list of route parameters
63 63
 	 * @return ResponseInterface $response Modified response object with generated output
64 64
 	 */
65
-	public static function patchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
65
+	public static function patchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
66 66
 	{
67
-		return self::createClient( $container, $request, $response, $args )->patch( $request, $response );
67
+		return self::createClient($container, $request, $response, $args)->patch($request, $response);
68 68
 	}
69 69
 
70 70
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 * @param array $args Associative list of route parameters
78 78
 	 * @return ResponseInterface $response Modified response object with generated output
79 79
 	 */
80
-	public static function postAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
80
+	public static function postAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
81 81
 	{
82
-		return self::createClient( $container, $request, $response, $args )->post( $request, $response );
82
+		return self::createClient($container, $request, $response, $args)->post($request, $response);
83 83
 	}
84 84
 
85 85
 
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 	 * @param array $args Associative list of route parameters
93 93
 	 * @return ResponseInterface $response Modified response object with generated output
94 94
 	 */
95
-	public static function putAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
95
+	public static function putAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
96 96
 	{
97
-		return self::createClient( $container, $request, $response, $args )->put( $request, $response );
97
+		return self::createClient($container, $request, $response, $args)->put($request, $response);
98 98
 	}
99 99
 
100 100
 
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 	 * @param array $args Associative list of route parameters
108 108
 	 * @return ResponseInterface $response Modified response object with generated output
109 109
 	 */
110
-	public static function optionsAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
110
+	public static function optionsAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
111 111
 	{
112
-		return self::createClient( $container, $request, $response, $args )->options( $request, $response );
112
+		return self::createClient($container, $request, $response, $args)->options($request, $response);
113 113
 	}
114 114
 
115 115
 
@@ -122,21 +122,21 @@  discard block
 block discarded – undo
122 122
 	 * @param array $args Associative list of route parameters
123 123
 	 * @return \Aimeos\Admin\JsonAdm\Iface JSON admin client
124 124
 	 */
125
-	protected static function createClient( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
125
+	protected static function createClient(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
126 126
 	{
127
-		$resource = ( isset( $args['resource'] ) ? $args['resource'] : null );
128
-		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
129
-		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
127
+		$resource = (isset($args['resource']) ? $args['resource'] : null);
128
+		$site = (isset($args['site']) ? $args['site'] : 'default');
129
+		$lang = (isset($args['lang']) ? $args['lang'] : 'en');
130 130
 
131
-		$templatePaths = $container->get( 'aimeos' )->getCustomPaths( 'admin/jsonadm/templates' );
131
+		$templatePaths = $container->get('aimeos')->getCustomPaths('admin/jsonadm/templates');
132 132
 
133
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
134
-		$context->setI18n( $container->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) );
135
-		$context->setLocale( $container->get( 'aimeos_locale' )->getBackend( $context, $site ) );
133
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
134
+		$context->setI18n($container->get('aimeos_i18n')->get(array($lang, 'en')));
135
+		$context->setLocale($container->get('aimeos_locale')->getBackend($context, $site));
136 136
 
137
-		$view = $container->get( 'aimeos_view' )->create( $context, $request, $response, $args, $templatePaths, $lang );
138
-		$context->setView( $view );
137
+		$view = $container->get('aimeos_view')->create($context, $request, $response, $args, $templatePaths, $lang);
138
+		$context->setView($view);
139 139
 
140
-		return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource );
140
+		return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource);
141 141
 	}
142 142
 }
Please login to merge, or discard this patch.
src/Controller/Extadm.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -32,63 +32,63 @@  discard block
 block discarded – undo
32 32
 	 * @param array $args Associative list of route parameters
33 33
 	 * @return ResponseInterface $response Modified response object with generated output
34 34
 	 */
35
-	public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
35
+	public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
36 36
 	{
37
-		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
38
-		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
39
-		$tab = ( isset( $args['tab'] ) ? $args['tab'] : 0 );
37
+		$site = (isset($args['site']) ? $args['site'] : 'default');
38
+		$lang = (isset($args['lang']) ? $args['lang'] : 'en');
39
+		$tab = (isset($args['tab']) ? $args['tab'] : 0);
40 40
 
41
-		$aimeos = $container->get( 'aimeos' );
42
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
41
+		$aimeos = $container->get('aimeos');
42
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
43 43
 
44
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
45
-		$context = self::setLocale( $context, $site, $lang );
44
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
45
+		$context = self::setLocale($context, $site, $lang);
46 46
 
47
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
47
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
48 48
 		$cssFiles = array();
49 49
 
50
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
50
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
51 51
 		{
52
-			foreach( $paths as $path )
52
+			foreach ($paths as $path)
53 53
 			{
54
-				$jsbAbsPath = $base . '/' . $path;
54
+				$jsbAbsPath = $base.'/'.$path;
55 55
 
56
-				if( !is_file( $jsbAbsPath ) ) {
57
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
56
+				if (!is_file($jsbAbsPath)) {
57
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
58 58
 				}
59 59
 
60
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
61
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
60
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
61
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
62 62
 			}
63 63
 		}
64 64
 
65
-		$csrfname = $request->getAttribute( 'csrf_name' );
66
-		$csrfvalue = $request->getAttribute( 'csrf_value' );
65
+		$csrfname = $request->getAttribute('csrf_name');
66
+		$csrfvalue = $request->getAttribute('csrf_value');
67 67
 
68
-		$router = $container->get( 'router' );
69
-		$jsonUrl = $router->pathFor( 'aimeos_shop_extadm_json', array( 'site' => $site, $csrfname => $csrfvalue ) );
70
-		$jqadmUrl = $router->pathFor( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'lang' => $lang, 'resource' => 'dashboard' ) );
71
-		$adminUrl = $router->pathFor( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) );
68
+		$router = $container->get('router');
69
+		$jsonUrl = $router->pathFor('aimeos_shop_extadm_json', array('site' => $site, $csrfname => $csrfvalue));
70
+		$jqadmUrl = $router->pathFor('aimeos_shop_jqadm_search', array('site' => $site, 'lang' => $lang, 'resource' => 'dashboard'));
71
+		$adminUrl = $router->pathFor('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>'));
72 72
 
73 73
 		$vars = array(
74 74
 			'lang' => $lang,
75 75
 			'cssFiles' => $cssFiles,
76
-			'languages' => self::getJsonLanguages( $aimeos ),
77
-			'config' => self::getJsonClientConfig( $context ),
78
-			'site' => self::getJsonSiteItem( $context, $site ),
79
-			'i18nContent' => self::getJsonClientI18n( $aimeos->getI18nPaths(), $lang ),
80
-			'uploaddir' => $context->getConfig()->get( 'uploaddir', '/' ),
76
+			'languages' => self::getJsonLanguages($aimeos),
77
+			'config' => self::getJsonClientConfig($context),
78
+			'site' => self::getJsonSiteItem($context, $site),
79
+			'i18nContent' => self::getJsonClientI18n($aimeos->getI18nPaths(), $lang),
80
+			'uploaddir' => $context->getConfig()->get('uploaddir', '/'),
81 81
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
82 82
 			'itemSchemas' => $controller->getJsonItemSchemas(),
83
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
84
-			'urlTemplate' => str_replace( ['<', '>'], ['{', '}'], urldecode( $adminUrl ) ),
83
+			'smd' => $controller->getJsonSmd($jsonUrl),
84
+			'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)),
85 85
 			'jqadmurl' => $jqadmUrl,
86 86
 			'activeTab' => $tab,
87 87
 			'version' => \Aimeos\Slim\Bootstrap::getVersion(),
88
-			'extensions' => implode( ',', $aimeos->getExtensions() ),
88
+			'extensions' => implode(',', $aimeos->getExtensions()),
89 89
 		);
90 90
 
91
-		return $container->get( 'view' )->render( $response, 'Extadm/index.html.twig', $vars );
91
+		return $container->get('view')->render($response, 'Extadm/index.html.twig', $vars);
92 92
 	}
93 93
 
94 94
 
@@ -101,22 +101,22 @@  discard block
 block discarded – undo
101 101
 	 * @param array $args Associative list of route parameters
102 102
 	 * @return ResponseInterface $response Modified response object with generated output
103 103
 	 */
104
-	public static function doAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
104
+	public static function doAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
105 105
 	{
106
-		$cntlPaths = $container->get( 'aimeos' )->getCustomPaths( 'controller/extjs' );
106
+		$cntlPaths = $container->get('aimeos')->getCustomPaths('controller/extjs');
107 107
 
108
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
109
-		$context->setView( $container->get( 'aimeos_view' )->create( $context, $request, $response, $args, array() ) );
110
-		$context = self::setLocale( $context );
108
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
109
+		$context->setView($container->get('aimeos_view')->create($context, $request, $response, $args, array()));
110
+		$context = self::setLocale($context);
111 111
 
112 112
 		$params = $request->getQueryParams();
113
-		if( ( $post = $request->getParsedBody() ) !== null ) {
114
-			$params = array_merge( $params, (array) $post );
113
+		if (($post = $request->getParsedBody()) !== null) {
114
+			$params = array_merge($params, (array) $post);
115 115
 		}
116 116
 
117
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
118
-		$output = $controller->process( $params, (string) $request->getBody() );
119
-		$response->getBody()->write( $output );
117
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
118
+		$output = $controller->process($params, (string) $request->getBody());
119
+		$response->getBody()->write($output);
120 120
 
121 121
 		return $response;
122 122
 	}
@@ -131,30 +131,30 @@  discard block
 block discarded – undo
131 131
 	 * @param array $args Associative list of route parameters
132 132
 	 * @return ResponseInterface $response Modified response object with generated output
133 133
 	 */
134
-	public static function fileAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
134
+	public static function fileAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
135 135
 	{
136 136
 		$contents = '';
137 137
 		$jsFiles = array();
138
-		$aimeos = $container->get( 'aimeos' );
138
+		$aimeos = $container->get('aimeos');
139 139
 
140
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
140
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
141 141
 		{
142
-			foreach( $paths as $path )
142
+			foreach ($paths as $path)
143 143
 			{
144
-				$jsbAbsPath = $base . '/' . $path;
145
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
146
-				$jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) );
144
+				$jsbAbsPath = $base.'/'.$path;
145
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
146
+				$jsFiles = array_merge($jsFiles, $jsb2->getFiles('js'));
147 147
 			}
148 148
 		}
149 149
 
150
-		foreach( $jsFiles as $file )
150
+		foreach ($jsFiles as $file)
151 151
 		{
152
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
152
+			if (($content = file_get_contents($file)) !== false) {
153 153
 				$contents .= $content;
154 154
 			}
155 155
 		}
156 156
 
157
-		return $response->withHeader( 'Content-Type', 'application/javascript' )->getBody()->write( $contents );
157
+		return $response->withHeader('Content-Type', 'application/javascript')->getBody()->write($contents);
158 158
 	}
159 159
 
160 160
 
@@ -164,15 +164,15 @@  discard block
 block discarded – undo
164 164
 	 * @param \Aimeos\Bootstrap $aimeos Aimeos object
165 165
 	 * @return array List of language IDs with labels
166 166
 	 */
167
-	protected static function getJsonLanguages( \Aimeos\Bootstrap $aimeos )
167
+	protected static function getJsonLanguages(\Aimeos\Bootstrap $aimeos)
168 168
 	{
169 169
 		$result = array();
170 170
 
171
-		foreach( $aimeos->getI18nList( 'admin' ) as $id ) {
172
-			$result[] = array( 'id' => $id, 'label' => $id );
171
+		foreach ($aimeos->getI18nList('admin') as $id) {
172
+			$result[] = array('id' => $id, 'label' => $id);
173 173
 		}
174 174
 
175
-		return json_encode( $result );
175
+		return json_encode($result);
176 176
 	}
177 177
 
178 178
 
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
183 183
 	 * @return string JSON encoded configuration object
184 184
 	 */
185
-	protected static function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
185
+	protected static function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
186 186
 	{
187
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
188
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
187
+		$config = $context->getConfig()->get('admin/extjs', array());
188
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
189 189
 	}
190 190
 
191 191
 
@@ -196,16 +196,16 @@  discard block
 block discarded – undo
196 196
 	 * @param string $lang ISO language code like "en" or "en_GB"
197 197
 	 * @return string JSON encoded translation object
198 198
 	 */
199
-	protected static function getJsonClientI18n( array $i18nPaths, $lang )
199
+	protected static function getJsonClientI18n(array $i18nPaths, $lang)
200 200
 	{
201
-		$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang );
201
+		$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang);
202 202
 
203 203
 		$content = array(
204
-			'admin' => $i18n->getAll( 'admin' ),
205
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
204
+			'admin' => $i18n->getAll('admin'),
205
+			'admin/ext' => $i18n->getAll('admin/ext'),
206 206
 		);
207 207
 
208
-		return json_encode( $content, JSON_FORCE_OBJECT );
208
+		return json_encode($content, JSON_FORCE_OBJECT);
209 209
 	}
210 210
 
211 211
 
@@ -217,19 +217,19 @@  discard block
 block discarded – undo
217 217
 	 * @return string JSON encoded site item object
218 218
 	 * @throws Exception If no site item was found for the code
219 219
 	 */
220
-	protected static function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
220
+	protected static function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
221 221
 	{
222
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
222
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
223 223
 
224 224
 		$criteria = $manager->createSearch();
225
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
226
-		$items = $manager->searchItems( $criteria );
225
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
226
+		$items = $manager->searchItems($criteria);
227 227
 
228
-		if( ( $item = reset( $items ) ) === false ) {
229
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
228
+		if (($item = reset($items)) === false) {
229
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
230 230
 		}
231 231
 
232
-		return json_encode( $item->toArray() );
232
+		return json_encode($item->toArray());
233 233
 	}
234 234
 
235 235
 
@@ -241,17 +241,17 @@  discard block
 block discarded – undo
241 241
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
242 242
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
243 243
 	 */
244
-	protected static function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
244
+	protected static function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
245 245
 	{
246
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
246
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
247 247
 
248 248
 		try {
249
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
250
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
249
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
250
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
251 251
 			$localeItem = $localeManager->createItem();
252 252
 		}
253 253
 
254
-		$context->setLocale( $localeItem );
254
+		$context->setLocale($localeItem);
255 255
 
256 256
 		return $context;
257 257
 	}
Please login to merge, or discard this patch.
src/Controller/Jsonapi.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 	 * @param array $args Associative list of route parameters
33 33
 	 * @return ResponseInterface $response Modified response object with generated output
34 34
 	 */
35
-	public static function deleteAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
35
+	public static function deleteAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
36 36
 	{
37
-		return self::createClient( $container, $request, $response, $args )->delete( $request, $response );
37
+		return self::createClient($container, $request, $response, $args)->delete($request, $response);
38 38
 	}
39 39
 
40 40
 
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	 * @param array $args Associative list of route parameters
48 48
 	 * @return ResponseInterface $response Modified response object with generated output
49 49
 	 */
50
-	public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
50
+	public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
51 51
 	{
52
-		return self::createClient( $container, $request, $response, $args )->get( $request, $response );
52
+		return self::createClient($container, $request, $response, $args)->get($request, $response);
53 53
 	}
54 54
 
55 55
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 * @param array $args Associative list of route parameters
63 63
 	 * @return ResponseInterface $response Modified response object with generated output
64 64
 	 */
65
-	public static function patchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
65
+	public static function patchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
66 66
 	{
67
-		return self::createClient( $container, $request, $response, $args )->patch( $request, $response );
67
+		return self::createClient($container, $request, $response, $args)->patch($request, $response);
68 68
 	}
69 69
 
70 70
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 * @param array $args Associative list of route parameters
78 78
 	 * @return ResponseInterface $response Modified response object with generated output
79 79
 	 */
80
-	public static function postAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
80
+	public static function postAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
81 81
 	{
82
-		return self::createClient( $container, $request, $response, $args )->post( $request, $response );
82
+		return self::createClient($container, $request, $response, $args)->post($request, $response);
83 83
 	}
84 84
 
85 85
 
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 	 * @param array $args Associative list of route parameters
93 93
 	 * @return ResponseInterface $response Modified response object with generated output
94 94
 	 */
95
-	public static function putAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
95
+	public static function putAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
96 96
 	{
97
-		return self::createClient( $container, $request, $response, $args )->put( $request, $response );
97
+		return self::createClient($container, $request, $response, $args)->put($request, $response);
98 98
 	}
99 99
 
100 100
 
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 	 * @param array $args Associative list of route parameters
108 108
 	 * @return ResponseInterface $response Modified response object with generated output
109 109
 	 */
110
-	public static function optionsAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
110
+	public static function optionsAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
111 111
 	{
112
-		return self::createClient( $container, $request, $response, $args )->options( $request, $response );
112
+		return self::createClient($container, $request, $response, $args)->options($request, $response);
113 113
 	}
114 114
 
115 115
 
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
 	 * @param array $args Associative list of route parameters
123 123
 	 * @return \Aimeos\Client\JsonApi\Iface JSON client controller
124 124
 	 */
125
-	protected static function createClient( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
125
+	protected static function createClient(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
126 126
 	{
127 127
 		$params = $request->getQueryParams();
128
-		$resource = ( isset( $args['resource'] ) ? $args['resource'] : ( isset( $params['resource'] ) ? $params['resource'] : null ) );
129
-		$related = ( isset( $args['related'] ) ? $args['related'] : ( isset( $params['related'] ) ? $params['related'] : null ) );
130
-		$tmplPaths = $container->get( 'aimeos' )->getCustomPaths( 'client/jsonapi/templates' );
128
+		$resource = (isset($args['resource']) ? $args['resource'] : (isset($params['resource']) ? $params['resource'] : null));
129
+		$related = (isset($args['related']) ? $args['related'] : (isset($params['related']) ? $params['related'] : null));
130
+		$tmplPaths = $container->get('aimeos')->getCustomPaths('client/jsonapi/templates');
131 131
 
132
-		$context = $container->get( 'aimeos_context' )->get( true, $args );
132
+		$context = $container->get('aimeos_context')->get(true, $args);
133 133
 		$langid = $context->getLocale()->getLanguageId();
134 134
 
135
-		$view = $container->get( 'aimeos_view' )->create( $context, $request, $response, $args, $tmplPaths, $langid );
136
-		$context->setView( $view );
135
+		$view = $container->get('aimeos_view')->create($context, $request, $response, $args, $tmplPaths, $langid);
136
+		$context->setView($view);
137 137
 
138
-		return \Aimeos\Client\JsonApi\Factory::createClient( $context, $tmplPaths, $resource . '/' . $related );
138
+		return \Aimeos\Client\JsonApi\Factory::createClient($context, $tmplPaths, $resource.'/'.$related);
139 139
 	}
140 140
 }
Please login to merge, or discard this patch.
src/Controller/Jqadm.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -32,36 +32,36 @@  discard block
 block discarded – undo
32 32
 	 * @param array $args Associative list of route parameters
33 33
 	 * @return ResponseInterface $response Modified response object with generated output
34 34
 	 */
35
-	public static function fileAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
35
+	public static function fileAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
36 36
 	{
37 37
 		$contents = '';
38 38
 		$files = array();
39
-		$aimeos = $container->get( 'aimeos' );
40
-		$type = ( isset( $args['type'] ) ? $args['type'] : 'js' );
39
+		$aimeos = $container->get('aimeos');
40
+		$type = (isset($args['type']) ? $args['type'] : 'js');
41 41
 
42
-		foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths )
42
+		foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths)
43 43
 		{
44
-			foreach( $paths as $path )
44
+			foreach ($paths as $path)
45 45
 			{
46
-				$jsbAbsPath = $base . '/' . $path;
47
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
48
-				$files = array_merge( $files, $jsb2->getFiles( $type ) );
46
+				$jsbAbsPath = $base.'/'.$path;
47
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
48
+				$files = array_merge($files, $jsb2->getFiles($type));
49 49
 			}
50 50
 		}
51 51
 
52
-		foreach( $files as $file )
52
+		foreach ($files as $file)
53 53
 		{
54
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
54
+			if (($content = file_get_contents($file)) !== false) {
55 55
 				$contents .= $content;
56 56
 			}
57 57
 		}
58 58
 
59
-		$response->getBody()->write( $contents );
59
+		$response->getBody()->write($contents);
60 60
 
61
-		if( $type === 'js' ) {
62
-			$response = $response->withHeader( 'Content-Type', 'application/javascript' );
63
-		} elseif( $type === 'css' ) {
64
-			$response = $response->withHeader( 'Content-Type', 'text/css' );
61
+		if ($type === 'js') {
62
+			$response = $response->withHeader('Content-Type', 'application/javascript');
63
+		} elseif ($type === 'css') {
64
+			$response = $response->withHeader('Content-Type', 'text/css');
65 65
 		}
66 66
 
67 67
 		return $response;
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 	 * @param array $args Associative list of route parameters
78 78
 	 * @return ResponseInterface $response Modified response object with generated output
79 79
 	 */
80
-	public static function copyAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
80
+	public static function copyAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
81 81
 	{
82
-		$cntl = self::createClient( $container, $request, $response, $args );
83
-		return self::getHtml( $container, $response, $cntl->copy() );
82
+		$cntl = self::createClient($container, $request, $response, $args);
83
+		return self::getHtml($container, $response, $cntl->copy());
84 84
 	}
85 85
 
86 86
 
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 	 * @param array $args Associative list of route parameters
94 94
 	 * @return ResponseInterface $response Modified response object with generated output
95 95
 	 */
96
-	public static function createAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
96
+	public static function createAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
97 97
 	{
98
-		$cntl = self::createClient( $container, $request, $response, $args );
99
-		return self::getHtml( $container, $response, $cntl->create() );
98
+		$cntl = self::createClient($container, $request, $response, $args);
99
+		return self::getHtml($container, $response, $cntl->create());
100 100
 	}
101 101
 
102 102
 
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
 	 * @param array $args Associative list of route parameters
110 110
 	 * @return ResponseInterface $response Modified response object with generated output
111 111
 	 */
112
-	public static function deleteAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
112
+	public static function deleteAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
113 113
 	{
114
-		$cntl = self::createClient( $container, $request, $response, $args );
115
-		return self::getHtml( $container, $response, $cntl->delete() . $cntl->search() );
114
+		$cntl = self::createClient($container, $request, $response, $args);
115
+		return self::getHtml($container, $response, $cntl->delete().$cntl->search());
116 116
 	}
117 117
 
118 118
 
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
 	 * @param array $args Associative list of route parameters
126 126
 	 * @return ResponseInterface $response Modified response object with generated output
127 127
 	 */
128
-	public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
128
+	public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
129 129
 	{
130
-		$cntl = self::createClient( $container, $request, $response, $args );
131
-		return self::getHtml( $container, $response, $cntl->get() );
130
+		$cntl = self::createClient($container, $request, $response, $args);
131
+		return self::getHtml($container, $response, $cntl->get());
132 132
 	}
133 133
 
134 134
 
@@ -141,10 +141,10 @@  discard block
 block discarded – undo
141 141
 	 * @param array $args Associative list of route parameters
142 142
 	 * @return ResponseInterface $response Modified response object with generated output
143 143
 	 */
144
-	public static function saveAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
144
+	public static function saveAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
145 145
 	{
146
-		$cntl = self::createClient( $container, $request, $response, $args );
147
-		return self::getHtml( $container, $response, ( $cntl->save() ? : $cntl->search() ) );
146
+		$cntl = self::createClient($container, $request, $response, $args);
147
+		return self::getHtml($container, $response, ($cntl->save() ?: $cntl->search()));
148 148
 	}
149 149
 
150 150
 
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 	 * @param array $args Associative list of route parameters
158 158
 	 * @return ResponseInterface $response Modified response object with generated output
159 159
 	 */
160
-	public static function searchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
160
+	public static function searchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
161 161
 	{
162
-		$cntl = self::createClient( $container, $request, $response, $args );
163
-		return self::getHtml( $container, $response, $cntl->search() );
162
+		$cntl = self::createClient($container, $request, $response, $args);
163
+		return self::getHtml($container, $response, $cntl->search());
164 164
 	}
165 165
 
166 166
 
@@ -173,24 +173,24 @@  discard block
 block discarded – undo
173 173
 	 * @param array $args Associative list of route parameters
174 174
 	 * @return \Aimeos\Admin\JQAdm\Iface JQAdm client
175 175
 	 */
176
-	protected static function createClient( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
176
+	protected static function createClient(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
177 177
 	{
178
-		$aimeos = $container->get( 'aimeos' );
179
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' );
178
+		$aimeos = $container->get('aimeos');
179
+		$templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates');
180 180
 		$params = $args + (array) $request->getParsedBody() + (array) $request->getQueryParams();
181 181
 
182
-		$resource = ( isset( $params['resource'] ) ? $params['resource'] : null );
183
-		$site = ( isset( $params['site'] ) ? $params['site'] : 'default' );
184
-		$lang = ( isset( $params['lang'] ) ? $params['lang'] : 'en' );
182
+		$resource = (isset($params['resource']) ? $params['resource'] : null);
183
+		$site = (isset($params['site']) ? $params['site'] : 'default');
184
+		$lang = (isset($params['lang']) ? $params['lang'] : 'en');
185 185
 
186
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
187
-		$context->setI18n( $container->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) );
188
-		$context->setLocale( $container->get( 'aimeos_locale' )->getBackend( $context, $site ) );
186
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
187
+		$context->setI18n($container->get('aimeos_i18n')->get(array($lang, 'en')));
188
+		$context->setLocale($container->get('aimeos_locale')->getBackend($context, $site));
189 189
 
190
-		$view = $container->get( 'aimeos_view' )->create( $context, $request, $response, $args, $templatePaths, $lang );
191
-		$context->setView( $view );
190
+		$view = $container->get('aimeos_view')->create($context, $request, $response, $args, $templatePaths, $lang);
191
+		$context->setView($view);
192 192
 
193
-		return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource )->setAimeos( $aimeos );
193
+		return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource)->setAimeos($aimeos);
194 194
 	}
195 195
 
196 196
 
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 	 * @param string $content Content from admin client
203 203
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
204 204
 	 */
205
-	protected static function getHtml( ContainerInterface $container, ResponseInterface $response, $content )
205
+	protected static function getHtml(ContainerInterface $container, ResponseInterface $response, $content)
206 206
 	{
207 207
 		$version = \Aimeos\Slim\Bootstrap::getVersion();
208
-		$extnames = implode( ',', $container->get( 'aimeos' )->getExtensions() );
209
-		$content = str_replace( ['{type}', '{version}', '{extensions}'], ['Slim', $version, $extnames], $content );
208
+		$extnames = implode(',', $container->get('aimeos')->getExtensions());
209
+		$content = str_replace(['{type}', '{version}', '{extensions}'], ['Slim', $version, $extnames], $content);
210 210
 
211
-		return $container->get( 'view' )->render( $response, 'Jqadm/index.html.twig', array( 'content' => $content ) );
211
+		return $container->get('view')->render($response, 'Jqadm/index.html.twig', array('content' => $content));
212 212
 	}
213 213
 }
Please login to merge, or discard this patch.