Completed
Push — master ( b53863...ac109f )
by Aimeos
07:38
created
client/jsonapi/src/Client/JsonApi/Locale/Standard.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -31,35 +31,35 @@  discard block
 block discarded – undo
31 31
 	 * @param \Psr\Http\Message\ResponseInterface $response Response object
32 32
 	 * @return \Psr\Http\Message\ResponseInterface Modified response object
33 33
 	 */
34
-	public function get( ServerRequestInterface $request, ResponseInterface $response )
34
+	public function get(ServerRequestInterface $request, ResponseInterface $response)
35 35
 	{
36 36
 		$view = $this->getView();
37 37
 
38 38
 		try
39 39
 		{
40
-			if( $view->param( 'id' ) != '' ) {
41
-				$response = $this->getItem( $view, $request, $response );
40
+			if ($view->param('id') != '') {
41
+				$response = $this->getItem($view, $request, $response);
42 42
 			} else {
43
-				$response = $this->getItems( $view, $request, $response );
43
+				$response = $this->getItems($view, $request, $response);
44 44
 			}
45 45
 
46 46
 			$status = 200;
47 47
 		}
48
-		catch( \Aimeos\MShop\Exception $e )
48
+		catch (\Aimeos\MShop\Exception $e)
49 49
 		{
50 50
 			$status = 404;
51
-			$view->errors = array( array(
52
-				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
51
+			$view->errors = array(array(
52
+				'title' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()),
53 53
 				'detail' => $e->getTraceAsString(),
54
-			) );
54
+			));
55 55
 		}
56
-		catch( \Exception $e )
56
+		catch (\Exception $e)
57 57
 		{
58 58
 			$status = 500;
59
-			$view->errors = array( array(
59
+			$view->errors = array(array(
60 60
 				'title' => $e->getMessage(),
61 61
 				'detail' => $e->getTraceAsString(),
62
-			) );
62
+			));
63 63
 		}
64 64
 
65 65
 		/** client/jsonapi/locale/standard/template-get
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
 		$tplconf = 'client/jsonapi/locale/standard/template-get';
85 85
 		$default = 'locale/get-default.php';
86 86
 
87
-		$body = $view->render( $view->config( $tplconf, $default ) );
87
+		$body = $view->render($view->config($tplconf, $default));
88 88
 
89
-		return $response->withHeader( 'Allow', 'GET' )
90
-			->withHeader( 'Content-Type', 'application/vnd.api+json' )
91
-			->withBody( $view->response()->createStreamFromString( $body ) )
92
-			->withStatus( $status );
89
+		return $response->withHeader('Allow', 'GET')
90
+			->withHeader('Content-Type', 'application/vnd.api+json')
91
+			->withBody($view->response()->createStreamFromString($body))
92
+			->withStatus($status);
93 93
 	}
94 94
 
95 95
 
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 	 * @param \Psr\Http\Message\ResponseInterface $response Response object
102 102
 	 * @return \Psr\Http\Message\ResponseInterface Modified response object
103 103
 	 */
104
-	protected function getItem( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response )
104
+	protected function getItem(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response)
105 105
 	{
106
-		$cntl = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'locale' );
106
+		$cntl = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'locale');
107 107
 
108
-		$view->items = $cntl->getItem( $view->param( 'id' ) );
108
+		$view->items = $cntl->getItem($view->param('id'));
109 109
 		$view->total = 1;
110 110
 
111 111
 		return $response;
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
 	 * @param \Psr\Http\Message\ResponseInterface $response Response object
121 121
 	 * @return \Psr\Http\Message\ResponseInterface Modified response object
122 122
 	 */
123
-	protected function getItems( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response )
123
+	protected function getItems(\Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response)
124 124
 	{
125 125
 		$total = 0;
126 126
 
127
-		$cntl = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'locale' );
127
+		$cntl = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'locale');
128 128
 
129 129
 		$filter = $cntl->createFilter();
130
-		$filter = $this->initCriteriaConditions( $filter, $view->param() );
130
+		$filter = $this->initCriteriaConditions($filter, $view->param());
131 131
 
132
-		$view->items = $cntl->searchItems( $filter, [], $total );
132
+		$view->items = $cntl->searchItems($filter, [], $total);
133 133
 		$view->total = $total;
134 134
 
135 135
 		return $response;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,16 +44,14 @@
 block discarded – undo
44 44
 			}
45 45
 
46 46
 			$status = 200;
47
-		}
48
-		catch( \Aimeos\MShop\Exception $e )
47
+		} catch( \Aimeos\MShop\Exception $e )
49 48
 		{
50 49
 			$status = 404;
51 50
 			$view->errors = array( array(
52 51
 				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
53 52
 				'detail' => $e->getTraceAsString(),
54 53
 			) );
55
-		}
56
-		catch( \Exception $e )
54
+		} catch( \Exception $e )
57 55
 		{
58 56
 			$status = 500;
59 57
 			$view->errors = array( array(
Please login to merge, or discard this patch.
client/jsonapi/src/Client/JsonApi/Locale/Factory.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	 * @return \Aimeos\Client\JsonApi\Iface JSON API client
32 32
 	 * @throws \Aimeos\Client\JsonApi\Exception If requested client implementation couldn't be found or initialisation fails
33 33
 	 */
34
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $path, $name = null )
34
+	public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $path, $name = null)
35 35
 	{
36
-		if( ctype_alnum( $path ) === false )
36
+		if (ctype_alnum($path) === false)
37 37
 		{
38
-			$path = ( is_string( $path ) ? $path : '<not a string>' );
39
-			throw new \Aimeos\Client\JsonApi\Exception( sprintf( 'Invalid client "%1$s"', $path ), 400 );
38
+			$path = (is_string($path) ? $path : '<not a string>');
39
+			throw new \Aimeos\Client\JsonApi\Exception(sprintf('Invalid client "%1$s"', $path), 400);
40 40
 		}
41 41
 
42 42
 		/** client/jsonapi/locale/name
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
 		 * @since 2017.03
73 73
 		 * @category Developer
74 74
 		 */
75
-		if( $name === null ) {
76
-			$name = $context->getConfig()->get( 'client/jsonapi/locale/name', 'Standard' );
75
+		if ($name === null) {
76
+			$name = $context->getConfig()->get('client/jsonapi/locale/name', 'Standard');
77 77
 		}
78 78
 
79
-		if( ctype_alnum( $name ) === false )
79
+		if (ctype_alnum($name) === false)
80 80
 		{
81
-			$classname = is_string( $name ) ? '\\Aimeos\\Client\\JsonApi\\Locale\\' . $name : '<not a string>';
82
-			throw new \Aimeos\Client\JsonApi\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
81
+			$classname = is_string($name) ? '\\Aimeos\\Client\\JsonApi\\Locale\\' . $name : '<not a string>';
82
+			throw new \Aimeos\Client\JsonApi\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
83 83
 		}
84 84
 
85 85
 		$view = $context->getView();
86 86
 		$iface = '\\Aimeos\\Client\\JsonApi\\Iface';
87 87
 		$classname = '\\Aimeos\\Client\\JsonApi\\Locale\\' . $name;
88 88
 
89
-		$client = self::createClientBase( $classname, $iface, $context, $view, $templatePaths, $path );
89
+		$client = self::createClientBase($classname, $iface, $context, $view, $templatePaths, $path);
90 90
 
91
-		return self::addClientDecorators( $client, $context, $view, $templatePaths, $path );
91
+		return self::addClientDecorators($client, $context, $view, $templatePaths, $path);
92 92
 	}
93 93
 
94 94
 }
Please login to merge, or discard this patch.
client/jsonapi/templates/locale/get-default.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -8,37 +8,37 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 
11
-$target = $this->config( 'client/jsonapi/url/target' );
12
-$cntl = $this->config( 'client/jsonapi/url/controller', 'jsonapi' );
13
-$action = $this->config( 'client/jsonapi/url/action', 'get' );
14
-$config = $this->config( 'client/jsonapi/url/config', array() );
11
+$target = $this->config('client/jsonapi/url/target');
12
+$cntl = $this->config('client/jsonapi/url/controller', 'jsonapi');
13
+$action = $this->config('client/jsonapi/url/action', 'get');
14
+$config = $this->config('client/jsonapi/url/config', array());
15 15
 
16 16
 
17 17
 $view = $this;
18 18
 $enc = $this->encoder();
19 19
 
20
-$ref = array( 'id', 'resource', 'filter', 'page', 'sort', 'include', 'fields' );
21
-$params = array_intersect_key( $this->param(), array_flip( $ref ) );
20
+$ref = array('id', 'resource', 'filter', 'page', 'sort', 'include', 'fields');
21
+$params = array_intersect_key($this->param(), array_flip($ref));
22 22
 
23
-$offset = max( $this->param( 'page/offset', 0 ), 0 );
24
-$limit = max( $this->param( 'page/limit', 100 ), 1 );
23
+$offset = max($this->param('page/offset', 0), 0);
24
+$limit = max($this->param('page/limit', 100), 1);
25 25
 
26 26
 
27
-$fields = $this->param( 'fields', array() );
27
+$fields = $this->param('fields', array());
28 28
 
29
-foreach( (array) $fields as $resource => $list ) {
30
-	$fields[$resource] = array_flip( explode( ',', $list ) );
29
+foreach ((array) $fields as $resource => $list) {
30
+	$fields[$resource] = array_flip(explode(',', $list));
31 31
 }
32 32
 
33 33
 
34
-$entryFcn = function( \Aimeos\MShop\Locale\Item\Iface $item ) use ( $fields, $view, $target, $cntl, $action, $config )
34
+$entryFcn = function(\Aimeos\MShop\Locale\Item\Iface $item) use ($fields, $view, $target, $cntl, $action, $config)
35 35
 {
36 36
 	$attributes = $item->toArray();
37 37
 	$type = $item->getResourceType();
38
-	$params = array( 'resource' => $type, 'id' => $item->getId() );
38
+	$params = array('resource' => $type, 'id' => $item->getId());
39 39
 
40
-	if( isset( $fields[$type] ) ) {
41
-		$attributes = array_intersect_key( $attributes, $fields[$type] );
40
+	if (isset($fields[$type])) {
41
+		$attributes = array_intersect_key($attributes, $fields[$type]);
42 42
 	}
43 43
 
44 44
 	$entry = array(
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 		'type' => $item->getResourceType(),
47 47
 		'links' => array(
48 48
 			'self' => array(
49
-				'href' => $view->url( $target, $cntl, $action, $params, array(), $config ),
50
-				'allow' => array( 'GET' ),
49
+				'href' => $view->url($target, $cntl, $action, $params, array(), $config),
50
+				'allow' => array('GET'),
51 51
 			),
52 52
 		),
53 53
 		'attributes' => $attributes,
@@ -60,37 +60,37 @@  discard block
 block discarded – undo
60 60
 ?>
61 61
 {
62 62
 	"meta": {
63
-		"total": <?php echo $this->get( 'total', 0 ); ?>
63
+		"total": <?php echo $this->get('total', 0); ?>
64 64
 
65 65
 	},
66 66
 
67 67
 	"links": {
68
-		"self": "<?php echo $this->url( $target, $cntl, $action, $params, array(), $config ); ?>"
68
+		"self": "<?php echo $this->url($target, $cntl, $action, $params, array(), $config); ?>"
69 69
 	},
70 70
 
71
-	<?php if( isset( $this->errors ) ) : ?>
71
+	<?php if (isset($this->errors)) : ?>
72 72
 
73
-		"errors": <?php echo json_encode( $this->errors, JSON_PRETTY_PRINT ); ?>
73
+		"errors": <?php echo json_encode($this->errors, JSON_PRETTY_PRINT); ?>
74 74
 
75
-	<?php elseif( isset( $this->items ) ) : ?>
75
+	<?php elseif (isset($this->items)) : ?>
76 76
 
77 77
 		<?php
78 78
 			$data = [];
79
-			$items = $this->get( 'items', [] );
79
+			$items = $this->get('items', []);
80 80
 
81
-			if( is_array( $items ) )
81
+			if (is_array($items))
82 82
 			{
83
-				foreach( $items as $localeItem ) {
84
-					$data[] = $entryFcn( $localeItem );
83
+				foreach ($items as $localeItem) {
84
+					$data[] = $entryFcn($localeItem);
85 85
 				}
86 86
 			}
87 87
 			else
88 88
 			{
89
-				$data = $entryFcn( $items );
89
+				$data = $entryFcn($items);
90 90
 			}
91 91
 		 ?>
92 92
 
93
-		"data": <?php echo json_encode( $data ); ?>
93
+		"data": <?php echo json_encode($data); ?>
94 94
 
95 95
 	<?php endif; ?>
96 96
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@
 block discarded – undo
83 83
 				foreach( $items as $localeItem ) {
84 84
 					$data[] = $entryFcn( $localeItem );
85 85
 				}
86
-			}
87
-			else
86
+			} else
88 87
 			{
89 88
 				$data = $entryFcn( $items );
90 89
 			}
Please login to merge, or discard this patch.
client/jsonapi/tests/Client/JsonApi/Locale/FactoryTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 		$context = \TestHelperJapi::getContext();
17 17
 		$templatePaths = \TestHelperJapi::getTemplatePaths();
18 18
 
19
-		$client = \Aimeos\Client\JsonApi\Locale\Factory::createClient( $context, $templatePaths, 'locale' );
20
-		$this->assertInstanceOf( '\Aimeos\Client\JsonApi\Iface', $client );
19
+		$client = \Aimeos\Client\JsonApi\Locale\Factory::createClient($context, $templatePaths, 'locale');
20
+		$this->assertInstanceOf('\Aimeos\Client\JsonApi\Iface', $client);
21 21
 	}
22 22
 
23 23
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 		$context = \TestHelperJapi::getContext();
27 27
 		$templatePaths = \TestHelperJapi::getTemplatePaths();
28 28
 
29
-		$this->setExpectedException( '\Aimeos\Client\JsonApi\Exception' );
30
-		\Aimeos\Client\JsonApi\Locale\Factory::createClient( $context, $templatePaths, '' );
29
+		$this->setExpectedException('\Aimeos\Client\JsonApi\Exception');
30
+		\Aimeos\Client\JsonApi\Locale\Factory::createClient($context, $templatePaths, '');
31 31
 	}
32 32
 
33 33
 
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 		$context = \TestHelperJapi::getContext();
37 37
 		$templatePaths = \TestHelperJapi::getTemplatePaths();
38 38
 
39
-		$this->setExpectedException( '\Aimeos\Client\JsonApi\Exception' );
40
-		\Aimeos\Client\JsonApi\Locale\Factory::createClient( $context, $templatePaths, '%^' );
39
+		$this->setExpectedException('\Aimeos\Client\JsonApi\Exception');
40
+		\Aimeos\Client\JsonApi\Locale\Factory::createClient($context, $templatePaths, '%^');
41 41
 	}
42 42
 
43 43
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		$context = \TestHelperJapi::getContext();
47 47
 		$templatePaths = \TestHelperJapi::getTemplatePaths();
48 48
 
49
-		$this->setExpectedException( '\Aimeos\Client\JsonApi\Exception' );
50
-		\Aimeos\Client\JsonApi\Locale\Factory::createClient( $context, $templatePaths, 'locale', '%^' );
49
+		$this->setExpectedException('\Aimeos\Client\JsonApi\Exception');
50
+		\Aimeos\Client\JsonApi\Locale\Factory::createClient($context, $templatePaths, 'locale', '%^');
51 51
 	}
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
client/jsonapi/tests/Client/JsonApi/Locale/StandardTest.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -22,20 +22,20 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJapi::getTemplatePaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Client\JsonApi\Locale\Standard( $this->context, $this->view, $templatePaths, 'locale' );
25
+		$this->object = new \Aimeos\Client\JsonApi\Locale\Standard($this->context, $this->view, $templatePaths, 'locale');
26 26
 	}
27 27
 
28 28
 
29 29
 	public function testGetItem()
30 30
 	{
31
-		$localeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale' );
31
+		$localeManager = \Aimeos\MShop\Factory::createManager($this->context, 'locale');
32 32
 		$search = $localeManager->createSearch();
33
-		$search->setSortations( [$search->sort( '+', 'locale.position' )] );
34
-		$search->setSlice( 0, 1 );
35
-		$localeItems = $localeManager->searchItems( $search );
33
+		$search->setSortations([$search->sort('+', 'locale.position')]);
34
+		$search->setSlice(0, 1);
35
+		$localeItems = $localeManager->searchItems($search);
36 36
 
37
-		if( ( $localeItem = reset( $localeItems ) ) === false ) {
38
-			throw new \Exception( 'No locale item found' );
37
+		if (($localeItem = reset($localeItems)) === false) {
38
+			throw new \Exception('No locale item found');
39 39
 		}
40 40
 
41 41
 
@@ -46,24 +46,24 @@  discard block
 block discarded – undo
46 46
 			)
47 47
 		);
48 48
 
49
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
50
-		$this->view->addHelper( 'param', $helper );
49
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
50
+		$this->view->addHelper('param', $helper);
51 51
 
52
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
53
-		$result = json_decode( (string) $response->getBody(), true );
52
+		$response = $this->object->get($this->view->request(), $this->view->response());
53
+		$result = json_decode((string) $response->getBody(), true);
54 54
 
55 55
 
56
-		$this->assertEquals( 200, $response->getStatusCode() );
57
-		$this->assertEquals( 1, count( $response->getHeader( 'Allow' ) ) );
58
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
56
+		$this->assertEquals(200, $response->getStatusCode());
57
+		$this->assertEquals(1, count($response->getHeader('Allow')));
58
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
59 59
 
60
-		$this->assertEquals( 1, $result['meta']['total'] );
61
-		$this->assertEquals( 'locale', $result['data']['type'] );
62
-		$this->assertGreaterThan( 0, $result['data']['attributes']['locale.id'] );
63
-		$this->assertEquals( 'de', $result['data']['attributes']['locale.languageid'] );
64
-		$this->assertEquals( 'EUR', $result['data']['attributes']['locale.currencyid'] );
60
+		$this->assertEquals(1, $result['meta']['total']);
61
+		$this->assertEquals('locale', $result['data']['type']);
62
+		$this->assertGreaterThan(0, $result['data']['attributes']['locale.id']);
63
+		$this->assertEquals('de', $result['data']['attributes']['locale.languageid']);
64
+		$this->assertEquals('EUR', $result['data']['attributes']['locale.currencyid']);
65 65
 
66
-		$this->assertArrayNotHasKey( 'errors', $result );
66
+		$this->assertArrayNotHasKey('errors', $result);
67 67
 	}
68 68
 
69 69
 
@@ -75,25 +75,25 @@  discard block
 block discarded – undo
75 75
 			),
76 76
 			'sort' => 'locale.position',
77 77
 		);
78
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
79
-		$this->view->addHelper( 'param', $helper );
78
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
79
+		$this->view->addHelper('param', $helper);
80 80
 
81
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
82
-		$result = json_decode( (string) $response->getBody(), true );
81
+		$response = $this->object->get($this->view->request(), $this->view->response());
82
+		$result = json_decode((string) $response->getBody(), true);
83 83
 
84 84
 
85
-		$this->assertEquals( 200, $response->getStatusCode() );
86
-		$this->assertEquals( 1, count( $response->getHeader( 'Allow' ) ) );
87
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
85
+		$this->assertEquals(200, $response->getStatusCode());
86
+		$this->assertEquals(1, count($response->getHeader('Allow')));
87
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
88 88
 
89
-		$this->assertEquals( 1, $result['meta']['total'] );
90
-		$this->assertEquals( 1, count( $result['data'] ) );
91
-		$this->assertEquals( 'locale', $result['data'][0]['type'] );
92
-		$this->assertEquals( 3, count( $result['data'][0]['attributes'] ) );
93
-		$this->assertEquals( 'en', $result['data'][0]['attributes']['locale.languageid'] );
94
-		$this->assertEquals( 'EUR', $result['data'][0]['attributes']['locale.currencyid'] );
89
+		$this->assertEquals(1, $result['meta']['total']);
90
+		$this->assertEquals(1, count($result['data']));
91
+		$this->assertEquals('locale', $result['data'][0]['type']);
92
+		$this->assertEquals(3, count($result['data'][0]['attributes']));
93
+		$this->assertEquals('en', $result['data'][0]['attributes']['locale.languageid']);
94
+		$this->assertEquals('EUR', $result['data'][0]['attributes']['locale.currencyid']);
95 95
 
96
-		$this->assertArrayNotHasKey( 'errors', $result );
96
+		$this->assertArrayNotHasKey('errors', $result);
97 97
 	}
98 98
 
99 99
 
@@ -101,20 +101,20 @@  discard block
 block discarded – undo
101 101
 	{
102 102
 		$params = array(
103 103
 			'filter' => array(
104
-				'>=' => array( 'locale.position' => 0 ),
104
+				'>=' => array('locale.position' => 0),
105 105
 			),
106 106
 			'sort' => '-locale.position',
107 107
 		);
108
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
109
-		$this->view->addHelper( 'param', $helper );
108
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
109
+		$this->view->addHelper('param', $helper);
110 110
 
111
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
112
-		$result = json_decode( (string) $response->getBody(), true );
111
+		$response = $this->object->get($this->view->request(), $this->view->response());
112
+		$result = json_decode((string) $response->getBody(), true);
113 113
 
114 114
 
115
-		$this->assertEquals( 200, $response->getStatusCode() );
116
-		$this->assertEquals( 1, $result['meta']['total'] );
117
-		$this->assertArrayNotHasKey( 'errors', $result );
115
+		$this->assertEquals(200, $response->getStatusCode());
116
+		$this->assertEquals(1, $result['meta']['total']);
117
+		$this->assertArrayNotHasKey('errors', $result);
118 118
 	}
119 119
 
120 120
 
@@ -122,21 +122,21 @@  discard block
 block discarded – undo
122 122
 	{
123 123
 		$templatePaths = \TestHelperJapi::getTemplatePaths();
124 124
 
125
-		$object = $this->getMockBuilder( '\Aimeos\Client\JsonApi\Locale\Standard' )
126
-			->setConstructorArgs( [$this->context, $this->view, $templatePaths, 'locale'] )
127
-			->setMethods( ['getItems'] )
125
+		$object = $this->getMockBuilder('\Aimeos\Client\JsonApi\Locale\Standard')
126
+			->setConstructorArgs([$this->context, $this->view, $templatePaths, 'locale'])
127
+			->setMethods(['getItems'])
128 128
 			->getMock();
129 129
 
130
-		$object->expects( $this->once() )->method( 'getItems' )
131
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
130
+		$object->expects($this->once())->method('getItems')
131
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
132 132
 
133 133
 
134
-		$response = $object->get( $this->view->request(), $this->view->response() );
135
-		$result = json_decode( (string) $response->getBody(), true );
134
+		$response = $object->get($this->view->request(), $this->view->response());
135
+		$result = json_decode((string) $response->getBody(), true);
136 136
 
137 137
 
138
-		$this->assertEquals( 404, $response->getStatusCode() );
139
-		$this->assertArrayHasKey( 'errors', $result );
138
+		$this->assertEquals(404, $response->getStatusCode());
139
+		$this->assertArrayHasKey('errors', $result);
140 140
 	}
141 141
 
142 142
 
@@ -144,20 +144,20 @@  discard block
 block discarded – undo
144 144
 	{
145 145
 		$templatePaths = \TestHelperJapi::getTemplatePaths();
146 146
 
147
-		$object = $this->getMockBuilder( '\Aimeos\Client\JsonApi\Locale\Standard' )
148
-			->setConstructorArgs( [$this->context, $this->view, $templatePaths, 'locale'] )
149
-			->setMethods( ['getItems'] )
147
+		$object = $this->getMockBuilder('\Aimeos\Client\JsonApi\Locale\Standard')
148
+			->setConstructorArgs([$this->context, $this->view, $templatePaths, 'locale'])
149
+			->setMethods(['getItems'])
150 150
 			->getMock();
151 151
 
152
-		$object->expects( $this->once() )->method( 'getItems' )
153
-			->will( $this->throwException( new \Exception() ) );
152
+		$object->expects($this->once())->method('getItems')
153
+			->will($this->throwException(new \Exception()));
154 154
 
155 155
 
156
-		$response = $object->get( $this->view->request(), $this->view->response() );
157
-		$result = json_decode( (string) $response->getBody(), true );
156
+		$response = $object->get($this->view->request(), $this->view->response());
157
+		$result = json_decode((string) $response->getBody(), true);
158 158
 
159 159
 
160
-		$this->assertEquals( 500, $response->getStatusCode() );
161
-		$this->assertArrayHasKey( 'errors', $result );
160
+		$this->assertEquals(500, $response->getStatusCode());
161
+		$this->assertArrayHasKey('errors', $result);
162 162
 	}
163 163
 }
164 164
\ No newline at end of file
Please login to merge, or discard this patch.