Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 12 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
48 | public function removeProperty(Property $property): self |
||
49 | { |
||
50 | if ($this->properties->contains($property)) { |
||
51 | $this->properties->removeElement($property); |
||
52 | // set the owning side to null (unless already changed) |
||
53 | if ($property->getCategory() === $this) { |
||
54 | $property->setCategory(null); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | return $this; |
||
59 | } |
||
60 | } |
||
61 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.