Completed
Push — master ( 74a52d...dd9c53 )
by Aimeos
15:35
created
src/Aimeos/Shop/Base/View.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @param \Aimeos\Shop\Base\I18n $i18n I18n object
42 42
 	 * @param \Aimeos\Shop\Base\Support $support Support object
43 43
 	 */
44
-	public function __construct( \Aimeos\Shop\Base\I18n $i18n, \Aimeos\Shop\Base\Support $support )
44
+	public function __construct(\Aimeos\Shop\Base\I18n $i18n, \Aimeos\Shop\Base\Support $support)
45 45
 	{
46 46
 		$this->i18n = $i18n;
47 47
 		$this->support = $support;
@@ -56,24 +56,24 @@  discard block
 block discarded – undo
56 56
 	 * @param string|null $locale Code of the current language or null for no translation
57 57
 	 * @return \Aimeos\MW\View\Iface View object
58 58
 	 */
59
-	public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null )
59
+	public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null)
60 60
 	{
61
-		$engine = new \Aimeos\MW\View\Engine\Blade( app( 'Illuminate\Contracts\View\Factory' ) );
62
-		$view = new \Aimeos\MW\View\Standard( $templatePaths, array( '.blade.php' => $engine ) );
61
+		$engine = new \Aimeos\MW\View\Engine\Blade(app('Illuminate\Contracts\View\Factory'));
62
+		$view = new \Aimeos\MW\View\Standard($templatePaths, array('.blade.php' => $engine));
63 63
 
64 64
 		$config = $context->getConfig();
65 65
 		$session = $context->getSession();
66 66
 
67
-		$this->addCsrf( $view );
68
-		$this->addAccess( $view, $context );
69
-		$this->addConfig( $view, $config );
70
-		$this->addNumber( $view, $config );
71
-		$this->addParam( $view );
72
-		$this->addRequest( $view );
73
-		$this->addResponse( $view );
74
-		$this->addSession( $view, $session );
75
-		$this->addTranslate( $view, $locale );
76
-		$this->addUrl( $view );
67
+		$this->addCsrf($view);
68
+		$this->addAccess($view, $context);
69
+		$this->addConfig($view, $config);
70
+		$this->addNumber($view, $config);
71
+		$this->addParam($view);
72
+		$this->addRequest($view);
73
+		$this->addResponse($view);
74
+		$this->addSession($view, $session);
75
+		$this->addTranslate($view, $locale);
76
+		$this->addUrl($view);
77 77
 
78 78
 		return $view;
79 79
 	}
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
87 87
 	 * @return \Aimeos\MW\View\Iface Modified view object
88 88
 	 */
89
-	protected function addAccess( \Aimeos\MW\View\Iface $view, \Aimeos\MShop\Context\Item\Iface $context )
89
+	protected function addAccess(\Aimeos\MW\View\Iface $view, \Aimeos\MShop\Context\Item\Iface $context)
90 90
 	{
91 91
 		$support = $this->support;
92 92
 
93
-		$fcn = function() use ( $support, $context ) {
94
-			return $support->getGroups( $context );
93
+		$fcn = function() use ($support, $context) {
94
+			return $support->getGroups($context);
95 95
 		};
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn );
98
-		$view->addHelper( 'access', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn);
98
+		$view->addHelper('access', $helper);
99 99
 
100 100
 		return $view;
101 101
 	}
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
109 109
 	 * @return \Aimeos\MW\View\Iface Modified view object
110 110
 	 */
111
-	protected function addConfig( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
111
+	protected function addConfig(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
112 112
 	{
113
-		$config = new \Aimeos\MW\Config\Decorator\Protect( clone $config, array( 'admin', 'client' ) );
114
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
115
-		$view->addHelper( 'config', $helper );
113
+		$config = new \Aimeos\MW\Config\Decorator\Protect(clone $config, array('admin', 'client'));
114
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
115
+		$view->addHelper('config', $helper);
116 116
 
117 117
 		return $view;
118 118
 	}
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
 	 * @param \Aimeos\MW\View\Iface $view View object
125 125
 	 * @return \Aimeos\MW\View\Iface Modified view object
126 126
 	 */
127
-	protected function addCsrf( \Aimeos\MW\View\Iface $view )
127
+	protected function addCsrf(\Aimeos\MW\View\Iface $view)
128 128
 	{
129
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() );
130
-		$view->addHelper( 'csrf', $helper );
129
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token());
130
+		$view->addHelper('csrf', $helper);
131 131
 
132 132
 		return $view;
133 133
 	}
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
141 141
 	 * @return \Aimeos\MW\View\Iface Modified view object
142 142
 	 */
143
-	protected function addNumber( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
143
+	protected function addNumber(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
144 144
 	{
145
-		$sepDec = $config->get( 'client/html/common/format/separatorDecimal', '.' );
146
-		$sep1000 = $config->get( 'client/html/common/format/separator1000', ' ' );
147
-		$decimals = $config->get( 'client/html/common/format/decimals', 2 );
145
+		$sepDec = $config->get('client/html/common/format/separatorDecimal', '.');
146
+		$sep1000 = $config->get('client/html/common/format/separator1000', ' ');
147
+		$decimals = $config->get('client/html/common/format/decimals', 2);
148 148
 
149
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000, $decimals );
150
-		$view->addHelper( 'number', $helper );
149
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000, $decimals);
150
+		$view->addHelper('number', $helper);
151 151
 
152 152
 		return $view;
153 153
 	}
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
 	 * @param \Aimeos\MW\View\Iface $view View object
160 160
 	 * @return \Aimeos\MW\View\Iface Modified view object
161 161
 	 */
162
-	protected function addParam( \Aimeos\MW\View\Iface $view )
162
+	protected function addParam(\Aimeos\MW\View\Iface $view)
163 163
 	{
164
-		$params = ( Route::current() ? Route::current()->parameters() : array() ) + Input::all();
165
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
166
-		$view->addHelper( 'param', $helper );
164
+		$params = (Route::current() ? Route::current()->parameters() : array()) + Input::all();
165
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
166
+		$view->addHelper('param', $helper);
167 167
 
168 168
 		return $view;
169 169
 	}
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 	 * @param \Aimeos\MW\View\Iface $view View object
176 176
 	 * @return \Aimeos\MW\View\Iface Modified view object
177 177
 	 */
178
-	protected function addRequest( \Aimeos\MW\View\Iface $view )
178
+	protected function addRequest(\Aimeos\MW\View\Iface $view)
179 179
 	{
180
-		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, Request::instance() );
181
-		$view->addHelper( 'request', $helper );
180
+		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, Request::instance());
181
+		$view->addHelper('request', $helper);
182 182
 
183 183
 		return $view;
184 184
 	}
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
 	 * @param \Aimeos\MW\View\Iface $view View object
191 191
 	 * @return \Aimeos\MW\View\Iface Modified view object
192 192
 	 */
193
-	protected function addResponse( \Aimeos\MW\View\Iface $view )
193
+	protected function addResponse(\Aimeos\MW\View\Iface $view)
194 194
 	{
195
-		$helper = new \Aimeos\MW\View\Helper\Response\Laravel5( $view );
196
-		$view->addHelper( 'response', $helper );
195
+		$helper = new \Aimeos\MW\View\Helper\Response\Laravel5($view);
196
+		$view->addHelper('response', $helper);
197 197
 
198 198
 		return $view;
199 199
 	}
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
 	 * @param \Aimeos\MW\Session\Iface $session Session object
207 207
 	 * @return \Aimeos\MW\View\Iface Modified view object
208 208
 	 */
209
-	protected function addSession( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Session\Iface $session )
209
+	protected function addSession(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Session\Iface $session)
210 210
 	{
211
-		$helper = new \Aimeos\MW\View\Helper\Session\Standard( $view, $session );
212
-		$view->addHelper( 'session', $helper );
211
+		$helper = new \Aimeos\MW\View\Helper\Session\Standard($view, $session);
212
+		$view->addHelper('session', $helper);
213 213
 
214 214
 		return $view;
215 215
 	}
@@ -222,20 +222,20 @@  discard block
 block discarded – undo
222 222
 	 * @param string|null $locale ISO language code, e.g. "de" or "de_CH"
223 223
 	 * @return \Aimeos\MW\View\Iface Modified view object
224 224
 	 */
225
-	protected function addTranslate( \Aimeos\MW\View\Iface $view, $locale )
225
+	protected function addTranslate(\Aimeos\MW\View\Iface $view, $locale)
226 226
 	{
227
-		if( $locale !== null )
227
+		if ($locale !== null)
228 228
 		{
229
-			$i18n = $this->i18n->get( array( $locale ) );
229
+			$i18n = $this->i18n->get(array($locale));
230 230
 			$translation = $i18n[$locale];
231 231
 		}
232 232
 		else
233 233
 		{
234
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
234
+			$translation = new \Aimeos\MW\Translation\None('en');
235 235
 		}
236 236
 
237
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
238
-		$view->addHelper( 'translate', $helper );
237
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
238
+		$view->addHelper('translate', $helper);
239 239
 
240 240
 		return $view;
241 241
 	}
@@ -247,27 +247,27 @@  discard block
 block discarded – undo
247 247
 	 * @param \Aimeos\MW\View\Iface $view View object
248 248
 	 * @return \Aimeos\MW\View\Iface Modified view object
249 249
 	 */
250
-	protected function addUrl( \Aimeos\MW\View\Iface $view )
250
+	protected function addUrl(\Aimeos\MW\View\Iface $view)
251 251
 	{
252 252
 		$fixed = array();
253 253
 
254
-		if( Route::current() )
254
+		if (Route::current())
255 255
 		{
256
-			if( ( $value = Route::input( 'site' ) ) !== null ) {
256
+			if (($value = Route::input('site')) !== null) {
257 257
 				$fixed['site'] = $value;
258 258
 			}
259 259
 
260
-			if( ( $value = Route::input( 'locale' ) ) !== null ) {
260
+			if (($value = Route::input('locale')) !== null) {
261 261
 				$fixed['locale'] = $value;
262 262
 			}
263 263
 
264
-			if( ( $value = Route::input( 'currency' ) ) !== null ) {
264
+			if (($value = Route::input('currency')) !== null) {
265 265
 				$fixed['currency'] = $value;
266 266
 			}
267 267
 		}
268 268
 
269
-		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed );
270
-		$view->addHelper( 'url', $helper );
269
+		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed);
270
+		$view->addHelper('url', $helper);
271 271
 
272 272
 		return $view;
273 273
 	}
Please login to merge, or discard this patch.
src/default.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@  discard block
 block discarded – undo
10 10
 	'uploaddir' => '/',
11 11
 
12 12
 	'page' => array(
13
-		'account-index' => array( 'account/profile','account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
14
-		'basket-index' => array( 'basket/standard','basket/related' ),
15
-		'catalog-count' => array( 'catalog/count' ),
16
-		'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
17
-		'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
18
-		'catalog-stock' => array( 'catalog/stock' ),
19
-		'catalog-suggest' => array( 'catalog/suggest' ),
20
-		'checkout-confirm' => array( 'checkout/confirm' ),
21
-		'checkout-index' => array( 'checkout/standard' ),
22
-		'checkout-update' => array( 'checkout/update'),
13
+		'account-index' => array('account/profile', 'account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'),
14
+		'basket-index' => array('basket/standard', 'basket/related'),
15
+		'catalog-count' => array('catalog/count'),
16
+		'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'),
17
+		'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'),
18
+		'catalog-stock' => array('catalog/stock'),
19
+		'catalog-suggest' => array('catalog/suggest'),
20
+		'checkout-confirm' => array('checkout/confirm'),
21
+		'checkout-index' => array('checkout/standard'),
22
+		'checkout-update' => array('checkout/update'),
23 23
 	),
24 24
 
25 25
 	'resource' => array(
@@ -37,17 +37,17 @@  discard block
 block discarded – undo
37 37
 		'fs' => array(
38 38
 			'adapter' => 'Standard',
39 39
 			'basedir' => public_path(),
40
-			'tempdir' => storage_path( 'tmp' ),
40
+			'tempdir' => storage_path('tmp'),
41 41
 		),
42 42
 		'fs-admin' => array(
43 43
 			'adapter' => 'Standard',
44
-			'basedir' => storage_path( 'admin' ),
45
-			'tempdir' => storage_path( 'tmp' ),
44
+			'basedir' => storage_path('admin'),
45
+			'tempdir' => storage_path('tmp'),
46 46
 		),
47 47
 		'fs-secure' => array(
48 48
 			'adapter' => 'Standard',
49
-			'basedir' => storage_path( 'secure' ),
50
-			'tempdir' => storage_path( 'tmp' ),
49
+			'basedir' => storage_path('secure'),
50
+			'tempdir' => storage_path('tmp'),
51 51
 		),
52 52
 		'mq' => array(
53 53
 			'adapter' => 'Standard',
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 						# in the "maxwidth" parameter
284 284
 						# 'maxheight' => 280,
285 285
 					),
286
-					'tempdir' => storage_path( 'aimeos' ),
286
+					'tempdir' => storage_path('aimeos'),
287 287
 				),
288 288
 			),
289 289
 		),
Please login to merge, or discard this patch.