Code Duplication    Length = 16-16 lines in 2 locations

src/Controller/Jqadm.php 1 location

@@ 131-146 (lines=16) @@
128
	 * @param array $args Associative list of route parameters
129
	 * @return \Aimeos\Admin\JQAdm\Iface JQAdm client
130
	 */
131
	protected static function createClient( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
132
	{
133
		$resource = ( isset( $args['resource'] ) ? $args['resource'] : null );
134
		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
135
		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
136
137
		$templatePaths = $container->get( 'aimeos' )->getCustomPaths( 'admin/jqadm/templates' );
138
139
		$context = $container->get( 'aimeos_context' )->get( false, $args );
140
		$context = self::setLocale( $container->get( 'aimeos_i18n' ), $context, $site, $lang );
141
142
		$view = $container->get( 'aimeos_view' )->create( $request, $response, $args, $templatePaths, $lang );
143
		$context->setView( $view );
144
145
		return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource );
146
	}
147
148
149
	/**

src/Controller/Jsonadm.php 1 location

@@ 161-176 (lines=16) @@
158
	 * @param array $args Associative list of route parameters
159
	 * @return \Aimeos\Controller\JsonAdm\Iface JSON admin controller
160
	 */
161
	protected static function createController( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
162
	{
163
		$resource = ( isset( $args['resource'] ) ? $args['resource'] : null );
164
		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
165
		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
166
167
		$templatePaths = $container->get( 'aimeos' )->getCustomPaths( 'controller/jsonadm/templates' );
168
169
		$context = $container->get( 'aimeos_context' )->get( false, $args );
170
		$context = self::setLocale( $container->get( 'aimeos_i18n' ), $context, $site, $lang );
171
172
		$view = $container->get( 'aimeos_view' )->create( $request, $response, $args, $templatePaths, $lang );
173
		$context->setView( $view );
174
175
		return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource );
176
	}
177
178
179
	/**