Completed
Push — master ( bb9c1e...e0f733 )
by Tim
17:17
created

ProductController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A listAction() 0 4 1
A detailAction() 0 4 1
1
<?php
2
/**
3
 * product controller
4
 *
5
 * @author  Tim Lochmüller
6
 */
7
8
namespace FRUIT\Shopize\Controller;
9
10
use FRUIT\Shopize\Domain\Model\Product;
11
12
/**
13
 * product controller
14
 */
15
class ProductController extends AbstractController
16
{
17
18
    /**
19
     * Product repository
20
     *
21
     * @var \FRUIT\Shopize\Domain\Repository\ProductRepository
22
     * @inject
23
     */
24
    protected $productRepository;
25
26
    /**
27
     * List action
28
     */
29
    public function listAction()
30
    {
31
        $this->view->assign('products', $this->productRepository->findAll());
32
    }
33
34
    /**
35
     * Detail action
36
     *
37
     * @param \FRUIT\Shopize\Domain\Model\Product $product
38
     */
39
    public function detailAction(Product $product)
40
    {
41
        $this->view->assign('product', $product);
42
    }
43
}
44