Completed
Push — master ( 960354...758f3f )
by Aimeos
04:30
created
src/Aimeos/Shop/Controller/CheckoutController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function confirmAction()
30 30
 	{
31
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-confirm' );
31
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-confirm');
32 32
 		return \View::make('shop::checkout.confirm', $params);
33 33
 	}
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function indexAction()
42 42
 	{
43
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-index' );
43
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-index');
44 44
 		return \View::make('shop::checkout.index', $params);
45 45
 	}
46 46
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function updateAction()
54 54
 	{
55
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-update' );
55
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-update');
56 56
 		return \View::make('shop::checkout.update', $params);
57 57
 	}
58 58
 }
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/ShopServiceProvider.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,31 +28,31 @@
 block discarded – undo
28 28
 	 */
29 29
 	public function boot()
30 30
 	{
31
-		$basedir = dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR;
31
+		$basedir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR;
32 32
 
33
-		$this->mergeConfigFrom(dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.'config/shop.php', 'shop');
33
+		$this->mergeConfigFrom(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'config/shop.php', 'shop');
34 34
 
35
-		$this->loadViewsFrom($basedir.'views', 'shop');
35
+		$this->loadViewsFrom($basedir . 'views', 'shop');
36 36
 
37 37
 
38 38
 		$this->publishes(array(
39
-			$basedir.'config/shop.php' => config_path('shop.php'),
39
+			$basedir . 'config/shop.php' => config_path('shop.php'),
40 40
 		), 'config');
41 41
 
42 42
 		$this->publishes(array(
43
-			$basedir.'database/migrations' => base_path('database/migrations'),
43
+			$basedir . 'database/migrations' => base_path('database/migrations'),
44 44
 		), 'migrations');
45 45
 
46 46
 		$this->publishes(array(
47
-			$basedir.'views' => base_path('resources/views/vendor/shop'),
47
+			$basedir . 'views' => base_path('resources/views/vendor/shop'),
48 48
 		), 'views');
49 49
 
50 50
 		$this->publishes(array(
51
-			dirname($basedir).DIRECTORY_SEPARATOR.'public' => public_path('packages/aimeos/shop'),
51
+			dirname($basedir) . DIRECTORY_SEPARATOR . 'public' => public_path('packages/aimeos/shop'),
52 52
 		), 'public');
53 53
 
54 54
 
55
-		require $basedir.'routes.php';
55
+		require $basedir . 'routes.php';
56 56
 	}
57 57
 
58 58
 
Please login to merge, or discard this patch.
src/Aimeos/Shop/Command/AccountCommand.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -39,21 +39,21 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function fire()
41 41
 	{
42
-		$code = $this->argument( 'email' );
43
-		if( ( $password = $this->option( 'password' ) ) === null ) {
44
-			$password = $this->secret( 'Password' );
42
+		$code = $this->argument('email');
43
+		if (($password = $this->option('password')) === null) {
44
+			$password = $this->secret('Password');
45 45
 		}
46 46
 
47
-		$context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false );
48
-		$context->setEditor( 'aimeos:account' );
47
+		$context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false);
48
+		$context->setEditor('aimeos:account');
49 49
 
50
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
51
-		$context->setLocale( $localeManager->createItem() );
50
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
51
+		$context->setLocale($localeManager->createItem());
52 52
 
53
-		$user = $this->createCustomerItem( $context, $code, $password );
53
+		$user = $this->createCustomerItem($context, $code, $password);
54 54
 
55
-		if( $this->option( 'admin' ) ) {
56
-			$this->addPrivilege( $context, $user, 'admin' );
55
+		if ($this->option('admin')) {
56
+			$this->addPrivilege($context, $user, 'admin');
57 57
 		}
58 58
 	}
59 59
 
@@ -65,31 +65,31 @@  discard block
 block discarded – undo
65 65
 	 * @param string $userid Unique user ID
66 66
 	 * @param string $groupid Unique group ID
67 67
 	 */
68
-	protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid )
68
+	protected function addListItem(\Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid)
69 69
 	{
70
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'lists' );
71
-		$typeid = $this->getTypeItem( $manager, 'default' )->getId();
70
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('lists');
71
+		$typeid = $this->getTypeItem($manager, 'default')->getId();
72 72
 
73 73
 		$search = $manager->createSearch();
74 74
 		$expr = array(
75
-			$search->compare( '==', 'customer.lists.parentid', $userid ),
76
-			$search->compare( '==', 'customer.lists.refid', $groupid ),
77
-			$search->compare( '==', 'customer.lists.domain', 'customer/group' ),
78
-			$search->compare( '==', 'customer.lists.typeid', $typeid ),
75
+			$search->compare('==', 'customer.lists.parentid', $userid),
76
+			$search->compare('==', 'customer.lists.refid', $groupid),
77
+			$search->compare('==', 'customer.lists.domain', 'customer/group'),
78
+			$search->compare('==', 'customer.lists.typeid', $typeid),
79 79
 		);
80
-		$search->setConditions( $search->combine( '&&', $expr ) );
81
-		$search->setSlice( 0, 1 );
80
+		$search->setConditions($search->combine('&&', $expr));
81
+		$search->setSlice(0, 1);
82 82
 
83
-		if( count( $manager->searchItems( $search ) ) === 0 )
83
+		if (count($manager->searchItems($search)) === 0)
84 84
 		{
85 85
 			$item = $manager->createItem();
86
-			$item->setDomain( 'customer/group' );
87
-			$item->setParentId( $userid );
88
-			$item->setTypeId( $typeid );
89
-			$item->setRefId( $groupid );
90
-			$item->setStatus( 1 );
86
+			$item->setDomain('customer/group');
87
+			$item->setParentId($userid);
88
+			$item->setTypeId($typeid);
89
+			$item->setRefId($groupid);
90
+			$item->setStatus(1);
91 91
 
92
-			$manager->saveItem( $item, false );
92
+			$manager->saveItem($item, false);
93 93
 		}
94 94
 	}
95 95
 
@@ -101,23 +101,23 @@  discard block
 block discarded – undo
101 101
 	 * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object
102 102
 	 * @param string $privilege Unique customer group code
103 103
 	 */
104
-	protected function addPrivilege( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege )
104
+	protected function addPrivilege(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege)
105 105
 	{
106
-		$this->info( sprintf( 'Add "%1$s" privilege to user "%2$s" for sites', $privilege, $user->getCode() ) );
106
+		$this->info(sprintf('Add "%1$s" privilege to user "%2$s" for sites', $privilege, $user->getCode()));
107 107
 
108
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
108
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
109 109
 
110
-		foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem )
110
+		foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem)
111 111
 		{
112
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
112
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
113 113
 
114 114
 			$lcontext = clone $context;
115
-			$lcontext->setLocale( $localeItem );
115
+			$lcontext->setLocale($localeItem);
116 116
 
117
-			$this->info( '- ' . $siteItem->getCode() );
117
+			$this->info('- ' . $siteItem->getCode());
118 118
 
119
-			$groupItem = $this->getGroupItem( $lcontext, $privilege );
120
-			$this->addListItem( $lcontext, $user->getId(), $groupItem->getId() );
119
+			$groupItem = $this->getGroupItem($lcontext, $privilege);
120
+			$this->addListItem($lcontext, $user->getId(), $groupItem->getId());
121 121
 		}
122 122
 	}
123 123
 
@@ -132,21 +132,21 @@  discard block
 block discarded – undo
132 132
 	 * @param string $password New user password
133 133
 	 * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object
134 134
 	 */
135
-	protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password )
135
+	protected function createCustomerItem(\Aimeos\MShop\Context\Item\Iface $context, $email, $password)
136 136
 	{
137
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
137
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
138 138
 
139 139
 		try {
140
-			$item = $manager->getItem( $email );
141
-		} catch( \Aimeos\MShop\Exception $e ) {
140
+			$item = $manager->getItem($email);
141
+		} catch (\Aimeos\MShop\Exception $e) {
142 142
 			$item = $manager->createItem();
143 143
 		}
144 144
 
145
-		$item->setCode( $email );
146
-		$item->getPaymentAddress()->setEmail( $email );
147
-		$item->setPassword( $password );
145
+		$item->setCode($email);
146
+		$item->getPaymentAddress()->setEmail($email);
147
+		$item->setPassword($password);
148 148
 
149
-		$manager->saveItem( $item );
149
+		$manager->saveItem($item);
150 150
 
151 151
 		return $item;
152 152
 	}
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
 	protected function getArguments()
161 161
 	{
162 162
 		return array(
163
-			array( 'email', InputArgument::REQUIRED, 'E-mail address of the account that should be created' ),
164
-			array( 'site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)' ),
163
+			array('email', InputArgument::REQUIRED, 'E-mail address of the account that should be created'),
164
+			array('site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)'),
165 165
 		);
166 166
 	}
167 167
 
@@ -173,21 +173,21 @@  discard block
 block discarded – undo
173 173
 	 * @param string $code Unique customer group code
174 174
 	 * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object
175 175
 	 */
176
-	protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code )
176
+	protected function getGroupItem(\Aimeos\MShop\Context\Item\Iface $context, $code)
177 177
 	{
178
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' );
178
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('group');
179 179
 
180 180
 		try
181 181
 		{
182
-			$item = $manager->getItem( $code );
182
+			$item = $manager->getItem($code);
183 183
 		}
184
-		catch( \Aimeos\MShop\Exception $e )
184
+		catch (\Aimeos\MShop\Exception $e)
185 185
 		{
186 186
 			$item = $manager->createItem();
187
-			$item->setLabel( $code );
188
-			$item->setCode( $code );
187
+			$item->setLabel($code);
188
+			$item->setCode($code);
189 189
 
190
-			$manager->saveItem( $item );
190
+			$manager->saveItem($item);
191 191
 		}
192 192
 
193 193
 		return $item;
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 	protected function getOptions()
203 203
 	{
204 204
 		return array(
205
-				array( 'password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)' ),
206
-				array( 'admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges' ),
205
+				array('password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)'),
206
+				array('admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges'),
207 207
 		);
208 208
 	}
209 209
 
@@ -216,23 +216,23 @@  discard block
 block discarded – undo
216 216
 	 * @return \Aimeos\MShop\Common\Item\Type\Iface Aimeos customer list type item object
217 217
 	 * @throws \Exception If no customer list type item for the given code is found
218 218
 	 */
219
-	protected function getTypeItem( \Aimeos\MShop\Common\Manager\Iface $listManager, $code )
219
+	protected function getTypeItem(\Aimeos\MShop\Common\Manager\Iface $listManager, $code)
220 220
 	{
221
-		$manager = $listManager->getSubmanager( 'type' );
221
+		$manager = $listManager->getSubmanager('type');
222 222
 
223 223
 		$search = $manager->createSearch();
224 224
 		$expr = array(
225
-			$search->compare( '==', 'customer.lists.type.domain', 'customer/group' ),
226
-			$search->compare( '==', 'customer.lists.type.code', $code ),
225
+			$search->compare('==', 'customer.lists.type.domain', 'customer/group'),
226
+			$search->compare('==', 'customer.lists.type.code', $code),
227 227
 		);
228
-		$search->setConditions( $search->combine( '&&', $expr ) );
228
+		$search->setConditions($search->combine('&&', $expr));
229 229
 
230
-		$result = $manager->searchItems( $search );
230
+		$result = $manager->searchItems($search);
231 231
 
232
-		if( ( $item = reset( $result ) ) === false )
232
+		if (($item = reset($result)) === false)
233 233
 		{
234
-			$msg = sprintf( 'No user list type item for domain "%1$s" and code "%2$s" found', 'customer/group', $code );
235
-			throw new \Exception( $msg );
234
+			$msg = sprintf('No user list type item for domain "%1$s" and code "%2$s" found', 'customer/group', $code);
235
+			throw new \Exception($msg);
236 236
 		}
237 237
 
238 238
 		return $item;
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/Support.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param \Aimeos\Shop\Base\Context $context Context object
31 31
 	 */
32
-	public function __construct( \Aimeos\Shop\Base\Context $context )
32
+	public function __construct(\Aimeos\Shop\Base\Context $context)
33 33
 	{
34 34
 		$this->context = $context;
35 35
 	}
@@ -42,21 +42,21 @@  discard block
 block discarded – undo
42 42
 	 * @param string $groupcode Unique user/customer group code
43 43
 	 * @return boolean True if user is part of the group, false if not
44 44
 	 */
45
-	public function checkGroup( $userid, $groupcode )
45
+	public function checkGroup($userid, $groupcode)
46 46
 	{
47 47
 		$context = $this->context->get();
48
-		$group = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' )->getItem( $groupcode );
49
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
48
+		$group = \Aimeos\MShop\Factory::createManager($context, 'customer/group')->getItem($groupcode);
49
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
50 50
 
51 51
 		$search = $manager->createSearch();
52 52
 		$expr = array(
53
-			$search->compare( '==', 'customer.lists.parentid', $userid ),
54
-			$search->compare( '==', 'customer.lists.refid', $group->getId() ),
55
-			$search->compare( '==', 'customer.lists.domain', 'customer/group' ),
53
+			$search->compare('==', 'customer.lists.parentid', $userid),
54
+			$search->compare('==', 'customer.lists.refid', $group->getId()),
55
+			$search->compare('==', 'customer.lists.domain', 'customer/group'),
56 56
 		);
57
-		$search->setConditions( $search->combine( '&&', $expr ) );
58
-		$search->setSlice( 0, 1 );
57
+		$search->setConditions($search->combine('&&', $expr));
58
+		$search->setSlice(0, 1);
59 59
 
60
-		return (bool) count( $manager->searchItems( $search ) );
60
+		return (bool) count($manager->searchItems($search));
61 61
 	}
62 62
 }
63 63
\ No newline at end of file
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
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
46 46
 	 * @param \Illuminate\Session\Store $session Laravel session object
47 47
 	 */
48
-	public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session )
48
+	public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session)
49 49
 	{
50 50
 		$this->config = $config;
51 51
 		$this->session = $session;
@@ -58,48 +58,48 @@  discard block
 block discarded – undo
58 58
 	 * @param boolean $locale True to add locale object to context, false if not
59 59
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
60 60
 	 */
61
-	public function get( $locale = true )
61
+	public function get($locale = true)
62 62
 	{
63
-		if( self::$context === null )
63
+		if (self::$context === null)
64 64
 		{
65 65
 			$context = new \Aimeos\MShop\Context\Item\Standard();
66 66
 
67 67
 			$config = $this->getConfig();
68
-			$context->setConfig( $config );
68
+			$context->setConfig($config);
69 69
 
70
-			$dbm = new \Aimeos\MW\DB\Manager\PDO( $config );
71
-			$context->setDatabaseManager( $dbm );
70
+			$dbm = new \Aimeos\MW\DB\Manager\PDO($config);
71
+			$context->setDatabaseManager($dbm);
72 72
 
73
-			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) );
74
-			$context->setFilesystemManager( $fs );
73
+			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos'));
74
+			$context->setFilesystemManager($fs);
75 75
 
76
-			$mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } );
77
-			$context->setMail( $mail );
76
+			$mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } );
77
+			$context->setMail($mail);
78 78
 
79
-			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
80
-			$context->setLogger( $logger );
79
+			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context);
80
+			$context->setLogger($logger);
81 81
 
82
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context );
83
-			$context->setCache( $cache );
82
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
83
+			$context->setCache($cache);
84 84
 
85 85
 			self::$context = $context;
86 86
 		}
87 87
 
88 88
 		$context = self::$context;
89 89
 
90
-		if( $locale === true )
90
+		if ($locale === true)
91 91
 		{
92
-			$localeItem = $this->getLocale( $context );
92
+			$localeItem = $this->getLocale($context);
93 93
 			$langid = $localeItem->getLanguageId();
94 94
 
95
-			$context->setLocale( $localeItem );
96
-			$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) );
95
+			$context->setLocale($localeItem);
96
+			$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid)));
97 97
 		}
98 98
 
99
-		$session = new \Aimeos\MW\Session\Laravel4( $this->session );
100
-		$context->setSession( $session );
99
+		$session = new \Aimeos\MW\Session\Laravel4($this->session);
100
+		$context->setSession($session);
101 101
 
102
-		$this->addUser( $context );
102
+		$this->addUser($context);
103 103
 
104 104
 		return $context;
105 105
 	}
@@ -110,20 +110,20 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
112 112
 	 */
113
-	protected function addUser( \Aimeos\MShop\Context\Item\Iface $context )
113
+	protected function addUser(\Aimeos\MShop\Context\Item\Iface $context)
114 114
 	{
115
-		if( ( $userid = \Auth::id() ) !== null )
115
+		if (($userid = \Auth::id()) !== null)
116 116
 		{
117
-			$context->setUserId( $userid );
118
-			$context->setGroupIds( function() use ( $context, $userid )
117
+			$context->setUserId($userid);
118
+			$context->setGroupIds(function() use ($context, $userid)
119 119
 			{
120
-				$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
121
-				return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups();
120
+				$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
121
+				return $manager->getItem($userid, array('customer/group'))->getGroups();
122 122
 			} );
123 123
 		}
124 124
 
125
-		if( ( $user = \Auth::user() ) !== null ) {
126
-			$context->setEditor( $user->name );
125
+		if (($user = \Auth::user()) !== null) {
126
+			$context->setEditor($user->name);
127 127
 		}
128 128
 	}
129 129
 
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	protected function getConfig()
137 137
 	{
138
-		$conf = $this->config->get( 'shop' );
138
+		$conf = $this->config->get('shop');
139 139
 
140
-		$configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths( 'mysql' );
141
-		$config = new \Aimeos\MW\Config\PHPArray( $conf, $configPaths );
140
+		$configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths('mysql');
141
+		$config = new \Aimeos\MW\Config\PHPArray($conf, $configPaths);
142 142
 
143
-		if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) {
144
-			$config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) );
143
+		if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) {
144
+			$config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:'));
145 145
 		}
146 146
 
147 147
 		return $config;
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
155 155
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
156 156
 	 */
157
-	protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context )
157
+	protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context)
158 158
 	{
159
-		if( $this->locale === null )
159
+		if ($this->locale === null)
160 160
 		{
161
-			if( \Route::current() !== null )
161
+			if (\Route::current() !== null)
162 162
 			{
163
-				$site = \Route::input( 'site', 'default' );
164
-				$lang = \Route::input( 'locale', '' );
165
-				$currency = \Route::input( 'currency', '' );
163
+				$site = \Route::input('site', 'default');
164
+				$lang = \Route::input('locale', '');
165
+				$currency = \Route::input('currency', '');
166 166
 			}
167 167
 			else
168 168
 			{
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 				$lang = $currency = '';
171 171
 			}
172 172
 
173
-			$disableSites = $this->config->has( 'shop.disableSites' );
173
+			$disableSites = $this->config->has('shop.disableSites');
174 174
 
175
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
176
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites );
175
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
176
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites);
177 177
 		}
178 178
 
179 179
 		return $this->locale;
Please login to merge, or discard this patch.
src/config/shop.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 return array(
4 4
 	'apc_enabled' => false,
5 5
 	'apc_prefix' => 'laravel:',
6
-	'extdir' => ( is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext' ),
6
+	'extdir' => (is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext'),
7 7
 	'uploaddir' => '/',
8 8
 
9 9
 	'routes' => array(
@@ -14,16 +14,16 @@  discard block
 block discarded – undo
14 14
 	),
15 15
 
16 16
 	'page' => array(
17
-		'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
18
-		'basket-index' => array( 'basket/standard','basket/related' ),
19
-		'catalog-count' => array( 'catalog/count' ),
20
-		'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
21
-		'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
22
-		'catalog-stock' => array( 'catalog/stock' ),
23
-		'catalog-suggest' => array( 'catalog/suggest' ),
24
-		'checkout-confirm' => array( 'checkout/confirm' ),
25
-		'checkout-index' => array( 'checkout/standard' ),
26
-		'checkout-update' => array( 'checkout/update'),
17
+		'account-index' => array('account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'),
18
+		'basket-index' => array('basket/standard', 'basket/related'),
19
+		'catalog-count' => array('catalog/count'),
20
+		'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'),
21
+		'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'),
22
+		'catalog-stock' => array('catalog/stock'),
23
+		'catalog-suggest' => array('catalog/suggest'),
24
+		'checkout-confirm' => array('checkout/confirm'),
25
+		'checkout-index' => array('checkout/standard'),
26
+		'checkout-update' => array('checkout/update'),
27 27
 	),
28 28
 
29 29
 	'resource' => array(
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 			'database' => env('DB_DATABASE', 'laravel'),
35 35
 			'username' => env('DB_USERNAME', 'root'),
36 36
 			'password' => env('DB_PASSWORD', ''),
37
-			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
37
+			'stmt' => array("SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'"),
38 38
 			'opt-persistent' => 0,
39 39
 			'limit' => 2,
40 40
 		),
41 41
 		'fs' => array(
42 42
 			'adapter' => 'Standard',
43 43
 			'basedir' => public_path(),
44
-			'tempdir' => storage_path( 'aimeos' ),
44
+			'tempdir' => storage_path('aimeos'),
45 45
 		),
46 46
 		'fs-admin' => array(
47 47
 			'adapter' => 'Standard',
48
-			'basedir' => public_path( 'uploads' ),
49
-			'tempdir' => storage_path( 'aimeos' ),
48
+			'basedir' => public_path('uploads'),
49
+			'tempdir' => storage_path('aimeos'),
50 50
 		),
51 51
 		/* 'fs-media' => array(
52 52
 			'adapter' => 'Standard',
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 				'default' => array(
192 192
 					'mimeicon' => array(
193 193
 						# Directory where icons for the mime types stored
194
-						'directory' => public_path( '/packages/aimeos/shop/mimeicons' ),
194
+						'directory' => public_path('/packages/aimeos/shop/mimeicons'),
195 195
 						# File extension of mime type icons
196 196
 						'extension' => '.png'
197 197
 					),
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 						# in the "maxwidth" parameter
235 235
 						# maxheight: 280
236 236
 					),
237
-					'tempdir' => storage_path( 'aimeos' ),
237
+					'tempdir' => storage_path('aimeos'),
238 238
 				),
239 239
 			),
240 240
 			'product' => array(
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/AdminController.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -32,54 +32,54 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	public function indexAction()
34 34
 	{
35
-		if( config( 'shop.authorize', true ) ) {
36
-			$this->authorize( 'admin' );
35
+		if (config('shop.authorize', true)) {
36
+			$this->authorize('admin');
37 37
 		}
38 38
 
39
-		$site = \Input::get( 'site', 'default' );
40
-		$lang = \Input::get( 'lang', config( 'app.locale', 'en' ) );
39
+		$site = \Input::get('site', 'default');
40
+		$lang = \Input::get('lang', config('app.locale', 'en'));
41 41
 
42
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
43
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
42
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
43
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
44 44
 
45
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
46
-		$context = $this->setLocale( $context, $site, $lang );
45
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
46
+		$context = $this->setLocale($context, $site, $lang);
47 47
 
48
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
48
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
49 49
 		$cssFiles = array();
50 50
 
51
-		foreach( $aimeos->getCustomPaths( 'client/extjs' ) as $base => $paths )
51
+		foreach ($aimeos->getCustomPaths('client/extjs') as $base => $paths)
52 52
 		{
53
-			foreach( $paths as $path )
53
+			foreach ($paths as $path)
54 54
 			{
55 55
 				$jsbAbsPath = $base . '/' . $path;
56 56
 
57
-				if( !is_file( $jsbAbsPath ) ) {
58
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
57
+				if (!is_file($jsbAbsPath)) {
58
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
59 59
 				}
60 60
 
61
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
62
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
61
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
62
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
63 63
 			}
64 64
 		}
65 65
 
66
-		$params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' );
67
-		$adminUrl = route( 'aimeos_shop_admin', $params );
68
-		$jsonUrl = route( 'aimeos_shop_admin_json', array( '_token' => csrf_token() ) );
66
+		$params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
67
+		$adminUrl = route('aimeos_shop_admin', $params);
68
+		$jsonUrl = route('aimeos_shop_admin_json', array('_token' => csrf_token()));
69 69
 
70 70
 		$vars = array(
71 71
 			'lang' => $lang,
72 72
 			'cssFiles' => $cssFiles,
73
-			'languages' => $this->getJsonLanguages( $context),
74
-			'config' => $this->getJsonClientConfig( $context ),
75
-			'site' => $this->getJsonSiteItem( $context, \Input::get( 'site', 'default' ) ),
76
-			'i18nContent' => $this->getJsonClientI18n( $aimeos->getI18nPaths(), $lang ),
73
+			'languages' => $this->getJsonLanguages($context),
74
+			'config' => $this->getJsonClientConfig($context),
75
+			'site' => $this->getJsonSiteItem($context, \Input::get('site', 'default')),
76
+			'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang),
77 77
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
78 78
 			'itemSchemas' => $controller->getJsonItemSchemas(),
79
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
80
-			'urlTemplate' => urldecode( $adminUrl ),
81
-			'uploaddir' => \Config::get( 'shop::uploaddir' ),
82
-			'activeTab' => \Input::get( 'tab', 0 ),
79
+			'smd' => $controller->getJsonSmd($jsonUrl),
80
+			'urlTemplate' => urldecode($adminUrl),
81
+			'uploaddir' => \Config::get('shop::uploaddir'),
82
+			'activeTab' => \Input::get('tab', 0),
83 83
 			'version' => $this->getVersion(),
84 84
 		);
85 85
 
@@ -94,20 +94,20 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function doAction()
96 96
 	{
97
-		if( config( 'shop.authorize', true ) ) {
98
-			$this->authorize( 'admin' );
97
+		if (config('shop.authorize', true)) {
98
+			$this->authorize('admin');
99 99
 		}
100 100
 
101
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
102
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
101
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
102
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
103 103
 
104
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
105
-		$context = $this->setLocale( $context );
104
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
105
+		$context = $this->setLocale($context);
106 106
 
107
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
107
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
108 108
 
109
-		$response = $controller->process( \Input::instance()->request->all(), 'php://input' );
110
-		return \View::make('shop::admin.do', array( 'output' => $response ));
109
+		$response = $controller->process(\Input::instance()->request->all(), 'php://input');
110
+		return \View::make('shop::admin.do', array('output' => $response));
111 111
 	}
112 112
 
113 113
 
@@ -118,32 +118,32 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function fileAction()
120 120
 	{
121
-		if( config( 'shop.authorize', true ) ) {
122
-			$this->authorize( 'admin' );
121
+		if (config('shop.authorize', true)) {
122
+			$this->authorize('admin');
123 123
 		}
124 124
 
125 125
 		$contents = '';
126 126
 		$jsFiles = array();
127
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
127
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
128 128
 
129
-		foreach( $aimeos->getCustomPaths( 'client/extjs' ) as $base => $paths )
129
+		foreach ($aimeos->getCustomPaths('client/extjs') as $base => $paths)
130 130
 		{
131
-			foreach( $paths as $path )
131
+			foreach ($paths as $path)
132 132
 			{
133 133
 				$jsbAbsPath = $base . '/' . $path;
134
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
135
-				$jsFiles = array_merge( $jsFiles, $jsb2->getUrls( 'js', '' ) );
134
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
135
+				$jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', ''));
136 136
 			}
137 137
 		}
138 138
 
139
-		foreach( $jsFiles as $file )
139
+		foreach ($jsFiles as $file)
140 140
 		{
141
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
141
+			if (($content = file_get_contents($file)) !== false) {
142 142
 				$contents .= $content;
143 143
 			}
144 144
 		}
145 145
 
146
-		return response( $contents )->header( 'Content-Type', 'application/javascript' );
146
+		return response($contents)->header('Content-Type', 'application/javascript');
147 147
 	}
148 148
 
149 149
 
@@ -153,30 +153,30 @@  discard block
 block discarded – undo
153 153
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
154 154
 	 * @return array List of language IDs with labels
155 155
 	 */
156
-	protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context )
156
+	protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context)
157 157
 	{
158
-		$paths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nPaths();
158
+		$paths = app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nPaths();
159 159
 		$langs = array();
160 160
 
161
-		if( !isset( $paths['client/extjs'] ) ) {
162
-			return json_encode( array() );
161
+		if (!isset($paths['client/extjs'])) {
162
+			return json_encode(array());
163 163
 		}
164 164
 
165
-		foreach( $paths['client/extjs'] as $path )
165
+		foreach ($paths['client/extjs'] as $path)
166 166
 		{
167
-			$iter = new \DirectoryIterator( $path );
167
+			$iter = new \DirectoryIterator($path);
168 168
 
169
-			foreach( $iter as $file )
169
+			foreach ($iter as $file)
170 170
 			{
171 171
 				$name = $file->getFilename();
172 172
 
173
-				if( preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name ) ) {
173
+				if (preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name)) {
174 174
 					$langs[$name] = null;
175 175
 				}
176 176
 			}
177 177
 		}
178 178
 
179
-		return json_encode( $this->getLanguages( $context, array_keys( $langs ) ) );
179
+		return json_encode($this->getLanguages($context, array_keys($langs)));
180 180
 	}
181 181
 
182 182
 
@@ -186,10 +186,10 @@  discard block
 block discarded – undo
186 186
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
187 187
 	 * @return string JSON encoded configuration object
188 188
 	 */
189
-	protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
189
+	protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
190 190
 	{
191
-		$config = $context->getConfig()->get( 'client/extjs', array() );
192
-		return json_encode( array( 'client' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
191
+		$config = $context->getConfig()->get('client/extjs', array());
192
+		return json_encode(array('client' => array('extjs' => $config)), JSON_FORCE_OBJECT);
193 193
 	}
194 194
 
195 195
 
@@ -200,16 +200,16 @@  discard block
 block discarded – undo
200 200
 	 * @param string $lang ISO language code like "en" or "en_GB"
201 201
 	 * @return string JSON encoded translation object
202 202
 	 */
203
-	protected function getJsonClientI18n( array $i18nPaths, $lang )
203
+	protected function getJsonClientI18n(array $i18nPaths, $lang)
204 204
 	{
205
-		$i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) );
205
+		$i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true));
206 206
 
207 207
 		$content = array(
208
-			'client/extjs' => $i18n->getAll( 'client/extjs' ),
209
-			'client/extjs/ext' => $i18n->getAll( 'client/extjs/ext' ),
208
+			'client/extjs' => $i18n->getAll('client/extjs'),
209
+			'client/extjs/ext' => $i18n->getAll('client/extjs/ext'),
210 210
 		);
211 211
 
212
-		return json_encode( $content, JSON_FORCE_OBJECT );
212
+		return json_encode($content, JSON_FORCE_OBJECT);
213 213
 	}
214 214
 
215 215
 
@@ -221,19 +221,19 @@  discard block
 block discarded – undo
221 221
 	 * @return string JSON encoded site item object
222 222
 	 * @throws Exception If no site item was found for the code
223 223
 	 */
224
-	protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
224
+	protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
225 225
 	{
226
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
226
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
227 227
 
228 228
 		$criteria = $manager->createSearch();
229
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
230
-		$items = $manager->searchItems( $criteria );
229
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
230
+		$items = $manager->searchItems($criteria);
231 231
 
232
-		if( ( $item = reset( $items ) ) === false ) {
233
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
232
+		if (($item = reset($items)) === false) {
233
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
234 234
 		}
235 235
 
236
-		return json_encode( $item->toArray() );
236
+		return json_encode($item->toArray());
237 237
 	}
238 238
 
239 239
 
@@ -244,18 +244,18 @@  discard block
 block discarded – undo
244 244
 	 * @param array $langIds List of language IDs
245 245
 	 * @return array List of associative lists with "id" and "label" as keys
246 246
 	 */
247
-	protected function getLanguages( \Aimeos\MShop\Context\Item\Iface $context, array $langIds )
247
+	protected function getLanguages(\Aimeos\MShop\Context\Item\Iface $context, array $langIds)
248 248
 	{
249
-		$languageManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' );
249
+		$languageManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language');
250 250
 		$result = array();
251 251
 
252 252
 		$search = $languageManager->createSearch();
253
-		$search->setConditions( $search->compare('==', 'locale.language.id', $langIds ) );
254
-		$search->setSortations( array( $search->sort( '-', 'locale.language.status' ), $search->sort( '+', 'locale.language.label' ) ) );
255
-		$langItems = $languageManager->searchItems( $search );
253
+		$search->setConditions($search->compare('==', 'locale.language.id', $langIds));
254
+		$search->setSortations(array($search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.label')));
255
+		$langItems = $languageManager->searchItems($search);
256 256
 
257
-		foreach( $langItems as $id => $item ) {
258
-			$result[] = array( 'id' => $id, 'label' => $item->getLabel() );
257
+		foreach ($langItems as $id => $item) {
258
+			$result[] = array('id' => $id, 'label' => $item->getLabel());
259 259
 		}
260 260
 
261 261
 		return $result;
@@ -269,12 +269,12 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	protected function getVersion()
271 271
 	{
272
-		if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false
273
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
272
+		if (($content = @file_get_contents(base_path('composer.lock'))) !== false
273
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
274 274
 		) {
275
-			foreach( (array) $content['packages'] as $item )
275
+			foreach ((array) $content['packages'] as $item)
276 276
 			{
277
-				if( $item['name'] === 'aimeos/aimeos-laravel' ) {
277
+				if ($item['name'] === 'aimeos/aimeos-laravel') {
278 278
 					return $item['version'];
279 279
 				}
280 280
 			}
@@ -292,17 +292,17 @@  discard block
 block discarded – undo
292 292
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
293 293
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
294 294
 	 */
295
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
295
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
296 296
 	{
297
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
297
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
298 298
 
299 299
 		try {
300
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
301
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
300
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
301
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
302 302
 			$localeItem = $localeManager->createItem();
303 303
 		}
304 304
 
305
-		$context->setLocale( $localeItem );
305
+		$context->setLocale($localeItem);
306 306
 
307 307
 		return $context;
308 308
 	}
Please login to merge, or discard this patch.
src/Aimeos/Shop/Base/View.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -26,53 +26,53 @@  discard block
 block discarded – undo
26 26
 	 * @param string|null $locale Code of the current language or null for no translation
27 27
 	 * @return \Aimeos\MW\View\Iface View object
28 28
 	 */
29
-	public function create( \Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null )
29
+	public function create(\Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null)
30 30
 	{
31 31
 		$params = $fixed = array();
32 32
 
33
-		if( $locale !== null )
33
+		if ($locale !== null)
34 34
 		{
35 35
 			$params = \Route::current()->parameters() + \Input::all();
36 36
 			$params['target'] = \Route::currentRouteName();
37 37
 
38 38
 			$fixed = $this->getFixedParams();
39 39
 
40
-			$i18n = app('\Aimeos\Shop\Base\I18n')->get( array( $locale ) );
40
+			$i18n = app('\Aimeos\Shop\Base\I18n')->get(array($locale));
41 41
 			$translation = $i18n[$locale];
42 42
 		}
43 43
 		else
44 44
 		{
45
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
45
+			$translation = new \Aimeos\MW\Translation\None('en');
46 46
 		}
47 47
 
48 48
 
49
-		$view = new \Aimeos\MW\View\Standard( $templatePaths );
49
+		$view = new \Aimeos\MW\View\Standard($templatePaths);
50 50
 
51
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
52
-		$view->addHelper( 'translate', $helper );
51
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
52
+		$view->addHelper('translate', $helper);
53 53
 
54
-		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed );
55
-		$view->addHelper( 'url', $helper );
54
+		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed);
55
+		$view->addHelper('url', $helper);
56 56
 
57
-		$helper = new \Aimeos\MW\View\Helper\Parameter\Standard( $view, $params );
58
-		$view->addHelper( 'param', $helper );
57
+		$helper = new \Aimeos\MW\View\Helper\Parameter\Standard($view, $params);
58
+		$view->addHelper('param', $helper);
59 59
 
60
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
61
-		$view->addHelper( 'config', $helper );
60
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
61
+		$view->addHelper('config', $helper);
62 62
 
63
-		$sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' );
64
-		$sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' );
65
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 );
66
-		$view->addHelper( 'number', $helper );
63
+		$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
64
+		$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
65
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000);
66
+		$view->addHelper('number', $helper);
67 67
 
68
-		$helper = new \Aimeos\MW\View\Helper\FormParam\Standard( $view, array() );
69
-		$view->addHelper( 'formparam', $helper );
68
+		$helper = new \Aimeos\MW\View\Helper\FormParam\Standard($view, array());
69
+		$view->addHelper('formparam', $helper);
70 70
 
71
-		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, \Request::instance() );
72
-		$view->addHelper( 'request', $helper );
71
+		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, \Request::instance());
72
+		$view->addHelper('request', $helper);
73 73
 
74
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() );
75
-		$view->addHelper( 'csrf', $helper );
74
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token());
75
+		$view->addHelper('csrf', $helper);
76 76
 
77 77
 		return $view;
78 78
 	}
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
 	{
88 88
 		$fixed = array();
89 89
 
90
-		if( ( $value = \Route::input( 'site' ) ) !== null ) {
90
+		if (($value = \Route::input('site')) !== null) {
91 91
 			$fixed['site'] = $value;
92 92
 		}
93 93
 
94
-		if( ( $value = \Route::input( 'locale' ) ) !== null ) {
94
+		if (($value = \Route::input('locale')) !== null) {
95 95
 			$fixed['locale'] = $value;
96 96
 		}
97 97
 
98
-		if( ( $value = \Route::input( 'currency' ) ) !== null ) {
98
+		if (($value = \Route::input('currency')) !== null) {
99 99
 			$fixed['currency'] = $value;
100 100
 		}
101 101
 
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/JqadmController.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
 	 * @param integer $id Unique resource ID
34 34
 	 * @return string Generated output
35 35
 	 */
36
-	public function copyAction( $site = 'default', $resource, $id )
36
+	public function copyAction($site = 'default', $resource, $id)
37 37
 	{
38
-		if( config( 'shop.authorize', true ) ) {
39
-			$this->authorize( 'admin' );
38
+		if (config('shop.authorize', true)) {
39
+			$this->authorize('admin');
40 40
 		}
41 41
 
42
-		$cntl = $this->createClient( $site, $resource );
43
-		$content = $cntl->copy( $id );
42
+		$cntl = $this->createClient($site, $resource);
43
+		$content = $cntl->copy($id);
44 44
 
45
-		return \View::make('shop::admin.jqadm', array( 'content' => $content ) );
45
+		return \View::make('shop::admin.jqadm', array('content' => $content));
46 46
 	}
47 47
 
48 48
 
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 	 * @param string $sitecode Unique site code
54 54
 	 * @return string Generated output
55 55
 	 */
56
-	public function createAction( $site = 'default', $resource )
56
+	public function createAction($site = 'default', $resource)
57 57
 	{
58
-		if( config( 'shop.authorize', true ) ) {
59
-			$this->authorize( 'admin' );
58
+		if (config('shop.authorize', true)) {
59
+			$this->authorize('admin');
60 60
 		}
61 61
 
62
-		$cntl = $this->createClient( $site, $resource );
63
-		$content = $cntl->create( $id );
62
+		$cntl = $this->createClient($site, $resource);
63
+		$content = $cntl->create($id);
64 64
 
65
-		return \View::make('shop::admin.jqadm', array( 'content' => $content ) );
65
+		return \View::make('shop::admin.jqadm', array('content' => $content));
66 66
 	}
67 67
 
68 68
 
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
 	 * @param integer $id Unique resource ID
75 75
 	 * @return string Generated output
76 76
 	 */
77
-	public function deleteAction( $site = 'default', $resource, $id )
77
+	public function deleteAction($site = 'default', $resource, $id)
78 78
 	{
79
-		if( config( 'shop.authorize', true ) ) {
80
-			$this->authorize( 'admin' );
79
+		if (config('shop.authorize', true)) {
80
+			$this->authorize('admin');
81 81
 		}
82 82
 
83
-		$cntl = $this->createClient( $site, $resource );
84
-		$content = ( $cntl->delete( $id ) ? : $cntl->search() );
83
+		$cntl = $this->createClient($site, $resource);
84
+		$content = ($cntl->delete($id) ?: $cntl->search());
85 85
 
86
-		return \View::make('shop::admin.jqadm', array( 'content' => $content ) );
86
+		return \View::make('shop::admin.jqadm', array('content' => $content));
87 87
 	}
88 88
 
89 89
 
@@ -95,16 +95,16 @@  discard block
 block discarded – undo
95 95
 	 * @param integer $id Unique resource ID
96 96
 	 * @return string Generated output
97 97
 	 */
98
-	public function getAction( $site = 'default', $resource, $id )
98
+	public function getAction($site = 'default', $resource, $id)
99 99
 	{
100
-		if( config( 'shop.authorize', true ) ) {
101
-			$this->authorize( 'admin' );
100
+		if (config('shop.authorize', true)) {
101
+			$this->authorize('admin');
102 102
 		}
103 103
 
104
-		$cntl = $this->createClient( $site, $resource );
105
-		$content = $cntl->get( $id );
104
+		$cntl = $this->createClient($site, $resource);
105
+		$content = $cntl->get($id);
106 106
 
107
-		return \View::make('shop::admin.jqadm', array( 'content' => $content ) );
107
+		return \View::make('shop::admin.jqadm', array('content' => $content));
108 108
 	}
109 109
 
110 110
 
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
 	 * @param string $sitecode Unique site code
116 116
 	 * @return string Generated output
117 117
 	 */
118
-	public function saveAction( $site = 'default', $resource )
118
+	public function saveAction($site = 'default', $resource)
119 119
 	{
120
-		if( config( 'shop.authorize', true ) ) {
121
-			$this->authorize( 'admin' );
120
+		if (config('shop.authorize', true)) {
121
+			$this->authorize('admin');
122 122
 		}
123 123
 
124
-		$cntl = $this->createClient( $site, $resource );
125
-		$content = ( $cntl->save() ? : $cntl->search() );
124
+		$cntl = $this->createClient($site, $resource);
125
+		$content = ($cntl->save() ?: $cntl->search());
126 126
 
127
-		return \View::make('shop::admin.jqadm', array( 'content' => $content ) );
127
+		return \View::make('shop::admin.jqadm', array('content' => $content));
128 128
 	}
129 129
 
130 130
 
@@ -135,16 +135,16 @@  discard block
 block discarded – undo
135 135
 	 * @param string $sitecode Unique site code
136 136
 	 * @return string Generated output
137 137
 	 */
138
-	public function searchAction( $site = 'default', $resource )
138
+	public function searchAction($site = 'default', $resource)
139 139
 	{
140
-		if( config( 'shop.authorize', true ) ) {
141
-			$this->authorize( 'admin' );
140
+		if (config('shop.authorize', true)) {
141
+			$this->authorize('admin');
142 142
 		}
143 143
 
144
-		$cntl = $this->createClient( $site, $resource );
144
+		$cntl = $this->createClient($site, $resource);
145 145
 		$content = $cntl->search();
146 146
 
147
-		return \View::make('shop::admin.jqadm', array( 'content' => $content ) );
147
+		return \View::make('shop::admin.jqadm', array('content' => $content));
148 148
 	}
149 149
 
150 150
 
@@ -154,20 +154,20 @@  discard block
 block discarded – undo
154 154
 	 * @param string $sitecode Unique site code
155 155
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
156 156
 	 */
157
-	protected function createClient( $sitecode, $resource )
157
+	protected function createClient($sitecode, $resource)
158 158
 	{
159
-		$lang = \Input::get( 'lang', config( 'app.locale', 'en' ) );
159
+		$lang = \Input::get('lang', config('app.locale', 'en'));
160 160
 
161
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
162
-		$templatePaths = $aimeos->getCustomPaths( 'controller/jqadm/templates' );
161
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
162
+		$templatePaths = $aimeos->getCustomPaths('controller/jqadm/templates');
163 163
 
164
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
165
-		$context = $this->setLocale( $context, $sitecode, $lang );
164
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
165
+		$context = $this->setLocale($context, $sitecode, $lang);
166 166
 
167
-		$view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang );
168
-		$context->setView( $view );
167
+		$view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang);
168
+		$context->setView($view);
169 169
 
170
-		return \Aimeos\Client\JQAdm\Factory::createClient( $context, $templatePaths, $resource );
170
+		return \Aimeos\Client\JQAdm\Factory::createClient($context, $templatePaths, $resource);
171 171
 	}
172 172
 
173 173
 
@@ -179,23 +179,23 @@  discard block
 block discarded – undo
179 179
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
180 180
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
181 181
 	 */
182
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang )
182
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang)
183 183
 	{
184
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
184
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
185 185
 
186 186
 		try
187 187
 		{
188
-			$localeItem = $localeManager->bootstrap( $sitecode, '', '', false );
189
-			$localeItem->setLanguageId( null );
190
-			$localeItem->setCurrencyId( null );
188
+			$localeItem = $localeManager->bootstrap($sitecode, '', '', false);
189
+			$localeItem->setLanguageId(null);
190
+			$localeItem->setCurrencyId(null);
191 191
 		}
192
-		catch( \Aimeos\MShop\Locale\Exception $e )
192
+		catch (\Aimeos\MShop\Locale\Exception $e)
193 193
 		{
194 194
 			$localeItem = $localeManager->createItem();
195 195
 		}
196 196
 
197
-		$context->setLocale( $localeItem );
198
-		$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) );
197
+		$context->setLocale($localeItem);
198
+		$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang)));
199 199
 
200 200
 		return $context;
201 201
 	}
Please login to merge, or discard this patch.