Completed
Push — master ( ad6ad2...4f1a9d )
by Aimeos
02:36
created
src/Base/View.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,6 @@
 block discarded – undo
143 143
 	 * Adds the "param" helper to the view object
144 144
 	 *
145 145
 	 * @param \Aimeos\MW\View\Iface $view View object
146
-	 * @param array $attributes Associative list of request parameters
147 146
 	 * @return \Aimeos\MW\View\Iface Modified view object
148 147
 	 */
149 148
 	protected static function addParam( \Aimeos\MW\View\Iface $view, array $params )
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 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,22 +47,22 @@  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\MW\Config\Iface $config, ServerRequestInterface $request,
51
-		ResponseInterface $response, array $attributes, array $templatePaths, $locale = null )
50
+	public function create(\Aimeos\MW\Config\Iface $config, ServerRequestInterface $request,
51
+		ResponseInterface $response, array $attributes, array $templatePaths, $locale = null)
52 52
 	{
53 53
 		$params = $attributes + (array) $request->getParsedBody() + (array) $request->getQueryParams();
54 54
 
55
-		$view = new \Aimeos\MW\View\Standard( $templatePaths );
55
+		$view = new \Aimeos\MW\View\Standard($templatePaths);
56 56
 
57
-		$this->addAccess( $view );
58
-		$this->addConfig( $view, $config );
59
-		$this->addNumber( $view, $config );
60
-		$this->addRequest( $view, $request );
61
-		$this->addResponse( $view, $response );
62
-		$this->addParam( $view, $params );
63
-		$this->addUrl( $view, $attributes );
64
-		$this->addCsrf( $view, $request );
65
-		$this->addTranslate( $view, $config, $locale );
57
+		$this->addAccess($view);
58
+		$this->addConfig($view, $config);
59
+		$this->addNumber($view, $config);
60
+		$this->addRequest($view, $request);
61
+		$this->addResponse($view, $response);
62
+		$this->addParam($view, $params);
63
+		$this->addUrl($view, $attributes);
64
+		$this->addCsrf($view, $request);
65
+		$this->addTranslate($view, $config, $locale);
66 66
 
67 67
 		return $view;
68 68
 	}
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 	 * @param \Aimeos\MW\View\Iface $view View object
75 75
 	 * @return \Aimeos\MW\View\Iface Modified view object
76 76
 	 */
77
-	protected function addAccess( \Aimeos\MW\View\Iface $view )
77
+	protected function addAccess(\Aimeos\MW\View\Iface $view)
78 78
 	{
79
-		$helper = new \Aimeos\MW\View\Helper\Access\All( $view );
80
-		$view->addHelper( 'access', $helper );
79
+		$helper = new \Aimeos\MW\View\Helper\Access\All($view);
80
+		$view->addHelper('access', $helper);
81 81
 
82 82
 		return $view;
83 83
 	}
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
91 91
 	 * @return \Aimeos\MW\View\Iface Modified view object
92 92
 	 */
93
-	protected function addConfig( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
93
+	protected function addConfig(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
94 94
 	{
95
-		$config = new \Aimeos\MW\Config\Decorator\Protect( clone $config, array( 'admin', 'client' ) );
96
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
97
-		$view->addHelper( 'config', $helper );
95
+		$config = new \Aimeos\MW\Config\Decorator\Protect(clone $config, array('admin', 'client'));
96
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
97
+		$view->addHelper('config', $helper);
98 98
 
99 99
 		return $view;
100 100
 	}
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
 	 * @param ServerRequestInterface $request Request object
108 108
 	 * @return \Aimeos\MW\View\Iface Modified view object
109 109
 	 */
110
-	protected function addCsrf( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request )
110
+	protected function addCsrf(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request)
111 111
 	{
112
-		$name = $request->getAttribute( 'csrf_name' );
113
-		$value = $request->getAttribute( 'csrf_value' );
112
+		$name = $request->getAttribute('csrf_name');
113
+		$value = $request->getAttribute('csrf_value');
114 114
 
115
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, $name, $value );
116
-		$view->addHelper( 'csrf', $helper );
115
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, $name, $value);
116
+		$view->addHelper('csrf', $helper);
117 117
 
118 118
 		return $view;
119 119
 	}
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
127 127
 	 * @return \Aimeos\MW\View\Iface Modified view object
128 128
 	 */
129
-	protected function addNumber( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
129
+	protected function addNumber(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
130 130
 	{
131
-		$sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' );
132
-		$sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' );
133
-		$decimals = $config->get( 'client/html/common/format/decimals', 2 );
131
+		$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
132
+		$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
133
+		$decimals = $config->get('client/html/common/format/decimals', 2);
134 134
 
135
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000, $decimals );
136
-		$view->addHelper( 'number', $helper );
135
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000, $decimals);
136
+		$view->addHelper('number', $helper);
137 137
 
138 138
 		return $view;
139 139
 	}
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 	 * @param array $attributes Associative list of request parameters
147 147
 	 * @return \Aimeos\MW\View\Iface Modified view object
148 148
 	 */
149
-	protected static function addParam( \Aimeos\MW\View\Iface $view, array $params )
149
+	protected static function addParam(\Aimeos\MW\View\Iface $view, array $params)
150 150
 	{
151
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
152
-		$view->addHelper( 'param', $helper );
151
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
152
+		$view->addHelper('param', $helper);
153 153
 
154 154
 		return $view;
155 155
 	}
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 	 * @param ServerRequestInterface $request Request object
163 163
 	 * @return \Aimeos\MW\View\Iface Modified view object
164 164
 	 */
165
-	protected static function addRequest( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request )
165
+	protected static function addRequest(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request)
166 166
 	{
167
-		$helper = new \Aimeos\MW\View\Helper\Request\Slim( $view, $request );
168
-		$view->addHelper( 'request', $helper );
167
+		$helper = new \Aimeos\MW\View\Helper\Request\Slim($view, $request);
168
+		$view->addHelper('request', $helper);
169 169
 
170 170
 		return $view;
171 171
 	}
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 	 * @param ResponseInterface $response Response object
179 179
 	 * @return \Aimeos\MW\View\Iface Modified view object
180 180
 	 */
181
-	protected static function addResponse( \Aimeos\MW\View\Iface $view, ResponseInterface $response )
181
+	protected static function addResponse(\Aimeos\MW\View\Iface $view, ResponseInterface $response)
182 182
 	{
183
-		$helper = new \Aimeos\MW\View\Helper\Response\Slim( $view, $response );
184
-		$view->addHelper( 'response', $helper );
183
+		$helper = new \Aimeos\MW\View\Helper\Response\Slim($view, $response);
184
+		$view->addHelper('response', $helper);
185 185
 
186 186
 		return $view;
187 187
 	}
@@ -194,24 +194,24 @@  discard block
 block discarded – undo
194 194
 	 * @param array $attributes Associative list of URI parameters
195 195
 	 * @return \Aimeos\MW\View\Iface Modified view object
196 196
 	 */
197
-	protected function addUrl( \Aimeos\MW\View\Iface $view, array $attributes )
197
+	protected function addUrl(\Aimeos\MW\View\Iface $view, array $attributes)
198 198
 	{
199 199
 		$fixed = array();
200 200
 
201
-		if( isset( $attributes['site'] ) ) {
201
+		if (isset($attributes['site'])) {
202 202
 			$fixed['site'] = $attributes['site'];
203 203
 		}
204 204
 
205
-		if( isset( $attributes['locale'] ) ) {
205
+		if (isset($attributes['locale'])) {
206 206
 			$fixed['locale'] = $attributes['locale'];
207 207
 		}
208 208
 
209
-		if( isset( $attributes['currency'] ) ) {
209
+		if (isset($attributes['currency'])) {
210 210
 			$fixed['currency'] = $attributes['currency'];
211 211
 		}
212 212
 
213
-		$helper = new \Aimeos\MW\View\Helper\Url\Slim( $view, $this->container->get( 'router' ), $fixed );
214
-		$view->addHelper( 'url', $helper );
213
+		$helper = new \Aimeos\MW\View\Helper\Url\Slim($view, $this->container->get('router'), $fixed);
214
+		$view->addHelper('url', $helper);
215 215
 
216 216
 		return $view;
217 217
 	}
@@ -225,20 +225,20 @@  discard block
 block discarded – undo
225 225
 	 * @param string|null $locale ISO language code, e.g. "de" or "de_CH"
226 226
 	 * @return \Aimeos\MW\View\Iface Modified view object
227 227
 	 */
228
-	protected function addTranslate( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config, $locale )
228
+	protected function addTranslate(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config, $locale)
229 229
 	{
230
-		if( $locale !== null )
230
+		if ($locale !== null)
231 231
 		{
232
-			$i18n = $this->container->get( 'aimeos_i18n' )->get( array( $locale ) );
232
+			$i18n = $this->container->get('aimeos_i18n')->get(array($locale));
233 233
 			$translation = $i18n[$locale];
234 234
 		}
235 235
 		else
236 236
 		{
237
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
237
+			$translation = new \Aimeos\MW\Translation\None('en');
238 238
 		}
239 239
 
240
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
241
-		$view->addHelper( 'translate', $helper );
240
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
241
+		$view->addHelper('translate', $helper);
242 242
 
243 243
 		return $view;
244 244
 	}
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->getConfig(), $request, $response, $attr, $tmplPaths, $langid );
55
-		$context->setView( $view );
54
+		$view = $this->container->get('aimeos_view')->create($context->getConfig(), $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/Context.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param ContainerInterface $container Dependency container
31 31
 	 */
32
-	public function __construct( ContainerInterface $container )
32
+	public function __construct(ContainerInterface $container)
33 33
 	{
34 34
 		$this->container = $container;
35 35
 	}
@@ -43,33 +43,33 @@  discard block
 block discarded – undo
43 43
 	 * @param string $type Configuration type ("frontend" or "backend")
44 44
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
45 45
 	 */
46
-	public function get( $locale = true, array $attributes = array(), $type = 'frontend' )
46
+	public function get($locale = true, array $attributes = array(), $type = 'frontend')
47 47
 	{
48
-		$config = $this->container->get( 'aimeos_config' )->get( $type );
48
+		$config = $this->container->get('aimeos_config')->get($type);
49 49
 
50
-		if( $this->context === null )
50
+		if ($this->context === null)
51 51
 		{
52 52
 			$context = new \Aimeos\MShop\Context\Item\Standard();
53
-			$context->setConfig( $config );
53
+			$context->setConfig($config);
54 54
 
55
-			$this->addDataBaseManager( $context );
56
-			$this->addFilesystemManager( $context );
57
-			$this->addMessageQueueManager( $context );
58
-			$this->addLogger( $context );
59
-			$this->addCache( $context );
60
-			$this->addMailer( $context);
61
-			$this->addSession( $context );
55
+			$this->addDataBaseManager($context);
56
+			$this->addFilesystemManager($context);
57
+			$this->addMessageQueueManager($context);
58
+			$this->addLogger($context);
59
+			$this->addCache($context);
60
+			$this->addMailer($context);
61
+			$this->addSession($context);
62 62
 
63 63
 			$this->context = $context;
64 64
 		}
65 65
 
66
-		$this->context->setConfig( $config );
66
+		$this->context->setConfig($config);
67 67
 
68
-		if( $locale === true )
68
+		if ($locale === true)
69 69
 		{
70
-			$localeItem = $this->container->get( 'aimeos_locale' )->get( $this->context, $attributes );
71
-			$this->context->setLocale( $localeItem );
72
-			$this->context->setI18n( $this->container->get( 'aimeos_i18n' )->get( array( $localeItem->getLanguageId() ) ) );
70
+			$localeItem = $this->container->get('aimeos_locale')->get($this->context, $attributes);
71
+			$this->context->setLocale($localeItem);
72
+			$this->context->setI18n($this->container->get('aimeos_i18n')->get(array($localeItem->getLanguageId())));
73 73
 		}
74 74
 
75 75
 		return $this->context;
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object including config
83 83
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
84 84
 	 */
85
-	protected function addCache( \Aimeos\MShop\Context\Item\Iface $context )
85
+	protected function addCache(\Aimeos\MShop\Context\Item\Iface $context)
86 86
 	{
87
-		$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context );
88
-		$context->setCache( $cache );
87
+		$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
88
+		$context->setCache($cache);
89 89
 
90 90
 		return $context;
91 91
 	}
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
98 98
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
99 99
 	 */
100
-	protected function addDatabaseManager( \Aimeos\MShop\Context\Item\Iface $context )
100
+	protected function addDatabaseManager(\Aimeos\MShop\Context\Item\Iface $context)
101 101
 	{
102
-		$dbm = new \Aimeos\MW\DB\Manager\DBAL( $context->getConfig() );
103
-		$context->setDatabaseManager( $dbm );
102
+		$dbm = new \Aimeos\MW\DB\Manager\DBAL($context->getConfig());
103
+		$context->setDatabaseManager($dbm);
104 104
 
105 105
 		return $context;
106 106
 	}
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
113 113
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
114 114
 	 */
115
-	protected function addFilesystemManager( \Aimeos\MShop\Context\Item\Iface $context )
115
+	protected function addFilesystemManager(\Aimeos\MShop\Context\Item\Iface $context)
116 116
 	{
117
-		$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $context->getConfig() );
118
-		$context->setFilesystemManager( $fs );
117
+		$fs = new \Aimeos\MW\Filesystem\Manager\Standard($context->getConfig());
118
+		$context->setFilesystemManager($fs);
119 119
 
120 120
 		return $context;
121 121
 	}
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
128 128
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
129 129
 	 */
130
-	protected function addLogger( \Aimeos\MShop\Context\Item\Iface $context )
130
+	protected function addLogger(\Aimeos\MShop\Context\Item\Iface $context)
131 131
 	{
132
-		$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
133
-		$context->setLogger( $logger );
132
+		$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context);
133
+		$context->setLogger($logger);
134 134
 
135 135
 		return $context;
136 136
 	}
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
144 144
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
145 145
 	 */
146
-	protected function addMailer( \Aimeos\MShop\Context\Item\Iface $context )
146
+	protected function addMailer(\Aimeos\MShop\Context\Item\Iface $context)
147 147
 	{
148
-		$mail = new \Aimeos\MW\Mail\Swift( $this->container->get( 'mailer' ) );
149
-		$context->setMail( $mail );
148
+		$mail = new \Aimeos\MW\Mail\Swift($this->container->get('mailer'));
149
+		$context->setMail($mail);
150 150
 
151 151
 		return $context;
152 152
 	}
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
159 159
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
160 160
 	 */
161
-	protected function addMessageQueueManager( \Aimeos\MShop\Context\Item\Iface $context )
161
+	protected function addMessageQueueManager(\Aimeos\MShop\Context\Item\Iface $context)
162 162
 	{
163
-		$mq = new \Aimeos\MW\MQueue\Manager\Standard( $context->getConfig() );
164
-		$context->setMessageQueueManager( $mq );
163
+		$mq = new \Aimeos\MW\MQueue\Manager\Standard($context->getConfig());
164
+		$context->setMessageQueueManager($mq);
165 165
 
166 166
 		return $context;
167 167
 	}
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
174 174
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
175 175
 	 */
176
-	protected function addSession( \Aimeos\MShop\Context\Item\Iface $context )
176
+	protected function addSession(\Aimeos\MShop\Context\Item\Iface $context)
177 177
 	{
178 178
 		$session = new \Aimeos\MW\Session\PHP();
179
-		$context->setSession( $session );
179
+		$context->setSession($session);
180 180
 
181 181
 		return $context;
182 182
 	}
Please login to merge, or discard this patch.
src/Base/Locale.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param ContainerInterface $container Dependency container
31 31
 	 */
32
-	public function __construct( ContainerInterface $container )
32
+	public function __construct(ContainerInterface $container)
33 33
 	{
34 34
 		$this->container = $container;
35 35
 	}
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 	 * @param array $attributes Associative list of URL parameter
43 43
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
44 44
 	 */
45
-	public function get( \Aimeos\MShop\Context\Item\Iface $context, array $attributes )
45
+	public function get(\Aimeos\MShop\Context\Item\Iface $context, array $attributes)
46 46
 	{
47
-		if( $this->locale === null )
47
+		if ($this->locale === null)
48 48
 		{
49
-			$disableSites = $this->container->get( 'aimeos_config' )->get( 'disableSites', true );
49
+			$disableSites = $this->container->get('aimeos_config')->get('disableSites', true);
50 50
 
51
-			$site = ( isset( $attributes['site'] ) ? $attributes['site'] : 'default' );
52
-			$lang = ( isset( $attributes['locale'] ) ? $attributes['locale'] : '' );
53
-			$currency = ( isset( $attributes['currency'] ) ? $attributes['currency'] : '' );
51
+			$site = (isset($attributes['site']) ? $attributes['site'] : 'default');
52
+			$lang = (isset($attributes['locale']) ? $attributes['locale'] : '');
53
+			$currency = (isset($attributes['currency']) ? $attributes['currency'] : '');
54 54
 
55
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
56
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites );
55
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
56
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites);
57 57
 		}
58 58
 
59 59
 		return $this->locale;
@@ -67,17 +67,17 @@  discard block
 block discarded – undo
67 67
 	 * @param string $site Unique site code
68 68
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
69 69
 	 */
70
-	public function getBackend( \Aimeos\MShop\Context\Item\Iface $context, $site )
70
+	public function getBackend(\Aimeos\MShop\Context\Item\Iface $context, $site)
71 71
 	{
72
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
72
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
73 73
 
74 74
 		try
75 75
 		{
76
-			$localeItem = $localeManager->bootstrap( $site, '', '', false );
77
-			$localeItem->setLanguageId( null );
78
-			$localeItem->setCurrencyId( null );
76
+			$localeItem = $localeManager->bootstrap($site, '', '', false);
77
+			$localeItem->setLanguageId(null);
78
+			$localeItem->setCurrencyId(null);
79 79
 		}
80
-		catch( \Aimeos\MShop\Locale\Exception $e )
80
+		catch (\Aimeos\MShop\Locale\Exception $e)
81 81
 		{
82 82
 			$localeItem = $localeManager->createItem();
83 83
 		}
Please login to merge, or discard this patch.
src/Controller/Jsonadm.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -32,15 +32,15 @@  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 37
 		$status = 500;
38 38
 		$header = $request->getHeaders();
39 39
 
40
-		$client = self::createClient( $container, $request, $response, $args );
41
-		$result = $client->delete( (string) $request->getBody(), $header, $status );
40
+		$client = self::createClient($container, $request, $response, $args);
41
+		$result = $client->delete((string) $request->getBody(), $header, $status);
42 42
 
43
-		return self::withResponse( $response, $result, $status, $header );
43
+		return self::withResponse($response, $result, $status, $header);
44 44
 	}
45 45
 
46 46
 
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
 	 * @param array $args Associative list of route parameters
54 54
 	 * @return ResponseInterface $response Modified response object with generated output
55 55
 	 */
56
-	public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
56
+	public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
57 57
 	{
58 58
 		$status = 500;
59 59
 		$header = $request->getHeaders();
60 60
 
61
-		$client = self::createClient( $container, $request, $response, $args );
62
-		$result = $client->get( (string) $request->getBody(), $header, $status );
61
+		$client = self::createClient($container, $request, $response, $args);
62
+		$result = $client->get((string) $request->getBody(), $header, $status);
63 63
 
64
-		return self::withResponse( $response, $result, $status, $header );
64
+		return self::withResponse($response, $result, $status, $header);
65 65
 	}
66 66
 
67 67
 
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
 	 * @param array $args Associative list of route parameters
75 75
 	 * @return ResponseInterface $response Modified response object with generated output
76 76
 	 */
77
-	public static function patchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
77
+	public static function patchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
78 78
 	{
79 79
 		$status = 500;
80 80
 		$header = $request->getHeaders();
81 81
 
82
-		$client = self::createClient( $container, $request, $response, $args );
83
-		$result = $client->patch( (string) $request->getBody(), $header, $status );
82
+		$client = self::createClient($container, $request, $response, $args);
83
+		$result = $client->patch((string) $request->getBody(), $header, $status);
84 84
 
85
-		return self::withResponse( $response, $result, $status, $header );
85
+		return self::withResponse($response, $result, $status, $header);
86 86
 	}
87 87
 
88 88
 
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 	 * @param array $args Associative list of route parameters
96 96
 	 * @return ResponseInterface $response Modified response object with generated output
97 97
 	 */
98
-	public static function postAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
98
+	public static function postAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
99 99
 	{
100 100
 		$status = 500;
101 101
 		$header = $request->getHeaders();
102 102
 
103
-		$client = self::createClient( $container, $request, $response, $args );
104
-		$result = $client->post( (string) $request->getBody(), $header, $status );
103
+		$client = self::createClient($container, $request, $response, $args);
104
+		$result = $client->post((string) $request->getBody(), $header, $status);
105 105
 
106
-		return self::withResponse( $response, $result, $status, $header );
106
+		return self::withResponse($response, $result, $status, $header);
107 107
 	}
108 108
 
109 109
 
@@ -116,15 +116,15 @@  discard block
 block discarded – undo
116 116
 	 * @param array $args Associative list of route parameters
117 117
 	 * @return ResponseInterface $response Modified response object with generated output
118 118
 	 */
119
-	public static function putAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
119
+	public static function putAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
120 120
 	{
121 121
 		$status = 500;
122 122
 		$header = $request->getHeaders();
123 123
 
124
-		$client = self::createClient( $container, $request, $response, $args );
125
-		$result = $client->put( (string) $request->getBody(), $header, $status );
124
+		$client = self::createClient($container, $request, $response, $args);
125
+		$result = $client->put((string) $request->getBody(), $header, $status);
126 126
 
127
-		return self::withResponse( $response, $result, $status, $header );
127
+		return self::withResponse($response, $result, $status, $header);
128 128
 	}
129 129
 
130 130
 
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
 	 * @param array $args Associative list of route parameters
138 138
 	 * @return ResponseInterface $response Modified response object with generated output
139 139
 	 */
140
-	public static function optionsAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
140
+	public static function optionsAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
141 141
 	{
142 142
 		$status = 500;
143 143
 		$header = $request->getHeaders();
144 144
 
145
-		$client = self::createClient( $container, $request, $response, $args );
146
-		$result = $client->options( (string) $request->getBody(), $header, $status );
145
+		$client = self::createClient($container, $request, $response, $args);
146
+		$result = $client->options((string) $request->getBody(), $header, $status);
147 147
 
148
-		return self::withResponse( $response, $result, $status, $header );
148
+		return self::withResponse($response, $result, $status, $header);
149 149
 	}
150 150
 
151 151
 
@@ -158,22 +158,22 @@  discard block
 block discarded – undo
158 158
 	 * @param array $args Associative list of route parameters
159 159
 	 * @return \Aimeos\Controller\JsonAdm\Iface JSON admin controller
160 160
 	 */
161
-	protected static function createClient( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
161
+	protected static function createClient(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
162 162
 	{
163
-		$resource = ( isset( $args['resource'] ) ? $args['resource'] : null );
164
-		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
165
-		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
163
+		$resource = (isset($args['resource']) ? $args['resource'] : null);
164
+		$site = (isset($args['site']) ? $args['site'] : 'default');
165
+		$lang = (isset($args['lang']) ? $args['lang'] : 'en');
166 166
 
167
-		$templatePaths = $container->get( 'aimeos' )->getCustomPaths( 'admin/jsonadm/templates' );
167
+		$templatePaths = $container->get('aimeos')->getCustomPaths('admin/jsonadm/templates');
168 168
 
169
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
170
-		$context->setI18n( $container->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) );
171
-		$context->setLocale( $container->get( 'aimeos_locale' )->getBackend( $context, $site ) );
169
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
170
+		$context->setI18n($container->get('aimeos_i18n')->get(array($lang, 'en')));
171
+		$context->setLocale($container->get('aimeos_locale')->getBackend($context, $site));
172 172
 
173
-		$view = $container->get( 'aimeos_view' )->create( $context->getConfig(), $request, $response, $args, $templatePaths, $lang );
174
-		$context->setView( $view );
173
+		$view = $container->get('aimeos_view')->create($context->getConfig(), $request, $response, $args, $templatePaths, $lang);
174
+		$context->setView($view);
175 175
 
176
-		return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource );
176
+		return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource);
177 177
 	}
178 178
 
179 179
 
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
 	 * @param array $header List of HTTP headers
187 187
 	 * @return ResponseInterface $response Populated response object
188 188
 	 */
189
-	protected static function withResponse( ResponseInterface $response, $content, $status, array $header )
189
+	protected static function withResponse(ResponseInterface $response, $content, $status, array $header)
190 190
 	{
191
-		$response->getBody()->write( $content );
192
-		$response = $response->withStatus( $status );
191
+		$response->getBody()->write($content);
192
+		$response = $response->withStatus($status);
193 193
 
194
-		foreach( $header as $key => $value ) {
195
-			$response->withHeader( $key, $value );
194
+		foreach ($header as $key => $value) {
195
+			$response->withHeader($key, $value);
196 196
 		}
197 197
 
198 198
 		return $response;
Please login to merge, or discard this patch.
src/Controller/Extadm.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -32,62 +32,62 @@  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
-		$jqadmUrl = $router->pathFor( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) );
70
-		$jsonUrl = $router->pathFor( 'aimeos_shop_extadm_json', array( 'site' => $site, $csrfname => $csrfvalue ) );
71
-		$adminUrl = $router->pathFor( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) );
68
+		$router = $container->get('router');
69
+		$jqadmUrl = $router->pathFor('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product'));
70
+		$jsonUrl = $router->pathFor('aimeos_shop_extadm_json', array('site' => $site, $csrfname => $csrfvalue));
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 ),
83
+			'smd' => $controller->getJsonSmd($jsonUrl),
84 84
 			'urlTemplate' => $adminUrl,
85 85
 			'jqadmurl' => $jqadmUrl,
86 86
 			'activeTab' => $tab,
87 87
 			'version' => \Aimeos\Slim\Bootstrap::getVersion(),
88 88
 		);
89 89
 
90
-		return $container->get( 'view' )->render( $response, 'Extadm/index.html.twig', $vars );
90
+		return $container->get('view')->render($response, 'Extadm/index.html.twig', $vars);
91 91
 	}
92 92
 
93 93
 
@@ -100,22 +100,22 @@  discard block
 block discarded – undo
100 100
 	 * @param array $args Associative list of route parameters
101 101
 	 * @return ResponseInterface $response Modified response object with generated output
102 102
 	 */
103
-	public static function doAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
103
+	public static function doAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
104 104
 	{
105
-		$cntlPaths = $container->get( 'aimeos' )->getCustomPaths( 'controller/extjs' );
105
+		$cntlPaths = $container->get('aimeos')->getCustomPaths('controller/extjs');
106 106
 
107
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
108
-		$context->setView( $container->get( 'aimeos_view' )->create( $context->getConfig(), $request, $response, $args, array() ) );
109
-		$context = self::setLocale( $context );
107
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
108
+		$context->setView($container->get('aimeos_view')->create($context->getConfig(), $request, $response, $args, array()));
109
+		$context = self::setLocale($context);
110 110
 
111 111
 		$params = $request->getQueryParams();
112
-		if( ( $post = $request->getParsedBody() ) !== null ) {
113
-			$params = array_merge( $params, (array) $post );
112
+		if (($post = $request->getParsedBody()) !== null) {
113
+			$params = array_merge($params, (array) $post);
114 114
 		}
115 115
 
116
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
117
-		$output = $controller->process( $params, (string) $request->getBody() );
118
-		$response->getBody()->write( $output );
116
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
117
+		$output = $controller->process($params, (string) $request->getBody());
118
+		$response->getBody()->write($output);
119 119
 
120 120
 		return $response;
121 121
 	}
@@ -130,30 +130,30 @@  discard block
 block discarded – undo
130 130
 	 * @param array $args Associative list of route parameters
131 131
 	 * @return ResponseInterface $response Modified response object with generated output
132 132
 	 */
133
-	public static function fileAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
133
+	public static function fileAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
134 134
 	{
135 135
 		$contents = '';
136 136
 		$jsFiles = array();
137
-		$aimeos = $container->get( 'aimeos' );
137
+		$aimeos = $container->get('aimeos');
138 138
 
139
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
139
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
140 140
 		{
141
-			foreach( $paths as $path )
141
+			foreach ($paths as $path)
142 142
 			{
143
-				$jsbAbsPath = $base . '/' . $path;
144
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
145
-				$jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) );
143
+				$jsbAbsPath = $base.'/'.$path;
144
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
145
+				$jsFiles = array_merge($jsFiles, $jsb2->getFiles('js'));
146 146
 			}
147 147
 		}
148 148
 
149
-		foreach( $jsFiles as $file )
149
+		foreach ($jsFiles as $file)
150 150
 		{
151
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
151
+			if (($content = file_get_contents($file)) !== false) {
152 152
 				$contents .= $content;
153 153
 			}
154 154
 		}
155 155
 
156
-		return $response->withHeader( 'Content-Type', 'application/javascript' )->getBody()->write( $contents );
156
+		return $response->withHeader('Content-Type', 'application/javascript')->getBody()->write($contents);
157 157
 	}
158 158
 
159 159
 
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
 	 * @param \Aimeos\Bootstrap $aimeos Aimeos object
164 164
 	 * @return array List of language IDs with labels
165 165
 	 */
166
-	protected static function getJsonLanguages( \Aimeos\Bootstrap $aimeos )
166
+	protected static function getJsonLanguages(\Aimeos\Bootstrap $aimeos)
167 167
 	{
168 168
 		$result = array();
169 169
 
170
-		foreach( $aimeos->getI18nList( 'admin' ) as $id ) {
171
-			$result[] = array( 'id' => $id, 'label' => $id );
170
+		foreach ($aimeos->getI18nList('admin') as $id) {
171
+			$result[] = array('id' => $id, 'label' => $id);
172 172
 		}
173 173
 
174
-		return json_encode( $result );
174
+		return json_encode($result);
175 175
 	}
176 176
 
177 177
 
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
182 182
 	 * @return string JSON encoded configuration object
183 183
 	 */
184
-	protected static function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
184
+	protected static function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
185 185
 	{
186
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
187
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
186
+		$config = $context->getConfig()->get('admin/extjs', array());
187
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
188 188
 	}
189 189
 
190 190
 
@@ -195,16 +195,16 @@  discard block
 block discarded – undo
195 195
 	 * @param string $lang ISO language code like "en" or "en_GB"
196 196
 	 * @return string JSON encoded translation object
197 197
 	 */
198
-	protected static function getJsonClientI18n( array $i18nPaths, $lang )
198
+	protected static function getJsonClientI18n(array $i18nPaths, $lang)
199 199
 	{
200
-		$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang );
200
+		$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang);
201 201
 
202 202
 		$content = array(
203
-			'admin' => $i18n->getAll( 'admin' ),
204
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
203
+			'admin' => $i18n->getAll('admin'),
204
+			'admin/ext' => $i18n->getAll('admin/ext'),
205 205
 		);
206 206
 
207
-		return json_encode( $content, JSON_FORCE_OBJECT );
207
+		return json_encode($content, JSON_FORCE_OBJECT);
208 208
 	}
209 209
 
210 210
 
@@ -216,19 +216,19 @@  discard block
 block discarded – undo
216 216
 	 * @return string JSON encoded site item object
217 217
 	 * @throws Exception If no site item was found for the code
218 218
 	 */
219
-	protected static function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
219
+	protected static function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
220 220
 	{
221
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
221
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
222 222
 
223 223
 		$criteria = $manager->createSearch();
224
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
225
-		$items = $manager->searchItems( $criteria );
224
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
225
+		$items = $manager->searchItems($criteria);
226 226
 
227
-		if( ( $item = reset( $items ) ) === false ) {
228
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
227
+		if (($item = reset($items)) === false) {
228
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
229 229
 		}
230 230
 
231
-		return json_encode( $item->toArray() );
231
+		return json_encode($item->toArray());
232 232
 	}
233 233
 
234 234
 
@@ -240,17 +240,17 @@  discard block
 block discarded – undo
240 240
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
241 241
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
242 242
 	 */
243
-	protected static function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
243
+	protected static function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
244 244
 	{
245
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
245
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
246 246
 
247 247
 		try {
248
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
249
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
248
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
249
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
250 250
 			$localeItem = $localeManager->createItem();
251 251
 		}
252 252
 
253
-		$context->setLocale( $localeItem );
253
+		$context->setLocale($localeItem);
254 254
 
255 255
 		return $context;
256 256
 	}
Please login to merge, or discard this patch.
src/Controller/Jqadm.php 1 patch
Spacing   +47 added lines, -47 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,22 +173,22 @@  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
-		$resource = ( isset( $args['resource'] ) ? $args['resource'] : null );
179
-		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
180
-		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
178
+		$resource = (isset($args['resource']) ? $args['resource'] : null);
179
+		$site = (isset($args['site']) ? $args['site'] : 'default');
180
+		$lang = (isset($args['lang']) ? $args['lang'] : 'en');
181 181
 
182
-		$templatePaths = $container->get( 'aimeos' )->getCustomPaths( 'admin/jqadm/templates' );
182
+		$templatePaths = $container->get('aimeos')->getCustomPaths('admin/jqadm/templates');
183 183
 
184
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
185
-		$context->setI18n( $container->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) );
186
-		$context->setLocale( $container->get( 'aimeos_locale' )->getBackend( $context, $site ) );
184
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
185
+		$context->setI18n($container->get('aimeos_i18n')->get(array($lang, 'en')));
186
+		$context->setLocale($container->get('aimeos_locale')->getBackend($context, $site));
187 187
 
188
-		$view = $container->get( 'aimeos_view' )->create( $context->getConfig(), $request, $response, $args, $templatePaths, $lang );
189
-		$context->setView( $view );
188
+		$view = $container->get('aimeos_view')->create($context->getConfig(), $request, $response, $args, $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
 
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 	 * @param string $content Content from admin client
201 201
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
202 202
 	 */
203
-	protected static function getHtml( ContainerInterface $container, ResponseInterface $response, $content )
203
+	protected static function getHtml(ContainerInterface $container, ResponseInterface $response, $content)
204 204
 	{
205 205
 		$version = \Aimeos\Slim\Bootstrap::getVersion();
206
-		$content = str_replace( array( '{type}', '{version}' ), array( 'Slim', $version ), $content );
206
+		$content = str_replace(array('{type}', '{version}'), array('Slim', $version), $content);
207 207
 
208
-		return $container->get( 'view' )->render( $response, 'Jqadm/index.html.twig', array( 'content' => $content ) );
208
+		return $container->get('view')->render($response, 'Jqadm/index.html.twig', array('content' => $content));
209 209
 	}
210 210
 }
Please login to merge, or discard this patch.
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->getConfig(), $request, $response, $args, array(), $langid );
56
-		$context->setView( $view );
55
+		$view = $container->get('aimeos_view')->create($context->getConfig(), $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/Bootstrap.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @param \Slim\App $app Slim application
28 28
 	 * @param array $settings Multi-dimensional array of configuration settings
29 29
 	 */
30
-	public function __construct( \Slim\App $app, array $settings )
30
+	public function __construct(\Slim\App $app, array $settings)
31 31
 	{
32 32
 		$this->app = $app;
33 33
 		$this->settings = $settings;
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
 	 * @param string $path Absolute or relative path to the Aimeos route file
41 41
 	 * @return \Aimeos\Slim\Bootstrap Self instance
42 42
 	 */
43
-	public function routes( $path )
43
+	public function routes($path)
44 44
 	{
45 45
 		$app = $this->app;
46 46
 		$settings = $this->settings;
47 47
 
48
-		$config = function( $key, $default ) use ( $settings )
48
+		$config = function($key, $default) use ($settings)
49 49
 		{
50
-			foreach( explode( '/', trim( $key, '/' ) ) as $part )
50
+			foreach (explode('/', trim($key, '/')) as $part)
51 51
 			{
52
-				if( isset( $settings[$part] ) ) {
52
+				if (isset($settings[$part])) {
53 53
 					$settings = $settings[$part];
54 54
 				} else {
55 55
 					return $default;
@@ -71,48 +71,48 @@  discard block
 block discarded – undo
71 71
 	 * @param string $extdir Absolute or relative path to the Aimeos extension directory
72 72
 	 * @return \Aimeos\Slim\Bootstrap Self instance
73 73
 	 */
74
-	public function setup( $extdir = '../ext' )
74
+	public function setup($extdir = '../ext')
75 75
 	{
76 76
 		$container = $this->app->getContainer();
77 77
 
78
-		$container['router'] = function( $c ) {
78
+		$container['router'] = function($c) {
79 79
 			return new \Aimeos\Slim\Router();
80 80
 		};
81 81
 
82
-		$container['mailer'] = function( $c ) {
83
-			return \Swift_Mailer::newInstance( \Swift_SendmailTransport::newInstance() );
82
+		$container['mailer'] = function($c) {
83
+			return \Swift_Mailer::newInstance(\Swift_SendmailTransport::newInstance());
84 84
 		};
85 85
 
86 86
 
87
-		$default = require __DIR__ . DIRECTORY_SEPARATOR . 'aimeos-default.php';
88
-		$settings = array_replace_recursive( $default, $this->settings );
87
+		$default = require __DIR__.DIRECTORY_SEPARATOR.'aimeos-default.php';
88
+		$settings = array_replace_recursive($default, $this->settings);
89 89
 
90
-		$container['aimeos'] = function( $c ) use ( $extdir ) {
91
-			return new \Aimeos\Bootstrap( (array) $extdir, false );
90
+		$container['aimeos'] = function($c) use ($extdir) {
91
+			return new \Aimeos\Bootstrap((array) $extdir, false);
92 92
 		};
93 93
 
94
-		$container['aimeos_config'] = function( $c ) use ( $settings ) {
95
-			return new \Aimeos\Slim\Base\Config( $c, $settings );
94
+		$container['aimeos_config'] = function($c) use ($settings) {
95
+			return new \Aimeos\Slim\Base\Config($c, $settings);
96 96
 		};
97 97
 
98
-		$container['aimeos_context'] = function( $c ) {
99
-			return new \Aimeos\Slim\Base\Context( $c );
98
+		$container['aimeos_context'] = function($c) {
99
+			return new \Aimeos\Slim\Base\Context($c);
100 100
 		};
101 101
 
102
-		$container['aimeos_i18n'] = function( $c ) {
103
-			return new \Aimeos\Slim\Base\I18n( $c );
102
+		$container['aimeos_i18n'] = function($c) {
103
+			return new \Aimeos\Slim\Base\I18n($c);
104 104
 		};
105 105
 
106
-		$container['aimeos_locale'] = function( $c ) {
107
-			return new \Aimeos\Slim\Base\Locale( $c );
106
+		$container['aimeos_locale'] = function($c) {
107
+			return new \Aimeos\Slim\Base\Locale($c);
108 108
 		};
109 109
 
110
-		$container['aimeos_page'] = function( $c ) {
111
-			return new \Aimeos\Slim\Base\Page( $c );
110
+		$container['aimeos_page'] = function($c) {
111
+			return new \Aimeos\Slim\Base\Page($c);
112 112
 		};
113 113
 
114
-		$container['aimeos_view'] = function( $c ) {
115
-			return new \Aimeos\Slim\Base\View( $c );
114
+		$container['aimeos_view'] = function($c) {
115
+			return new \Aimeos\Slim\Base\View($c);
116 116
 		};
117 117
 
118 118
 		return $this;
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public static function getVersion()
128 128
 	{
129
-		$basedir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . DIRECTORY_SEPARATOR;
129
+		$basedir = dirname(dirname(dirname(dirname(__DIR__)))).DIRECTORY_SEPARATOR;
130 130
 
131
-		if( ( $content = @file_get_contents( $basedir . 'composer.lock' ) ) !== false
132
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
131
+		if (($content = @file_get_contents($basedir.'composer.lock')) !== false
132
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
133 133
 		) {
134
-			foreach( (array) $content['packages'] as $item )
134
+			foreach ((array) $content['packages'] as $item)
135 135
 			{
136
-				if( $item['name'] === 'aimeos/aimeos-slim' ) {
136
+				if ($item['name'] === 'aimeos/aimeos-slim') {
137 137
 					return $item['version'];
138 138
 				}
139 139
 			}
Please login to merge, or discard this patch.