The Polearm Master feat (PHB, p. 168) says:
While you are wielding a glaive, halberd, pike, or quarterstaff, other creatures provoke an opportunity attack from you when they enter your reach.
The War Caster feat (PHB, p. 170) says:
When a hostile creature's movement provokes an opportunity attack from you, you can use your reaction to cast a spell at the creature, rather than making an opportunity attack. The spell must have a casting time of 1 action and must target only that creature.
On this very topic, Mearls has said it requires an attack with the same weapon that's granting you the trigger:
Q: Do Polearm Master and War Caster combine to allow a magic user to make a spell opportunity attack when they enter reach?
A: No - polearm master applies only if you use the weapons it lists to make the attack
Another question on this very topic: Which is likely to provide more chances to opportunity attack, Polearm Master or Sentinel (with War Caster)?
But since then, we now have spells like booming blade (SCAG, p. 142):
As part of the action used to cast this spell, you must make a melee attack with a weapon against one creature within the spell’s range, otherwise the spell fails. On a hit, the target suffers the attack’s normal effects, and it becomes sheathed in booming energy until the start of your next turn. If the target willingly moves before then, it immediately takes 1d8 thunder damage, and the spell ends.
So, with the addition of booming blade, if I have a quarterstaff + War Caster + Polearm Master, could I use my reaction to cast booming blade if someone steps into my reach?