Completed
Push — master ( b7adea...585a69 )
by Aimeos
02:56
created
src/Aimeos/Shop/Base/I18n.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @param \Aimeos\Shop\Base\Aimeos $aimeos Aimeos object
41 41
 	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
42 42
 	 */
43
-	public function __construct( \Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config )
43
+	public function __construct(\Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config)
44 44
 	{
45 45
 		$this->aimeos = $aimeos;
46 46
 		$this->config = $config;
@@ -53,22 +53,22 @@  discard block
 block discarded – undo
53 53
 	 * @param array $languageIds List of two letter ISO language IDs
54 54
 	 * @return \Aimeos\MW\Translation\Iface[] List of translation objects
55 55
 	 */
56
-	public function get( array $languageIds )
56
+	public function get(array $languageIds)
57 57
 	{
58 58
 		$i18nPaths = $this->aimeos->get()->getI18nPaths();
59 59
 
60
-		foreach( $languageIds as $langid )
60
+		foreach ($languageIds as $langid)
61 61
 		{
62
-			if( !isset( $this->i18n[$langid] ) )
62
+			if (!isset($this->i18n[$langid]))
63 63
 			{
64
-				$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid );
64
+				$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid);
65 65
 
66
-				if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) {
67
-					$i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $this->config->get( 'shop.apc_prefix', 'laravel:' ) );
66
+				if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) {
67
+					$i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $this->config->get('shop.apc_prefix', 'laravel:'));
68 68
 				}
69 69
 
70
-				if( $this->config->has( 'shop.i18n.' . $langid ) ) {
71
-					$i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $this->config->get( 'shop.i18n.' . $langid ) );
70
+				if ($this->config->has('shop.i18n.'.$langid)) {
71
+					$i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $this->config->get('shop.i18n.'.$langid));
72 72
 				}
73 73
 
74 74
 				$this->i18n[$langid] = $i18n;
Please login to merge, or discard this patch.
src/default.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -4,20 +4,20 @@  discard block
 block discarded – undo
4 4
 
5 5
 	'apc_enabled' => false,
6 6
 	'apc_prefix' => 'laravel:',
7
-	'extdir' => ( is_dir(base_path('ext')) ? base_path('ext') : dirname(__DIR__) . DIRECTORY_SEPARATOR . 'ext' ),
7
+	'extdir' => (is_dir(base_path('ext')) ? base_path('ext') : dirname(__DIR__).DIRECTORY_SEPARATOR.'ext'),
8 8
 	'uploaddir' => '/',
9 9
 
10 10
 	'page' => array(
11
-		'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
12
-		'basket-index' => array( 'basket/standard','basket/related' ),
13
-		'catalog-count' => array( 'catalog/count' ),
14
-		'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
15
-		'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
16
-		'catalog-stock' => array( 'catalog/stock' ),
17
-		'catalog-suggest' => array( 'catalog/suggest' ),
18
-		'checkout-confirm' => array( 'checkout/confirm' ),
19
-		'checkout-index' => array( 'checkout/standard' ),
20
-		'checkout-update' => array( 'checkout/update'),
11
+		'account-index' => array('account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'),
12
+		'basket-index' => array('basket/standard', 'basket/related'),
13
+		'catalog-count' => array('catalog/count'),
14
+		'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'),
15
+		'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'),
16
+		'catalog-stock' => array('catalog/stock'),
17
+		'catalog-suggest' => array('catalog/suggest'),
18
+		'checkout-confirm' => array('checkout/confirm'),
19
+		'checkout-index' => array('checkout/standard'),
20
+		'checkout-update' => array('checkout/update'),
21 21
 	),
22 22
 
23 23
 	'resource' => array(
@@ -28,24 +28,24 @@  discard block
 block discarded – undo
28 28
 			'database' => env('DB_DATABASE', 'laravel'),
29 29
 			'username' => env('DB_USERNAME', 'root'),
30 30
 			'password' => env('DB_PASSWORD', ''),
31
-			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
31
+			'stmt' => array("SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'"),
32 32
 			'opt-persistent' => 0,
33 33
 			'limit' => 2,
34 34
 		),
35 35
 		'fs' => array(
36 36
 			'adapter' => 'Standard',
37 37
 			'basedir' => public_path(),
38
-			'tempdir' => storage_path( 'tmp' ),
38
+			'tempdir' => storage_path('tmp'),
39 39
 		),
40 40
 		'fs-admin' => array(
41 41
 			'adapter' => 'Standard',
42
-			'basedir' => public_path( 'uploads' ),
43
-			'tempdir' => storage_path( 'tmp' ),
42
+			'basedir' => public_path('uploads'),
43
+			'tempdir' => storage_path('tmp'),
44 44
 		),
45 45
 		'fs-secure' => array(
46 46
 			'adapter' => 'Standard',
47
-			'basedir' => storage_path( 'secure' ),
48
-			'tempdir' => storage_path( 'tmp' ),
47
+			'basedir' => storage_path('secure'),
48
+			'tempdir' => storage_path('tmp'),
49 49
 		),
50 50
 		'mq' => array(
51 51
 			'adapter' => 'Standard',
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 				'default' => array(
238 238
 					'mimeicon' => array(
239 239
 						# Directory where icons for the mime types stored
240
-						'directory' => public_path( '/packages/aimeos/shop/mimeicons' ),
240
+						'directory' => public_path('/packages/aimeos/shop/mimeicons'),
241 241
 						# File extension of mime type icons
242 242
 						'extension' => '.png'
243 243
 					),
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 						# in the "maxwidth" parameter
286 286
 						# 'maxheight' => 280,
287 287
 					),
288
-					'tempdir' => storage_path( 'aimeos' ),
288
+					'tempdir' => storage_path('aimeos'),
289 289
 				),
290 290
 			),
291 291
 			'product' => array(
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/Context.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
51 51
 	 * @param \Illuminate\Session\Store $session Laravel session object
52 52
 	 */
53
-	public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session )
53
+	public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session)
54 54
 	{
55 55
 		$this->config = $config;
56 56
 		$this->session = $session;
@@ -63,51 +63,51 @@  discard block
 block discarded – undo
63 63
 	 * @param boolean $locale True to add locale object to context, false if not
64 64
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
65 65
 	 */
66
-	public function get( $locale = true )
66
+	public function get($locale = true)
67 67
 	{
68
-		if( self::$context === null )
68
+		if (self::$context === null)
69 69
 		{
70 70
 			$context = new \Aimeos\MShop\Context\Item\Standard();
71 71
 
72 72
 			$config = $this->getConfig();
73
-			$context->setConfig( $config );
73
+			$context->setConfig($config);
74 74
 
75
-			$dbm = new \Aimeos\MW\DB\Manager\PDO( $config );
76
-			$context->setDatabaseManager( $dbm );
75
+			$dbm = new \Aimeos\MW\DB\Manager\PDO($config);
76
+			$context->setDatabaseManager($dbm);
77 77
 
78
-			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) );
79
-			$context->setFilesystemManager( $fs );
78
+			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos'));
79
+			$context->setFilesystemManager($fs);
80 80
 
81
-			$mq = new \Aimeos\MW\MQueue\Manager\Standard( $config );
82
-			$context->setMessageQueueManager( $mq );
81
+			$mq = new \Aimeos\MW\MQueue\Manager\Standard($config);
82
+			$context->setMessageQueueManager($mq);
83 83
 
84
-			$mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } );
85
-			$context->setMail( $mail );
84
+			$mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } );
85
+			$context->setMail($mail);
86 86
 
87
-			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
88
-			$context->setLogger( $logger );
87
+			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context);
88
+			$context->setLogger($logger);
89 89
 
90
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context );
91
-			$context->setCache( $cache );
90
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
91
+			$context->setCache($cache);
92 92
 
93 93
 			self::$context = $context;
94 94
 		}
95 95
 
96 96
 		$context = self::$context;
97 97
 
98
-		if( $locale === true )
98
+		if ($locale === true)
99 99
 		{
100
-			$localeItem = $this->getLocale( $context );
100
+			$localeItem = $this->getLocale($context);
101 101
 			$langid = $localeItem->getLanguageId();
102 102
 
103
-			$context->setLocale( $localeItem );
104
-			$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) );
103
+			$context->setLocale($localeItem);
104
+			$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid)));
105 105
 		}
106 106
 
107
-		$session = new \Aimeos\MW\Session\Laravel5( $this->session );
108
-		$context->setSession( $session );
107
+		$session = new \Aimeos\MW\Session\Laravel5($this->session);
108
+		$context->setSession($session);
109 109
 
110
-		$this->addUser( $context );
110
+		$this->addUser($context);
111 111
 
112 112
 		return $context;
113 113
 	}
@@ -118,20 +118,20 @@  discard block
 block discarded – undo
118 118
 	 *
119 119
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
120 120
 	 */
121
-	protected function addUser( \Aimeos\MShop\Context\Item\Iface $context )
121
+	protected function addUser(\Aimeos\MShop\Context\Item\Iface $context)
122 122
 	{
123
-		if( ( $userid = Auth::id() ) !== null )
123
+		if (($userid = Auth::id()) !== null)
124 124
 		{
125
-			$context->setUserId( $userid );
126
-			$context->setGroupIds( function() use ( $context, $userid )
125
+			$context->setUserId($userid);
126
+			$context->setGroupIds(function() use ($context, $userid)
127 127
 			{
128
-				$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
129
-				return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups();
128
+				$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
129
+				return $manager->getItem($userid, array('customer/group'))->getGroups();
130 130
 			} );
131 131
 		}
132 132
 
133
-		if( ( $user = Auth::user() ) !== null ) {
134
-			$context->setEditor( $user->name );
133
+		if (($user = Auth::user()) !== null) {
134
+			$context->setEditor($user->name);
135 135
 		}
136 136
 	}
137 137
 
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	protected function getConfig()
145 145
 	{
146
-		$configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths();
147
-		$config = new \Aimeos\MW\Config\PHPArray( $this->config->get( 'shop' ), $configPaths );
146
+		$configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths();
147
+		$config = new \Aimeos\MW\Config\PHPArray($this->config->get('shop'), $configPaths);
148 148
 
149
-		if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) {
150
-			$config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) );
149
+		if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) {
150
+			$config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:'));
151 151
 		}
152 152
 
153 153
 		return $config;
@@ -160,18 +160,18 @@  discard block
 block discarded – undo
160 160
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
161 161
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
162 162
 	 */
163
-	protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context )
163
+	protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context)
164 164
 	{
165
-		if( $this->locale === null )
165
+		if ($this->locale === null)
166 166
 		{
167
-			$site = Route::input( 'site', Input::get( 'site', 'default' ) );
168
-			$currency = Route::input( 'currency', Input::get( 'currency', '' ) );
169
-			$lang = Route::input( 'locale', Input::get( 'locale', '' ) );
167
+			$site = Route::input('site', Input::get('site', 'default'));
168
+			$currency = Route::input('currency', Input::get('currency', ''));
169
+			$lang = Route::input('locale', Input::get('locale', ''));
170 170
 
171
-			$disableSites = $this->config->get( 'shop.disableSites', true );
171
+			$disableSites = $this->config->get('shop.disableSites', true);
172 172
 
173
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
174
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites );
173
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
174
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites);
175 175
 		}
176 176
 
177 177
 		return $this->locale;
Please login to merge, or discard this patch.