Completed
Push — master ( 3df36a...73a491 )
by Aimeos
03:04
created
src/Aimeos/Shop/Base/Context.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
50 50
 	 * @param \Illuminate\Session\Store $session Laravel session object
51 51
 	 */
52
-	public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session )
52
+	public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session)
53 53
 	{
54 54
 		$this->config = $config;
55 55
 		$this->session = $session;
@@ -62,51 +62,51 @@  discard block
 block discarded – undo
62 62
 	 * @param boolean $locale True to add locale object to context, false if not
63 63
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
64 64
 	 */
65
-	public function get( $locale = true )
65
+	public function get($locale = true)
66 66
 	{
67
-		if( self::$context === null )
67
+		if (self::$context === null)
68 68
 		{
69 69
 			$context = new \Aimeos\MShop\Context\Item\Standard();
70 70
 
71 71
 			$config = $this->getConfig();
72
-			$context->setConfig( $config );
72
+			$context->setConfig($config);
73 73
 
74
-			$dbm = new \Aimeos\MW\DB\Manager\PDO( $config );
75
-			$context->setDatabaseManager( $dbm );
74
+			$dbm = new \Aimeos\MW\DB\Manager\PDO($config);
75
+			$context->setDatabaseManager($dbm);
76 76
 
77
-			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) );
78
-			$context->setFilesystemManager( $fs );
77
+			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos'));
78
+			$context->setFilesystemManager($fs);
79 79
 
80
-			$mq = new \Aimeos\MW\MQueue\Manager\Standard( $config );
81
-			$context->setMessageQueueManager( $mq );
80
+			$mq = new \Aimeos\MW\MQueue\Manager\Standard($config);
81
+			$context->setMessageQueueManager($mq);
82 82
 
83
-			$mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } );
84
-			$context->setMail( $mail );
83
+			$mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } );
84
+			$context->setMail($mail);
85 85
 
86
-			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
87
-			$context->setLogger( $logger );
86
+			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context);
87
+			$context->setLogger($logger);
88 88
 
89
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context );
90
-			$context->setCache( $cache );
89
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
90
+			$context->setCache($cache);
91 91
 
92 92
 			self::$context = $context;
93 93
 		}
94 94
 
95 95
 		$context = self::$context;
96 96
 
97
-		if( $locale === true )
97
+		if ($locale === true)
98 98
 		{
99
-			$localeItem = $this->getLocale( $context );
99
+			$localeItem = $this->getLocale($context);
100 100
 			$langid = $localeItem->getLanguageId();
101 101
 
102
-			$context->setLocale( $localeItem );
103
-			$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) );
102
+			$context->setLocale($localeItem);
103
+			$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid)));
104 104
 		}
105 105
 
106
-		$session = new \Aimeos\MW\Session\Laravel5( $this->session );
107
-		$context->setSession( $session );
106
+		$session = new \Aimeos\MW\Session\Laravel5($this->session);
107
+		$context->setSession($session);
108 108
 
109
-		$this->addUser( $context );
109
+		$this->addUser($context);
110 110
 
111 111
 		return $context;
112 112
 	}
@@ -117,20 +117,20 @@  discard block
 block discarded – undo
117 117
 	 *
118 118
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
119 119
 	 */
120
-	protected function addUser( \Aimeos\MShop\Context\Item\Iface $context )
120
+	protected function addUser(\Aimeos\MShop\Context\Item\Iface $context)
121 121
 	{
122
-		if( ( $userid = Auth::id() ) !== null )
122
+		if (($userid = Auth::id()) !== null)
123 123
 		{
124
-			$context->setUserId( $userid );
125
-			$context->setGroupIds( function() use ( $context, $userid )
124
+			$context->setUserId($userid);
125
+			$context->setGroupIds(function() use ($context, $userid)
126 126
 			{
127
-				$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
128
-				return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups();
127
+				$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
128
+				return $manager->getItem($userid, array('customer/group'))->getGroups();
129 129
 			} );
130 130
 		}
131 131
 
132
-		if( ( $user = Auth::user() ) !== null ) {
133
-			$context->setEditor( $user->name );
132
+		if (($user = Auth::user()) !== null) {
133
+			$context->setEditor($user->name);
134 134
 		}
135 135
 	}
136 136
 
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	protected function getConfig()
144 144
 	{
145
-		$configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths();
146
-		$config = new \Aimeos\MW\Config\PHPArray( $this->config->get( 'shop' ), $configPaths );
145
+		$configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths();
146
+		$config = new \Aimeos\MW\Config\PHPArray($this->config->get('shop'), $configPaths);
147 147
 
148
-		if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) {
149
-			$config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) );
148
+		if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) {
149
+			$config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:'));
150 150
 		}
151 151
 
152 152
 		return $config;
@@ -159,15 +159,15 @@  discard block
 block discarded – undo
159 159
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
160 160
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
161 161
 	 */
162
-	protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context )
162
+	protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context)
163 163
 	{
164
-		if( $this->locale === null )
164
+		if ($this->locale === null)
165 165
 		{
166
-			if( Route::current() !== null )
166
+			if (Route::current() !== null)
167 167
 			{
168
-				$site = Route::input( 'site', 'default' );
169
-				$lang = Route::input( 'locale', '' );
170
-				$currency = Route::input( 'currency', '' );
168
+				$site = Route::input('site', 'default');
169
+				$lang = Route::input('locale', '');
170
+				$currency = Route::input('currency', '');
171 171
 			}
172 172
 			else
173 173
 			{
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 				$lang = $currency = '';
176 176
 			}
177 177
 
178
-			$disableSites = $this->config->has( 'shop.disableSites' );
178
+			$disableSites = $this->config->has('shop.disableSites');
179 179
 
180
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
181
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites );
180
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
181
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites);
182 182
 		}
183 183
 
184 184
 		return $this->locale;
Please login to merge, or discard this patch.
src/Aimeos/Shop/ShopServiceProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -33,36 +33,36 @@
 block discarded – undo
33 33
 	 */
34 34
 	public function boot()
35 35
 	{
36
-		$basedir = dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR;
36
+		$basedir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR;
37 37
 
38 38
 		$config = array_replace_recursive(
39 39
 			$this->app['config']->get('shop', []),
40
-			require $basedir.'default.php',
41
-			require $basedir.'config/shop.php'
40
+			require $basedir . 'default.php',
41
+			require $basedir . 'config/shop.php'
42 42
 		);
43 43
 		$this->app['config']->set('shop', $config);
44 44
 
45
-		$this->loadViewsFrom($basedir.'views', 'shop');
45
+		$this->loadViewsFrom($basedir . 'views', 'shop');
46 46
 
47 47
 
48 48
 		$this->publishes(array(
49
-			$basedir.'config/shop.php' => config_path('shop.php'),
49
+			$basedir . 'config/shop.php' => config_path('shop.php'),
50 50
 		), 'config');
51 51
 
52 52
 		$this->publishes(array(
53
-			$basedir.'database/migrations' => base_path('database/migrations'),
53
+			$basedir . 'database/migrations' => base_path('database/migrations'),
54 54
 		), 'migrations');
55 55
 
56 56
 		$this->publishes(array(
57
-			$basedir.'views' => base_path('resources/views/vendor/shop'),
57
+			$basedir . 'views' => base_path('resources/views/vendor/shop'),
58 58
 		), 'views');
59 59
 
60 60
 		$this->publishes(array(
61
-			dirname($basedir).DIRECTORY_SEPARATOR.'public' => public_path('packages/aimeos/shop'),
61
+			dirname($basedir) . DIRECTORY_SEPARATOR . 'public' => public_path('packages/aimeos/shop'),
62 62
 		), 'public');
63 63
 
64 64
 
65
-		require $basedir.'routes.php';
65
+		require $basedir . 'routes.php';
66 66
 	}
67 67
 
68 68
 
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.