Overview for 'tomasvotruba'

Dependency Juggling Code Smell

Written by Tomáš Votruba / Original link on Apr. 26, 2021

The best way to pass dependencies is via constructor injection. Only in services, we need the dependency in. I've noticed that sometimes the dependency is passed way too early, just to be passed to another service as a method argument. Why is it a code smell, and how can we avoid it?

How can We use GitHub Actions in Gitlab?

Written by Tomáš Votruba / Original link on Apr. 19, 2021

One of my customers is building a monorepo, so we prepared a prototype on GitHub to test it out. It uses Monorepo Split GitHub Action and works well. You know I'm a big fan of GitHub, so when client asked me: "how can we do it in Gitlab?" I was like: "that's not possible... you need to switch to Gi…

How to Traverse PHPDoc and Modify It

Written by Tomáš Votruba / Original link on Mar. 29, 2021

Traversing and modifying PHP code is possible thanks to the amazing tool php-parser written by Nikita Popov. Rector can work thanks to node traverser, which can get to any node abstract syntax tree. Do you want to replace all numbers with 1000? I wrote about it in How to change PHP code with Abstra…