mmcev106/psalm-playground-plugins

A tool for learning how to write Psalm plugins

dev-main 2023-04-17 23:29 UTC

This package is not auto-updated.

Last update: 2024-12-13 02:42:47 UTC


README

These Psalm plugins aim to provide a playground that makes it easy to learn more about how to create Psalm plugins. By default they print each location analyzed by Psalm, and can be modified to quickly test the result of any desired action in any of Psalm's API interfaces.

To see these plugins in action:

  1. Clone this repo
  2. Run composer install
  3. Run psalm --no-cache to see a trace of example.php including lines & positions from which each of Psalm's API events are fired
  4. Modify these plugins to learn whatever you like! Suggestions include but are not limited to...
    • Include your own code in example.php to learn more about how Psalm steps through it
    • Modify these plugins to perform any action you like to aid in learning how to write your own plugins
    • Include these plugins in your own projects to see how Psalm steps through them
    • Modify these plugins in your own projects to only show traces and/or perform actions relevant to your own goals
    • Use the static::dump() method to get details about any Psalm class.