Geni Jahoblog.genijaho.dev·Jun 20, 2023Speed up GitHub Actions by caching Composer, Rector, & PintGitHub's 2000 minutes per month of free usage of GitHub Actions is usually enough to handle light workflows. However, as more tech is run automatically, we are forced to upgrade to a paid plan or optimize our workflows. Currently, I am running Rector...2.1K readsPHP
Geni Jahoblog.genijaho.dev·Apr 8, 2023Doing stricter checks in PHPA nice refactoring I've learned recently is to utilize types in conditionals. For years I’ve been doing if (!empty($posts)), but Rector, a tool to automatically refactor code, changed that to if ($posts === []). The main advantage of using $posts ===...1.2K readsPHP
Geni Jahoblog.genijaho.dev·Feb 26, 2023Upgrading to Eloquent accessors & mutators from Laravel 9Laravel 10 is making the headlines these days. However, many apps are stuck in older versions, or at least still use the syntax and methods of older releases. One of the most significant changes introduced in Laravel 9 is the syntax for accessors and...1.1K readsRectorPHP
Geni Jahoblog.genijaho.dev·Sep 24, 2022Safely upgrade from PHP 7.4 to 8.1 using RectorI have to say it from the start, the only thing that comes close to safely upgrading a codebase is having a solid set of automated tests. Nothing gives you more comfort than a bunch of green checkmarks dancing on the screen. With that said, we're goi...1 like·5.2K readsRectorPHP
Geni Jahoblog.genijaho.dev·Sep 4, 2022Refactoring #8: What is dead may never runIt's important to take a good look at your code and clean up when you're done with it. Once in a while, we tend to forget this little detail and just move on, leaving behind trails of unreachable statements. Here's a very blatant example of a dead pi...355 readsRectorPHP
Geni Jahoblog.genijaho.dev·Aug 31, 2022Refactoring #7: Upping the coding style game in PHP using RectorContinuing from the last post, we're now exploring other Rector configurations that help us improve our code. It's funny actually, Rector is a refactoring tool, but I'd be lying if I didn't use it to learn a good practice or two. Really, they have a ...637 readsRectorPHP
Geni Jahoblog.genijaho.dev·Aug 11, 2022Refactoring #6: Improve Code Quality in Laravel using RectorI recently discovered Rector and was completely blown away by its power and effectiveness. The promise is simple: you install and run the package, you get instant automated upgrades and refactorings. Damn, that's bold, I thought as I dry ran it into ...1.3K readsRectorPHP