Completed
Push — master ( af42cb...3888f0 )
by Julito
13:17
created

LearnPathCategory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A show() 0 4 1
A __construct() 0 6 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Component\CourseCopy\Resources;
5
6
use Chamilo\CourseBundle\Entity\CLpCategory;
7
8
/**
9
 * Class LearnPathCategory.
10
 *
11
 * @package Chamilo\CourseBundle\Component\CourseCopy\Resources
12
 */
13
class LearnPathCategory extends Resource
14
{
15
    /**
16
     * @var CLpCategory
17
     */
18
    public $object;
19
20
    /**
21
     * @param int    $id
22
     * @param string $object
23
     */
24
    public function __construct(
25
        $id,
26
        $object
27
    ) {
28
        parent::__construct($id, RESOURCE_LEARNPATH_CATEGORY);
29
        $this->object = $object;
0 ignored issues
show
Documentation Bug introduced by
It seems like $object of type string is incompatible with the declared type Chamilo\CourseBundle\Entity\CLpCategory of property $object.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30
    }
31
32
    /**
33
     * Show this resource.
34
     */
35
    public function show()
36
    {
37
        parent::show();
38
        echo $this->object->getName();
39
    }
40
}
41