Completed
Push — master ( 1ae3d4...6560db )
by Aimeos
02:45
created
src/Aimeos/Shop/Command/AbstractCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,19 +22,19 @@
 block discarded – undo
22 22
 	 * @param string|array $sites Unique site codes
23 23
 	 * @return \Aimeos\MShop\Locale\Item\Site\Iface[] List of site items
24 24
 	 */
25
-	protected function getSiteItems( \Aimeos\MShop\Context\Item\Iface $context, $sites )
25
+	protected function getSiteItems(\Aimeos\MShop\Context\Item\Iface $context, $sites)
26 26
 	{
27
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
27
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
28 28
 		$search = $manager->createSearch();
29 29
 
30
-		if( is_scalar( $sites ) && $sites != '' ) {
31
-			$sites = explode( ' ', $sites );
30
+		if (is_scalar($sites) && $sites != '') {
31
+			$sites = explode(' ', $sites);
32 32
 		}
33 33
 
34
-		if( !empty( $sites ) ) {
35
-			$search->setConditions( $search->compare( '==', 'locale.site.code', $sites ) );
34
+		if (!empty($sites)) {
35
+			$search->setConditions($search->compare('==', 'locale.site.code', $sites));
36 36
 		}
37 37
 
38
-		return $manager->searchItems( $search );
38
+		return $manager->searchItems($search);
39 39
 	}
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Command/CacheCommand.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,24 +35,24 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	public function fire()
37 37
 	{
38
-		$context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false );
39
-		$context->setEditor( 'aimeos:cache' );
38
+		$context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false);
39
+		$context->setEditor('aimeos:cache');
40 40
 
41
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
41
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
42 42
 
43
-		foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem )
43
+		foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem)
44 44
 		{
45
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
45
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
46 46
 
47 47
 			$lcontext = clone $context;
48
-			$lcontext->setLocale( $localeItem );
48
+			$lcontext->setLocale($localeItem);
49 49
 
50
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext );
51
-			$lcontext->setCache( $cache );
50
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext);
51
+			$lcontext->setCache($cache);
52 52
 
53
-			$this->info( sprintf( 'Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode() ) );
53
+			$this->info(sprintf('Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode()));
54 54
 
55
-			\Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush();
55
+			\Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush();
56 56
 		}
57 57
 	}
58 58
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	protected function getArguments()
66 66
 	{
67 67
 		return array(
68
-			array( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' ),
68
+			array('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)'),
69 69
 		);
70 70
 	}
71 71
 
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/BasketController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	 */
29 29
 	public function indexAction()
30 30
 	{
31
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'basket-index' );
31
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('basket-index');
32 32
 		return \View::make('shop::basket.index', $params);
33 33
 	}
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/CatalogController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function countAction()
30 30
 	{
31
-		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'catalog-count' );
31
+		$params = app('\Aimeos\Shop\Base\Page')->getSections('catalog-count');
32 32
 		$contents = \View::make('shop::catalog.count', $params);
33 33
 
34 34
 		$response = \Response::make($contents, 200);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function detailAction()
47 47
 	{
48
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-detail' );
48
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-detail');
49 49
 		return \View::make('shop::catalog.detail', $params);
50 50
 	}
51 51
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function listAction()
59 59
 	{
60
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-list' );
60
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-list');
61 61
 		return \View::make('shop::catalog.list', $params);
62 62
 	}
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function stockAction()
71 71
 	{
72
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-stock' );
72
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-stock');
73 73
 		$contents = \View::make('shop::catalog.stock', $params);
74 74
 
75 75
 		$response = \Response::make($contents, 200);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function suggestAction()
88 88
 	{
89
-		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-suggest' );
89
+		$params = app('Aimeos\Shop\Base\Page')->getSections('catalog-suggest');
90 90
 		$contents = \View::make('shop::catalog.suggest', $params);
91 91
 
92 92
 		$response = \Response::make($contents, 200);
Please login to merge, or discard this patch.
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/Base/Page.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 * @param \Aimeos\Shop\Base\Context $context Context object
48 48
 	 * @param \Aimeos\Shop\Base\View $view View object
49 49
 	 */
50
-	public function __construct( \Illuminate\Contracts\Config\Repository $config,
51
-		\Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view )
50
+	public function __construct(\Illuminate\Contracts\Config\Repository $config,
51
+		\Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view)
52 52
 	{
53 53
 		$this->config = $config;
54 54
 		$this->aimeos = $aimeos;
@@ -63,23 +63,23 @@  discard block
 block discarded – undo
63 63
 	 * @param string $pageName Name of the configured page
64 64
 	 * @return array Associative list with body and header output separated by client name
65 65
 	 */
66
-	public function getSections( $pageName )
66
+	public function getSections($pageName)
67 67
 	{
68 68
 		$context = $this->context->get();
69 69
 		$langid = $context->getLocale()->getLanguageId();
70
-		$tmplPaths = $this->aimeos->get()->getCustomPaths( 'client/html/templates' );
71
-		$view = $this->view->create( $context->getConfig(), $tmplPaths, $langid );
72
-		$context->setView( $view );
70
+		$tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates');
71
+		$view = $this->view->create($context->getConfig(), $tmplPaths, $langid);
72
+		$context->setView($view);
73 73
 
74
-		$pagesConfig = $this->config->get( 'shop.page', array() );
75
-		$result = array( 'aibody' => array(), 'aiheader' => array() );
74
+		$pagesConfig = $this->config->get('shop.page', array());
75
+		$result = array('aibody' => array(), 'aiheader' => array());
76 76
 
77
-		if( isset( $pagesConfig[$pageName] ) )
77
+		if (isset($pagesConfig[$pageName]))
78 78
 		{
79
-			foreach( (array) $pagesConfig[$pageName] as $clientName )
79
+			foreach ((array) $pagesConfig[$pageName] as $clientName)
80 80
 			{
81
-				$client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName );
82
-				$client->setView( clone $view );
81
+				$client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName);
82
+				$client->setView(clone $view);
83 83
 				$client->process();
84 84
 
85 85
 				$result['aibody'][$clientName] = $client->getBody();
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' )->findItem( $groupcode );
49
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
48
+		$group = \Aimeos\MShop\Factory::createManager($context, 'customer/group')->findItem($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/Controller/ExtadmController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
 	 * Creates a list of all available translations.
136 136
 	 *
137 137
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
138
-	 * @return array List of language IDs with labels
138
+	 * @return string List of language IDs with labels
139 139
 	 */
140 140
 	protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context )
141 141
 	{
Please login to merge, or discard this patch.
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -34,63 +34,63 @@  discard block
 block discarded – undo
34 34
 	 * @param \Illuminate\Http\Request $request Laravel request object
35 35
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
36 36
 	 */
37
-	public function indexAction( Request $request )
37
+	public function indexAction(Request $request)
38 38
 	{
39
-		if( config( 'shop.authorize', true ) ) {
40
-			$this->authorize( 'admin' );
39
+		if (config('shop.authorize', true)) {
40
+			$this->authorize('admin');
41 41
 		}
42 42
 
43
-		$site = Route::input( 'site', 'default' );
44
-		$lang = Input::get( 'lang', config( 'app.locale', 'en' ) );
43
+		$site = Route::input('site', 'default');
44
+		$lang = Input::get('lang', config('app.locale', 'en'));
45 45
 
46
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' );
46
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos');
47 47
 
48 48
 		$bootstrap = $aimeos->get();
49
-		$cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' );
49
+		$cntlPaths = $bootstrap->getCustomPaths('controller/extjs');
50 50
 
51
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
52
-		$context = $this->setLocale( $context, $site, $lang );
51
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
52
+		$context = $this->setLocale($context, $site, $lang);
53 53
 
54
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
54
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
55 55
 		$cssFiles = array();
56 56
 
57
-		foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths )
57
+		foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths)
58 58
 		{
59
-			foreach( $paths as $path )
59
+			foreach ($paths as $path)
60 60
 			{
61 61
 				$jsbAbsPath = $base . '/' . $path;
62 62
 
63
-				if( !is_file( $jsbAbsPath ) ) {
64
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
63
+				if (!is_file($jsbAbsPath)) {
64
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
65 65
 				}
66 66
 
67
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
68
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
67
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
68
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
69 69
 			}
70 70
 		}
71 71
 
72
-		$jqadmUrl = route( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) );
73
-		$jsonUrl = route( 'aimeos_shop_extadm_json', array( 'site' => $site, '_token' => csrf_token() ) );
74
-		$adminUrl = route( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) );
72
+		$jqadmUrl = route('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product'));
73
+		$jsonUrl = route('aimeos_shop_extadm_json', array('site' => $site, '_token' => csrf_token()));
74
+		$adminUrl = route('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>'));
75 75
 
76 76
 		$vars = array(
77 77
 			'lang' => $lang,
78 78
 			'cssFiles' => $cssFiles,
79
-			'languages' => $this->getJsonLanguages( $context),
80
-			'config' => $this->getJsonClientConfig( $context ),
81
-			'site' => $this->getJsonSiteItem( $context, $site ),
82
-			'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ),
79
+			'languages' => $this->getJsonLanguages($context),
80
+			'config' => $this->getJsonClientConfig($context),
81
+			'site' => $this->getJsonSiteItem($context, $site),
82
+			'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang),
83 83
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
84 84
 			'itemSchemas' => $controller->getJsonItemSchemas(),
85
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
86
-			'urlTemplate' => str_replace( ['<', '>'], ['{', '}'], urldecode( $adminUrl ) ),
87
-			'uploaddir' => config( 'shop::uploaddir' ),
88
-			'activeTab' => Input::get( 'tab', 0 ),
85
+			'smd' => $controller->getJsonSmd($jsonUrl),
86
+			'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)),
87
+			'uploaddir' => config('shop::uploaddir'),
88
+			'activeTab' => Input::get('tab', 0),
89 89
 			'version' => $aimeos->getVersion(),
90 90
 			'jqadmurl' => $jqadmUrl,
91 91
 		);
92 92
 
93
-		return View::make( 'shop::extadm.index', $vars );
93
+		return View::make('shop::extadm.index', $vars);
94 94
 	}
95 95
 
96 96
 
@@ -100,22 +100,22 @@  discard block
 block discarded – undo
100 100
 	 * @param \Illuminate\Http\Request $request Laravel request object
101 101
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
102 102
 	 */
103
-	public function doAction( Request $request )
103
+	public function doAction(Request $request)
104 104
 	{
105
-		if( config( 'shop.authorize', true ) ) {
106
-			$this->authorize( 'admin' );
105
+		if (config('shop.authorize', true)) {
106
+			$this->authorize('admin');
107 107
 		}
108 108
 
109
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
110
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
109
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
110
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
111 111
 
112
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
113
-		$context = $this->setLocale( $context );
112
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
113
+		$context = $this->setLocale($context);
114 114
 
115
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
115
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
116 116
 
117
-		$response = $controller->process( Input::instance()->request->all(), $request->getContent() );
118
-		return View::make( 'shop::extadm.do', array( 'output' => $response ) );
117
+		$response = $controller->process(Input::instance()->request->all(), $request->getContent());
118
+		return View::make('shop::extadm.do', array('output' => $response));
119 119
 	}
120 120
 
121 121
 
@@ -126,32 +126,32 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function fileAction()
128 128
 	{
129
-		if( config( 'shop.authorize', true ) ) {
130
-			$this->authorize( 'admin' );
129
+		if (config('shop.authorize', true)) {
130
+			$this->authorize('admin');
131 131
 		}
132 132
 
133 133
 		$contents = '';
134 134
 		$jsFiles = array();
135
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
135
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
136 136
 
137
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
137
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
138 138
 		{
139
-			foreach( $paths as $path )
139
+			foreach ($paths as $path)
140 140
 			{
141 141
 				$jsbAbsPath = $base . '/' . $path;
142
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
143
-				$jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) );
142
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
143
+				$jsFiles = array_merge($jsFiles, $jsb2->getFiles('js'));
144 144
 			}
145 145
 		}
146 146
 
147
-		foreach( $jsFiles as $file )
147
+		foreach ($jsFiles as $file)
148 148
 		{
149
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
149
+			if (($content = file_get_contents($file)) !== false) {
150 150
 				$contents .= $content;
151 151
 			}
152 152
 		}
153 153
 
154
-		return response( $contents )->header( 'Content-Type', 'application/javascript' );
154
+		return response($contents)->header('Content-Type', 'application/javascript');
155 155
 	}
156 156
 
157 157
 
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
162 162
 	 * @return array List of language IDs with labels
163 163
 	 */
164
-	protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context )
164
+	protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context)
165 165
 	{
166 166
 		$result = array();
167 167
 
168
-		foreach( app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nList( 'admin' ) as $id ) {
169
-			$result[] = array( 'id' => $id, 'label' => $id );
168
+		foreach (app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nList('admin') as $id) {
169
+			$result[] = array('id' => $id, 'label' => $id);
170 170
 		}
171 171
 
172
-		return json_encode( $result );
172
+		return json_encode($result);
173 173
 	}
174 174
 
175 175
 
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
180 180
 	 * @return string JSON encoded configuration object
181 181
 	 */
182
-	protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
182
+	protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
183 183
 	{
184
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
185
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
184
+		$config = $context->getConfig()->get('admin/extjs', array());
185
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
186 186
 	}
187 187
 
188 188
 
@@ -193,16 +193,16 @@  discard block
 block discarded – undo
193 193
 	 * @param string $lang ISO language code like "en" or "en_GB"
194 194
 	 * @return string JSON encoded translation object
195 195
 	 */
196
-	protected function getJsonClientI18n( array $i18nPaths, $lang )
196
+	protected function getJsonClientI18n(array $i18nPaths, $lang)
197 197
 	{
198
-		$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang );
198
+		$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang);
199 199
 
200 200
 		$content = array(
201
-			'admin' => $i18n->getAll( 'admin' ),
202
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
201
+			'admin' => $i18n->getAll('admin'),
202
+			'admin/ext' => $i18n->getAll('admin/ext'),
203 203
 		);
204 204
 
205
-		return json_encode( $content, JSON_FORCE_OBJECT );
205
+		return json_encode($content, JSON_FORCE_OBJECT);
206 206
 	}
207 207
 
208 208
 
@@ -214,19 +214,19 @@  discard block
 block discarded – undo
214 214
 	 * @return string JSON encoded site item object
215 215
 	 * @throws Exception If no site item was found for the code
216 216
 	 */
217
-	protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
217
+	protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
218 218
 	{
219
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
219
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
220 220
 
221 221
 		$criteria = $manager->createSearch();
222
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
223
-		$items = $manager->searchItems( $criteria );
222
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
223
+		$items = $manager->searchItems($criteria);
224 224
 
225
-		if( ( $item = reset( $items ) ) === false ) {
226
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
225
+		if (($item = reset($items)) === false) {
226
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
227 227
 		}
228 228
 
229
-		return json_encode( $item->toArray() );
229
+		return json_encode($item->toArray());
230 230
 	}
231 231
 
232 232
 
@@ -238,17 +238,17 @@  discard block
 block discarded – undo
238 238
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
239 239
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
240 240
 	 */
241
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
241
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
242 242
 	{
243
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
243
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
244 244
 
245 245
 		try {
246
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
247
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
246
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
247
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
248 248
 			$localeItem = $localeManager->createItem();
249 249
 		}
250 250
 
251
-		$context->setLocale( $localeItem );
251
+		$context->setLocale($localeItem);
252 252
 
253 253
 		return $context;
254 254
 	}
Please login to merge, or discard this patch.