Issues (34)

src/Controller/BasketController.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * @license MIT, http://opensource.org/licenses/MIT
5
 * @copyright Aimeos (aimeos.org), 2014-2016
6
 * @package symfony
7
 * @subpackage Controller
8
 */
9
10
11
namespace Aimeos\ShopBundle\Controller;
12
13
use Symfony\Component\HttpFoundation\Response;
14
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
15
16
17
/**
18
 * Aimeos controller for basket related functionality.
19
 *
20
 * @package symfony
21
 * @subpackage Controller
22
 */
23
class BasketController extends AbstractController
24
{
25
	/**
26
	 * Returns the html for the standard basket page.
27
	 *
28
	 * @return Response Response object containing the generated output
29
	 */
30
	public function indexAction( \Twig\Environment $twig ) : Response
31
	{
32
		$params = [];
33
		$shop = $this->container->get( 'shop' );
34
35
		foreach( $this->container->getParameter( 'aimeos_shop.page' )['basket-index'] as $name )
0 ignored issues
show
The method getParameter() does not exist on Psr\Container\ContainerInterface. It seems like you code against a sub-type of Psr\Container\ContainerInterface such as Symfony\Component\Depend...tion\ContainerInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

35
		foreach( $this->container->/** @scrutinizer ignore-call */ getParameter( 'aimeos_shop.page' )['basket-index'] as $name )
Loading history...
36
		{
37
			$params['aiheader'][$name] = $shop->get( $name )->header();
38
			$params['aibody'][$name] = $shop->get( $name )->body();
39
		}
40
41
		return new Response(
42
			$twig->render( '@AimeosShop/Basket/index.html.twig', $params ),
43
			200, ['Cache-Control' => 'no-store, , max-age=0']
44
		);
45
	}
46
}
47