PHPnews.io

Overview for 'matthiasnoback'

On using PSR abstractions

Written by Matthias Noback / Original link on Aug. 19, 2021

Several years ago, when the PHP-FIG (PHP Framework Interop Group) created its first PSRs (PHP Standard Recommendations) they started some big changes in the PHP ecosystem. The standard for class auto-loading was created to go hand-in-hand with the then new package manager Composer. PSRs for coding…


Release of the Rector book

Written by Matthias Noback / Original link on Jun. 15, 2021

TLDR; Rector - The Power of Automated Refactoring is now 100% completed Tomas Votruba and I first met a couple of years ago at one of my favorite conferences; the Dutch PHP Conference in Amsterdam (so actually, we're very close to our anniversary, Tomas!). He presented Rector there and it was reall…


Don't test constructors

Written by Matthias Noback / Original link on May. 31, 2021

@ediar asked me on Twitter if I still think a constructor should not be tested. It depends on the type of object you're working with, so I think it'll be useful to elaborate here. Would you test the constructor of a service that just gets some dependencies injected? No. You'll test the behavior of…



Do tests need static analysis level max?

Written by Matthias Noback / Original link on Mar. 8, 2021

I recently heard this interesting question: if your project uses a static analysis tool like PHPStan or Psalm (as it should), should the tests by analysed too? The first thing to consider: what are potential reasons for not analysing your test code? Why not? 1. Tests are messy in terms of types Tes…