Issues (74)

src/Aimeos/Shop/Controller/SupplierController.php (1 issue)

Check for undefined variables.

Best Practice Comprehensibility Minor
1
<?php
2
3
/**
4
 * @license MIT, http://opensource.org/licenses/MIT
5
 * @copyright Aimeos (aimeos.org), 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 supplier related functionality.
20
 *
21
 * @package laravel
22
 * @subpackage Controller
23
 */
24
class SupplierController extends Controller
25
{
26
	/**
27
	 * Returns the html for the supplier detail page.
28
	 *
29
	 * @return \Illuminate\Http\Response Response object with output and headers
30
	 */
31
	public function detailAction()
32
	{
33
		foreach( app( 'config' )->get( 'shop.page.supplier-detail' ) as $name )
34
		{
35
			$params['aiheader'][$name] = Shop::get( $name )->header();
36
			$params['aibody'][$name] = Shop::get( $name )->body();
37
		}
38
39
		return Response::view( Shop::template( 'supplier.detail' ), $params )
0 ignored issues
show
Comprehensibility Best Practice introduced by Andreas
The variable $params seems to be defined by a foreach iteration on line 33. Are you sure the iterator is never empty, otherwise this variable is not defined?
Loading history...
40
			->header( 'Cache-Control', 'private, max-age=10' );
41
	}
42
}