1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license MIT, http://opensource.org/licenses/MIT |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2015-2016 |
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\Response; |
16
|
|
|
|
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Aimeos controller for checkout related functionality. |
20
|
|
|
* |
21
|
|
|
* @package laravel |
22
|
|
|
* @subpackage Controller |
23
|
|
|
*/ |
24
|
|
|
class CheckoutController extends Controller |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* Returns the html for the checkout confirmation page. |
28
|
|
|
* |
29
|
|
|
* @return \Illuminate\Http\Response Response object with output and headers |
30
|
|
|
*/ |
31
|
|
|
public function confirmAction() |
32
|
|
|
{ |
33
|
|
|
$params = ['page' => 'page-checkout-confirm']; |
34
|
|
|
|
35
|
|
|
foreach( app( 'config' )->get( 'shop.page.checkout-confirm' ) as $name ) |
36
|
|
|
{ |
37
|
|
|
$params['aiheader'][$name] = Shop::get( $name )->header(); |
|
|
|
|
38
|
|
|
$params['aibody'][$name] = Shop::get( $name )->body(); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
return Response::view( Shop::template( 'checkout.confirm' ), $params ) |
|
|
|
|
42
|
|
|
->header( 'Cache-Control', 'no-store, max-age=0' ); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Returns the html for the standard checkout page. |
48
|
|
|
* |
49
|
|
|
* @return \Illuminate\Http\Response Response object with output and headers |
50
|
|
|
*/ |
51
|
|
|
public function indexAction() |
52
|
|
|
{ |
53
|
|
|
$params = ['page' => 'page-checkout-index']; |
54
|
|
|
|
55
|
|
|
foreach( app( 'config' )->get( 'shop.page.checkout-index' ) as $name ) |
56
|
|
|
{ |
57
|
|
|
$params['aiheader'][$name] = Shop::get( $name )->header(); |
|
|
|
|
58
|
|
|
$params['aibody'][$name] = Shop::get( $name )->body(); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
return Response::view( Shop::template( 'checkout.index' ), $params ) |
62
|
|
|
->header( 'Cache-Control', 'no-store, max-age=0' ); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Returns the view for the order update page. |
68
|
|
|
* |
69
|
|
|
* @return \Illuminate\Http\Response Response object with output and headers |
70
|
|
|
*/ |
71
|
|
|
public function updateAction() |
72
|
|
|
{ |
73
|
|
|
$params = ['page' => 'page-checkout-update']; |
74
|
|
|
|
75
|
|
|
foreach( app( 'config' )->get( 'shop.page.checkout-update' ) as $name ) |
76
|
|
|
{ |
77
|
|
|
$params['aiheader'][$name] = Shop::get( $name )->header(); |
|
|
|
|
78
|
|
|
$params['aibody'][$name] = Shop::get( $name )->body(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
return Response::view( Shop::template( 'checkout.update' ), $params ) |
82
|
|
|
->header( 'Cache-Control', 'no-store, max-age=0' ); |
83
|
|
|
} |
84
|
|
|
} |
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.