# phpstan pro with ddev

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:

```yaml
# .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:&#x20;

```bash
ddev exec vendor/bin/phpstan analyse --pro
```

You should see something like:

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

Now simply point your browser to <http://127.0.0.1:11111> - after login/registration, you will be redirected to phpstan pro's dashboard.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notebook.vanwittlaer.de/ddev-for-shopware/phpstan-pro-with-ddev.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
