Introducing PHPStan Pro—Save Your Keystrokes and Get More Productive!

September 29, 2020 · 7 min read

I’m really excited to show everyone what I’ve been working on for the past 9 months. It’s a new product aimed to enhance user experience when using PHPStan. I want to challenge a common presumption that developer tools like PHPStan are usually constrained to CLI, limiting their visual side, and possible interactions.

With PHPStan Pro you’ll be able to sift through reported errors much faster.

Web UI for browsing errors #

When you launch PHPStan Pro by adding --pro flag to the analyse command, it will automatically open your web browser with its user interface:

Instead of scrolling through a textual output of errors on the command line, you’ll get a beautiful interactive UI that allows you to go back and forth between files, and see the surrounding code. This is especially nice if you have a large number of errors.

Developers are also often slowed down by having to pull up the error location in their IDE manually – by searching for the file name and jumping to a specific line. PHPStan Pro will do that for you when you click this icon:

PHPStan Pro can also show you ignored errors, right where they’d be reported if they weren’t ignored:

Continuous analysis (watch mode) #

Once you fix all the found errors and achieve Error Zero, PHPStan Pro keeps running in the background, watching files, and re-running analysis each time it detects a change. There’s a loading indicator in the lower right corner for that:

Continuous analysis reflects and supports my preferred workflow when developing applications: when I realize that I have to pass an additional new value through multiple layers of a codebase, I start by changing method signatures – renaming them, adding parameters, changing return typehints. After that, I run PHPStan which essentially gives me a todo list of places to fix. But running PHPStan several times a minute to get instant feedback can become tedious. Having a persistent window that refreshes automatically and gives me an up-to-date view of the project is much nicer.

Migration wizards for improving your codebase #

Besides providing a beautiful web UI for browsing reported (and ignored) errors, PHPStan Pro now offers migration wizards to improve your code:

Wizards let you update various aspects of your codebase related to static analysis and leave it in a better state. They improve typehints and add PHPDocs that will make PHPStan understand your code better and find more issues.

Pricing #

I want to address the elephpant in the room. As the name suggests, PHPStan Pro is a paid add-on for the free open-source PHPStan project.

I believe that successful open-source projects should have a business model behind them so that their creators can justify spending time on their development.

As PHPStan gets more popular and more complex, it takes a lot of time every day to just stay on top of new issues, let alone work on something new and innovative. That’s why I’m creating something that people would only get if they pay for it, so I can work on PHPStan full-time and maybe even hire other developers to help me out. I’m in this for the long haul.

By paying for PHPStan Pro, you’re supporting the development of both open-source PHPStan and PHPStan Pro. The incentives for me to continue working on the free open-source PHPStan are greatly aligned – by improving it, it advances and improves the paid add-on as well. The advancements that happened this year are evidence of this – result cache, parallel analysis, and static reflection were all done in the anticipation of PHPStan Pro, but users have already been benefiting from them for months.

PHPStan Pro is priced very moderately because I’m betting that a large portion of its user base will find it appealing.

If you’re working alone as a freelancer or an independent developer, PHPStan will keep you company and help you every day for €7/month.

If you’re a team of developers, PHPStan Pro costs €70/month, and as many as 25 people can join a single team. That’s less than a day worth of salary of a single developer where I come from. [1] Great value for teams that use PHPStan to find and prevent bugs from reaching production!

If you decide to pay annually, you’ll get PHPStan Pro for 12 months for the price of 10 months – that’s €70/year for individual developers, €700/year for teams.

There’s a 30-day free trial period for all the plans. And there’s no limit on the number of projects - you can run PHPStan Pro on any code you have on your computer.

Start today! #

Make sure you have at least PHPStan 0.12.45 and launch PHPStan Pro by running the usual analyse command with one of these options:

  • --pro
  • --watch

They all do the same thing so you can choose which one you like. PHPStan will download the PHPStan Pro PHAR file and open your web browser pointing to a locally hosted website. After that, you can follow the on-screen instructions and create an account.

Keep in mind right now it’s really early in PHPStan Pro’s development life cycle. If you were a PHPStan user right after its initial release in December 2016, you’d remember it also didn’t do a lot but the main idea was there, ready to blossom.

I have plans on what to do next for both PHPStan and PHPStan Pro, but I rely on you to tell me what you want the most. Don’t hesitate to use the built-in “Send feedback” form to tell me what you think.

Thank you.
- Ondřej Mirtes

  1. I’m aware it can be as much as a day, and as little as an hour elsewhere in the world. ↩︎

© 2016–2024 Ondřej Mirtes