Preheat the oven to 200°C/390°F, or 180°C fan-forced.
Mix the spinach, ricotta, cheddar, Parmesan, egg, garlic, salt, and pepper until combined.
Cut each puff pastry sheet into 9 equal squares.
Generously oil 18 muffin tin holes and press a pastry square into each.
Divide the filling among the pastry cups.
Bring the four pastry corners into the centre and pinch to seal, leaving some spinach visible.
Brush the pastry tops lightly with egg yolk.
Bake for 25 minutes, adding about 5 minutes to the partially filled tin if needed, until deep golden and crisp.
Rest for 5 minutes, then remove and serve warm or at room temperature.