Completed
Push — master ( e82a98...dca556 )
by Aimeos
01:54
created
src/Controller/Jsonadm.php 1 patch
Spacing   +24 added lines, -24 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,22 +122,22 @@  discard block
 block discarded – undo
122 122
 	 * @param array $args Associative list of route parameters
123 123
 	 * @return \Aimeos\Admin\JsonAdm\Iface JSON admin client
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
-		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
129
-		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
127
+		$resource = (isset($args['resource']) ? $args['resource'] : null);
128
+		$site = (isset($args['site']) ? $args['site'] : 'default');
129
+		$lang = (isset($args['lang']) ? $args['lang'] : 'en');
130 130
 
131
-		$aimeos = $container->get( 'aimeos' );
132
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' );
131
+		$aimeos = $container->get('aimeos');
132
+		$templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates');
133 133
 
134
-		$context = $container->get( 'aimeos_context' )->get( false, $args, 'backend' );
135
-		$context->setI18n( $container->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) );
136
-		$context->setLocale( $container->get( 'aimeos_locale' )->getBackend( $context, $site ) );
134
+		$context = $container->get('aimeos_context')->get(false, $args, 'backend');
135
+		$context->setI18n($container->get('aimeos_i18n')->get(array($lang, 'en')));
136
+		$context->setLocale($container->get('aimeos_locale')->getBackend($context, $site));
137 137
 
138
-		$view = $container->get( 'aimeos_view' )->create( $context, $request, $response, $args, $templatePaths, $lang );
139
-		$context->setView( $view );
138
+		$view = $container->get('aimeos_view')->create($context, $request, $response, $args, $templatePaths, $lang);
139
+		$context->setView($view);
140 140
 
141
-		return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, $resource );
141
+		return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, $resource);
142 142
 	}
143 143
 }
Please login to merge, or discard this patch.
src/Base/Page.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @param ContainerInterface $container Dependency container
32 32
 	 */
33
-	public function __construct( ContainerInterface $container )
33
+	public function __construct(ContainerInterface $container)
34 34
 	{
35 35
 		$this->container = $container;
36 36
 	}
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
 	 * @param array Associative list of URI attributes
46 46
 	 * @return array Associative list with body and header output separated by client name
47 47
 	 */
48
-	public function getSections( $pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr )
48
+	public function getSections($pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr)
49 49
 	{
50
-		$tmplPaths = $this->container->get( 'aimeos' )->getCustomPaths( 'client/html/templates' );
51
-		$context = $this->container->get( 'aimeos_context' )->get( true, $attr );
50
+		$tmplPaths = $this->container->get('aimeos')->getCustomPaths('client/html/templates');
51
+		$context = $this->container->get('aimeos_context')->get(true, $attr);
52 52
 		$langid = $context->getLocale()->getLanguageId();
53 53
 
54
-		$view = $this->container->get( 'aimeos_view' )->create( $context, $request, $response, $attr, $tmplPaths, $langid );
55
-		$context->setView( $view );
54
+		$view = $this->container->get('aimeos_view')->create($context, $request, $response, $attr, $tmplPaths, $langid);
55
+		$context->setView($view);
56 56
 
57
-		$pagesConfig = $this->container->get( 'aimeos_config' )->get()->get( 'page', array() );
58
-		$result = array( 'aibody' => array(), 'aiheader' => array() );
57
+		$pagesConfig = $this->container->get('aimeos_config')->get()->get('page', array());
58
+		$result = array('aibody' => array(), 'aiheader' => array());
59 59
 
60
-		if( isset( $pagesConfig[$pageName] ) )
60
+		if (isset($pagesConfig[$pageName]))
61 61
 		{
62
-			foreach( (array) $pagesConfig[$pageName] as $clientName )
62
+			foreach ((array) $pagesConfig[$pageName] as $clientName)
63 63
 			{
64
-				$client = \Aimeos\Client\Html\Factory::createClient( $context, $clientName );
65
-				$client->setView( clone $view );
64
+				$client = \Aimeos\Client\Html\Factory::createClient($context, $clientName);
65
+				$client->setView(clone $view);
66 66
 				$client->process();
67 67
 
68 68
 				$result['aibody'][$clientName] = $client->getBody();
Please login to merge, or discard this patch.