Completed
Push — master ( 3b843b...fa2058 )
by Aimeos
02:49
created
Entity/FosUser.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	public function getSalutation()
211 211
 	{
212
-		return ( isset( $this->salutation ) ? (string) $this->salutation : \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN );
212
+		return (isset($this->salutation) ? (string) $this->salutation : \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN);
213 213
 	}
214 214
 
215 215
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 */
221 221
 	public function setSalutation($salutation)
222 222
 	{
223
-		switch( $salutation )
223
+		switch ($salutation)
224 224
 		{
225 225
 			case \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN:
226 226
 			case \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY:
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			case \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR:
230 230
 				break;
231 231
 			default:
232
-				throw new \Exception( sprintf( 'Address salutation "%1$s" is unknown', $value ) );
232
+				throw new \Exception(sprintf('Address salutation "%1$s" is unknown', $value));
233 233
 		}
234 234
 
235 235
 		$this->salutation = (string) $salutation;
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 	 */
442 442
 	public function setCountryId($countryid)
443 443
 	{
444
-		$this->countryid = strtoupper( (string) $countryid );
444
+		$this->countryid = strtoupper((string) $countryid);
445 445
 	}
446 446
 
447 447
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	 */
464 464
 	public function setLanguageId($langid)
465 465
 	{
466
-		$this->langid = strtolower( (string) $langid );
466
+		$this->langid = strtolower((string) $langid);
467 467
 	}
468 468
 
469 469
 
@@ -542,8 +542,8 @@  discard block
 block discarded – undo
542 542
 	{
543 543
 		$pattern = '#^([a-z]+://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)+(:[0-9]+)?(/.*)?$#';
544 544
 
545
-		if( $website !== '' && preg_match( $pattern, $website ) !== 1 ) {
546
-			throw new \Exception( sprintf( 'Invalid web site URL "%1$s"', $website ) );
545
+		if ($website !== '' && preg_match($pattern, $website) !== 1) {
546
+			throw new \Exception(sprintf('Invalid web site URL "%1$s"', $website));
547 547
 		}
548 548
 
549 549
 		$this->website = (string) $website;
Please login to merge, or discard this patch.
Command/SetupCommand.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 	 * @param string $classname Name of the setup task class
26 26
 	 * @return boolean True if class is found, false if not
27 27
 	 */
28
-	public static function autoload( $classname )
28
+	public static function autoload($classname)
29 29
 	{
30
-		if( strncmp( $classname, 'Aimeos\\MW\\Setup\\Task\\', 21 ) === 0 )
30
+		if (strncmp($classname, 'Aimeos\\MW\\Setup\\Task\\', 21) === 0)
31 31
 		{
32
-			$fileName = substr( $classname, 21 ) . '.php';
33
-			$paths = explode( PATH_SEPARATOR, get_include_path() );
32
+			$fileName = substr($classname, 21) . '.php';
33
+			$paths = explode(PATH_SEPARATOR, get_include_path());
34 34
 
35
-			foreach( $paths as $path )
35
+			foreach ($paths as $path)
36 36
 			{
37 37
 				$file = $path . DIRECTORY_SEPARATOR . $fileName;
38 38
 
39
-				if( file_exists( $file ) === true && ( include_once $file ) !== false ) {
39
+				if (file_exists($file) === true && (include_once $file) !== false) {
40 40
 					return true;
41 41
 				}
42 42
 			}
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	protected function configure()
53 53
 	{
54
-		$this->setName( 'aimeos:setup');
55
-		$this->setDescription( 'Initialize or update the Aimeos database tables' );
56
-		$this->addArgument( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' );
57
-		$this->addArgument( 'tplsite', InputArgument::OPTIONAL, 'Template site for creating or updating database entries', 'default' );
58
-		$this->addOption( 'option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() );
54
+		$this->setName('aimeos:setup');
55
+		$this->setDescription('Initialize or update the Aimeos database tables');
56
+		$this->addArgument('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default');
57
+		$this->addArgument('tplsite', InputArgument::OPTIONAL, 'Template site for creating or updating database entries', 'default');
58
+		$this->addOption('option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array());
59 59
 	}
60 60
 
61 61
 
@@ -65,35 +65,35 @@  discard block
 block discarded – undo
65 65
 	 * @param InputInterface $input Input object
66 66
 	 * @param OutputInterface $output Output object
67 67
 	 */
68
-	protected function execute( InputInterface $input, OutputInterface $output )
68
+	protected function execute(InputInterface $input, OutputInterface $output)
69 69
 	{
70
-		$ctx = $this->getContainer()->get( 'aimeos_context' )->get( false );
71
-		$ctx->setEditor( 'aimeos:setup' );
70
+		$ctx = $this->getContainer()->get('aimeos_context')->get(false);
71
+		$ctx->setEditor('aimeos:setup');
72 72
 
73 73
 		$config = $ctx->getConfig();
74
-		$site = $input->getArgument( 'site' );
75
-		$tplsite = $input->getArgument( 'tplsite' );
74
+		$site = $input->getArgument('site');
75
+		$tplsite = $input->getArgument('tplsite');
76 76
 
77
-		$config->set( 'setup/site', $site );
78
-		$dbconfig = $this->getDbConfig( $config );
79
-		$this->setOptions( $config, $input );
77
+		$config->set('setup/site', $site);
78
+		$dbconfig = $this->getDbConfig($config);
79
+		$this->setOptions($config, $input);
80 80
 
81
-		$taskPaths = $this->getContainer()->get( 'aimeos' )->get()->getSetupPaths( $tplsite );
81
+		$taskPaths = $this->getContainer()->get('aimeos')->get()->getSetupPaths($tplsite);
82 82
 
83 83
 		$includePaths = $taskPaths;
84 84
 		$includePaths[] = get_include_path();
85 85
 
86
-		if( set_include_path( implode( PATH_SEPARATOR, $includePaths ) ) === false ) {
87
-			throw new \Exception( 'Unable to extend include path' );
86
+		if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) {
87
+			throw new \Exception('Unable to extend include path');
88 88
 		}
89 89
 
90
-		spl_autoload_register( '\Aimeos\ShopBundle\Command\SetupCommand::autoload', true );
90
+		spl_autoload_register('\Aimeos\ShopBundle\Command\SetupCommand::autoload', true);
91 91
 
92
-		$manager = new \Aimeos\MW\Setup\Manager\Multiple( $ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx );
92
+		$manager = new \Aimeos\MW\Setup\Manager\Multiple($ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx);
93 93
 
94
-		$output->writeln( sprintf( 'Initializing or updating the Aimeos database tables for site <info>%1$s</info>', $site ) );
94
+		$output->writeln(sprintf('Initializing or updating the Aimeos database tables for site <info>%1$s</info>', $site));
95 95
 
96
-		$manager->run( 'mysql' );
96
+		$manager->run('mysql');
97 97
 	}
98 98
 
99 99
 
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
 	 * @param \Aimeos\MW\Config\Iface $conf Config object
104 104
 	 * @return array Multi-dimensional associative list of database configuration parameters
105 105
 	 */
106
-	protected function getDbConfig( \Aimeos\MW\Config\Iface $conf )
106
+	protected function getDbConfig(\Aimeos\MW\Config\Iface $conf)
107 107
 	{
108
-		$dbconfig = $conf->get( 'resource', array() );
108
+		$dbconfig = $conf->get('resource', array());
109 109
 
110
-		foreach( $dbconfig as $rname => $dbconf )
110
+		foreach ($dbconfig as $rname => $dbconf)
111 111
 		{
112
-			if( strncmp( $rname, 'db', 2 ) !== 0 ) {
113
-				unset( $dbconfig[$rname] );
112
+			if (strncmp($rname, 'db', 2) !== 0) {
113
+				unset($dbconfig[$rname]);
114 114
 			}
115 115
 		}
116 116
 
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 	 * @param array Associative list of database configurations
127 127
 	 * @throws \RuntimeException If the format of the options is invalid
128 128
 	 */
129
-	protected function setOptions( \Aimeos\MW\Config\Iface $conf, InputInterface $input )
129
+	protected function setOptions(\Aimeos\MW\Config\Iface $conf, InputInterface $input)
130 130
 	{
131
-		foreach( (array) $input->getOption( 'option' ) as $option )
131
+		foreach ((array) $input->getOption('option') as $option)
132 132
 		{
133
-			list( $name, $value ) = explode( ':', $option );
134
-			$conf->set( $name, $value );
133
+			list($name, $value) = explode(':', $option);
134
+			$conf->set($name, $value);
135 135
 		}
136 136
 	}
137 137
 }
Please login to merge, or discard this patch.
Tests/Controller/JsonadmControllerTest.php 1 patch
Spacing   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -12,29 +12,29 @@  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 17
 
18
-		$client->request( 'OPTIONS', '/unittest/jsonadm/product' );
18
+		$client->request('OPTIONS', '/unittest/jsonadm/product');
19 19
 		$response = $client->getResponse();
20 20
 
21
-		$json = json_decode( $response->getContent(), true );
21
+		$json = json_decode($response->getContent(), true);
22 22
 
23
-		$this->assertNotNull( $json );
24
-		$this->assertEquals( 200, $response->getStatusCode() );
25
-		$this->assertArrayHasKey( 'resources', $json['meta'] );
26
-		$this->assertGreaterThan( 1, count( $json['meta']['resources'] ) );
23
+		$this->assertNotNull($json);
24
+		$this->assertEquals(200, $response->getStatusCode());
25
+		$this->assertArrayHasKey('resources', $json['meta']);
26
+		$this->assertGreaterThan(1, count($json['meta']['resources']));
27 27
 
28 28
 
29
-		$client->request( 'OPTIONS', '/unittest/jsonadm' );
29
+		$client->request('OPTIONS', '/unittest/jsonadm');
30 30
 		$response = $client->getResponse();
31 31
 
32
-		$json = json_decode( $response->getContent(), true );
32
+		$json = json_decode($response->getContent(), true);
33 33
 
34
-		$this->assertNotNull( $json );
35
-		$this->assertEquals( 200, $response->getStatusCode() );
36
-		$this->assertArrayHasKey( 'resources', $json['meta'] );
37
-		$this->assertGreaterThan( 1, count( $json['meta']['resources'] ) );
34
+		$this->assertNotNull($json);
35
+		$this->assertEquals(200, $response->getStatusCode());
36
+		$this->assertArrayHasKey('resources', $json['meta']);
37
+		$this->assertGreaterThan(1, count($json['meta']['resources']));
38 38
 	}
39 39
 
40 40
 
@@ -43,62 +43,62 @@  discard block
 block discarded – undo
43 43
 		$client = static::createClient(array(), array(
44 44
 			'PHP_AUTH_USER' => 'admin',
45 45
 			'PHP_AUTH_PW'   => 'adminpass',
46
-		) );
46
+		));
47 47
 
48 48
 
49 49
 		$content = '{"data":{"type":"product/stock/warehouse","attributes":{"product.stock.warehouse.code":"symfony","product.stock.warehouse.label":"symfony"}}}';
50
-		$client->request( 'POST', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content );
50
+		$client->request('POST', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content);
51 51
 		$response = $client->getResponse();
52 52
 
53
-		$json = json_decode( $response->getContent(), true );
53
+		$json = json_decode($response->getContent(), true);
54 54
 
55
-		$this->assertNotNull( $json );
56
-		$this->assertEquals( 201, $response->getStatusCode() );
57
-		$this->assertArrayHasKey( 'product.stock.warehouse.id', $json['data']['attributes'] );
58
-		$this->assertEquals( 'symfony', $json['data']['attributes']['product.stock.warehouse.code'] );
59
-		$this->assertEquals( 'symfony', $json['data']['attributes']['product.stock.warehouse.label'] );
60
-		$this->assertEquals( 1, $json['meta']['total'] );
55
+		$this->assertNotNull($json);
56
+		$this->assertEquals(201, $response->getStatusCode());
57
+		$this->assertArrayHasKey('product.stock.warehouse.id', $json['data']['attributes']);
58
+		$this->assertEquals('symfony', $json['data']['attributes']['product.stock.warehouse.code']);
59
+		$this->assertEquals('symfony', $json['data']['attributes']['product.stock.warehouse.label']);
60
+		$this->assertEquals(1, $json['meta']['total']);
61 61
 
62 62
 		$id = $json['data']['attributes']['product.stock.warehouse.id'];
63 63
 
64 64
 
65 65
 		$content = '{"data":{"type":"product/stock/warehouse","attributes":{"product.stock.warehouse.code":"symfony2","product.stock.warehouse.label":"symfony2"}}}';
66
-		$client->request( 'PATCH', '/unittest/jsonadm/product/stock/warehouse/' . $id, array(), array(), array(), $content );
66
+		$client->request('PATCH', '/unittest/jsonadm/product/stock/warehouse/' . $id, array(), array(), array(), $content);
67 67
 		$response = $client->getResponse();
68 68
 
69
-		$json = json_decode( $response->getContent(), true );
69
+		$json = json_decode($response->getContent(), true);
70 70
 
71
-		$this->assertNotNull( $json );
72
-		$this->assertEquals( 200, $response->getStatusCode() );
73
-		$this->assertArrayHasKey( 'product.stock.warehouse.id', $json['data']['attributes'] );
74
-		$this->assertEquals( 'symfony2', $json['data']['attributes']['product.stock.warehouse.code'] );
75
-		$this->assertEquals( 'symfony2', $json['data']['attributes']['product.stock.warehouse.label'] );
76
-		$this->assertEquals( $id, $json['data']['attributes']['product.stock.warehouse.id'] );
77
-		$this->assertEquals( 1, $json['meta']['total'] );
71
+		$this->assertNotNull($json);
72
+		$this->assertEquals(200, $response->getStatusCode());
73
+		$this->assertArrayHasKey('product.stock.warehouse.id', $json['data']['attributes']);
74
+		$this->assertEquals('symfony2', $json['data']['attributes']['product.stock.warehouse.code']);
75
+		$this->assertEquals('symfony2', $json['data']['attributes']['product.stock.warehouse.label']);
76
+		$this->assertEquals($id, $json['data']['attributes']['product.stock.warehouse.id']);
77
+		$this->assertEquals(1, $json['meta']['total']);
78 78
 
79 79
 
80
-		$client->request( 'GET', '/unittest/jsonadm/product/stock/warehouse/' . $id );
80
+		$client->request('GET', '/unittest/jsonadm/product/stock/warehouse/' . $id);
81 81
 		$response = $client->getResponse();
82 82
 
83
-		$json = json_decode( $response->getContent(), true );
83
+		$json = json_decode($response->getContent(), true);
84 84
 
85
-		$this->assertNotNull( $json );
86
-		$this->assertEquals( 200, $response->getStatusCode() );
87
-		$this->assertArrayHasKey( 'product.stock.warehouse.id', $json['data']['attributes'] );
88
-		$this->assertEquals( 'symfony2', $json['data']['attributes']['product.stock.warehouse.code'] );
89
-		$this->assertEquals( 'symfony2', $json['data']['attributes']['product.stock.warehouse.label'] );
90
-		$this->assertEquals( $id, $json['data']['attributes']['product.stock.warehouse.id'] );
91
-		$this->assertEquals( 1, $json['meta']['total'] );
85
+		$this->assertNotNull($json);
86
+		$this->assertEquals(200, $response->getStatusCode());
87
+		$this->assertArrayHasKey('product.stock.warehouse.id', $json['data']['attributes']);
88
+		$this->assertEquals('symfony2', $json['data']['attributes']['product.stock.warehouse.code']);
89
+		$this->assertEquals('symfony2', $json['data']['attributes']['product.stock.warehouse.label']);
90
+		$this->assertEquals($id, $json['data']['attributes']['product.stock.warehouse.id']);
91
+		$this->assertEquals(1, $json['meta']['total']);
92 92
 
93 93
 
94
-		$client->request( 'DELETE', '/unittest/jsonadm/product/stock/warehouse/' . $id );
94
+		$client->request('DELETE', '/unittest/jsonadm/product/stock/warehouse/' . $id);
95 95
 		$response = $client->getResponse();
96 96
 
97
-		$json = json_decode( $response->getContent(), true );
97
+		$json = json_decode($response->getContent(), true);
98 98
 
99
-		$this->assertNotNull( $json );
100
-		$this->assertEquals( 200, $response->getStatusCode() );
101
-		$this->assertEquals( 1, $json['meta']['total'] );
99
+		$this->assertNotNull($json);
100
+		$this->assertEquals(200, $response->getStatusCode());
101
+		$this->assertEquals(1, $json['meta']['total']);
102 102
 	}
103 103
 
104 104
 
@@ -107,85 +107,85 @@  discard block
 block discarded – undo
107 107
 		$client = static::createClient(array(), array(
108 108
 			'PHP_AUTH_USER' => 'admin',
109 109
 			'PHP_AUTH_PW'   => 'adminpass',
110
-		) );
110
+		));
111 111
 
112 112
 
113 113
 		$content = '{"data":[
114 114
 			{"type":"product/stock/warehouse","attributes":{"product.stock.warehouse.code":"symfony","product.stock.warehouse.label":"symfony"}},
115 115
 			{"type":"product/stock/warehouse","attributes":{"product.stock.warehouse.code":"symfony2","product.stock.warehouse.label":"symfony"}}
116 116
 		]}';
117
-		$client->request( 'POST', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content );
117
+		$client->request('POST', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content);
118 118
 		$response = $client->getResponse();
119 119
 
120
-		$json = json_decode( $response->getContent(), true );
120
+		$json = json_decode($response->getContent(), true);
121 121
 
122
-		$this->assertNotNull( $json );
123
-		$this->assertEquals( 201, $response->getStatusCode() );
124
-		$this->assertEquals( 2, count( $json['data'] ) );
125
-		$this->assertArrayHasKey( 'product.stock.warehouse.id', $json['data'][0]['attributes'] );
126
-		$this->assertArrayHasKey( 'product.stock.warehouse.id', $json['data'][1]['attributes'] );
127
-		$this->assertEquals( 'symfony', $json['data'][0]['attributes']['product.stock.warehouse.label'] );
128
-		$this->assertEquals( 'symfony', $json['data'][1]['attributes']['product.stock.warehouse.label'] );
129
-		$this->assertEquals( 2, $json['meta']['total'] );
122
+		$this->assertNotNull($json);
123
+		$this->assertEquals(201, $response->getStatusCode());
124
+		$this->assertEquals(2, count($json['data']));
125
+		$this->assertArrayHasKey('product.stock.warehouse.id', $json['data'][0]['attributes']);
126
+		$this->assertArrayHasKey('product.stock.warehouse.id', $json['data'][1]['attributes']);
127
+		$this->assertEquals('symfony', $json['data'][0]['attributes']['product.stock.warehouse.label']);
128
+		$this->assertEquals('symfony', $json['data'][1]['attributes']['product.stock.warehouse.label']);
129
+		$this->assertEquals(2, $json['meta']['total']);
130 130
 
131
-		$ids = array( $json['data'][0]['attributes']['product.stock.warehouse.id'], $json['data'][1]['attributes']['product.stock.warehouse.id'] );
131
+		$ids = array($json['data'][0]['attributes']['product.stock.warehouse.id'], $json['data'][1]['attributes']['product.stock.warehouse.id']);
132 132
 
133 133
 
134 134
 		$content = '{"data":[
135 135
 			{"type":"product/stock/warehouse","id":' . $ids[0] . ',"attributes":{"product.stock.warehouse.label":"symfony2"}},
136 136
 			{"type":"product/stock/warehouse","id":' . $ids[1] . ',"attributes":{"product.stock.warehouse.label":"symfony2"}}
137 137
 		]}';
138
-		$client->request( 'PATCH', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content );
138
+		$client->request('PATCH', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content);
139 139
 		$response = $client->getResponse();
140 140
 
141
-		$json = json_decode( $response->getContent(), true );
142
-
143
-		$this->assertNotNull( $json );
144
-		$this->assertEquals( 200, $response->getStatusCode() );
145
-		$this->assertEquals( 2, count( $json['data'] ) );
146
-		$this->assertArrayHasKey( 'product.stock.warehouse.id', $json['data'][0]['attributes'] );
147
-		$this->assertArrayHasKey( 'product.stock.warehouse.id', $json['data'][1]['attributes'] );
148
-		$this->assertEquals( 'symfony2', $json['data'][0]['attributes']['product.stock.warehouse.label'] );
149
-		$this->assertEquals( 'symfony2', $json['data'][1]['attributes']['product.stock.warehouse.label'] );
150
-		$this->assertTrue( in_array( $json['data'][0]['attributes']['product.stock.warehouse.id'], $ids ) );
151
-		$this->assertTrue( in_array( $json['data'][1]['attributes']['product.stock.warehouse.id'], $ids ) );
152
-		$this->assertEquals( 2, $json['meta']['total'] );
153
-
154
-
155
-		$getParams = array( 'filter' => array( '&&' => array(
156
-			array( '=~' => array( 'product.stock.warehouse.code' => 'symfony' ) ),
157
-			array( '==' => array( 'product.stock.warehouse.label' => 'symfony2' ) )
158
-			) ),
159
-			'sort' => 'product.stock.warehouse.code', 'page' => array( 'offset' => 0, 'limit' => 3 )
141
+		$json = json_decode($response->getContent(), true);
142
+
143
+		$this->assertNotNull($json);
144
+		$this->assertEquals(200, $response->getStatusCode());
145
+		$this->assertEquals(2, count($json['data']));
146
+		$this->assertArrayHasKey('product.stock.warehouse.id', $json['data'][0]['attributes']);
147
+		$this->assertArrayHasKey('product.stock.warehouse.id', $json['data'][1]['attributes']);
148
+		$this->assertEquals('symfony2', $json['data'][0]['attributes']['product.stock.warehouse.label']);
149
+		$this->assertEquals('symfony2', $json['data'][1]['attributes']['product.stock.warehouse.label']);
150
+		$this->assertTrue(in_array($json['data'][0]['attributes']['product.stock.warehouse.id'], $ids));
151
+		$this->assertTrue(in_array($json['data'][1]['attributes']['product.stock.warehouse.id'], $ids));
152
+		$this->assertEquals(2, $json['meta']['total']);
153
+
154
+
155
+		$getParams = array('filter' => array('&&' => array(
156
+			array('=~' => array('product.stock.warehouse.code' => 'symfony')),
157
+			array('==' => array('product.stock.warehouse.label' => 'symfony2'))
158
+			)),
159
+			'sort' => 'product.stock.warehouse.code', 'page' => array('offset' => 0, 'limit' => 3)
160 160
 		);
161
-		$client->request( 'GET', '/unittest/jsonadm/product/stock/warehouse', $getParams );
161
+		$client->request('GET', '/unittest/jsonadm/product/stock/warehouse', $getParams);
162 162
 		$response = $client->getResponse();
163 163
 
164
-		$json = json_decode( $response->getContent(), true );
164
+		$json = json_decode($response->getContent(), true);
165 165
 
166
-		$this->assertNotNull( $json );
167
-		$this->assertEquals( 200, $response->getStatusCode() );
168
-		$this->assertEquals( 2, count( $json['data'] ) );
169
-		$this->assertEquals( 'symfony', $json['data'][0]['attributes']['product.stock.warehouse.code'] );
170
-		$this->assertEquals( 'symfony2', $json['data'][1]['attributes']['product.stock.warehouse.code'] );
171
-		$this->assertEquals( 'symfony2', $json['data'][0]['attributes']['product.stock.warehouse.label'] );
172
-		$this->assertEquals( 'symfony2', $json['data'][1]['attributes']['product.stock.warehouse.label'] );
173
-		$this->assertTrue( in_array( $json['data'][0]['attributes']['product.stock.warehouse.id'], $ids ) );
174
-		$this->assertTrue( in_array( $json['data'][1]['attributes']['product.stock.warehouse.id'], $ids ) );
175
-		$this->assertEquals( 2, $json['meta']['total'] );
166
+		$this->assertNotNull($json);
167
+		$this->assertEquals(200, $response->getStatusCode());
168
+		$this->assertEquals(2, count($json['data']));
169
+		$this->assertEquals('symfony', $json['data'][0]['attributes']['product.stock.warehouse.code']);
170
+		$this->assertEquals('symfony2', $json['data'][1]['attributes']['product.stock.warehouse.code']);
171
+		$this->assertEquals('symfony2', $json['data'][0]['attributes']['product.stock.warehouse.label']);
172
+		$this->assertEquals('symfony2', $json['data'][1]['attributes']['product.stock.warehouse.label']);
173
+		$this->assertTrue(in_array($json['data'][0]['attributes']['product.stock.warehouse.id'], $ids));
174
+		$this->assertTrue(in_array($json['data'][1]['attributes']['product.stock.warehouse.id'], $ids));
175
+		$this->assertEquals(2, $json['meta']['total']);
176 176
 
177 177
 
178 178
 		$content = '{"data":[
179 179
 			{"type":"product/stock/warehouse","id":' . $ids[0] . '},
180 180
 			{"type":"product/stock/warehouse","id":' . $ids[1] . '}
181 181
 		]}';
182
-		$client->request( 'DELETE', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content );
182
+		$client->request('DELETE', '/unittest/jsonadm/product/stock/warehouse', array(), array(), array(), $content);
183 183
 		$response = $client->getResponse();
184 184
 
185
-		$json = json_decode( $response->getContent(), true );
185
+		$json = json_decode($response->getContent(), true);
186 186
 
187
-		$this->assertNotNull( $json );
188
-		$this->assertEquals( 200, $response->getStatusCode() );
189
-		$this->assertEquals( 2, $json['meta']['total'] );
187
+		$this->assertNotNull($json);
188
+		$this->assertEquals(200, $response->getStatusCode());
189
+		$this->assertEquals(2, $json['meta']['total']);
190 190
 	}
191 191
 }
Please login to merge, or discard this patch.
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/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/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.
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.