You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
blockstudio/phpstan: report unknown field properties in block.json and field.json #190
BlockJsonShapeRule and FieldJsonShapeRule check a field's type and the nesting of containers, but not its properties. A misspelled property passes the analysis and then silently does nothing.
Example from a theme on 7.7.9 with blockstudio/phpstan 0.1.10: a text field with "translat": false instead of "translate": false. The analysis reports nothing, wp bs wpml config declares the field as translatable again, and nothing points at the typo. The same happens with editor texts such as textRemov, textMinimized on the wrong field type, or minimized on a non-repeater.
schemas/block.json already lists the properties of each field type (and is additionalProperties-closed only in a few places), so the rules could report a property that the schema does not know for that type, with the closest known name as a suggestion, similar to the existing "Did you mean" for $a['…'] access. For example:
block.json field "konto" has unknown property "translat". Did you mean "translate"?
Questions before I send a PR:
Is the schema the right source of truth for the allowed properties per type, or is there a list in PHP you would rather use?
Should unknown properties be an error, or a separate identifier (for example blockstudio.blockJson.unknownProperty) so projects with custom keys can ignore it?
Custom field types from bs_register_field_type(): skip them, or check only the shared properties (id, label, help, conditions, …)?
Unknown and misplaced built-in field properties are now reported in block.json and field.json, including nested fields, with type-aware typo suggestions and separately suppressible diagnostic identifiers. Implemented by #192, with schema alignment in #191.
Activity
dnnsjsk commentedon Oct 28, 2026
Released in Blockstudio PHPStan 0.1.12, alongside Blockstudio 7.7.10.
Unknown and misplaced built-in field properties are now reported in
block.jsonandfield.json, including nested fields, with type-aware typo suggestions and separately suppressible diagnostic identifiers. Implemented by #192, with schema alignment in #191.Update the standalone extension with:
The complete CI and distribution checks passed.