Passed
Push — master ( 9955bf...fc8eee )
by Fabian
03:50
created

CategoryFixture   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getUrlKey() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
namespace TddWizard\Fixtures\Catalog;
4
5
use Magento\Catalog\Api\Data\CategoryInterface;
6
use Magento\Catalog\Model\Category;
7
8
class CategoryFixture
9
{
10
    /**
11
     * @var CategoryInterface
12
     */
13
    private $category;
14
15
    public function __construct(CategoryInterface $category)
16
    {
17
        $this->category = $category;
18
    }
19
20
    public function getId() : int
21
    {
22
        return $this->category->getId();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->category->getId() could return the type null which is incompatible with the type-hinted return integer. Consider adding an additional type-check to rule them out.
Loading history...
23
    }
24
25
    public function getUrlKey() : string
26
    {
27
        /** @var Category $category */
28
        $category = $this->category;
29
        return $category->getUrlKey();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $category->getUrlKey() could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
30
    }
31
}
32