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 | $params = ['page' => 'page-index']; |
||
35 | |||
36 | foreach( app( 'config' )->get( 'shop.page.cms', ['cms/page', 'basket/mini'] ) as $name ) |
||
37 | { |
||
38 | $params['aiheader'][$name] = Shop::get( $name )->header(); |
||
0 ignored issues
–
show
|
|||
39 | $params['aibody'][$name] = Shop::get( $name )->body(); |
||
40 | } |
||
41 | |||
42 | return Response::view( Shop::template( 'page.index' ), $params ) |
||
43 | ->header( 'Cache-Control', 'private, max-age=10' ); |
||
44 | } |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Returns the html for the privacy policy page. |
||
49 | * |
||
50 | * @return \Illuminate\Contracts\View\View View for rendering the output |
||
51 | */ |
||
52 | public function privacyAction() |
||
53 | { |
||
54 | return View::make( Shop::template( 'page.privacy' ), ['page' => 'page-privacy'] ); |
||
55 | } |
||
56 | |||
57 | |||
58 | /** |
||
59 | * Returns the html for the terms and conditions page. |
||
60 | * |
||
61 | * @return \Illuminate\Contracts\View\View View for rendering the output |
||
62 | */ |
||
63 | public function termsAction() |
||
64 | { |
||
65 | return View::make( Shop::template( 'page.terms' ), ['page' => 'page-terms'] ); |
||
66 | } |
||
67 | } |
||
68 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.