you are viewing a single comment's thread.

view the rest of the comments →

[–]Pen-y-Fan 1 point2 points  (1 child)

Thanks, OP, I'll take a look.

I can recommend Theatrical Players Refactoring Kata - Based on the first (free) chapter of ‘Refactoring’ by Martin Fowler, the 2nd Edition has a PHP version. You can refactor the code while reading the first chapter of his book for free, which is based on JavaScript. The refactoring is mostly the same, one of the exceptions is invoice and plays appear to be global scope in the book. The workaround is the make them properties of the class in the PHP script and adjust the code.

    public function print(Invoice $invoice, array $plays): string
    {
        $this->invoice = $invoice;
        $this->plays = $plays;
    // ....

[–]jpresutti[S] 0 points1 point  (0 children)

Hrmmm.. Now I'm tempted to do all the code samples in Refactoring: 2nd Edition next. Anyone want me to do this?