Completed
Push — master ( 6e8b10...d2a4bf )
by Aimeos
04:17
created
admin/jqadm/tests/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,17 +11,17 @@
 block discarded – undo
11 11
  * Set error reporting to maximum
12 12
  */
13 13
 error_reporting( -1 );
14
-ini_set( 'display_errors', '1' );
14
+ini_set('display_errors', '1');
15 15
 
16
-date_default_timezone_set( 'UTC' );
16
+date_default_timezone_set('UTC');
17 17
 
18 18
 /*
19 19
  * Set locale settings to reasonable defaults
20 20
  */
21
-setlocale( LC_ALL, 'en_US.UTF-8' );
22
-setlocale( LC_NUMERIC, 'POSIX' );
23
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
24
-setlocale( LC_TIME, 'POSIX' );
21
+setlocale(LC_ALL, 'en_US.UTF-8');
22
+setlocale(LC_NUMERIC, 'POSIX');
23
+setlocale(LC_CTYPE, 'en_US.UTF-8');
24
+setlocale(LC_TIME, 'POSIX');
25 25
 
26 26
 
27 27
 require_once 'TestHelperJqadm.php';
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Common/Decorator/Index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$result = $this->getClient()->delete();
30 30
 
31
-		$ids = (array) $this->getView()->param( 'id' );
32
-		\Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->deleteItems( $ids );
31
+		$ids = (array) $this->getView()->param('id');
32
+		\Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->deleteItems($ids);
33 33
 
34 34
 		return $result;
35 35
 	}
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 		$result = $this->getClient()->save();
46 46
 		$item = $this->getView()->item;
47 47
 
48
-		if( $item->getId() !== null ) {
49
-			\Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->saveItem( $item );
48
+		if ($item->getId() !== null) {
49
+			\Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->saveItem($item);
50 50
 		}
51 51
 
52 52
 		return $result;
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Common/Decorator/Cache.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$result = $this->getClient()->delete();
30 30
 
31
-		$ids = (array) $this->getView()->param( 'id' );
32
-		$tags = array( 'product' );
31
+		$ids = (array) $this->getView()->param('id');
32
+		$tags = array('product');
33 33
 
34
-		foreach( $ids as $id ) {
34
+		foreach ($ids as $id) {
35 35
 			$tags[] = 'product-' . $id;
36 36
 		}
37 37
 
38
-		$this->getContext()->getCache()->deleteByTags( $tags );
38
+		$this->getContext()->getCache()->deleteByTags($tags);
39 39
 
40 40
 		return $result;
41 41
 	}
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 		$result = $this->getClient()->save();
52 52
 		$item = $this->getView()->item;
53 53
 
54
-		if( $item->getId() !== null )
54
+		if ($item->getId() !== null)
55 55
 		{
56 56
 			$idtag = 'product-' . $item->getId();
57
-			$this->getContext()->getCache()->deleteByTags( array( 'product', $idtag ) );
57
+			$this->getContext()->getCache()->deleteByTags(array('product', $idtag));
58 58
 		}
59 59
 
60 60
 		return $result;
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Iface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @param string|null $name Name of the sub-client (Default if null)
27 27
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
28 28
 	 */
29
-	public function getSubClient( $type, $name = null );
29
+	public function getSubClient($type, $name = null);
30 30
 
31 31
 	/**
32 32
 	 * Returns the view object that will generate the admin output.
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output
42 42
 	 * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls
43 43
 	 */
44
-	public function setView( \Aimeos\MW\View\Iface $view );
44
+	public function setView(\Aimeos\MW\View\Iface $view);
45 45
 
46 46
 	/**
47 47
 	 * Copies a resource
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Product/Category/Decorator/Cache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@
 block discarded – undo
27 27
 	public function save()
28 28
 	{
29 29
 		$result = $this->getClient()->save();
30
-		$ids = array( 'catalog' );
30
+		$ids = array('catalog');
31 31
 
32
-		foreach( $this->getView()->param( 'category/catalog.id', [] ) as $id ) {
32
+		foreach ($this->getView()->param('category/catalog.id', []) as $id) {
33 33
 			$ids[] = 'catalog-' . $id;
34 34
 		}
35 35
 
36
-		$this->getContext()->getCache()->deleteByTags( $ids );
36
+		$this->getContext()->getCache()->deleteByTags($ids);
37 37
 
38 38
 		return $result;
39 39
 	}
Please login to merge, or discard this patch.
lib/custom/tests/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 block discarded – undo
10 10
  * Set error reporting to maximum
11 11
  */
12 12
 error_reporting( -1 );
13
-ini_set( 'display_errors', '1' );
13
+ini_set('display_errors', '1');
14 14
 
15
-date_default_timezone_set( 'UTC' );
15
+date_default_timezone_set('UTC');
16 16
 
17 17
 /*
18 18
  * Set locale settings to reasonable defaults
19 19
  */
20
-setlocale( LC_ALL, 'en_US.UTF-8' );
21
-setlocale( LC_NUMERIC, 'POSIX' );
22
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
23
-setlocale( LC_TIME, 'POSIX' );
20
+setlocale(LC_ALL, 'en_US.UTF-8');
21
+setlocale(LC_NUMERIC, 'POSIX');
22
+setlocale(LC_CTYPE, 'en_US.UTF-8');
23
+setlocale(LC_TIME, 'POSIX');
24 24
 
25 25
 
26 26
 require_once 'TestHelperCustom.php';
Please login to merge, or discard this patch.
lib/custom/tests/TestHelperCustom.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -13,55 +13,55 @@  discard block
 block discarded – undo
13 13
 	public static function bootstrap()
14 14
 	{
15 15
 		self::getAimeos();
16
-		\Aimeos\MShop\Factory::setCache( false );
16
+		\Aimeos\MShop\Factory::setCache(false);
17 17
 	}
18 18
 
19 19
 
20
-	public static function getContext( $site = 'unittest' )
20
+	public static function getContext($site = 'unittest')
21 21
 	{
22
-		if( !isset( self::$context[$site] ) ) {
23
-			self::$context[$site] = self::createContext( $site );
22
+		if (!isset(self::$context[$site])) {
23
+			self::$context[$site] = self::createContext($site);
24 24
 		}
25 25
 
26 26
 		return clone self::$context[$site];
27 27
 	}
28 28
 
29 29
 
30
-	public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null )
30
+	public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null)
31 31
 	{
32
-		if( $config === null ) {
33
-			$config = self::getContext( $site )->getConfig();
32
+		if ($config === null) {
33
+			$config = self::getContext($site)->getConfig();
34 34
 		}
35 35
 
36
-		$view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() );
36
+		$view = new \Aimeos\MW\View\Standard(self::getTemplatePaths());
37 37
 
38 38
 		$param = ['site' => 'unittest'];
39
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
40
-		$view->addHelper( 'param', $helper );
39
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
40
+		$view->addHelper('param', $helper);
41 41
 
42
-		$trans = new \Aimeos\MW\Translation\None( 'de_DE' );
43
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans );
44
-		$view->addHelper( 'translate', $helper );
42
+		$trans = new \Aimeos\MW\Translation\None('de_DE');
43
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans);
44
+		$view->addHelper('translate', $helper);
45 45
 
46
-		$helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' );
47
-		$view->addHelper( 'url', $helper );
46
+		$helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl');
47
+		$view->addHelper('url', $helper);
48 48
 
49
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' );
50
-		$view->addHelper( 'number', $helper );
49
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', '');
50
+		$view->addHelper('number', $helper);
51 51
 
52
-		$helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' );
53
-		$view->addHelper( 'date', $helper );
52
+		$helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d');
53
+		$view->addHelper('date', $helper);
54 54
 
55
-		$config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin', 'client/html', 'controller/jsonadm' ) );
56
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
57
-		$view->addHelper( 'config', $helper );
55
+		$config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin', 'client/html', 'controller/jsonadm'));
56
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
57
+		$view->addHelper('config', $helper);
58 58
 
59
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' );
60
-		$view->addHelper( 'csrf', $helper );
59
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value');
60
+		$view->addHelper('csrf', $helper);
61 61
 
62
-		$fcn = function() { return array( 'admin' ); };
63
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn );
64
-		$view->addHelper( 'access', $helper );
62
+		$fcn = function() { return array('admin'); };
63
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn);
64
+		$view->addHelper('access', $helper);
65 65
 
66 66
 		return $view;
67 67
 	}
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 
70 70
 	public static function getTemplatePaths()
71 71
 	{
72
-		return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' );
72
+		return self::getAimeos()->getCustomPaths('admin/jqadm/templates');
73 73
 	}
74 74
 
75 75
 
76 76
 	private static function getAimeos()
77 77
 	{
78
-		if( !isset( self::$aimeos ) )
78
+		if (!isset(self::$aimeos))
79 79
 		{
80 80
 			require_once 'Bootstrap.php';
81
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
81
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
82 82
 
83
-			$extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
84
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
83
+			$extdir = dirname(dirname(dirname(dirname(__FILE__))));
84
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
85 85
 		}
86 86
 
87 87
 		return self::$aimeos;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	/**
92 92
 	 * @param string $site
93 93
 	 */
94
-	private static function createContext( $site )
94
+	private static function createContext($site)
95 95
 	{
96 96
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
97 97
 		$aimeos = self::getAimeos();
@@ -100,44 +100,44 @@  discard block
 block discarded – undo
100 100
 		$paths = $aimeos->getConfigPaths();
101 101
 		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
102 102
 		$file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser';
103
-		$local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) );
103
+		$local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp')));
104 104
 
105
-		$conf = new \Aimeos\MW\Config\PHPArray( $local, $paths );
106
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
107
-		$conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file );
108
-		$ctx->setConfig( $conf );
105
+		$conf = new \Aimeos\MW\Config\PHPArray($local, $paths);
106
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
107
+		$conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file);
108
+		$ctx->setConfig($conf);
109 109
 
110 110
 
111
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
112
-		$ctx->setDatabaseManager( $dbm );
111
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
112
+		$ctx->setDatabaseManager($dbm);
113 113
 
114 114
 
115
-		$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf );
116
-		$ctx->setFilesystemManager( $fs );
115
+		$fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf);
116
+		$ctx->setFilesystemManager($fs);
117 117
 
118 118
 
119
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
120
-		$ctx->setLogger( $logger );
119
+		$logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG);
120
+		$ctx->setLogger($logger);
121 121
 
122 122
 
123 123
 		$cache = new \Aimeos\MW\Cache\None();
124
-		$ctx->setCache( $cache );
124
+		$ctx->setCache($cache);
125 125
 
126 126
 
127
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
128
-		$ctx->setI18n( array( 'de' => $i18n ) );
127
+		$i18n = new \Aimeos\MW\Translation\None('de');
128
+		$ctx->setI18n(array('de' => $i18n));
129 129
 
130 130
 
131 131
 		$session = new \Aimeos\MW\Session\None();
132
-		$ctx->setSession( $session );
132
+		$ctx->setSession($session);
133 133
 
134 134
 
135
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
136
-		$locale = $localeManager->bootstrap( $site, '', '', false );
137
-		$ctx->setLocale( $locale );
135
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
136
+		$locale = $localeManager->bootstrap($site, '', '', false);
137
+		$ctx->setLocale($locale);
138 138
 
139 139
 
140
-		$ctx->setEditor( 'ai-admin-jqadm:lib/custom' );
140
+		$ctx->setEditor('ai-admin-jqadm:lib/custom');
141 141
 
142 142
 		return $ctx;
143 143
 	}
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Helper/Site/Standard.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	/**
38 38
 	 * Returns the site view helper
39 39
 	 *
40
-	 * @return Aimeos\MW\View\Helper\Site\Iface Site view helper
40
+	 * @return Standard Site view helper
41 41
 	 */
42 42
 	public function transform()
43 43
 	{
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 	 *
28 28
 	 * @param \Aimeos\MW\View\Iface $view View object
29 29
 	 */
30
-	public function __construct( \Aimeos\MW\View\Iface $view )
30
+	public function __construct(\Aimeos\MW\View\Iface $view)
31 31
 	{
32
-		parent::__construct( $view );
32
+		parent::__construct($view);
33 33
 		$this->siteItem = $view->pageSiteItem;
34 34
 	}
35 35
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 * @param string $siteid ID of a site item
63 63
 	 * @return string|null Label of the site item or null if not found
64 64
 	 */
65
-	public function match( $siteid )
65
+	public function match($siteid)
66 66
 	{
67
-		if( $this->siteItem->getId() == $siteid ) {
67
+		if ($this->siteItem->getId() == $siteid) {
68 68
 			return $this->siteItem->getLabel();
69 69
 		}
70 70
 	}
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	 * @param string $siteid ID of a site item
77 77
 	 * @return string|null "readonly" if item is from a parent site, null if not
78 78
 	 */
79
-	public function readonly( $siteid )
79
+	public function readonly($siteid)
80 80
 	{
81
-		if( $this->siteItem->getId() != $siteid ) {
81
+		if ($this->siteItem->getId() != $siteid) {
82 82
 			return 'readonly';
83 83
 		}
84 84
 	}
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Locale/Site/Standard.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -498,7 +498,7 @@
 block discarded – undo
498 498
 	/**
499 499
 	 * Constructs the data array for the view from the given item
500 500
 	 *
501
-	 * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object
501
+	 * @param \Aimeos\MShop\Locale\Item\Site\Iface $item Locale item object
502 502
 	 * @return string[] Multi-dimensional associative list of item data
503 503
 	 */
504 504
 	protected function toArray( \Aimeos\MShop\Locale\Item\Site\Iface $item, $copy = false )
Please login to merge, or discard this patch.
Spacing   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Locale\Site;
12 12
 
13
-sprintf( 'locale/site' ); // for translation
13
+sprintf('locale/site'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,45 +35,45 @@  discard block
 block discarded – undo
35 35
 
36 36
 		try
37 37
 		{
38
-			if( ( $id = $view->param( 'id' ) ) === null ) {
39
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
38
+			if (($id = $view->param('id')) === null) {
39
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
40 40
 			}
41 41
 
42
-			$this->checkSite( $view->access( 'super' ), $id );
42
+			$this->checkSite($view->access('super'), $id);
43 43
 
44
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
45
-			$view->item = $manager->getItem( $id );
44
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
45
+			$view->item = $manager->getItem($id);
46 46
 
47
-			$view->itemData = $this->toArray( $view->item, true );
47
+			$view->itemData = $this->toArray($view->item, true);
48 48
 			$view->itemSubparts = $this->getSubClientNames();
49 49
 			$view->itemBody = '';
50 50
 
51
-			foreach( $this->getSubClients() as $idx => $client )
51
+			foreach ($this->getSubClients() as $idx => $client)
52 52
 			{
53 53
 				$view->tabindex = ++$idx + 1;
54 54
 				$view->itemBody .= $client->copy();
55 55
 			}
56 56
 		}
57
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
57
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
58 58
 		{
59
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
60
-			$view->errors = $view->get( 'errors', [] ) + $error;
61
-			$this->logException( $e );
59
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
60
+			$view->errors = $view->get('errors', []) + $error;
61
+			$this->logException($e);
62 62
 		}
63
-		catch( \Aimeos\MShop\Exception $e )
63
+		catch (\Aimeos\MShop\Exception $e)
64 64
 		{
65
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
66
-			$view->errors = $view->get( 'errors', [] ) + $error;
67
-			$this->logException( $e );
65
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
66
+			$view->errors = $view->get('errors', []) + $error;
67
+			$this->logException($e);
68 68
 		}
69
-		catch( \Exception $e )
69
+		catch (\Exception $e)
70 70
 		{
71
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
72
-			$view->errors = $view->get( 'errors', [] ) + $error;
73
-			$this->logException( $e );
71
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
72
+			$view->errors = $view->get('errors', []) + $error;
73
+			$this->logException($e);
74 74
 		}
75 75
 
76
-		return $this->render( $view );
76
+		return $this->render($view);
77 77
 	}
78 78
 
79 79
 
@@ -89,44 +89,44 @@  discard block
 block discarded – undo
89 89
 
90 90
 		try
91 91
 		{
92
-			$this->checkSite( $view->access( 'super' ) );
92
+			$this->checkSite($view->access('super'));
93 93
 
94
-			$data = $view->param( 'item', [] );
94
+			$data = $view->param('item', []);
95 95
 
96
-			if( !isset( $view->item ) ) {
97
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' )->createItem();
96
+			if (!isset($view->item)) {
97
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'locale/site')->createItem();
98 98
 			}
99 99
 
100 100
 			$view->itemSubparts = $this->getSubClientNames();
101 101
 			$view->itemData = $data;
102 102
 			$view->itemBody = '';
103 103
 
104
-			foreach( $this->getSubClients() as $idx => $client )
104
+			foreach ($this->getSubClients() as $idx => $client)
105 105
 			{
106 106
 				$view->tabindex = ++$idx + 1;
107 107
 				$view->itemBody .= $client->create();
108 108
 			}
109 109
 		}
110
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
110
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
111 111
 		{
112
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
113
-			$view->errors = $view->get( 'errors', [] ) + $error;
114
-			$this->logException( $e );
112
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
113
+			$view->errors = $view->get('errors', []) + $error;
114
+			$this->logException($e);
115 115
 		}
116
-		catch( \Aimeos\MShop\Exception $e )
116
+		catch (\Aimeos\MShop\Exception $e)
117 117
 		{
118
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
119
-			$view->errors = $view->get( 'errors', [] ) + $error;
120
-			$this->logException( $e );
118
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
119
+			$view->errors = $view->get('errors', []) + $error;
120
+			$this->logException($e);
121 121
 		}
122
-		catch( \Exception $e )
122
+		catch (\Exception $e)
123 123
 		{
124
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
125
-			$view->errors = $view->get( 'errors', [] ) + $error;
126
-			$this->logException( $e );
124
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
125
+			$view->errors = $view->get('errors', []) + $error;
126
+			$this->logException($e);
127 127
 		}
128 128
 
129
-		return $this->render( $view );
129
+		return $this->render($view);
130 130
 	}
131 131
 
132 132
 
@@ -140,46 +140,46 @@  discard block
 block discarded – undo
140 140
 		$view = $this->getView();
141 141
 		$context = $this->getContext();
142 142
 
143
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
143
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
144 144
 		$manager->begin();
145 145
 
146 146
 		try
147 147
 		{
148
-			if( ( $id = $view->param( 'id' ) ) === null ) {
149
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
148
+			if (($id = $view->param('id')) === null) {
149
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
150 150
 			}
151 151
 
152
-			$this->checkSite( $view->access( 'super' ), $id );
152
+			$this->checkSite($view->access('super'), $id);
153 153
 
154
-			$view->item = $manager->getItem( $id );
154
+			$view->item = $manager->getItem($id);
155 155
 
156
-			foreach( $this->getSubClients() as $client ) {
156
+			foreach ($this->getSubClients() as $client) {
157 157
 				$client->delete();
158 158
 			}
159 159
 
160
-			$manager->deleteItem( $id );
160
+			$manager->deleteItem($id);
161 161
 			$manager->commit();
162 162
 
163
-			$this->nextAction( $view, 'search', 'locale/site', null, 'delete' );
163
+			$this->nextAction($view, 'search', 'locale/site', null, 'delete');
164 164
 			return;
165 165
 		}
166
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
166
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
167 167
 		{
168
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
169
-			$view->errors = $view->get( 'errors', [] ) + $error;
170
-			$this->logException( $e );
168
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
169
+			$view->errors = $view->get('errors', []) + $error;
170
+			$this->logException($e);
171 171
 		}
172
-		catch( \Aimeos\MShop\Exception $e )
172
+		catch (\Aimeos\MShop\Exception $e)
173 173
 		{
174
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
175
-			$view->errors = $view->get( 'errors', [] ) + $error;
176
-			$this->logException( $e );
174
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
175
+			$view->errors = $view->get('errors', []) + $error;
176
+			$this->logException($e);
177 177
 		}
178
-		catch( \Exception $e )
178
+		catch (\Exception $e)
179 179
 		{
180
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
181
-			$view->errors = $view->get( 'errors', [] ) + $error;
182
-			$this->logException( $e );
180
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
181
+			$view->errors = $view->get('errors', []) + $error;
182
+			$this->logException($e);
183 183
 		}
184 184
 
185 185
 		$manager->rollback();
@@ -200,45 +200,45 @@  discard block
 block discarded – undo
200 200
 
201 201
 		try
202 202
 		{
203
-			if( ( $id = $view->param( 'id' ) ) === null ) {
204
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
203
+			if (($id = $view->param('id')) === null) {
204
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
205 205
 			}
206 206
 
207
-			$this->checkSite( $view->access( 'super' ), $id );
207
+			$this->checkSite($view->access('super'), $id);
208 208
 
209
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
209
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
210 210
 
211
-			$view->item = $manager->getItem( $id );
211
+			$view->item = $manager->getItem($id);
212 212
 			$view->itemSubparts = $this->getSubClientNames();
213
-			$view->itemData = $this->toArray( $view->item );
213
+			$view->itemData = $this->toArray($view->item);
214 214
 			$view->itemBody = '';
215 215
 
216
-			foreach( $this->getSubClients() as $idx => $client )
216
+			foreach ($this->getSubClients() as $idx => $client)
217 217
 			{
218 218
 				$view->tabindex = ++$idx + 1;
219 219
 				$view->itemBody .= $client->get();
220 220
 			}
221 221
 		}
222
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
222
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
223 223
 		{
224
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
225
-			$view->errors = $view->get( 'errors', [] ) + $error;
226
-			$this->logException( $e );
224
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
225
+			$view->errors = $view->get('errors', []) + $error;
226
+			$this->logException($e);
227 227
 		}
228
-		catch( \Aimeos\MShop\Exception $e )
228
+		catch (\Aimeos\MShop\Exception $e)
229 229
 		{
230
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
231
-			$view->errors = $view->get( 'errors', [] ) + $error;
232
-			$this->logException( $e );
230
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
231
+			$view->errors = $view->get('errors', []) + $error;
232
+			$this->logException($e);
233 233
 		}
234
-		catch( \Exception $e )
234
+		catch (\Exception $e)
235 235
 		{
236
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
237
-			$view->errors = $view->get( 'errors', [] ) + $error;
238
-			$this->logException( $e );
236
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
237
+			$view->errors = $view->get('errors', []) + $error;
238
+			$this->logException($e);
239 239
 		}
240 240
 
241
-		return $this->render( $view );
241
+		return $this->render($view);
242 242
 	}
243 243
 
244 244
 
@@ -252,42 +252,42 @@  discard block
 block discarded – undo
252 252
 		$view = $this->getView();
253 253
 		$context = $this->getContext();
254 254
 
255
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
255
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
256 256
 		$manager->begin();
257 257
 
258 258
 		try
259 259
 		{
260
-			$item = $this->fromArray( $view->param( 'item', [] ), $view->access( 'super' ) );
261
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
260
+			$item = $this->fromArray($view->param('item', []), $view->access('super'));
261
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
262 262
 			$view->itemBody = '';
263 263
 
264
-			foreach( $this->getSubClients() as $client ) {
264
+			foreach ($this->getSubClients() as $client) {
265 265
 				$view->itemBody .= $client->save();
266 266
 			}
267 267
 
268
-			$manager->saveItem( clone $view->item );
268
+			$manager->saveItem(clone $view->item);
269 269
 			$manager->commit();
270 270
 
271
-			$this->nextAction( $view, $view->param( 'next' ), 'locale/site', $view->item->getId(), 'save' );
271
+			$this->nextAction($view, $view->param('next'), 'locale/site', $view->item->getId(), 'save');
272 272
 			return;
273 273
 		}
274
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
274
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
275 275
 		{
276
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'admin', $e->getMessage() ) );
277
-			$view->errors = $view->get( 'errors', [] ) + $error;
278
-			$this->logException( $e );
276
+			$error = array('locale-site-item' => $context->getI18n()->dt('admin', $e->getMessage()));
277
+			$view->errors = $view->get('errors', []) + $error;
278
+			$this->logException($e);
279 279
 		}
280
-		catch( \Aimeos\MShop\Exception $e )
280
+		catch (\Aimeos\MShop\Exception $e)
281 281
 		{
282
-			$error = array( 'locale-site-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
283
-			$view->errors = $view->get( 'errors', [] ) + $error;
284
-			$this->logException( $e );
282
+			$error = array('locale-site-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
283
+			$view->errors = $view->get('errors', []) + $error;
284
+			$this->logException($e);
285 285
 		}
286
-		catch( \Exception $e )
286
+		catch (\Exception $e)
287 287
 		{
288
-			$error = array( 'locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
289
-			$view->errors = $view->get( 'errors', [] ) + $error;
290
-			$this->logException( $e );
288
+			$error = array('locale-site-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
289
+			$view->errors = $view->get('errors', []) + $error;
290
+			$this->logException($e);
291 291
 		}
292 292
 
293 293
 		$manager->rollback();
@@ -309,39 +309,39 @@  discard block
 block discarded – undo
309 309
 		try
310 310
 		{
311 311
 			$total = 0;
312
-			$params = $this->storeSearchParams( $view->param(), 'locale/site' );
313
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
314
-			$search = $this->initCriteria( $manager->createSearch(), $params );
312
+			$params = $this->storeSearchParams($view->param(), 'locale/site');
313
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
314
+			$search = $this->initCriteria($manager->createSearch(), $params);
315 315
 
316
-			if( $view->access( 'super' ) === false )
316
+			if ($view->access('super') === false)
317 317
 			{
318
-				$search->setConditions( $search->combine( '&&', [
319
-					$search->compare( '==', 'locale.site.id', $this->getUserSiteId() ),
318
+				$search->setConditions($search->combine('&&', [
319
+					$search->compare('==', 'locale.site.id', $this->getUserSiteId()),
320 320
 					$search->getConditions(),
321
-				] ) );
321
+				]));
322 322
 			}
323 323
 
324
-			$view->items = $manager->searchItems( $search, [], $total );
325
-			$view->filterAttributes = $manager->getSearchAttributes( true );
324
+			$view->items = $manager->searchItems($search, [], $total);
325
+			$view->filterAttributes = $manager->getSearchAttributes(true);
326 326
 			$view->filterOperators = $search->getOperators();
327 327
 			$view->total = $total;
328 328
 			$view->itemBody = '';
329 329
 
330
-			foreach( $this->getSubClients() as $client ) {
330
+			foreach ($this->getSubClients() as $client) {
331 331
 				$view->itemBody .= $client->search();
332 332
 			}
333 333
 		}
334
-		catch( \Aimeos\MShop\Exception $e )
334
+		catch (\Aimeos\MShop\Exception $e)
335 335
 		{
336
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
337
-			$view->errors = $view->get( 'errors', [] ) + $error;
338
-			$this->logException( $e );
336
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
337
+			$view->errors = $view->get('errors', []) + $error;
338
+			$this->logException($e);
339 339
 		}
340
-		catch( \Exception $e )
340
+		catch (\Exception $e)
341 341
 		{
342
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
343
-			$view->errors = $view->get( 'errors', [] ) + $error;
344
-			$this->logException( $e );
342
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
343
+			$view->errors = $view->get('errors', []) + $error;
344
+			$this->logException($e);
345 345
 		}
346 346
 
347 347
 		/** admin/jqadm/locale/site/template-list
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 		$tplconf = 'admin/jqadm/locale/site/template-list';
367 367
 		$default = 'locale/site/list-standard';
368 368
 
369
-		return $view->render( $view->config( $tplconf, $default ) );
369
+		return $view->render($view->config($tplconf, $default));
370 370
 	}
371 371
 
372 372
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 * @param string|null $name Name of the sub-client (Default if null)
378 378
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
379 379
 	 */
380
-	public function getSubClient( $type, $name = null )
380
+	public function getSubClient($type, $name = null)
381 381
 	{
382 382
 		/** admin/jqadm/locale/site/decorators/excludes
383 383
 		 * Excludes decorators added by the "common" option from the locale JQAdm client
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 		 * @see admin/jqadm/locale/site/decorators/excludes
453 453
 		 * @see admin/jqadm/locale/site/decorators/global
454 454
 		 */
455
-		return $this->createSubClient( 'locale/site' . $type, $name );
455
+		return $this->createSubClient('locale/site' . $type, $name);
456 456
 	}
457 457
 
458 458
 
@@ -463,13 +463,13 @@  discard block
 block discarded – undo
463 463
 	 * @param string $id ID of the site to access
464 464
 	 * @throws \Aimeos\Admin\JQAdm\Exception If user isn't allowed to access the site
465 465
 	 */
466
-	protected function checkSite( $super, $id = null )
466
+	protected function checkSite($super, $id = null)
467 467
 	{
468
-		if( $super === true || (string) $this->getUserSiteId() === (string) $id ) {
468
+		if ($super === true || (string) $this->getUserSiteId() === (string) $id) {
469 469
 			return;
470 470
 		}
471 471
 
472
-		throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Permission denied' ) );
472
+		throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Permission denied'));
473 473
 	}
474 474
 
475 475
 
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
 	protected function getUserSiteId()
482 482
 	{
483 483
 		$context = $this->getContext();
484
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
484
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
485 485
 
486
-		return $manager->getItem( $context->getUserId() )->getSiteId();
486
+		return $manager->getItem($context->getUserId())->getSiteId();
487 487
 	}
488 488
 
489 489
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 		 * @since 2017.10
528 528
 		 * @category Developer
529 529
 		 */
530
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/locale/site/standard/subparts', [] );
530
+		return $this->getContext()->getConfig()->get('admin/jqadm/locale/site/standard/subparts', []);
531 531
 	}
532 532
 
533 533
 
@@ -538,38 +538,38 @@  discard block
 block discarded – undo
538 538
 	 * @param boolean $super If current user is a super user
539 539
 	 * @return \Aimeos\MShop\Locale\Item\Iface New locale item object
540 540
 	 */
541
-	protected function fromArray( array $data, $super )
541
+	protected function fromArray(array $data, $super)
542 542
 	{
543 543
 		$conf = [];
544 544
 
545
-		if( isset( $data['config']['key'] ) )
545
+		if (isset($data['config']['key']))
546 546
 		{
547
-			foreach( (array) $data['config']['key'] as $idx => $key )
547
+			foreach ((array) $data['config']['key'] as $idx => $key)
548 548
 			{
549
-				if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) {
549
+				if (trim($key) !== '' && isset($data['config']['val'][$idx])) {
550 550
 					$conf[$key] = $data['config']['val'][$idx];
551 551
 				}
552 552
 			}
553 553
 		}
554 554
 
555
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/site' );
555
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/site');
556 556
 
557
-		if( isset( $data['locale.site.id'] ) && $data['locale.site.id'] != '' )
557
+		if (isset($data['locale.site.id']) && $data['locale.site.id'] != '')
558 558
 		{
559
-			$this->checkSite( $super, $data['locale.site.id'] );
560
-			$item = $manager->getItem( $data['locale.site.id'] );
559
+			$this->checkSite($super, $data['locale.site.id']);
560
+			$item = $manager->getItem($data['locale.site.id']);
561 561
 		}
562 562
 		else
563 563
 		{
564
-			$this->checkSite( $super );
564
+			$this->checkSite($super);
565 565
 			$item = $manager->createItem();
566 566
 		}
567 567
 
568
-		$item->fromArray( $data );
569
-		$item->setConfig( $conf );
568
+		$item->fromArray($data);
569
+		$item->setConfig($conf);
570 570
 
571
-		if( $item->getId() == null ) {
572
-			return $manager->insertItem( $item );
571
+		if ($item->getId() == null) {
572
+			return $manager->insertItem($item);
573 573
 		}
574 574
 
575 575
 		return $item;
@@ -582,18 +582,18 @@  discard block
 block discarded – undo
582 582
 	 * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object
583 583
 	 * @return string[] Multi-dimensional associative list of item data
584 584
 	 */
585
-	protected function toArray( \Aimeos\MShop\Locale\Item\Site\Iface $item, $copy = false )
585
+	protected function toArray(\Aimeos\MShop\Locale\Item\Site\Iface $item, $copy = false)
586 586
 	{
587
-		$data = $item->toArray( true );
587
+		$data = $item->toArray(true);
588 588
 		$data['config'] = [];
589 589
 
590
-		if( $copy === true )
590
+		if ($copy === true)
591 591
 		{
592 592
 			$data['locale.site.code'] = $data['locale.site.code'] . '_copy';
593 593
 			$data['locale.site.id'] = '';
594 594
 		}
595 595
 
596
-		foreach( $item->getConfig() as $key => $value )
596
+		foreach ($item->getConfig() as $key => $value)
597 597
 		{
598 598
 			$data['config']['key'][] = $key;
599 599
 			$data['config']['val'][] = $value;
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 *
609 609
 	 * @return string HTML output
610 610
 	 */
611
-	protected function render( \Aimeos\MW\View\Iface $view )
611
+	protected function render(\Aimeos\MW\View\Iface $view)
612 612
 	{
613 613
 		/** admin/jqadm/locale/site/template-item
614 614
 		 * Relative path to the HTML body template for the locale item.
@@ -632,6 +632,6 @@  discard block
 block discarded – undo
632 632
 		$tplconf = 'admin/jqadm/locale/site/template-item';
633 633
 		$default = 'locale/site/item-standard';
634 634
 
635
-		return $view->render( $view->config( $tplconf, $default ) );
635
+		return $view->render($view->config($tplconf, $default));
636 636
 	}
637 637
 }
Please login to merge, or discard this patch.