Completed
Push — master ( cc7294...453d14 )
by Aimeos
08:58
created
Controller/AccountController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function indexAction()
31 31
 	{
32
-		$params = $this->get( 'aimeos_page' )->getSections( 'account-index' );
33
-		return $this->render( 'AimeosShopBundle:Account:index.html.twig', $params );
32
+		$params = $this->get('aimeos_page')->getSections('account-index');
33
+		return $this->render('AimeosShopBundle:Account:index.html.twig', $params);
34 34
 	}
35 35
 
36 36
 
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 		$context = $this->container->get('aimeos_context')->get();
45 45
 		$langid = $context->getLocale()->getLanguageId();
46 46
 
47
-		$view = $this->container->get('aimeos_view')->create( $context->getConfig(), array(), $langid );
48
-		$context->setView( $view );
47
+		$view = $this->container->get('aimeos_view')->create($context->getConfig(), array(), $langid);
48
+		$context->setView($view);
49 49
 
50
-		$client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' );
51
-		$client->setView( $view );
50
+		$client = \Aimeos\Client\Html\Factory::createClient($context, array(), 'account/download');
51
+		$client->setView($view);
52 52
 		$client->process();
53 53
 
54 54
 		$response = $view->response();
55
-		return new Response( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() );
55
+		return new Response((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders());
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.
Service/View.php 1 patch
Spacing   +30 added lines, -30 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,56 +47,56 @@  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\MW\Config\Iface $config, array $templatePaths, $locale = null )
50
+	public function create(\Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null)
51 51
 	{
52 52
 		$params = $fixed = array();
53 53
 		$request = $this->requestStack->getMasterRequest();
54 54
 
55
-		if( $locale !== null )
55
+		if ($locale !== null)
56 56
 		{
57
-			$params = $request->request->all() + $request->query->all() + $request->attributes->get( '_route_params' );
57
+			$params = $request->request->all() + $request->query->all() + $request->attributes->get('_route_params');
58 58
 			$fixed = $this->getFixedParams();
59 59
 
60
-			$i18n = $this->container->get('aimeos_i18n')->get( array( $locale ) );
60
+			$i18n = $this->container->get('aimeos_i18n')->get(array($locale));
61 61
 			$translation = $i18n[$locale];
62 62
 		}
63 63
 		else
64 64
 		{
65
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
65
+			$translation = new \Aimeos\MW\Translation\None('en');
66 66
 		}
67 67
 
68 68
 
69
-		$view = new \Aimeos\MW\View\Standard( $templatePaths );
69
+		$view = new \Aimeos\MW\View\Standard($templatePaths);
70 70
 
71
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
72
-		$view->addHelper( 'translate', $helper );
71
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
72
+		$view->addHelper('translate', $helper);
73 73
 
74
-		$helper = new \Aimeos\MW\View\Helper\Url\Symfony2( $view, $this->container->get( 'router' ), $fixed );
75
-		$view->addHelper( 'url', $helper );
74
+		$helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed);
75
+		$view->addHelper('url', $helper);
76 76
 
77
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
78
-		$view->addHelper( 'param', $helper );
77
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
78
+		$view->addHelper('param', $helper);
79 79
 
80
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
81
-		$view->addHelper( 'config', $helper );
80
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
81
+		$view->addHelper('config', $helper);
82 82
 
83
-		$sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' );
84
-		$sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' );
85
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 );
86
-		$view->addHelper( 'number', $helper );
83
+		$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
84
+		$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
85
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000);
86
+		$view->addHelper('number', $helper);
87 87
 
88
-		if( $request !== null )
88
+		if ($request !== null)
89 89
 		{
90
-			$helper = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request );
91
-			$view->addHelper( 'request', $helper );
90
+			$helper = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $request);
91
+			$view->addHelper('request', $helper);
92 92
 		}
93 93
 
94
-		$helper = new \Aimeos\MW\View\Helper\Response\Symfony2( $view );
95
-		$view->addHelper( 'response', $helper );
94
+		$helper = new \Aimeos\MW\View\Helper\Response\Symfony2($view);
95
+		$view->addHelper('response', $helper);
96 96
 
97
-		$token = $this->container->get( 'security.csrf.token_manager' )->getToken( '_token' );
98
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', $token->getValue() );
99
-		$view->addHelper( 'csrf', $helper );
97
+		$token = $this->container->get('security.csrf.token_manager')->getToken('_token');
98
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', $token->getValue());
99
+		$view->addHelper('csrf', $helper);
100 100
 
101 101
 		return $view;
102 102
 	}
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
 		$urlparams = array();
113 113
 		$attr = $this->requestStack->getMasterRequest()->attributes;
114 114
 
115
-		if( ( $site = $attr->get( 'site' ) ) !== null ) {
115
+		if (($site = $attr->get('site')) !== null) {
116 116
 			$urlparams['site'] = $site;
117 117
 		}
118 118
 
119
-		if( ( $lang = $attr->get( 'locale' ) ) !== null ) {
119
+		if (($lang = $attr->get('locale')) !== null) {
120 120
 			$urlparams['locale'] = $lang;
121 121
 		}
122 122
 
123
-		if( ( $currency = $attr->get( 'currency' ) ) !== null ) {
123
+		if (($currency = $attr->get('currency')) !== null) {
124 124
 			$urlparams['currency'] = $currency;
125 125
 		}
126 126
 
Please login to merge, or discard this patch.
Tests/Controller/AccountControllerTest.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 testAccount()
11 11
 	{
12 12
 		$client = static::createClient();
13
-		$client->request( 'GET', '/unittest/de/EUR/myaccount' );
13
+		$client->request('GET', '/unittest/de/EUR/myaccount');
14 14
 
15
-		$this->assertContains( 'aimeos account-history', $client->getResponse()->getContent() );
15
+		$this->assertContains('aimeos account-history', $client->getResponse()->getContent());
16 16
 	}
17 17
 
18 18
 
19 19
 	public function testDownload()
20 20
 	{
21 21
 		$client = static::createClient();
22
-		$client->request( 'GET', '/unittest/de/EUR/myaccount/download/0' );
22
+		$client->request('GET', '/unittest/de/EUR/myaccount/download/0');
23 23
 
24
-		$this->assertEquals( 401, $client->getResponse()->getStatusCode() );
24
+		$this->assertEquals(401, $client->getResponse()->getStatusCode());
25 25
 	}
26 26
 }
Please login to merge, or discard this patch.