Set-theoretic solutions of the Yang–Baxter equation associated to weak braces