Scope and Downgrade your PHP Tools for Everyone to Use
Tomas Votruba Blog
by Tomas Votruba
3d ago
Yesterday, I came across a cool PHP tool. I wanted to try it, but the installation instructions were a bit tricky. The tool required a specific PHP version and a specific version of each dependency. It required Symfony 5.4+, but our project has Symfony 3.3. I was unable to use it. Many PHP tools suffer from the same issue, so I thought I'd share a way to do it better ..read more
Visit website
Awesome PHP Packages from Japan
Tomas Votruba Blog
by Tomas Votruba
1M ago
Last month, I spent in Japan to travel and absorb the local culture. I've also pinged a few friends I knew from Rector and AST projects in the past. I was surprised by how productive the PHP community is around here, with tools I'd personally use and ideas that inspire me ..read more
Visit website
How to reload code highlighter on Livewire 3 component update
Tomas Votruba Blog
by Tomas Votruba
1M ago
I use Livewire 3 for interactive forms and fast clickable maps. Last week, I worked on a filter page for the Rector website, where you can use text input to search for core and community rules. I typed "add param" to the input and got the results that best matched the rules I could use. But the code highlight was gone; what now? Current proposed solutions in Laracast/Livewire forums are miss-leading or using old Livewire 2 syntax, so I wanted to share the solution here to make it easier to find ..read more
Visit website
How to add visibility to 338 Class Constants in 25 seconds
Tomas Votruba Blog
by Tomas Votruba
1M ago
In PHP, we have classes with methods inside them. Would making all your methods `public` be a good idea? No, because some of them should be used only by the class they're in and not anywhere else. What about class constants ..read more
Visit website
Cool features of Swiss Knife
Tomas Votruba Blog
by Tomas Votruba
2M ago
When using a Swiss knife, we think of a tool with many practical abilities. They're useful for different situations we might experience in the wild. Opening a box of milk? Here is a knife. Cutting wood to start a fire? Here is a chainsaw. Are the letters on the paint bucket too tiny? Try this magnifying class. Now, we apply the same approach to PHP tooling ..read more
Visit website
How adding Type Declarations makes Your Code Dangerous
Tomas Votruba Blog
by Tomas Votruba
2M ago
and how to avoid it. [Type coverage](/blog/how-to-measure-your-type-coverage) is a way to gradually add type declarations to your PHP project—step by step, one by one. It's a PHPStan package that helps you maintain a specific minimal level from 0 % to 100 %. Once we reach high coverage of 80-90 %, we feel safer. But our code can actually be in worse, even dangerous, shape ..read more
Visit website
Master the Change
Tomas Votruba Blog
by Tomas Votruba
3M ago
When we upgrade a new project to the best version possible, the latest PHP and framework versions, it's not only about changing syntax sugar to a more fancy one. It's about the vast focus shift in project management so far. It's a change to master. I want to share the basic rules we apply to make the "impossible" upgrades successful and steady ..read more
Visit website
Finalize Classes - Automated and Safe
Tomas Votruba Blog
by Tomas Votruba
4M ago
Final classes have [many](https://ocramius.github.io/blog/when-to-declare-classes-final/) [great](https://tomasvotruba.com/blog/2019/01/24/how-to-kill-parents) [benefits](https://matthiasnoback.nl/2018/09/final-classes-by-default-why/) for future human readers of your code. They have even more benefits for static analysis and Rector rules. But what if we have a project with 1000+ classes and 10 minutes and want to automate the finalization process safely ..read more
Visit website
Rector Book 2024 Release with Brand new Chapter
Tomas Votruba Blog
by Tomas Votruba
6M ago
I'm happy to introduce the latest update to our book - *Rector, the Power of Automated Refactoring*, along with Rector version 0.19.5 from this week. This release includes 2 new commands, brand new configuration with smart IDE autocomplete, brand new chapter and DX improvements to help you master code refactoring with ease ..read more
Visit website
3 Signs Your Project is Becoming Legacy - Mock Rottening
Tomas Votruba Blog
by Tomas Votruba
6M ago
In [the first post](/blog/3-signs-your-project-is-becoming-legacy-and-how-to-avoid-them), we looked at the long-term effects of our decisions. Turning a legacy project into a fresh one is a matter of the "just do it" approach. But there are 3 things we should take with care even if our project seems outside the legacy project category. The second of those is mocks ..read more
Visit website

Follow Tomas Votruba Blog on FeedSpot

Continue with Google
Continue with Apple
OR