Don't get doored! Really. There is a danger zone for cyclists next to parked cars.
For your own safety, ride at least one metre away from motor vehicles. That is the only way to prevent getting doored – and it works. Don't let anyone push you any closer. Take the lane, don't fear for intimidation, the vast majority of drivers understand why you do this. That way, even if a motorist opens a door without warning, you're far enough away to avoid it. If you need to move left to do this, remember to signal and shoulder check first.
A car door springs open in only a few seconds. If a cyclist is passing by at that moment close to the car, the cyclist cannot avoid the door, and will be knocked off balance or onto the ground, leading to serious injuries and possibly death. This is a major cause of collisions. In Toronto, it is the most common cause of downtown cycling collisions.
Unfortunately, it's impossible for cyclists to see in advance whether a vehicle door is about to open. Tinted windows and high headrests make it impossible to see from behind if a car is occupied, and a door flies open in only a few seconds – not enough time to react.
You (and your passengers) are responsible for checking for traffic – including cyclists – before opening a car door. And you will be charged under section 165 of the Highway Traffic Act if you cause a collision because you didn't check.
If you see cyclists riding one metre away from parked cars, please do not honk or yell at them for riding there, even if they slow you down for a brief time. This is a safety issue and cyclists need to stay out of this danger zone.