Completed
Pull Request — master (#23)
by
unknown
05:28
created
Tests/Entity/FosUserTest.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -17,144 +17,144 @@
 block discarded – undo
17 17
 
18 18
 	public function testGetId()
19 19
 	{
20
-		$this->assertEquals( null, $this->object->getId() );
20
+		$this->assertEquals(null, $this->object->getId());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testGetSetCompany()
25 25
 	{
26
-		$this->object->setCompany( 'ABC' );
27
-		$this->assertEquals( 'ABC', $this->object->getCompany() );
26
+		$this->object->setCompany('ABC');
27
+		$this->assertEquals('ABC', $this->object->getCompany());
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testGetSetVatID()
32 32
 	{
33
-		$this->object->setVatID( 'AT0000' );
34
-		$this->assertEquals( 'AT0000', $this->object->getVatID() );
33
+		$this->object->setVatID('AT0000');
34
+		$this->assertEquals('AT0000', $this->object->getVatID());
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testGetSetSalutation()
39 39
 	{
40
-		$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN );
41
-		$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation() );
40
+		$this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN);
41
+		$this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation());
42 42
 
43
-		$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY );
44
-		$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation() );
43
+		$this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY);
44
+		$this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation());
45 45
 
46
-		$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS );
47
-		$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation() );
46
+		$this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS);
47
+		$this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation());
48 48
 
49
-		$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS );
50
-		$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation() );
49
+		$this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS);
50
+		$this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation());
51 51
 
52
-		$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR );
53
-		$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation() );
52
+		$this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR);
53
+		$this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation());
54 54
 	}
55 55
 
56 56
 
57 57
 	public function testGetSetTitle()
58 58
 	{
59
-		$this->object->setTitle( 'Prof. Dr.' );
60
-		$this->assertEquals( 'Prof. Dr.', $this->object->getTitle() );
59
+		$this->object->setTitle('Prof. Dr.');
60
+		$this->assertEquals('Prof. Dr.', $this->object->getTitle());
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testGetSetFirstname()
65 65
 	{
66
-		$this->object->setFirstname( 'first' );
67
-		$this->assertEquals( 'first', $this->object->getFirstname() );
66
+		$this->object->setFirstname('first');
67
+		$this->assertEquals('first', $this->object->getFirstname());
68 68
 	}
69 69
 
70 70
 
71 71
 	public function testGetSetLastname()
72 72
 	{
73
-		$this->object->setLastname( 'last' );
74
-		$this->assertEquals( 'last', $this->object->getLastname() );
73
+		$this->object->setLastname('last');
74
+		$this->assertEquals('last', $this->object->getLastname());
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGetSetAddress1()
79 79
 	{
80
-		$this->object->setAddress1( 'test street' );
81
-		$this->assertEquals( 'test street', $this->object->getAddress1() );
80
+		$this->object->setAddress1('test street');
81
+		$this->assertEquals('test street', $this->object->getAddress1());
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testGetSetAddress2()
86 86
 	{
87
-		$this->object->setAddress2( '1' );
88
-		$this->assertEquals( '1', $this->object->getAddress2() );
87
+		$this->object->setAddress2('1');
88
+		$this->assertEquals('1', $this->object->getAddress2());
89 89
 	}
90 90
 
91 91
 
92 92
 	public function testGetSetAddress3()
93 93
 	{
94
-		$this->object->setAddress3( 'EG' );
95
-		$this->assertEquals( 'EG', $this->object->getAddress3() );
94
+		$this->object->setAddress3('EG');
95
+		$this->assertEquals('EG', $this->object->getAddress3());
96 96
 	}
97 97
 
98 98
 
99 99
 	public function testGetSetPostal()
100 100
 	{
101
-		$this->object->setPostal( '12345' );
102
-		$this->assertEquals( '12345', $this->object->getPostal() );
101
+		$this->object->setPostal('12345');
102
+		$this->assertEquals('12345', $this->object->getPostal());
103 103
 	}
104 104
 
105 105
 
106 106
 	public function testGetSetCity()
107 107
 	{
108
-		$this->object->setCity( 'Munich' );
109
-		$this->assertEquals( 'Munich', $this->object->getCity() );
108
+		$this->object->setCity('Munich');
109
+		$this->assertEquals('Munich', $this->object->getCity());
110 110
 	}
111 111
 
112 112
 
113 113
 	public function testGetSetState()
114 114
 	{
115
-		$this->object->setState( 'Bayern' );
116
-		$this->assertEquals( 'Bayern', $this->object->getState() );
115
+		$this->object->setState('Bayern');
116
+		$this->assertEquals('Bayern', $this->object->getState());
117 117
 	}
118 118
 
119 119
 
120 120
 	public function testGetSetCountryId()
121 121
 	{
122
-		$this->object->setCountryId( 'DE' );
123
-		$this->assertEquals( 'DE', $this->object->getCountryId() );
122
+		$this->object->setCountryId('DE');
123
+		$this->assertEquals('DE', $this->object->getCountryId());
124 124
 	}
125 125
 
126 126
 
127 127
 	public function testGetSetLanguageId()
128 128
 	{
129
-		$this->object->setLanguageId( 'de' );
130
-		$this->assertEquals( 'de', $this->object->getLanguageId() );
129
+		$this->object->setLanguageId('de');
130
+		$this->assertEquals('de', $this->object->getLanguageId());
131 131
 	}
132 132
 
133 133
 
134 134
 	public function testGetSetTelephone()
135 135
 	{
136
-		$this->object->setTelephone( '089123456789' );
137
-		$this->assertEquals( '089123456789', $this->object->getTelephone() );
136
+		$this->object->setTelephone('089123456789');
137
+		$this->assertEquals('089123456789', $this->object->getTelephone());
138 138
 	}
139 139
 
140 140
 
141 141
 	public function testGetSetTelefax()
142 142
 	{
143
-		$this->object->setTelefax( '089987654321' );
144
-		$this->assertEquals( '089987654321', $this->object->getTelefax() );
143
+		$this->object->setTelefax('089987654321');
144
+		$this->assertEquals('089987654321', $this->object->getTelefax());
145 145
 	}
146 146
 
147 147
 
148 148
 	public function testGetSetWebsite()
149 149
 	{
150
-		$this->object->setWebsite( 'http://aimeos.org' );
151
-		$this->assertEquals( 'http://aimeos.org', $this->object->getWebsite() );
150
+		$this->object->setWebsite('http://aimeos.org');
151
+		$this->assertEquals('http://aimeos.org', $this->object->getWebsite());
152 152
 	}
153 153
 
154 154
 
155 155
 	public function testSetWebsiteInvalid()
156 156
 	{
157
-		$this->setExpectedException( 'Exception' );
158
-		$this->object->setWebsite( 'aimeos+org' );
157
+		$this->setExpectedException('Exception');
158
+		$this->object->setWebsite('aimeos+org');
159 159
 	}
160 160
 }
Please login to merge, or discard this patch.
Tests/Controller/PageControllerTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 block discarded – undo
10 10
 	public function testTerms()
11 11
 	{
12 12
 		$client = static::createClient();
13
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/terms' );
13
+		$crawler = $client->request('GET', '/unittest/de/EUR/terms');
14 14
 
15
-		$this->assertEquals( 1, $crawler->filter( 'body:contains("Terms")' )->count() );
15
+		$this->assertEquals(1, $crawler->filter('body:contains("Terms")')->count());
16 16
 	}
17 17
 
18 18
 
19 19
 	public function testPrivacy()
20 20
 	{
21 21
 		$client = static::createClient();
22
-		$crawler = $client->request( 'GET', '/unittest/de/EUR/privacy' );
22
+		$crawler = $client->request('GET', '/unittest/de/EUR/privacy');
23 23
 
24
-		$this->assertEquals( 1, $crawler->filter( 'body:contains("Privacy")' )->count() );
24
+		$this->assertEquals(1, $crawler->filter('body:contains("Privacy")')->count());
25 25
 	}
26 26
 }
Please login to merge, or discard this patch.
Tests/Command/SetupCommandTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
 		$kernel = $this->createKernel();
15 15
 		$kernel->boot();
16 16
 
17
-		$application = new Application( $kernel );
18
-		$application->add( new Command\SetupCommand() );
17
+		$application = new Application($kernel);
18
+		$application->add(new Command\SetupCommand());
19 19
 
20
-		$command = $application->find( 'aimeos:setup' );
21
-		$commandTester = new CommandTester( $command );
22
-		$commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'tplsite' => 'unittest', '--option' => 'setup/default/demo:0' ) );
20
+		$command = $application->find('aimeos:setup');
21
+		$commandTester = new CommandTester($command);
22
+		$commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'tplsite' => 'unittest', '--option' => 'setup/default/demo:0'));
23 23
 
24
-		$this->assertEquals( 0, $commandTester->getStatusCode() );
24
+		$this->assertEquals(0, $commandTester->getStatusCode());
25 25
 	}
26 26
 }
Please login to merge, or discard this patch.
Service/View.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
 
59 59
 			$i18n = $this->container->get('aimeos_i18n')->get( array( $locale ) );
60 60
 			$translation = $i18n[$locale];
61
-		}
62
-		else
61
+		} else
63 62
 		{
64 63
 			$translation = new \Aimeos\MW\Translation\None( 'en' );
65 64
 		}
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param RequestStack $requestStack Current request stack
33 33
 	 * @param Container $container Container object to access parameters
34 34
 	 */
35
-	public function __construct( RequestStack $requestStack, Container $container )
35
+	public function __construct(RequestStack $requestStack, Container $container)
36 36
 	{
37 37
 		$this->requestStack = $requestStack;
38 38
 		$this->container = $container;
@@ -47,62 +47,62 @@  discard block
 block discarded – undo
47 47
 	 * @param string|null $locale Code of the current language or null for no translation
48 48
 	 * @return \Aimeos\MW\View\Iface View object
49 49
 	 */
50
-	public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null )
50
+	public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null)
51 51
 	{
52 52
 		$params = $fixed = array();
53 53
 		$config = $context->getConfig();
54 54
 		$request = $this->requestStack->getMasterRequest();
55 55
 
56
-		if( $locale !== null )
56
+		if ($locale !== null)
57 57
 		{
58
-			$params = $request->request->all() + $request->query->all() + $request->attributes->get( '_route_params' );
58
+			$params = $request->request->all() + $request->query->all() + $request->attributes->get('_route_params');
59 59
 			$fixed = $this->getFixedParams();
60 60
 
61
-			$i18n = $this->container->get('aimeos_i18n')->get( array( $locale ) );
61
+			$i18n = $this->container->get('aimeos_i18n')->get(array($locale));
62 62
 			$translation = $i18n[$locale];
63 63
 		}
64 64
 		else
65 65
 		{
66
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
66
+			$translation = new \Aimeos\MW\Translation\None('en');
67 67
 		}
68 68
 
69 69
 
70
-		$view = new \Aimeos\MW\View\Standard( $templatePaths );
70
+		$view = new \Aimeos\MW\View\Standard($templatePaths);
71 71
 
72
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
73
-		$view->addHelper( 'translate', $helper );
72
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
73
+		$view->addHelper('translate', $helper);
74 74
 
75
-		$helper = new \Aimeos\MW\View\Helper\Url\Symfony2( $view, $this->container->get( 'router' ), $fixed );
76
-		$view->addHelper( 'url', $helper );
75
+		$helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed);
76
+		$view->addHelper('url', $helper);
77 77
 
78
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
79
-		$view->addHelper( 'param', $helper );
78
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
79
+		$view->addHelper('param', $helper);
80 80
 
81
-		$config = new \Aimeos\MW\Config\Decorator\Protect( clone $config, array( 'admin', 'client' ) );
82
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
83
-		$view->addHelper( 'config', $helper );
81
+		$config = new \Aimeos\MW\Config\Decorator\Protect(clone $config, array('admin', 'client'));
82
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
83
+		$view->addHelper('config', $helper);
84 84
 
85
-		$sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' );
86
-		$sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' );
87
-		$decimals = $config->get( 'client/html/common/format/decimals', 2 );
88
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000, $decimals );
89
-		$view->addHelper( 'number', $helper );
85
+		$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
86
+		$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
87
+		$decimals = $config->get('client/html/common/format/decimals', 2);
88
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000, $decimals);
89
+		$view->addHelper('number', $helper);
90 90
 
91
-		if( $request !== null )
91
+		if ($request !== null)
92 92
 		{
93
-			$helper = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request );
94
-			$view->addHelper( 'request', $helper );
93
+			$helper = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $request);
94
+			$view->addHelper('request', $helper);
95 95
 		}
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Response\Symfony2( $view );
98
-		$view->addHelper( 'response', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Response\Symfony2($view);
98
+		$view->addHelper('response', $helper);
99 99
 
100
-		$token = $this->container->get( 'security.csrf.token_manager' )->getToken( '_token' );
101
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', $token->getValue() );
102
-		$view->addHelper( 'csrf', $helper );
100
+		$token = $this->container->get('security.csrf.token_manager')->getToken('_token');
101
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', $token->getValue());
102
+		$view->addHelper('csrf', $helper);
103 103
 
104
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $this->getGroups( $context ) );
105
-		$view->addHelper( 'access', $helper );
104
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $this->getGroups($context));
105
+		$view->addHelper('access', $helper);
106 106
 
107 107
 		return $view;
108 108
 	}
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
 		$urlparams = array();
119 119
 		$attr = $this->requestStack->getMasterRequest()->attributes;
120 120
 
121
-		if( ( $site = $attr->get( 'site' ) ) !== null ) {
121
+		if (($site = $attr->get('site')) !== null) {
122 122
 			$urlparams['site'] = $site;
123 123
 		}
124 124
 
125
-		if( ( $lang = $attr->get( 'locale' ) ) !== null ) {
125
+		if (($lang = $attr->get('locale')) !== null) {
126 126
 			$urlparams['locale'] = $lang;
127 127
 		}
128 128
 
129
-		if( ( $currency = $attr->get( 'currency' ) ) !== null ) {
129
+		if (($currency = $attr->get('currency')) !== null) {
130 130
 			$urlparams['currency'] = $currency;
131 131
 		}
132 132
 
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
141 141
 	 * @return \Closure Function which returns the user group codes
142 142
 	 */
143
-	protected function getGroups( \Aimeos\MShop\Context\Item\Iface $context )
143
+	protected function getGroups(\Aimeos\MShop\Context\Item\Iface $context)
144 144
 	{
145
-		return function() use ( $context )
145
+		return function() use ($context)
146 146
 		{
147 147
 			$list = array();
148
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' );
148
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group');
149 149
 
150 150
 			$search = $manager->createSearch();
151
-			$search->setConditions( $search->compare( '==', 'customer.group.id', $context->getGroupIds() ) );
151
+			$search->setConditions($search->compare('==', 'customer.group.id', $context->getGroupIds()));
152 152
 
153
-			foreach( $manager->searchItems( $search ) as $item ) {
153
+			foreach ($manager->searchItems($search) as $item) {
154 154
 				$list[] = $item->getCode();
155 155
 			}
156 156
 
Please login to merge, or discard this patch.
Service/Context.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,8 +107,7 @@
 block discarded – undo
107 107
 
108 108
 		if( $this->container->has( 'security.token_storage' ) ) {
109 109
 			$token = $this->container->get( 'security.token_storage' )->getToken();
110
-		}
111
-		else if( $this->container->has( 'security.context' ) ) {
110
+		} else if( $this->container->has( 'security.context' ) ) {
112 111
 			$token = $this->container->get( 'security.context' )->getToken();
113 112
 		}
114 113
 
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 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;
@@ -48,54 +48,54 @@  discard block
 block discarded – undo
48 48
 	 * @param string $type Configuration type ("frontend" or "backend")
49 49
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
50 50
 	 */
51
-	public function get( $locale = true, $type = 'frontend' )
51
+	public function get($locale = true, $type = 'frontend')
52 52
 	{
53 53
 		$container = $this->container;
54
-		$config = $container->get( 'aimeos_config' )->get( $type );
54
+		$config = $container->get('aimeos_config')->get($type);
55 55
 
56
-		if( self::$context === null )
56
+		if (self::$context === null)
57 57
 		{
58 58
 			$context = new \Aimeos\MShop\Context\Item\Standard();
59 59
 
60
-			$context->setConfig( $config );
60
+			$context->setConfig($config);
61 61
 
62
-			$dbm = new \Aimeos\MW\DB\Manager\DBAL( $config );
63
-			$context->setDatabaseManager( $dbm );
62
+			$dbm = new \Aimeos\MW\DB\Manager\DBAL($config);
63
+			$context->setDatabaseManager($dbm);
64 64
 
65
-			$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $config );
66
-			$context->setFilesystemManager( $fs );
65
+			$fs = new \Aimeos\MW\Filesystem\Manager\Standard($config);
66
+			$context->setFilesystemManager($fs);
67 67
 
68
-			$mq = new \Aimeos\MW\MQueue\Manager\Standard( $config );
69
-			$context->setMessageQueueManager( $mq );
68
+			$mq = new \Aimeos\MW\MQueue\Manager\Standard($config);
69
+			$context->setMessageQueueManager($mq);
70 70
 
71
-			$mail = new \Aimeos\MW\Mail\Swift( function() use ( $container) { return $container->get( 'mailer' ); } );
72
-			$context->setMail( $mail );
71
+			$mail = new \Aimeos\MW\Mail\Swift(function() use ($container) { return $container->get('mailer'); } );
72
+			$context->setMail($mail);
73 73
 
74
-			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context );
75
-			$context->setLogger( $logger );
74
+			$logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context);
75
+			$context->setLogger($logger);
76 76
 
77
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context );
78
-			$context->setCache( $cache );
77
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
78
+			$context->setCache($cache);
79 79
 
80 80
 			self::$context = $context;
81 81
 		}
82 82
 
83 83
 		$context = self::$context;
84
-		$context->setConfig( $config );
84
+		$context->setConfig($config);
85 85
 
86
-		if( $locale === true )
86
+		if ($locale === true)
87 87
 		{
88
-			$localeItem = $this->getLocale( $context );
88
+			$localeItem = $this->getLocale($context);
89 89
 			$langid = $localeItem->getLanguageId();
90 90
 
91
-			$context->setLocale( $localeItem );
92
-			$context->setI18n( $this->container->get('aimeos_i18n')->get( array( $langid ) ) );
91
+			$context->setLocale($localeItem);
92
+			$context->setI18n($this->container->get('aimeos_i18n')->get(array($langid)));
93 93
 		}
94 94
 
95
-		$session = new \Aimeos\MW\Session\Symfony2( $this->container->get( 'session' ) );
96
-		$context->setSession( $session );
95
+		$session = new \Aimeos\MW\Session\Symfony2($this->container->get('session'));
96
+		$context->setSession($session);
97 97
 
98
-		$this->addUser( $context );
98
+		$this->addUser($context);
99 99
 
100 100
 		return $context;
101 101
 	}
@@ -106,39 +106,39 @@  discard block
 block discarded – undo
106 106
 	 *
107 107
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
108 108
 	 */
109
-	protected function addUser( \Aimeos\MShop\Context\Item\Iface $context )
109
+	protected function addUser(\Aimeos\MShop\Context\Item\Iface $context)
110 110
 	{
111 111
 		$token = null;
112 112
 		$username = '';
113 113
 
114
-		if( $this->container->has( 'security.token_storage' ) ) {
115
-			$token = $this->container->get( 'security.token_storage' )->getToken();
114
+		if ($this->container->has('security.token_storage')) {
115
+			$token = $this->container->get('security.token_storage')->getToken();
116 116
 		}
117
-		else if( $this->container->has( 'security.context' ) ) {
118
-			$token = $this->container->get( 'security.context' )->getToken();
117
+		else if ($this->container->has('security.context')) {
118
+			$token = $this->container->get('security.context')->getToken();
119 119
 		}
120 120
 
121
-		if( is_object( $token ) )
121
+		if (is_object($token))
122 122
 		{
123
-			if( method_exists( $token->getUser(), 'getId' ) )
123
+			if (method_exists($token->getUser(), 'getId'))
124 124
 			{
125 125
 				$userid = $token->getUser()->getId();
126
-				$context->setUserId( $userid );
127
-				$context->setGroupIds( function() use ( $context, $userid )
126
+				$context->setUserId($userid);
127
+				$context->setGroupIds(function() use ($context, $userid)
128 128
 				{
129
-					$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
130
-					return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups();
129
+					$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
130
+					return $manager->getItem($userid, array('customer/group'))->getGroups();
131 131
 				} );
132 132
 			}
133 133
 
134
-			if( is_object( $token->getUser() ) ) {
135
-				$username =  $token->getUser()->getUsername();
134
+			if (is_object($token->getUser())) {
135
+				$username = $token->getUser()->getUsername();
136 136
 			} else {
137 137
 				$username = $token->getUser();
138 138
 			}
139 139
 		}
140 140
 
141
-		$context->setEditor( $username );
141
+		$context->setEditor($username);
142 142
 	}
143 143
 
144 144
 
@@ -148,19 +148,19 @@  discard block
 block discarded – undo
148 148
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
149 149
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
150 150
 	 */
151
-	protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context )
151
+	protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context)
152 152
 	{
153
-		if( $this->locale === null )
153
+		if ($this->locale === null)
154 154
 		{
155
-			$status = $this->container->getParameter( 'aimeos_shop.disable_sites' );
155
+			$status = $this->container->getParameter('aimeos_shop.disable_sites');
156 156
 			$request = $this->requestStack->getMasterRequest();
157 157
 
158
-			$site = $request->attributes->get( 'site', $request->query->get( 'site', 'default' ) );
159
-			$currency = $request->attributes->get( 'currency', $request->query->get( 'currency', '' ) );
160
-			$lang = $request->attributes->get( 'locale', $request->query->get( 'locale', '' ) );
158
+			$site = $request->attributes->get('site', $request->query->get('site', 'default'));
159
+			$currency = $request->attributes->get('currency', $request->query->get('currency', ''));
160
+			$lang = $request->attributes->get('locale', $request->query->get('locale', ''));
161 161
 
162
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
163
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $status );
162
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
163
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $status);
164 164
 		}
165 165
 
166 166
 		return $this->locale;
Please login to merge, or discard this patch.
Controller/JsonadmController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -210,8 +210,7 @@
 block discarded – undo
210 210
 			$localeItem = $localeManager->bootstrap( $sitecode, '', '', false );
211 211
 			$localeItem->setLanguageId( null );
212 212
 			$localeItem->setCurrencyId( null );
213
-		}
214
-		catch( \Aimeos\MShop\Locale\Exception $e )
213
+		} catch( \Aimeos\MShop\Locale\Exception $e )
215 214
 		{
216 215
 			$localeItem = $localeManager->createItem();
217 216
 		}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 	 * @param string $site Unique site code
150 150
 	 * @param string Resource location, e.g. "product/stock/wareshouse"
151 151
 	 * @param string $lang Language code
152
-	 * @return \Aimeos\MShop\Context\Item\Iface Context item
152
+	 * @return \Aimeos\Admin\JsonAdm\Iface Context item
153 153
 	 */
154 154
 	protected function createClient( $site, $resource, $lang )
155 155
 	{
Please login to merge, or discard this 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
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
40
-		$result = $client->delete( $request->getContent(), $header, $status );
39
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
40
+		$result = $client->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
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
60
-		$result = $client->get( $request->getContent(), $header, $status );
59
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
60
+		$result = $client->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
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
80
-		$result = $client->patch( $request->getContent(), $header, $status );
79
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
80
+		$result = $client->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
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
100
-		$result = $client->post( $request->getContent(), $header, $status );
99
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
100
+		$result = $client->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
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
120
-		$result = $client->put( $request->getContent(), $header, $status );
119
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
120
+		$result = $client->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
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
140
-		$result = $client->options( $request->getContent(), $header, $status );
139
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
140
+		$result = $client->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 createClient( $site, $resource, $lang )
154
+	protected function createClient($site, $resource, $lang)
155 155
 	{
156
-		$aimeos = $this->get( 'aimeos' )->get();
157
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' );
156
+		$aimeos = $this->get('aimeos')->get();
157
+		$templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates');
158 158
 
159
-		$context = $this->get( 'aimeos_context' )->get( false, 'backend' );
160
-		$context = $this->setLocale( $context, $site, $lang );
159
+		$context = $this->get('aimeos_context')->get(false, 'backend');
160
+		$context = $this->setLocale($context, $site, $lang);
161 161
 
162
-		$view = $this->get('aimeos_view')->create( $context, $templatePaths, $lang );
163
-		$context->setView( $view );
162
+		$view = $this->get('aimeos_view')->create($context, $templatePaths, $lang);
163
+		$context->setView($view);
164 164
 
165
-		return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource );
165
+		return \Aimeos\Admin\JsonAdm\Factory::createClient($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 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/PageController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public function privacyAction()
30 30
 	{
31
-		return $this->render( 'AimeosShopBundle:Page:privacy.html.twig' );
31
+		return $this->render('AimeosShopBundle:Page:privacy.html.twig');
32 32
 	}
33 33
 
34 34
 
@@ -39,6 +39,6 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function termsAction()
41 41
 	{
42
-		return $this->render( 'AimeosShopBundle:Page:terms.html.twig' );
42
+		return $this->render('AimeosShopBundle:Page:terms.html.twig');
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.
Command/Command.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@
 block discarded – undo
25 25
 	 * @param InputInterface $input Input object
26 26
 	 * @return \Aimeos\MShop\Locale\Item\Site\Interface[] List of site items
27 27
 	 */
28
-	protected function getSiteItems( \Aimeos\MShop\Context\Item\Iface $context, InputInterface $input )
28
+	protected function getSiteItems(\Aimeos\MShop\Context\Item\Iface $context, InputInterface $input)
29 29
 	{
30
-		$manager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'site' );
30
+		$manager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('site');
31 31
 		$search = $manager->createSearch();
32 32
 
33
-		if( ( $codes = (string) $input->getArgument( 'site' ) ) !== '' ) {
34
-			$search->setConditions( $search->compare( '==', 'locale.site.code', explode( ' ', $codes ) ) );
33
+		if (($codes = (string) $input->getArgument('site')) !== '') {
34
+			$search->setConditions($search->compare('==', 'locale.site.code', explode(' ', $codes)));
35 35
 		}
36 36
 
37
-		return $manager->searchItems( $search );
37
+		return $manager->searchItems($search);
38 38
 	}
39 39
 }
Please login to merge, or discard this patch.
Tests/Command/JobsCommandTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
 		$kernel = $this->createKernel();
15 15
 		$kernel->boot();
16 16
 
17
-		$application = new Application( $kernel );
18
-		$application->add( new Command\JobsCommand() );
17
+		$application = new Application($kernel);
18
+		$application->add(new Command\JobsCommand());
19 19
 
20
-		$command = $application->find( 'aimeos:jobs' );
21
-		$commandTester = new CommandTester( $command );
22
-		$commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild' ) );
20
+		$command = $application->find('aimeos:jobs');
21
+		$commandTester = new CommandTester($command);
22
+		$commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild'));
23 23
 
24
-		$this->assertEquals( 0, $commandTester->getStatusCode() );
24
+		$this->assertEquals(0, $commandTester->getStatusCode());
25 25
 	}
26 26
 }
Please login to merge, or discard this patch.