Completed
Push — master ( b0d777...348cdf )
by Aimeos
10:27
created
Tests/Controller/JqadmControllerTest.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
 		$client = static::createClient(array(), array(
13 13
 			'PHP_AUTH_USER' => 'admin',
14 14
 			'PHP_AUTH_PW'   => 'adminpass',
15
-		) );
15
+		));
16 16
 
17
-		$client->request( 'GET', '/unittest/jqadm/copy/product/0' );
17
+		$client->request('GET', '/unittest/jqadm/copy/product/0');
18 18
 		$response = $client->getResponse();
19 19
 
20
-		$this->assertEquals( 200, $response->getStatusCode() );
21
-		$this->assertContains( '<div class="product-item', $response->getContent() );
20
+		$this->assertEquals(200, $response->getStatusCode());
21
+		$this->assertContains('<div class="product-item', $response->getContent());
22 22
 	}
23 23
 
24 24
 
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 		$client = static::createClient(array(), array(
28 28
 			'PHP_AUTH_USER' => 'admin',
29 29
 			'PHP_AUTH_PW'   => 'adminpass',
30
-		) );
30
+		));
31 31
 
32
-		$client->request( 'GET', '/unittest/jqadm/create/product' );
32
+		$client->request('GET', '/unittest/jqadm/create/product');
33 33
 		$response = $client->getResponse();
34 34
 
35
-		$this->assertEquals( 200, $response->getStatusCode() );
36
-		$this->assertContains( '<div class="product-item', $response->getContent() );
35
+		$this->assertEquals(200, $response->getStatusCode());
36
+		$this->assertContains('<div class="product-item', $response->getContent());
37 37
 	}
38 38
 
39 39
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 		$client = static::createClient(array(), array(
43 43
 			'PHP_AUTH_USER' => 'admin',
44 44
 			'PHP_AUTH_PW'   => 'adminpass',
45
-		) );
45
+		));
46 46
 
47
-		$client->request( 'GET', '/unittest/jqadm/delete/product/0' );
47
+		$client->request('GET', '/unittest/jqadm/delete/product/0');
48 48
 		$response = $client->getResponse();
49 49
 
50
-		$this->assertEquals( 200, $response->getStatusCode() );
51
-		$this->assertContains( '<table class="list-items', $response->getContent() );
50
+		$this->assertEquals(200, $response->getStatusCode());
51
+		$this->assertContains('<table class="list-items', $response->getContent());
52 52
 	}
53 53
 
54 54
 
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 		$client = static::createClient(array(), array(
58 58
 			'PHP_AUTH_USER' => 'admin',
59 59
 			'PHP_AUTH_PW'   => 'adminpass',
60
-		) );
60
+		));
61 61
 
62
-		$client->request( 'GET', '/unittest/jqadm/get/product/0' );
62
+		$client->request('GET', '/unittest/jqadm/get/product/0');
63 63
 		$response = $client->getResponse();
64 64
 
65
-		$this->assertEquals( 200, $response->getStatusCode() );
66
-		$this->assertContains( '<div class="product-item', $response->getContent() );
65
+		$this->assertEquals(200, $response->getStatusCode());
66
+		$this->assertContains('<div class="product-item', $response->getContent());
67 67
 	}
68 68
 
69 69
 
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
 		$client = static::createClient(array(), array(
73 73
 			'PHP_AUTH_USER' => 'admin',
74 74
 			'PHP_AUTH_PW'   => 'adminpass',
75
-		) );
75
+		));
76 76
 
77
-		$client->request( 'POST', '/unittest/jqadm/save/product/0' );
77
+		$client->request('POST', '/unittest/jqadm/save/product/0');
78 78
 		$response = $client->getResponse();
79 79
 
80
-		$this->assertEquals( 200, $response->getStatusCode() );
81
-		$this->assertContains( '<div class="product-item', $response->getContent() );
80
+		$this->assertEquals(200, $response->getStatusCode());
81
+		$this->assertContains('<div class="product-item', $response->getContent());
82 82
 	}
83 83
 
84 84
 
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 		$client = static::createClient(array(), array(
88 88
 			'PHP_AUTH_USER' => 'admin',
89 89
 			'PHP_AUTH_PW'   => 'adminpass',
90
-		) );
90
+		));
91 91
 
92
-		$client->request( 'GET', '/unittest/jqadm/search/product' );
92
+		$client->request('GET', '/unittest/jqadm/search/product');
93 93
 		$response = $client->getResponse();
94 94
 
95
-		$this->assertEquals( 200, $response->getStatusCode() );
96
-		$this->assertContains( '<table class="list-items', $response->getContent() );
95
+		$this->assertEquals(200, $response->getStatusCode());
96
+		$this->assertContains('<table class="list-items', $response->getContent());
97 97
 	}
98 98
 
99 99
 
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
 		$client = static::createClient(array(), array(
103 103
 			'PHP_AUTH_USER' => 'admin',
104 104
 			'PHP_AUTH_PW'   => 'adminpass',
105
-		) );
105
+		));
106 106
 
107
-		$client->request( 'GET', '/invalid/jqadm/search/product' );
107
+		$client->request('GET', '/invalid/jqadm/search/product');
108 108
 		$response = $client->getResponse();
109 109
 
110
-		$this->assertEquals( 200, $response->getStatusCode() );
111
-		$this->assertContains( '<table class="list-items', $response->getContent() );
110
+		$this->assertEquals(200, $response->getStatusCode());
111
+		$this->assertContains('<table class="list-items', $response->getContent());
112 112
 	}
113 113
 }
Please login to merge, or discard this patch.
Service/Aimeos.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param Container $container Container object to access parameters
31 31
 	 */
32
-	public function __construct( Container $container )
32
+	public function __construct(Container $container)
33 33
 	{
34 34
 		$this->container = $container;
35 35
 	}
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function get()
44 44
 	{
45
-		if( $this->object === null )
45
+		if ($this->object === null)
46 46
 		{
47
-			$extDirs = (array) $this->container->getParameter( 'aimeos_shop.extdir' );
48
-			$this->object = new \Aimeos\Bootstrap( $extDirs, false );
47
+			$extDirs = (array) $this->container->getParameter('aimeos_shop.extdir');
48
+			$this->object = new \Aimeos\Bootstrap($extDirs, false);
49 49
 		}
50 50
 
51 51
 		return $this->object;
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function getVersion()
61 61
 	{
62
-		$filename = dirname( $this->container->get( 'kernel' )->getRootDir() ) . DIRECTORY_SEPARATOR . 'composer.lock';
62
+		$filename = dirname($this->container->get('kernel')->getRootDir()) . DIRECTORY_SEPARATOR . 'composer.lock';
63 63
 
64
-		if( file_exists( $filename ) === true && ( $content = file_get_contents( $filename ) ) !== false
65
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
64
+		if (file_exists($filename) === true && ($content = file_get_contents($filename)) !== false
65
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
66 66
 		) {
67
-			foreach( (array) $content['packages'] as $item )
67
+			foreach ((array) $content['packages'] as $item)
68 68
 			{
69
-				if( $item['name'] === 'aimeos/aimeos-symfony2' ) {
69
+				if ($item['name'] === 'aimeos/aimeos-symfony2') {
70 70
 					return $item['version'];
71 71
 				}
72 72
 			}
Please login to merge, or discard this patch.
Service/Context.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param RequestStack $requestStack Current request stack
35 35
 	 * @param Container $container Container object to access parameters
36 36
 	 */
37
-	public function __construct( RequestStack $requestStack, Container $container )
37
+	public function __construct(RequestStack $requestStack, Container $container)
38 38
 	{
39 39
 		$this->requestStack = $requestStack;
40 40
 		$this->container = $container;
@@ -47,49 +47,49 @@  discard block
 block discarded – undo
47 47
 	 * @param boolean $locale True to add locale object to context, false if not
48 48
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
49 49
 	 */
50
-	public function get( $locale = true )
50
+	public function get($locale = true)
51 51
 	{
52
-		if( self::$context === null )
52
+		if (self::$context === null)
53 53
 		{
54 54
 			$context = new \Aimeos\MShop\Context\Item\Standard();
55 55
 
56 56
 			$config = $this->getConfig();
57
-			$context->setConfig( $config );
57
+			$context->setConfig($config);
58 58
 
59
-			$dbm = new \Aimeos\MW\DB\Manager\PDO( $config );
60
-			$context->setDatabaseManager( $dbm );
59
+			$dbm = new \Aimeos\MW\DB\Manager\PDO($config);
60
+			$context->setDatabaseManager($dbm);
61 61
 
62
-			$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $config );
63
-			$context->setFilesystemManager( $fs );
62
+			$fs = new \Aimeos\MW\Filesystem\Manager\Standard($config);
63
+			$context->setFilesystemManager($fs);
64 64
 
65 65
 			$container = $this->container;
66
-			$mail = new \Aimeos\MW\Mail\Swift( function() use ( $container) { return $container->get( 'mailer' ); } );
67
-			$context->setMail( $mail );
66
+			$mail = new \Aimeos\MW\Mail\Swift(function() use ($container) { return $container->get('mailer'); } );
67
+			$context->setMail($mail);
68 68
 
69
-			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
70
-			$context->setLogger( $logger );
69
+			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context);
70
+			$context->setLogger($logger);
71 71
 
72
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context );
73
-			$context->setCache( $cache );
72
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
73
+			$context->setCache($cache);
74 74
 
75 75
 			self::$context = $context;
76 76
 		}
77 77
 
78 78
 		$context = self::$context;
79 79
 
80
-		if( $locale === true )
80
+		if ($locale === true)
81 81
 		{
82
-			$localeItem = $this->getLocale( $context );
82
+			$localeItem = $this->getLocale($context);
83 83
 			$langid = $localeItem->getLanguageId();
84 84
 
85
-			$context->setLocale( $localeItem );
86
-			$context->setI18n( $this->container->get('aimeos_i18n')->get( array( $langid ) ) );
85
+			$context->setLocale($localeItem);
86
+			$context->setI18n($this->container->get('aimeos_i18n')->get(array($langid)));
87 87
 		}
88 88
 
89
-		$session = new \Aimeos\MW\Session\Symfony2( $this->container->get( 'session' ) );
90
-		$context->setSession( $session );
89
+		$session = new \Aimeos\MW\Session\Symfony2($this->container->get('session'));
90
+		$context->setSession($session);
91 91
 
92
-		$this->addUser( $context );
92
+		$this->addUser($context);
93 93
 
94 94
 		return $context;
95 95
 	}
@@ -100,39 +100,39 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
102 102
 	 */
103
-	protected function addUser( \Aimeos\MShop\Context\Item\Iface $context )
103
+	protected function addUser(\Aimeos\MShop\Context\Item\Iface $context)
104 104
 	{
105 105
 		$token = null;
106 106
 		$username = '';
107 107
 
108
-		if( $this->container->has( 'security.token_storage' ) ) {
109
-			$token = $this->container->get( 'security.token_storage' )->getToken();
108
+		if ($this->container->has('security.token_storage')) {
109
+			$token = $this->container->get('security.token_storage')->getToken();
110 110
 		}
111
-		else if( $this->container->has( 'security.context' ) ) {
112
-			$token = $this->container->get( 'security.context' )->getToken();
111
+		else if ($this->container->has('security.context')) {
112
+			$token = $this->container->get('security.context')->getToken();
113 113
 		}
114 114
 
115
-		if( is_object( $token ) )
115
+		if (is_object($token))
116 116
 		{
117
-			if( method_exists( $token->getUser(), 'getId' ) )
117
+			if (method_exists($token->getUser(), 'getId'))
118 118
 			{
119 119
 				$userid = $token->getUser()->getId();
120
-				$context->setUserId( $userid );
121
-				$context->setGroupIds( function() use ( $context, $userid )
120
+				$context->setUserId($userid);
121
+				$context->setGroupIds(function() use ($context, $userid)
122 122
 				{
123
-					$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
124
-					return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups();
123
+					$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
124
+					return $manager->getItem($userid, array('customer/group'))->getGroups();
125 125
 				} );
126 126
 			}
127 127
 
128
-			if( is_object( $token->getUser() ) ) {
129
-				$username =  $token->getUser()->getUsername();
128
+			if (is_object($token->getUser())) {
129
+				$username = $token->getUser()->getUsername();
130 130
 			} else {
131 131
 				$username = $token->getUser();
132 132
 			}
133 133
 		}
134 134
 
135
-		$context->setEditor( $username );
135
+		$context->setEditor($username);
136 136
 	}
137 137
 
138 138
 
@@ -143,27 +143,27 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	protected function getConfig()
145 145
 	{
146
-		$configPaths = $this->container->get('aimeos')->get()->getConfigPaths( 'mysql' );
146
+		$configPaths = $this->container->get('aimeos')->get()->getConfigPaths('mysql');
147 147
 
148
-		$conf = new \Aimeos\MW\Config\PHPArray( array(), $configPaths );
148
+		$conf = new \Aimeos\MW\Config\PHPArray(array(), $configPaths);
149 149
 
150
-		$apc = (bool) $this->container->getParameter( 'aimeos_shop.apc_enable' );
151
-		$prefix = $this->container->getParameter( 'aimeos_shop.apc_prefix' );
150
+		$apc = (bool) $this->container->getParameter('aimeos_shop.apc_enable');
151
+		$prefix = $this->container->getParameter('aimeos_shop.apc_prefix');
152 152
 
153
-		if( function_exists( 'apc_store' ) === true && $apc === true ) {
154
-			$conf = new \Aimeos\MW\Config\Decorator\APC( $conf, $prefix );
153
+		if (function_exists('apc_store') === true && $apc === true) {
154
+			$conf = new \Aimeos\MW\Config\Decorator\APC($conf, $prefix);
155 155
 		}
156 156
 
157 157
 		$local = array(
158
-			'admin' => $this->container->getParameter( 'aimeos_shop.admin' ),
159
-			'client' => $this->container->getParameter( 'aimeos_shop.client' ),
160
-			'controller' => $this->container->getParameter( 'aimeos_shop.controller' ),
161
-			'madmin' => $this->container->getParameter( 'aimeos_shop.madmin' ),
162
-			'mshop' => $this->container->getParameter( 'aimeos_shop.mshop' ),
163
-			'resource' => $this->container->getParameter( 'aimeos_shop.resource' ),
158
+			'admin' => $this->container->getParameter('aimeos_shop.admin'),
159
+			'client' => $this->container->getParameter('aimeos_shop.client'),
160
+			'controller' => $this->container->getParameter('aimeos_shop.controller'),
161
+			'madmin' => $this->container->getParameter('aimeos_shop.madmin'),
162
+			'mshop' => $this->container->getParameter('aimeos_shop.mshop'),
163
+			'resource' => $this->container->getParameter('aimeos_shop.resource'),
164 164
 		);
165 165
 
166
-		return new \Aimeos\MW\Config\Decorator\Memory( $conf, $local );
166
+		return new \Aimeos\MW\Config\Decorator\Memory($conf, $local);
167 167
 	}
168 168
 
169 169
 
@@ -173,19 +173,19 @@  discard block
 block discarded – undo
173 173
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
174 174
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
175 175
 	 */
176
-	protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context )
176
+	protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context)
177 177
 	{
178
-		if( $this->locale === null )
178
+		if ($this->locale === null)
179 179
 		{
180
-			$status = $this->container->getParameter( 'aimeos_shop.disable_sites' );
180
+			$status = $this->container->getParameter('aimeos_shop.disable_sites');
181 181
 			$attr = $this->requestStack->getMasterRequest()->attributes;
182 182
 
183
-			$site = $attr->get( 'site', 'default' );
184
-			$lang = $attr->get( 'locale', '' );
185
-			$currency = $attr->get( 'currency', '' );
183
+			$site = $attr->get('site', 'default');
184
+			$lang = $attr->get('locale', '');
185
+			$currency = $attr->get('currency', '');
186 186
 
187
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
188
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $status );
187
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
188
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $status);
189 189
 		}
190 190
 
191 191
 		return $this->locale;
Please login to merge, or discard this patch.
DependencyInjection/Configuration.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,23 +29,23 @@
 block discarded – undo
29 29
 	public function getConfigTreeBuilder()
30 30
 	{
31 31
 		$treeBuilder = new TreeBuilder();
32
-		$rootNode = $treeBuilder->root( 'aimeos_shop' );
32
+		$rootNode = $treeBuilder->root('aimeos_shop');
33 33
 
34 34
 		$rootNode
35 35
 			->children()
36
-				->booleanNode('disable_sites')->defaultValue( true )->end()
37
-				->booleanNode('apc_enable')->defaultValue( false )->end()
38
-				->scalarNode('apc_prefix')->defaultValue( 'sf2:' )->end()
36
+				->booleanNode('disable_sites')->defaultValue(true)->end()
37
+				->booleanNode('apc_enable')->defaultValue(false)->end()
38
+				->scalarNode('apc_prefix')->defaultValue('sf2:')->end()
39 39
 				->scalarNode('extdir')->end()
40 40
 				->scalarNode('uploaddir')->end()
41
-				->variableNode('admin')->defaultValue( array() )->end()
42
-				->variableNode('client')->defaultValue( array() )->end()
43
-				->variableNode('controller')->defaultValue( array() )->end()
44
-				->variableNode('i18n')->defaultValue( array() )->end()
45
-				->variableNode('madmin')->defaultValue( array() )->end()
46
-				->variableNode('mshop')->defaultValue( array() )->end()
47
-				->variableNode('resource')->defaultValue( array() )->end()
48
-				->variableNode('page')->defaultValue( array() )->end()
41
+				->variableNode('admin')->defaultValue(array())->end()
42
+				->variableNode('client')->defaultValue(array())->end()
43
+				->variableNode('controller')->defaultValue(array())->end()
44
+				->variableNode('i18n')->defaultValue(array())->end()
45
+				->variableNode('madmin')->defaultValue(array())->end()
46
+				->variableNode('mshop')->defaultValue(array())->end()
47
+				->variableNode('resource')->defaultValue(array())->end()
48
+				->variableNode('page')->defaultValue(array())->end()
49 49
 			->end()
50 50
 		;
51 51
 
Please login to merge, or discard this patch.
Tests/Controller/AdminControllerTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 	{
12 12
 		$client = static::createClient();
13 13
 
14
-		$client->request( 'GET', '/admin' );
14
+		$client->request('GET', '/admin');
15 15
 		$response = $client->getResponse();
16 16
 
17
-		$this->assertEquals( 200, $response->getStatusCode() );
18
-		$this->assertContains( '<form class="login"', $response->getContent() );
17
+		$this->assertEquals(200, $response->getStatusCode());
18
+		$this->assertContains('<form class="login"', $response->getContent());
19 19
 	}
20 20
 
21 21
 
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 		$client = static::createClient(array(), array(
25 25
 			'PHP_AUTH_USER' => 'admin',
26 26
 			'PHP_AUTH_PW'   => 'adminpass',
27
-		) );
27
+		));
28 28
 
29
-		$client->request( 'GET', '/admin' );
29
+		$client->request('GET', '/admin');
30 30
 		$response = $client->getResponse();
31 31
 
32
-		$this->assertEquals( 302, $response->getStatusCode() );
33
-		$this->assertContains( '/default/jqadm/search/product?lang=en', $response->getContent() );
32
+		$this->assertEquals(302, $response->getStatusCode());
33
+		$this->assertContains('/default/jqadm/search/product?lang=en', $response->getContent());
34 34
 	}
35 35
 }
Please login to merge, or discard this patch.
Controller/ExtadmController.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -32,56 +32,56 @@  discard block
 block discarded – undo
32 32
 	 * @param integer $tab Number of the currently active tab
33 33
 	 * @return \Symfony\Component\HttpFoundation\Response HTML page for the admin interface
34 34
 	 */
35
-	public function indexAction( $site = 'default', $lang, $tab )
35
+	public function indexAction($site = 'default', $lang, $tab)
36 36
 	{
37
-		$context = $this->get( 'aimeos_context' )->get( false );
38
-		$context = $this->setLocale( $context, $site, $lang );
37
+		$context = $this->get('aimeos_context')->get(false);
38
+		$context = $this->setLocale($context, $site, $lang);
39 39
 
40
-		$aimeos = $this->get( 'aimeos' );
40
+		$aimeos = $this->get('aimeos');
41 41
 		$bootstrap = $aimeos->get();
42 42
 
43
-		$cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' );
44
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
43
+		$cntlPaths = $bootstrap->getCustomPaths('controller/extjs');
44
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
45 45
 		$cssFiles = array();
46 46
 
47
-		foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths )
47
+		foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths)
48 48
 		{
49
-			foreach( $paths as $path )
49
+			foreach ($paths as $path)
50 50
 			{
51 51
 				$jsbAbsPath = $base . '/' . $path;
52 52
 
53
-				if( !is_file( $jsbAbsPath ) ) {
54
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
53
+				if (!is_file($jsbAbsPath)) {
54
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
55 55
 				}
56 56
 
57
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
58
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
57
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
58
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
59 59
 			}
60 60
 		}
61 61
 
62
-		$params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' );
63
-		$adminUrl = $this->generateUrl( 'aimeos_shop_extadm', $params );
62
+		$params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
63
+		$adminUrl = $this->generateUrl('aimeos_shop_extadm', $params);
64 64
 
65
-		$token = $this->get( 'security.csrf.token_manager' )->getToken( 'aimeos_admin_token' )->getValue();
66
-		$jsonUrl = $this->generateUrl( 'aimeos_shop_extadm_json', array( '_token' => $token, 'site' => $site ) );
65
+		$token = $this->get('security.csrf.token_manager')->getToken('aimeos_admin_token')->getValue();
66
+		$jsonUrl = $this->generateUrl('aimeos_shop_extadm_json', array('_token' => $token, 'site' => $site));
67 67
 
68 68
 		$vars = array(
69 69
 			'lang' => $lang,
70 70
 			'cssFiles' => $cssFiles,
71 71
 			'languages' => $this->getJsonLanguages(),
72
-			'config' => $this->getJsonClientConfig( $context ),
73
-			'site' => $this->getJsonSiteItem( $context, $site ),
74
-			'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ),
72
+			'config' => $this->getJsonClientConfig($context),
73
+			'site' => $this->getJsonSiteItem($context, $site),
74
+			'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang),
75 75
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
76 76
 			'itemSchemas' => $controller->getJsonItemSchemas(),
77
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
78
-			'urlTemplate' => urldecode( $adminUrl ),
79
-			'uploaddir' => $this->container->getParameter( 'aimeos_shop.uploaddir' ),
77
+			'smd' => $controller->getJsonSmd($jsonUrl),
78
+			'urlTemplate' => urldecode($adminUrl),
79
+			'uploaddir' => $this->container->getParameter('aimeos_shop.uploaddir'),
80 80
 			'version' => $aimeos->getVersion(),
81 81
 			'activeTab' => $tab,
82 82
 		);
83 83
 
84
-		return $this->render( 'AimeosShopBundle:Extadm:index.html.twig', $vars );
84
+		return $this->render('AimeosShopBundle:Extadm:index.html.twig', $vars);
85 85
 	}
86 86
 
87 87
 
@@ -91,22 +91,22 @@  discard block
 block discarded – undo
91 91
 	 * @param Symfony\Component\HttpFoundation\Request $request Symfony request object
92 92
 	 * @return \Symfony\Component\HttpFoundation\Response 2.0 RPC message response
93 93
 	 */
94
-	public function doAction( Request $request )
94
+	public function doAction(Request $request)
95 95
 	{
96 96
 		$csrfProvider = $this->get('security.csrf.token_manager');
97 97
 
98
-		if( $csrfProvider->isTokenValid( new CsrfToken( 'aimeos_admin_token',  $request->query->get( '_token' ) ) ) !== true ) {
99
-			throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException( 'CSRF token is invalid' );
98
+		if ($csrfProvider->isTokenValid(new CsrfToken('aimeos_admin_token', $request->query->get('_token'))) !== true) {
99
+			throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException('CSRF token is invalid');
100 100
 		}
101 101
 
102
-		$cntlPaths = $this->get( 'aimeos' )->get()->getCustomPaths( 'controller/extjs' );
103
-		$context = $this->get( 'aimeos_context' )->get( false );
104
-		$context = $this->setLocale( $context );
102
+		$cntlPaths = $this->get('aimeos')->get()->getCustomPaths('controller/extjs');
103
+		$context = $this->get('aimeos_context')->get(false);
104
+		$context = $this->setLocale($context);
105 105
 
106
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
106
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
107 107
 
108
-		$response = $controller->process( $request->request->all(), 'php://input' );
109
-		return $this->render( 'AimeosShopBundle:Extadm:do.html.twig', array( 'output' => $response ) );
108
+		$response = $controller->process($request->request->all(), 'php://input');
109
+		return $this->render('AimeosShopBundle:Extadm:do.html.twig', array('output' => $response));
110 110
 	}
111 111
 
112 112
 
@@ -119,27 +119,27 @@  discard block
 block discarded – undo
119 119
 	{
120 120
 		$contents = '';
121 121
 		$jsFiles = array();
122
-		$aimeos = $this->get( 'aimeos' )->get();
122
+		$aimeos = $this->get('aimeos')->get();
123 123
 
124
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
124
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
125 125
 		{
126
-			foreach( $paths as $path )
126
+			foreach ($paths as $path)
127 127
 			{
128 128
 				$jsbAbsPath = $base . '/' . $path;
129
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
130
-				$jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) );
129
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
130
+				$jsFiles = array_merge($jsFiles, $jsb2->getFiles('js'));
131 131
 			}
132 132
 		}
133 133
 
134
-		foreach( $jsFiles as $file )
134
+		foreach ($jsFiles as $file)
135 135
 		{
136
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
136
+			if (($content = file_get_contents($file)) !== false) {
137 137
 				$contents .= $content;
138 138
 			}
139 139
 		}
140 140
 
141
-		$response = new Response( $contents );
142
-		$response->headers->set( 'Content-Type', 'application/javascript' );
141
+		$response = new Response($contents);
142
+		$response->headers->set('Content-Type', 'application/javascript');
143 143
 
144 144
 		return $response;
145 145
 	}
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
 	{
155 155
 		$result = array();
156 156
 
157
-		foreach( $this->get( 'aimeos' )->get()->getI18nList( 'admin' ) as $id ) {
158
-			$result[] = array( 'id' => $id, 'label' => $id );
157
+		foreach ($this->get('aimeos')->get()->getI18nList('admin') as $id) {
158
+			$result[] = array('id' => $id, 'label' => $id);
159 159
 		}
160 160
 
161
-		return json_encode( $result );
161
+		return json_encode($result);
162 162
 	}
163 163
 
164 164
 
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
169 169
 	 * @return string JSON encoded configuration object
170 170
 	 */
171
-	protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
171
+	protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
172 172
 	{
173
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
174
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
173
+		$config = $context->getConfig()->get('admin/extjs', array());
174
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
175 175
 	}
176 176
 
177 177
 
@@ -182,16 +182,16 @@  discard block
 block discarded – undo
182 182
 	 * @param string $lang ISO language code like "en" or "en_GB"
183 183
 	 * @return string JSON encoded translation object
184 184
 	 */
185
-	protected function getJsonClientI18n( array $i18nPaths, $lang )
185
+	protected function getJsonClientI18n(array $i18nPaths, $lang)
186 186
 	{
187
-		$i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) );
187
+		$i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true));
188 188
 
189 189
 		$content = array(
190
-			'admin' => $i18n->getAll( 'admin' ),
191
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
190
+			'admin' => $i18n->getAll('admin'),
191
+			'admin/ext' => $i18n->getAll('admin/ext'),
192 192
 		);
193 193
 
194
-		return json_encode( $content, JSON_FORCE_OBJECT );
194
+		return json_encode($content, JSON_FORCE_OBJECT);
195 195
 	}
196 196
 
197 197
 
@@ -203,19 +203,19 @@  discard block
 block discarded – undo
203 203
 	 * @return string JSON encoded site item object
204 204
 	 * @throws Exception If no site item was found for the code
205 205
 	 */
206
-	protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
206
+	protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
207 207
 	{
208
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
208
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
209 209
 
210 210
 		$criteria = $manager->createSearch();
211
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
212
-		$items = $manager->searchItems( $criteria );
211
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
212
+		$items = $manager->searchItems($criteria);
213 213
 
214
-		if( ( $item = reset( $items ) ) === false ) {
215
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
214
+		if (($item = reset($items)) === false) {
215
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
216 216
 		}
217 217
 
218
-		return json_encode( $item->toArray() );
218
+		return json_encode($item->toArray());
219 219
 	}
220 220
 
221 221
 
@@ -227,17 +227,17 @@  discard block
 block discarded – undo
227 227
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
228 228
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
229 229
 	 */
230
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
230
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
231 231
 	{
232
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
232
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
233 233
 
234 234
 		try {
235
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
236
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
235
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
236
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
237 237
 			$localeItem = $localeManager->createItem();
238 238
 		}
239 239
 
240
-		$context->setLocale( $localeItem );
240
+		$context->setLocale($localeItem);
241 241
 
242 242
 		return $context;
243 243
 	}
Please login to merge, or discard this patch.
Controller/JsonadmController.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	 * @param string $site Unique site code
32 32
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
33 33
 	 */
34
-	public function deleteAction( Request $request, $resource, $site = 'default' )
34
+	public function deleteAction(Request $request, $resource, $site = 'default')
35 35
 	{
36 36
 		$status = 500;
37 37
 		$header = $request->headers->all();
38 38
 
39
-		$cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) );
40
-		$result = $cntl->delete( $request->getContent(), $header, $status );
39
+		$cntl = $this->createController($site, $resource, $request->get('lang', 'en'));
40
+		$result = $cntl->delete($request->getContent(), $header, $status);
41 41
 
42
-		return $this->createResponse( $result, $status, $header );
42
+		return $this->createResponse($result, $status, $header);
43 43
 	}
44 44
 
45 45
 
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
 	 * @param string $site Unique site code
52 52
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
53 53
 	 */
54
-	public function getAction( Request $request, $resource, $site = 'default' )
54
+	public function getAction(Request $request, $resource, $site = 'default')
55 55
 	{
56 56
 		$status = 500;
57 57
 		$header = $request->headers->all();
58 58
 
59
-		$cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) );
60
-		$result = $cntl->get( $request->getContent(), $header, $status );
59
+		$cntl = $this->createController($site, $resource, $request->get('lang', 'en'));
60
+		$result = $cntl->get($request->getContent(), $header, $status);
61 61
 
62
-		return $this->createResponse( $result, $status, $header );
62
+		return $this->createResponse($result, $status, $header);
63 63
 	}
64 64
 
65 65
 
@@ -71,15 +71,15 @@  discard block
 block discarded – undo
71 71
 	 * @param string $site Unique site code
72 72
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
73 73
 	 */
74
-	public function patchAction( Request $request, $resource, $site = 'default' )
74
+	public function patchAction(Request $request, $resource, $site = 'default')
75 75
 	{
76 76
 		$status = 500;
77 77
 		$header = $request->headers->all();
78 78
 
79
-		$cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) );
80
-		$result = $cntl->patch( $request->getContent(), $header, $status );
79
+		$cntl = $this->createController($site, $resource, $request->get('lang', 'en'));
80
+		$result = $cntl->patch($request->getContent(), $header, $status);
81 81
 
82
-		return $this->createResponse( $result, $status, $header );
82
+		return $this->createResponse($result, $status, $header);
83 83
 	}
84 84
 
85 85
 
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 	 * @param string $site Unique site code
92 92
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
93 93
 	 */
94
-	public function postAction( Request $request, $resource, $site = 'default' )
94
+	public function postAction(Request $request, $resource, $site = 'default')
95 95
 	{
96 96
 		$status = 500;
97 97
 		$header = $request->headers->all();
98 98
 
99
-		$cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) );
100
-		$result = $cntl->post( $request->getContent(), $header, $status );
99
+		$cntl = $this->createController($site, $resource, $request->get('lang', 'en'));
100
+		$result = $cntl->post($request->getContent(), $header, $status);
101 101
 
102
-		return $this->createResponse( $result, $status, $header );
102
+		return $this->createResponse($result, $status, $header);
103 103
 	}
104 104
 
105 105
 
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
 	 * @param string $site Unique site code
112 112
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
113 113
 	 */
114
-	public function putAction( Request $request, $resource, $site = 'default' )
114
+	public function putAction(Request $request, $resource, $site = 'default')
115 115
 	{
116 116
 		$status = 500;
117 117
 		$header = $request->headers->all();
118 118
 
119
-		$cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) );
120
-		$result = $cntl->put( $request->getContent(), $header, $status );
119
+		$cntl = $this->createController($site, $resource, $request->get('lang', 'en'));
120
+		$result = $cntl->put($request->getContent(), $header, $status);
121 121
 
122
-		return $this->createResponse( $result, $status, $header );
122
+		return $this->createResponse($result, $status, $header);
123 123
 	}
124 124
 
125 125
 
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
 	 * @param string $site Unique site code
132 132
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
133 133
 	 */
134
-	public function optionsAction( Request $request, $resource = '', $site = 'default' )
134
+	public function optionsAction(Request $request, $resource = '', $site = 'default')
135 135
 	{
136 136
 		$status = 500;
137 137
 		$header = $request->headers->all();
138 138
 
139
-		$cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) );
140
-		$result = $cntl->options( $request->getContent(), $header, $status );
139
+		$cntl = $this->createController($site, $resource, $request->get('lang', 'en'));
140
+		$result = $cntl->options($request->getContent(), $header, $status);
141 141
 
142
-		return $this->createResponse( $result, $status, $header );
142
+		return $this->createResponse($result, $status, $header);
143 143
 	}
144 144
 
145 145
 
@@ -151,18 +151,18 @@  discard block
 block discarded – undo
151 151
 	 * @param string $lang Language code
152 152
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
153 153
 	 */
154
-	protected function createController( $site, $resource, $lang )
154
+	protected function createController($site, $resource, $lang)
155 155
 	{
156
-		$aimeos = $this->get( 'aimeos' )->get();
157
-		$templatePaths = $aimeos->getCustomPaths( 'controller/jsonadm/templates' );
156
+		$aimeos = $this->get('aimeos')->get();
157
+		$templatePaths = $aimeos->getCustomPaths('controller/jsonadm/templates');
158 158
 
159
-		$context = $this->get( 'aimeos_context' )->get( false );
160
-		$context = $this->setLocale( $context, $site, $lang );
159
+		$context = $this->get('aimeos_context')->get(false);
160
+		$context = $this->setLocale($context, $site, $lang);
161 161
 
162
-		$view = $this->get('aimeos_view')->create( $context->getConfig(), $templatePaths, $lang );
163
-		$context->setView( $view );
162
+		$view = $this->get('aimeos_view')->create($context->getConfig(), $templatePaths, $lang);
163
+		$context->setView($view);
164 164
 
165
-		return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource );
165
+		return \Aimeos\Controller\JsonAdm\Factory::createController($context, $templatePaths, $resource);
166 166
 	}
167 167
 
168 168
 
@@ -174,14 +174,14 @@  discard block
 block discarded – undo
174 174
 	 * @param array $header List of HTTP headers
175 175
 	 * @return \Illuminate\Http\Response HTTP response object
176 176
 	 */
177
-	protected function createResponse( $content, $status, array $header )
177
+	protected function createResponse($content, $status, array $header)
178 178
 	{
179 179
 		$response = new Response();
180
-		$response->setContent( $content );
181
-		$response->setStatusCode( $status );
180
+		$response->setContent($content);
181
+		$response->setStatusCode($status);
182 182
 
183
-		foreach( $header as $key => $value ) {
184
-			$response->headers->set( $key, $value );
183
+		foreach ($header as $key => $value) {
184
+			$response->headers->set($key, $value);
185 185
 		}
186 186
 
187 187
 		return $response;
@@ -196,23 +196,23 @@  discard block
 block discarded – undo
196 196
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
197 197
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
198 198
 	 */
199
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site, $lang )
199
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site, $lang)
200 200
 	{
201
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
201
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
202 202
 
203 203
 		try
204 204
 		{
205
-			$localeItem = $localeManager->bootstrap( $site, '', '', false );
206
-			$localeItem->setLanguageId( null );
207
-			$localeItem->setCurrencyId( null );
205
+			$localeItem = $localeManager->bootstrap($site, '', '', false);
206
+			$localeItem->setLanguageId(null);
207
+			$localeItem->setCurrencyId(null);
208 208
 		}
209
-		catch( \Aimeos\MShop\Locale\Exception $e )
209
+		catch (\Aimeos\MShop\Locale\Exception $e)
210 210
 		{
211 211
 			$localeItem = $localeManager->createItem();
212 212
 		}
213 213
 
214
-		$context->setLocale( $localeItem );
215
-		$context->setI18n( $this->get('aimeos_i18n')->get( array( $lang ) ) );
214
+		$context->setLocale($localeItem);
215
+		$context->setI18n($this->get('aimeos_i18n')->get(array($lang)));
216 216
 
217 217
 		return $context;
218 218
 	}
Please login to merge, or discard this patch.
Controller/JqadmController.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	 * @param string $site Unique site code
32 32
 	 * @return string Generated output
33 33
 	 */
34
-	public function copyAction( Request $request, $resource, $site = 'default' )
34
+	public function copyAction(Request $request, $resource, $site = 'default')
35 35
 	{
36
-		$cntl = $this->createClient( $request, $site, $resource );
37
-		return $this->getHtml( $cntl->copy() );
36
+		$cntl = $this->createClient($request, $site, $resource);
37
+		return $this->getHtml($cntl->copy());
38 38
 	}
39 39
 
40 40
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 	 * @param string $site Unique site code
47 47
 	 * @return string Generated output
48 48
 	 */
49
-	public function createAction( Request $request, $resource, $site = 'default' )
49
+	public function createAction(Request $request, $resource, $site = 'default')
50 50
 	{
51
-		$cntl = $this->createClient( $request, $site, $resource );
52
-		return $this->getHtml( $cntl->create() );
51
+		$cntl = $this->createClient($request, $site, $resource);
52
+		return $this->getHtml($cntl->create());
53 53
 	}
54 54
 
55 55
 
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	 * @param string $site Unique site code
62 62
 	 * @return string Generated output
63 63
 	 */
64
-	public function deleteAction( Request $request, $resource, $site = 'default' )
64
+	public function deleteAction(Request $request, $resource, $site = 'default')
65 65
 	{
66
-		$cntl = $this->createClient( $request, $site, $resource );
67
-		return $this->getHtml( $cntl->delete() . $cntl->search() );
66
+		$cntl = $this->createClient($request, $site, $resource);
67
+		return $this->getHtml($cntl->delete() . $cntl->search());
68 68
 	}
69 69
 
70 70
 
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 	 * @param string $site Unique site code
77 77
 	 * @return string Generated output
78 78
 	 */
79
-	public function getAction( Request $request, $resource, $site = 'default' )
79
+	public function getAction(Request $request, $resource, $site = 'default')
80 80
 	{
81
-		$cntl = $this->createClient( $request, $site, $resource );
82
-		return $this->getHtml( $cntl->get() );
81
+		$cntl = $this->createClient($request, $site, $resource);
82
+		return $this->getHtml($cntl->get());
83 83
 	}
84 84
 
85 85
 
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 	 * @param string $site Unique site code
92 92
 	 * @return string Generated output
93 93
 	 */
94
-	public function saveAction( Request $request, $resource, $site = 'default' )
94
+	public function saveAction(Request $request, $resource, $site = 'default')
95 95
 	{
96
-		$cntl = $this->createClient( $request, $site, $resource );
97
-		return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) );
96
+		$cntl = $this->createClient($request, $site, $resource);
97
+		return $this->getHtml(($cntl->save() ?: $cntl->search()));
98 98
 	}
99 99
 
100 100
 
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 	 * @param string $site Unique site code
107 107
 	 * @return string Generated output
108 108
 	 */
109
-	public function searchAction( Request $request, $resource, $site = 'default' )
109
+	public function searchAction(Request $request, $resource, $site = 'default')
110 110
 	{
111
-		$cntl = $this->createClient( $request, $site, $resource );
112
-		return $this->getHtml( $cntl->search() );
111
+		$cntl = $this->createClient($request, $site, $resource);
112
+		return $this->getHtml($cntl->search());
113 113
 	}
114 114
 
115 115
 
@@ -121,20 +121,20 @@  discard block
 block discarded – undo
121 121
 	 * @param string $resource Resource location, e.g. "product"
122 122
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
123 123
 	 */
124
-	protected function createClient( Request $request, $site, $resource )
124
+	protected function createClient(Request $request, $site, $resource)
125 125
 	{
126
-		$lang = $request->get( 'lang', 'en' );
126
+		$lang = $request->get('lang', 'en');
127 127
 
128
-		$aimeos = $this->get( 'aimeos' )->get();
129
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' );
128
+		$aimeos = $this->get('aimeos')->get();
129
+		$templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates');
130 130
 
131
-		$context = $this->get( 'aimeos_context' )->get( false );
132
-		$context = $this->setLocale( $context, $site, $lang );
131
+		$context = $this->get('aimeos_context')->get(false);
132
+		$context = $this->setLocale($context, $site, $lang);
133 133
 
134
-		$view = $this->get( 'aimeos_view' )->create( $context->getConfig(), $templatePaths, $lang );
135
-		$context->setView( $view );
134
+		$view = $this->get('aimeos_view')->create($context->getConfig(), $templatePaths, $lang);
135
+		$context->setView($view);
136 136
 
137
-		return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource );
137
+		return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource);
138 138
 	}
139 139
 
140 140
 
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
 	 * @param string $content Content from admin client
145 145
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
146 146
 	 */
147
-	protected function getHtml( $content )
147
+	protected function getHtml($content)
148 148
 	{
149
-		$version = $this->get( 'aimeos' )->getVersion();
150
-		$content = str_replace( array( '{type}', '{version}' ), array( 'Symfony', $version ), $content );
149
+		$version = $this->get('aimeos')->getVersion();
150
+		$content = str_replace(array('{type}', '{version}'), array('Symfony', $version), $content);
151 151
 
152
-		return $this->render( 'AimeosShopBundle:Jqadm:index.html.twig', array( 'content' => $content ) );
152
+		return $this->render('AimeosShopBundle:Jqadm:index.html.twig', array('content' => $content));
153 153
 	}
154 154
 
155 155
 
@@ -161,23 +161,23 @@  discard block
 block discarded – undo
161 161
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
162 162
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
163 163
 	 */
164
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site = 'default', $lang = null )
164
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site = 'default', $lang = null)
165 165
 	{
166
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
166
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
167 167
 
168 168
 		try
169 169
 		{
170
-			$localeItem = $localeManager->bootstrap( $site, '', '', false );
171
-			$localeItem->setLanguageId( null );
172
-			$localeItem->setCurrencyId( null );
170
+			$localeItem = $localeManager->bootstrap($site, '', '', false);
171
+			$localeItem->setLanguageId(null);
172
+			$localeItem->setCurrencyId(null);
173 173
 		}
174
-		catch( \Aimeos\MShop\Locale\Exception $e )
174
+		catch (\Aimeos\MShop\Locale\Exception $e)
175 175
 		{
176 176
 			$localeItem = $localeManager->createItem();
177 177
 		}
178 178
 
179
-		$context->setLocale( $localeItem );
180
-		$context->setI18n( $this->get( 'aimeos_i18n' )->get( array( $lang ) ) );
179
+		$context->setLocale($localeItem);
180
+		$context->setI18n($this->get('aimeos_i18n')->get(array($lang)));
181 181
 
182 182
 		return $context;
183 183
 	}
Please login to merge, or discard this patch.
Tests/Entity/UserTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,31 +19,31 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public function testGetId()
21 21
 	{
22
-		$this->assertEquals( null, $this->object->getId() );
22
+		$this->assertEquals(null, $this->object->getId());
23 23
 	}
24 24
 
25 25
 
26 26
 	public function testGetUsername()
27 27
 	{
28
-		$this->assertEquals( null, $this->object->getUsername() );
28
+		$this->assertEquals(null, $this->object->getUsername());
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testGetPassword()
33 33
 	{
34
-		$this->assertEquals( null, $this->object->getPassword() );
34
+		$this->assertEquals(null, $this->object->getPassword());
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testGetSalt()
39 39
 	{
40
-		$this->assertEquals( 'mshop', $this->object->getSalt() );
40
+		$this->assertEquals('mshop', $this->object->getSalt());
41 41
 	}
42 42
 
43 43
 
44 44
 	public function testGetRoles()
45 45
 	{
46
-		$this->assertEquals( array( 'ROLE_USER' ), $this->object->getRoles() );
46
+		$this->assertEquals(array('ROLE_USER'), $this->object->getRoles());
47 47
 	}
48 48
 
49 49
 
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
 
56 56
 	public function testSerialize()
57 57
 	{
58
-		$this->assertEquals( 'a:3:{i:0;N;i:1;N;i:2;N;}', $this->object->serialize() );
58
+		$this->assertEquals('a:3:{i:0;N;i:1;N;i:2;N;}', $this->object->serialize());
59 59
 	}
60 60
 
61 61
 
62 62
 	public function testUnserialize()
63 63
 	{
64
-		$this->object->unserialize( 'a:3:{i:0;N;i:1;N;i:2;N;}' );
64
+		$this->object->unserialize('a:3:{i:0;N;i:1;N;i:2;N;}');
65 65
 	}
66 66
 }
Please login to merge, or discard this patch.