Bright and dark soliton solutions for variable-coefficient diffusion–reaction and modified Korteweg–de Vries equations