[PSR-19] Tag for "exported" variables?

46 views
Skip to first unread message

Michele Locati

unread,
Dec 31, 2019, 12:11:03 PM12/31/19
to PHP Framework Interoperability Group
Let's assume this condition:

- we have a PHP file that defines some variables, but don't actually "use" them

- another PHP file includes that file, and uses the variables defined there.

Intelligent IDEs would mark the variables in the first file as "unused", and the variables in the second file as "undefined".

In the second case, we can add "@var" tags to tell the IDE that those variables are actually defined.

But what about the first file? Which tag could be used to tell the IDEs that a variable will be used elsewhere?

Alexander Makarov

unread,
Jan 9, 2020, 5:45:39 AM1/9/20
to PHP Framework Interoperability Group
That's valid use case for PHP templates and I don't think there's currently a tag for the purpose.

Michele Locati

unread,
Jan 9, 2020, 5:56:10 AM1/9/20
to PHP Framework Interoperability Group
What about introducing a new tag? What about @export ?

--
Michele
Reply all
Reply to author
Forward
0 new messages