 [ ← blog / drupal ](/) Dec 16, 2019  ·  \#drupal  ·  2 min read 

# PHPStan Drupal 0.12.0 released!



      ![laptop with code](/sites/default/files/styles/large/public/2019-12/jantine-doornbos-xt9tb6oa42o-unsplash.jpg?itok=nHk9MsHK) 

 

🥳Six days after starting on the [PHPStan 0.12.0 release compatibility](/blog/phpstan-drupal-detecting-deprecated-constants-and-preparing-phpstan-012-support "PHPStan Drupal: detecting deprecated constants and preparing for PHPStan 0.12 support"), the PHPStan Drupal extension is now working. The [phpstan-drupal:0.12.0 release](https://github.com/mglaman/phpstan-drupal/releases/tag/0.12.0) is now available. It required some reengineering, though. Thanks to [Ondřej Mirtes](https://twitter.com/OndrejMirtes) for giving the code a review and pull request to fix my parameters schema 🙏. There should be no impact on your Drupal projects, these were all changes to meet refactoring within PHPStan.

However, there were *some* changes. PHPStan Drupal allowed you to specify a ***drupal\_root*** parameter that pointed PHPStan to your Drupal build It is now ***drupal.drupal\_root***, nested up the ***drupal*** parameter.

For example

```
# phpstan.neon
parameters:
    drupal:
        drupal_root: /path/to/drupal
```

If you provide entity type managers, mappings, you just need to move the data from the root **drupal** definition under parameters. Here's an example

```
parameters:
    drupal:
        entityTypeStorageMapping:
            search_api_index: Drupal\search_api\Entity\SearchApiConfigEntityStorage
            search_api_server: Drupal\search_api\Entity\SearchApiConfigEntityStorage
```

Give it a spin! [drupal-check](https://github.com/mglaman/drupal-check) will be updated in the next coming days as well. There are currently some unexpected failures. You can track the following pull request: <https://github.com/mglaman/drupal-check/pull/119>

I have also opened an [issue and made a patch for the Upgrade Status module](https://www.drupal.org/project/upgrade_status/issues/3101448) to support the new version, as well.

Has drupal-check or PHPStan helped you out?

- Visit [Ondréj's Patreon page](https://www.patreon.com/phpstan) to sponsor the development of PHPStan.
- Visit my [GitHub Sponsors page](https://github.com/sponsors/mglaman) and support my coffee fund.

Photo by [Jantine Doornbos](https://unsplash.com/@jantined?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/code?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)

 

  ![](/themes/custom/mglaman/images/headshot.webp)Thanks for reading

I write about Drupal, PHP, and the quiet infrastructure behind large sites — caching, config, and testing. New posts land every week or two.

 [Subscribe via RSS →](/rss.xml) [About me →](/about-me) 

 



 

  [← Older

Using onCreateNode to combine Drupal bundle schema types in GatsbyJS

 ](/blog/using-oncreatenode-combine-drupal-bundle-schema-types-gatsbyjs) [Newer →

ContribKanban v3, 2020 update

 ](/blog/contribkanban-v3-2020-update)