Benny's Shopware Notebook
  • Introduction
    • How to Get in Touch
  • ddev for Shopware
    • Less than 5 Minutes Install with ddev and Symfony Flex
    • Storefront and Admin Watchers with ddev
    • Message Queue Setup with ddev
    • Contribute with ddev
    • Performance Tweaks
    • RabbitMQ with ddev
    • phpstan pro with ddev
    • Fetch Media from Production or Staging Server
  • Hosting
    • Setting up a Cloud Server with ddev
    • How to Trouble-shoot and Evaluate Environment Variables
    • Media URLs Out Of Sync between Servers
    • RabbitMQ
    • Running Shopware CE with PaaS
    • SFTP-Users
    • Basic-Auth for Shopware 6 with nginx
    • How to Avoid Failed Systemd Units
    • JWT-Secrets as Environment Variables
  • Deployment
    • Close-to-Zero Downtime Deployment
    • Docker-Images for Deployment with Gitlab-Runners
    • PHP Cache Related Issues
  • Development
    • Patching the Core
    • How to Discover Available Updates?
    • Local Testing of Shopware Commercial Features
  • Administration
  • Database
  • Migration
    • Side Effects
Powered by GitBook
On this page

Was this helpful?

  1. ddev for Shopware

phpstan pro with ddev

For phpstan pro see https://phpstan.org/blog/introducing-phpstan-pro. It's a great tool, it's monthly plan for developers should be worth it for most of us.

Unfortunately, at this point in time, phpstan pro is not fully compatible with ddev. The following guide thus just describes a workaround, restricted to be used with one ddev project at a time.

First, make sure you have composer required phpstan in your project.

Add a file .ddev/docker-compose.phpstan.yaml with the following content:

# .ddev/docker-compose.phpstan.yaml
services:
  web:
    volumes:
      - ~/phpstan-pro:/tmp/phpstan-fixer
    environment:
      - PHPSTAN_PRO_WEB_PORT=11111
    ports:
      - 127.0.0.1:11111:11111

Restart ddev. Start phpstan with a command like:

ddev exec vendor/bin/phpstan analyse --pro

You should see something like:

Running in Docker? Don't forget to do these steps:
1) Publish this port when running Docker:
   -p 127.0.0.1:11111:11111
2) Map the temp directory to a persistent volume
   so that you don't have to log in every time:
   -v ~/.phpstan-pro:/tmp/phpstan-fixer

Open your web browser at: http://127.0.0.1:11111
Press [Ctrl-C] to quit.
PreviousRabbitMQ with ddevNextFetch Media from Production or Staging Server

Last updated 6 months ago

Was this helpful?

Now simply point your browser to - after login/registration, you will be redirected to phpstan pro's dashboard.

http://127.0.0.1:11111