Jump to content

Declare ProcessWire namespace but keep v2 compatability


Robin S
 Share

Recommended Posts

Without declaring the ProcessWire namespace at the top of a module file I don't get the benefit of code completion and warnings in my IDE (or rather I get a bunch of false-positive warnings without a namespace declared). So I'd like to declare it, but if I understand right this will make the module incompatible with PW 2.x. It would be great to be able to conditionally declare the namespace according to the PW version but that's not possible unfortunately.

I suppose I could declare the namespace and comment it out just before pushing to GitHub, but it would be easy to forget.

Any tips? Does anyone know if there's a way to indicate the namespace in a DocBlock comment so PhpStorm picks it up but it isn't an actual namespace declaration?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...