Completed
Push — master ( ec393a...539bbb )
by Aimeos
12:50
created
lib/custom/src/MW/View/Helper/Request/Symfony2.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 	 * @param \Aimeos\MW\View\Iface $view View instance with registered view helpers
31 31
 	 * @param \Symfony\Component\HttpFoundation\Request $request Symfony2 request object
32 32
 	 */
33
-	public function __construct( $view, \Symfony\Component\HttpFoundation\Request $request )
33
+	public function __construct($view, \Symfony\Component\HttpFoundation\Request $request)
34 34
 	{
35 35
 		$this->request = $request;
36 36
 
37 37
 		$factory = new \Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory();
38
-		$psr7request = $factory->createRequest( $request );
38
+		$psr7request = $factory->createRequest($request);
39 39
 
40
-		parent::__construct( $view, $psr7request );
40
+		parent::__construct($view, $psr7request);
41 41
 	}
42 42
 
43 43
 
@@ -59,6 +59,6 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function getTarget()
61 61
 	{
62
-		return $this->request->get( '_route' );
62
+		return $this->request->get('_route');
63 63
 	}
64 64
 }
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Helper/Response/Symfony2.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@
 block discarded – undo
27 27
 	 * @param \Aimeos\MW\View\Iface $view View instance with registered view helpers
28 28
 	 * @param \Symfony\Component\HttpFoundation\Response $response Symfony2 response object
29 29
 	 */
30
-	public function __construct( $view, \Symfony\Component\HttpFoundation\Response $response )
30
+	public function __construct($view, \Symfony\Component\HttpFoundation\Response $response)
31 31
 	{
32 32
 		$factory = new \Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory();
33
-		$psr7response = $factory->createResponse( $response );
33
+		$psr7response = $factory->createResponse($response);
34 34
 
35
-		parent::__construct( $view, $psr7response );
35
+		parent::__construct($view, $psr7response);
36 36
 	}
37 37
 }
Please login to merge, or discard this patch.
lib/custom/tests/MW/View/Helper/Request/Symfony2Test.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,35 +15,35 @@
 block discarded – undo
15 15
 
16 16
 	protected function setUp()
17 17
 	{
18
-		if( !class_exists( '\Symfony\Component\HttpFoundation\Request' ) ) {
19
-			$this->markTestSkipped( '\Symfony\Component\HttpFoundation\Request is not available' );
18
+		if (!class_exists('\Symfony\Component\HttpFoundation\Request')) {
19
+			$this->markTestSkipped('\Symfony\Component\HttpFoundation\Request is not available');
20 20
 		}
21 21
 
22
-		if( !class_exists( '\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' ) ) {
23
-			$this->markTestSkipped( '\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory is not available' );
22
+		if (!class_exists('\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory')) {
23
+			$this->markTestSkipped('\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory is not available');
24 24
 		}
25 25
 
26 26
 		$view = new \Aimeos\MW\View\Standard();
27
-		$param = array( 'HTTP_HOST' => 'localhost', 'REMOTE_ADDR' => '127.0.0.1' );
28
-		$request = new \Symfony\Component\HttpFoundation\Request( array(), array(), array(), array(), array(), $param, 'Content' );
29
-		$this->object = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request );
27
+		$param = array('HTTP_HOST' => 'localhost', 'REMOTE_ADDR' => '127.0.0.1');
28
+		$request = new \Symfony\Component\HttpFoundation\Request(array(), array(), array(), array(), array(), $param, 'Content');
29
+		$this->object = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $request);
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testTransform()
34 34
 	{
35
-		$this->assertInstanceOf( '\Aimeos\MW\View\Helper\Request\Symfony2', $this->object->transform() );
35
+		$this->assertInstanceOf('\Aimeos\MW\View\Helper\Request\Symfony2', $this->object->transform());
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testGetClientAddress()
40 40
 	{
41
-		$this->assertEquals( '127.0.0.1', $this->object->getClientAddress() );
41
+		$this->assertEquals('127.0.0.1', $this->object->getClientAddress());
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testGetTarget()
46 46
 	{
47
-		$this->assertEquals( null, $this->object->getTarget() );
47
+		$this->assertEquals(null, $this->object->getTarget());
48 48
 	}
49 49
 }
Please login to merge, or discard this patch.
lib/custom/tests/MW/View/Helper/Response/Symfony2Test.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,28 +17,28 @@
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		if( !class_exists( '\Symfony\Component\HttpFoundation\Response' ) ) {
21
-			$this->markTestSkipped( '\Symfony\Component\HttpFoundation\Response is not available' );
20
+		if (!class_exists('\Symfony\Component\HttpFoundation\Response')) {
21
+			$this->markTestSkipped('\Symfony\Component\HttpFoundation\Response is not available');
22 22
 		}
23 23
 
24
-		if( !class_exists( '\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' ) ) {
25
-			$this->markTestSkipped( '\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory is not available' );
24
+		if (!class_exists('\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory')) {
25
+			$this->markTestSkipped('\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory is not available');
26 26
 		}
27 27
 
28 28
 		$view = new \Aimeos\MW\View\Standard();
29
-		$request = new \Symfony\Component\HttpFoundation\Response( 'Content' );
30
-		$this->object = new \Aimeos\MW\View\Helper\Response\Symfony2( $view, $request );
29
+		$request = new \Symfony\Component\HttpFoundation\Response('Content');
30
+		$this->object = new \Aimeos\MW\View\Helper\Response\Symfony2($view, $request);
31 31
 	}
32 32
 
33 33
 
34 34
 	public function testTransform()
35 35
 	{
36
-		$this->assertInstanceOf( '\Aimeos\MW\View\Helper\Response\Symfony2', $this->object->transform() );
36
+		$this->assertInstanceOf('\Aimeos\MW\View\Helper\Response\Symfony2', $this->object->transform());
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreateStream()
41 41
 	{
42
-		$this->assertInstanceOf( '\Psr\Http\Message\StreamInterface', $this->object->createStream( __FILE__ ) );
42
+		$this->assertInstanceOf('\Psr\Http\Message\StreamInterface', $this->object->createStream(__FILE__));
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.