PHPackages                             blockstudio/phpstan - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. blockstudio/phpstan

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

blockstudio/phpstan
===================

PHPStan extension for Blockstudio with template typing, schema validation, block tag checks, and public API stubs.

v0.1.6(1mo ago)0440MITPHPPHP ^8.2

Since Apr 17Pushed 1mo agoCompare

[ Source](https://github.com/inline0/blockstudio-phpstan)[ Packagist](https://packagist.org/packages/blockstudio/phpstan)[ Docs](https://blockstudio.dev/docs/dev/phpstan)[ RSS](/packages/blockstudio-phpstan/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (8)Versions (8)Used By (0)

Blockstudio PHPStan Extension
=============================

[](#blockstudio-phpstan-extension)

PHPStan extension for [Blockstudio](https://blockstudio.dev). It adds type-safe template access, schema validation, hook checking, and stubs for the Blockstudio public PHP API.

Install
-------

[](#install)

```
composer require --dev blockstudio/phpstan
```

If you have [phpstan/extension-installer](https://github.com/phpstan/extension-installer)installed, the extension is auto-discovered. Otherwise, include it manually in your `phpstan.neon`:

```
includes:
  - vendor/blockstudio/phpstan/extension.neon
```

What it checks
--------------

[](#what-it-checks)

### Template field access

[](#template-field-access)

When a PHP file lives next to a `block.json`, the extension validates every `$a['key']` access against the block's declared attributes.

```
// blockstudio/hero/index.php
