Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
46 | public function load(ObjectManager $manager) |
||
47 | { |
||
48 | $manager->persist($this->user); |
||
49 | $manager->flush(); |
||
50 | |||
51 | $booking = new Booking(); |
||
52 | $booking->setUser($this->user); |
||
53 | $booking->setDate($this->date); |
||
|
|||
54 | $manager->persist($booking); |
||
55 | |||
56 | $manager->flush(); |
||
57 | |||
58 | $this->booking = $booking; |
||
59 | } |
||
60 | |||
69 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.