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

CategoryFixture::getUrlKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
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