@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | * @param array $cookies List of uploaded files like in $_COOKIES |
40 | 40 | * @param array $server List of uploaded files like in $_SERVER |
41 | 41 | */ |
42 | - public function __construct( \Aimeos\MW\View\Iface $view, \TYPO3\Flow\Http\Request $request, array $files = array(), |
|
43 | - array $query = array(), array $post = array(), array $cookies = array(), array $server = array() ) |
|
42 | + public function __construct(\Aimeos\MW\View\Iface $view, \TYPO3\Flow\Http\Request $request, array $files = array(), |
|
43 | + array $query = array(), array $post = array(), array $cookies = array(), array $server = array()) |
|
44 | 44 | { |
45 | 45 | $this->request = $request; |
46 | - $psr7request = $this->createRequest( $request, $files, $query, $post, $cookies, $server ); |
|
46 | + $psr7request = $this->createRequest($request, $files, $query, $post, $cookies, $server); |
|
47 | 47 | |
48 | - \Aimeos\MW\View\Helper\Base::__construct( $view, $psr7request ); |
|
48 | + \Aimeos\MW\View\Helper\Base::__construct($view, $psr7request); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -82,18 +82,18 @@ discard block |
||
82 | 82 | * @param array $server List of uploaded files like in $_SERVER |
83 | 83 | * @return \Psr\Http\Message\ServerRequestInterface PSR-7 request object |
84 | 84 | */ |
85 | - protected function createRequest( \TYPO3\Flow\Http\Request $nativeRequest, array $files, |
|
86 | - array $query, array $post, array $cookies, array $server ) |
|
85 | + protected function createRequest(\TYPO3\Flow\Http\Request $nativeRequest, array $files, |
|
86 | + array $query, array $post, array $cookies, array $server) |
|
87 | 87 | { |
88 | - $server = ServerRequestFactory::normalizeServer( $server ); |
|
89 | - $files = ServerRequestFactory::normalizeFiles( $files ); |
|
88 | + $server = ServerRequestFactory::normalizeServer($server); |
|
89 | + $files = ServerRequestFactory::normalizeFiles($files); |
|
90 | 90 | $headers = $nativeRequest->getHeaders()->getAll(); |
91 | 91 | $uri = (string) $nativeRequest->getUri(); |
92 | 92 | $method = $nativeRequest->getMethod(); |
93 | 93 | |
94 | 94 | $body = new Stream('php://temp', 'wb+'); |
95 | - $body->write( $nativeRequest->getContent() ); |
|
95 | + $body->write($nativeRequest->getContent()); |
|
96 | 96 | |
97 | - return new ServerRequest( $server, $files, $uri, $method, $body, $headers, $cookies, $query, $post ); |
|
97 | + return new ServerRequest($server, $files, $uri, $method, $body, $headers, $cookies, $query, $post); |
|
98 | 98 | } |
99 | 99 | } |
@@ -26,8 +26,8 @@ |
||
26 | 26 | * |
27 | 27 | * @param \Aimeos\MW\View\Iface $view View instance with registered view helpers |
28 | 28 | */ |
29 | - public function __construct( \Aimeos\MW\View\Iface $view ) |
|
29 | + public function __construct(\Aimeos\MW\View\Iface $view) |
|
30 | 30 | { |
31 | - \Aimeos\MW\View\Helper\Base::__construct( $view, new \Zend\Diactoros\Response() ); |
|
31 | + \Aimeos\MW\View\Helper\Base::__construct($view, new \Zend\Diactoros\Response()); |
|
32 | 32 | } |
33 | 33 | } |
@@ -14,41 +14,41 @@ |
||
14 | 14 | |
15 | 15 | protected function setUp() |
16 | 16 | { |
17 | - if( !class_exists( '\TYPO3\Flow\Http\Request' ) ) { |
|
18 | - $this->markTestSkipped( '\TYPO3\Flow\Http\Request is not available' ); |
|
17 | + if (!class_exists('\TYPO3\Flow\Http\Request')) { |
|
18 | + $this->markTestSkipped('\TYPO3\Flow\Http\Request is not available'); |
|
19 | 19 | } |
20 | 20 | |
21 | - if( !class_exists( '\Zend\Diactoros\ServerRequestFactory' ) ) { |
|
22 | - $this->markTestSkipped( '\Zend\Diactoros\ServerRequestFactory is not available' ); |
|
21 | + if (!class_exists('\Zend\Diactoros\ServerRequestFactory')) { |
|
22 | + $this->markTestSkipped('\Zend\Diactoros\ServerRequestFactory is not available'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $view = new \Aimeos\MW\View\Standard(); |
26 | - $server = array( 'REMOTE_ADDR' => '127.0.0.1' ); |
|
27 | - $request = new \TYPO3\Flow\Http\Request( array(), array(), array(), $server ); |
|
28 | - $this->object = new \Aimeos\MW\View\Helper\Request\Flow( $view, $request, array(), array(), array(), array(), $server ); |
|
26 | + $server = array('REMOTE_ADDR' => '127.0.0.1'); |
|
27 | + $request = new \TYPO3\Flow\Http\Request(array(), array(), array(), $server); |
|
28 | + $this->object = new \Aimeos\MW\View\Helper\Request\Flow($view, $request, array(), array(), array(), array(), $server); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | protected function tearDown() |
33 | 33 | { |
34 | - unset( $this->object, $this->mock ); |
|
34 | + unset($this->object, $this->mock); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testTransform() |
39 | 39 | { |
40 | - $this->assertInstanceOf( '\Aimeos\MW\View\Helper\Request\Flow', $this->object->transform() ); |
|
40 | + $this->assertInstanceOf('\Aimeos\MW\View\Helper\Request\Flow', $this->object->transform()); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | 44 | public function testGetClientAddress() |
45 | 45 | { |
46 | - $this->assertEquals( '127.0.0.1', $this->object->getClientAddress() ); |
|
46 | + $this->assertEquals('127.0.0.1', $this->object->getClientAddress()); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | 50 | public function testGetTarget() |
51 | 51 | { |
52 | - $this->assertEquals( null, $this->object->getTarget() ); |
|
52 | + $this->assertEquals(null, $this->object->getTarget()); |
|
53 | 53 | } |
54 | 54 | } |
@@ -16,23 +16,23 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - if( !class_exists( '\Zend\Diactoros\Response' ) ) { |
|
20 | - $this->markTestSkipped( '\Zend\Diactoros\Response is not available' ); |
|
19 | + if (!class_exists('\Zend\Diactoros\Response')) { |
|
20 | + $this->markTestSkipped('\Zend\Diactoros\Response is not available'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | $view = new \Aimeos\MW\View\Standard(); |
24 | - $this->object = new \Aimeos\MW\View\Helper\Response\Flow( $view ); |
|
24 | + $this->object = new \Aimeos\MW\View\Helper\Response\Flow($view); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset( $this->object ); |
|
30 | + unset($this->object); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | public function testTransform() |
35 | 35 | { |
36 | - $this->assertInstanceOf( '\Aimeos\MW\View\Helper\Response\Flow', $this->object->transform() ); |
|
36 | + $this->assertInstanceOf('\Aimeos\MW\View\Helper\Response\Flow', $this->object->transform()); |
|
37 | 37 | } |
38 | 38 | } |