Issues (121)

src/Aimeos/Shop/Controller/PageController.php (2 issues)

1
<?php
2
3
/**
4
 * @license MIT, http://opensource.org/licenses/MIT
5
 * @copyright Aimeos (aimeos.org), 2015-2021
6
 * @package laravel
7
 * @subpackage Controller
8
 */
9
10
11
namespace Aimeos\Shop\Controller;
12
13
use Aimeos\Shop\Facades\Shop;
14
use Illuminate\Routing\Controller;
15
use Illuminate\Support\Facades\View;
16
use Illuminate\Support\Facades\Response;
17
18
19
/**
20
 * Aimeos controller for support page request.
21
 *
22
 * @package laravel
23
 * @subpackage Controller
24
 */
25
class PageController extends Controller
26
{
27
	/**
28
	 * Returns the html for the content pages.
29
	 *
30
	 * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output
31
	 */
32
	public function indexAction()
33
	{
34
		foreach( app( 'config' )->get( 'shop.page.cms', ['cms/page', 'basket/mini'] ) as $name )
35
		{
36
			$params['aiheader'][$name] = Shop::get( $name )->header();
37
			$params['aibody'][$name] = Shop::get( $name )->body();
38
		}
39
40
		return Response::view( Shop::template( 'page.index' ), $params )
0 ignored issues
show
Comprehensibility Best Practice introduced by Andreas
The variable $params seems to be defined by a foreach iteration on line 34. Are you sure the iterator is never empty, otherwise this variable is not defined?
Loading history...
The method template() does not exist on Aimeos\Shop\Facades\Shop. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

40
		return Response::view( Shop::/** @scrutinizer ignore-call */ template( 'page.index' ), $params )
Loading history...
41
			->header( 'Cache-Control', 'private, max-age=10' );
42
	}
43
44
45
	/**
46
	 * Returns the html for the privacy policy page.
47
	 *
48
	 * @return \Illuminate\Contracts\View\View View for rendering the output
49
	 */
50
	public function privacyAction()
51
	{
52
		return View::make( Shop::template( 'page.privacy' ) );
53
	}
54
55
56
	/**
57
	 * Returns the html for the terms and conditions page.
58
	 *
59
	 * @return \Illuminate\Contracts\View\View View for rendering the output
60
	 */
61
	public function termsAction()
62
	{
63
		return View::make( Shop::template( 'page.terms' ) );
64
	}
65
}
66