Completed
Push — master ( 681530...7cfa63 )
by Aimeos
17:08
created
src/Controller/Jsonapi.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 	 * @param array $args Associative list of route parameters
33 33
 	 * @return ResponseInterface $response Modified response object with generated output
34 34
 	 */
35
-	public static function deleteAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
35
+	public static function deleteAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
36 36
 	{
37
-		return self::createClient( $container, $request, $response, $args )->delete( $request, $response );
37
+		return self::createClient($container, $request, $response, $args)->delete($request, $response);
38 38
 	}
39 39
 
40 40
 
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	 * @param array $args Associative list of route parameters
48 48
 	 * @return ResponseInterface $response Modified response object with generated output
49 49
 	 */
50
-	public static function getAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
50
+	public static function getAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
51 51
 	{
52
-		return self::createClient( $container, $request, $response, $args )->get( $request, $response );
52
+		return self::createClient($container, $request, $response, $args)->get($request, $response);
53 53
 	}
54 54
 
55 55
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 * @param array $args Associative list of route parameters
63 63
 	 * @return ResponseInterface $response Modified response object with generated output
64 64
 	 */
65
-	public static function patchAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
65
+	public static function patchAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
66 66
 	{
67
-		return self::createClient( $container, $request, $response, $args )->patch( $request, $response );
67
+		return self::createClient($container, $request, $response, $args)->patch($request, $response);
68 68
 	}
69 69
 
70 70
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 * @param array $args Associative list of route parameters
78 78
 	 * @return ResponseInterface $response Modified response object with generated output
79 79
 	 */
80
-	public static function postAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
80
+	public static function postAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
81 81
 	{
82
-		return self::createClient( $container, $request, $response, $args )->post( $request, $response );
82
+		return self::createClient($container, $request, $response, $args)->post($request, $response);
83 83
 	}
84 84
 
85 85
 
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 	 * @param array $args Associative list of route parameters
93 93
 	 * @return ResponseInterface $response Modified response object with generated output
94 94
 	 */
95
-	public static function putAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
95
+	public static function putAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
96 96
 	{
97
-		return self::createClient( $container, $request, $response, $args )->put( $request, $response );
97
+		return self::createClient($container, $request, $response, $args)->put($request, $response);
98 98
 	}
99 99
 
100 100
 
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 	 * @param array $args Associative list of route parameters
108 108
 	 * @return ResponseInterface $response Modified response object with generated output
109 109
 	 */
110
-	public static function optionsAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
110
+	public static function optionsAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
111 111
 	{
112
-		return self::createClient( $container, $request, $response, $args )->options( $request, $response );
112
+		return self::createClient($container, $request, $response, $args)->options($request, $response);
113 113
 	}
114 114
 
115 115
 
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
 	 * @param array $args Associative list of route parameters
123 123
 	 * @return \Aimeos\Client\JsonApi\Iface JSON client controller
124 124
 	 */
125
-	protected static function createClient( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
125
+	protected static function createClient(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
126 126
 	{
127
-		$resource = ( isset( $args['resource'] ) ? $args['resource'] : null );
128
-		$related = ( isset( $args['related'] ) ? $args['related'] : null );
129
-		$tmplPaths = $container->get( 'aimeos' )->getCustomPaths( 'client/jsonapi/templates' );
127
+		$resource = (isset($args['resource']) ? $args['resource'] : null);
128
+		$related = (isset($args['related']) ? $args['related'] : null);
129
+		$tmplPaths = $container->get('aimeos')->getCustomPaths('client/jsonapi/templates');
130 130
 
131
-		$context = $container->get( 'aimeos_context' )->get( true, $args );
131
+		$context = $container->get('aimeos_context')->get(true, $args);
132 132
 		$langid = $context->getLocale()->getLanguageId();
133 133
 		$config = $context->getConfig();
134 134
 
135
-		$view = $container->get( 'aimeos_view' )->create( $config, $request, $response, $args, $tmplPaths, $langid );
136
-		$context->setView( $view );
135
+		$view = $container->get('aimeos_view')->create($config, $request, $response, $args, $tmplPaths, $langid);
136
+		$context->setView($view);
137 137
 
138
-		return \Aimeos\Client\JsonApi\Factory::createClient( $context, $tmplPaths, $resource . '/' . $related );
138
+		return \Aimeos\Client\JsonApi\Factory::createClient($context, $tmplPaths, $resource.'/'.$related);
139 139
 	}
140 140
 }
Please login to merge, or discard this patch.