Order-parameter symmetries of domain walls in ferroelectrics and ferroelastics