Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
48 | public function setPalette(PaletteInterface $palette) |
||
49 | { |
||
50 | if ($this->getColorSpace() === $palette->getColorSpace()) { |
||
51 | return $this; |
||
52 | } |
||
53 | |||
54 | if (null === $this->getColorProfile()) { |
||
55 | $this->setColorProfile($this->getPalette()->getColorProfile()); |
||
56 | } |
||
57 | |||
58 | $this->setColorProfile($palette->getColorProfile()); |
||
|
|||
59 | $this->setColorSpace($palette->getColorSpace()); |
||
60 | |||
61 | return $this; |
||
62 | } |
||
63 | } |
||
64 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: