Design Patterns for Fun and Proficiency
The Decorator Pattern
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

Suppose the following class exists:

class Bakery
{
    public function bakeBread(string $type): Bread
    {
        // ...
    }
}

How could we decorate this to do something after a bread is baked?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.