MetaStorm – let your library help your IDE

MetaStorm – a PHPStorm plugin helps devs to let libs contribute IDE suggestions, references and any possible enhancements.

How it works?

  • Create a .meta-storm.xml file
  • Define basic configurations
  • Use them from the code

What’s available?

You may configure the following suggestions:

  • Methods names (with the reference to the target)
  • Properties names (with the reference to the target)
  • Files paths, as relatives as “absolutes” (with the reference to the target)
  • Directories paths, almost the same as Files paths
  • Database tables (with the reference to the target)
  • Columns coming soon
  • ENV variables (from .env files and putenv()) (with the reference to the target)
  • Simple scalar values: media types / html tags / http methods
  • Code entities: full qualified names of classes / interfaces / functions / traits
  • Collecting Attributes and pasting references to them in your code: mark #[Command(“app:index”)] and have reference from the string literal “app:index”
  • Changing icon for your own tool: change yii.php to Yii Framework icon, or .rector.php config file to Rector icon

Example
In PHP, as well as many other languages, you may write code like so:


function getAttributeValue(object $object, string $property): mixed {
  return $object->$property;
}

This snippet allows you to get a property value in a flexible way:


$user = new User;
$user->name = "Dmitrii";

echo getAttributeValue($user, "name"); // output "Dmitrii"
echo getAttributeValue($user, "firstName"); // fail here because no "name" property in the class User

If we design our library to accept some limited set of values, why can’t we suggest what values are possible?

This was original goal for MetaStorm.

Discover examples and see how it works: Code search results · GitHub

Btw, Yii2 became interactive than ever!

1 Like