tomasvotruba.com

Cool features of Swiss Knife (tomasvotruba.com)

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...

Get Quick Error Count for each PHPStan level (tomasvotruba.com)

When I come to a new project, I want to make a rough idea of what I'm dealing with in a few minutes. I usually check composer.json and measure the lines. Then, I'd love to run PHPStan and get a rough idea of the current state. But are there baselines, custom extensions, global ignores, or no PHPStan at all?

How adding Type Declarations makes Your Code Dangerous (tomasvotruba.com)

...and how to avoid it. 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,...

Master the Change (tomasvotruba.com)

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...

Rector Book 2024 Release with Brand new Chapter (tomasvotruba.com)

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.

3 Signs Your Project is Becoming Legacy - Mock Rottening (tomasvotruba.com)

In the first post, 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.

Get Json output for PHPUnit 10 (tomasvotruba.com)

Early this year, I created a few custom Rector rules for our client. It modified the code based on the PHPUnit error result report. The only problem is that PHPUnit outputs a string. So, I had to parse it manually with regexes. Having a JSON output would make my life easier. I'm used to PHP tools that provide the JSON out of the...

3 Signs Your Project is Becoming Legacy - Arrays Creep (tomasvotruba.com)

In the first post, 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. First of those are arrays.

How to Autowire Multiple Instances of Same Type in Symfony/Laravel (tomasvotruba.com)

Do you work with Symfony since 2 through 7? Then you know the main challange in the upgrade path is to trim your YAML configs to minimum. Where we needed 300 lines in YAML configs, we now need 2 lines. How to get there fast and reliable? I'll show 3 trick we use in Symfony project to get there.

Unleash the Power of Simplicity: PHP CLI App with Minimal Dependencies (tomasvotruba.com)

I have a couple of open-source CLI apps like Rector, ECS, Class Leak, Config Transformer, Monorepo Builder and Lines, and private ones like Cleaning Checklist, Fixai, Private Rector and Entropy. All of them run in the command line, and some of them are downgraded to PHP 7.2. In every project, there is the rule, the fewer...

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • mdbf
  • Youngstown
  • InstantRegret
  • ethstaker
  • slotface
  • PowerRangers
  • Durango
  • vwfavf
  • kavyap
  • tsrsr
  • ngwrru68w68
  • DreamBathrooms
  • everett
  • Leos
  • magazineikmin
  • rosin
  • tacticalgear
  • thenastyranch
  • osvaldo12
  • GTA5RPClips
  • khanakhh
  • cisconetworking
  • modclub
  • cubers
  • tester
  • normalnudes
  • provamag3
  • All magazines