Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally ignore deprecated structural elements #37

Open
GaryJones opened this issue Feb 10, 2014 · 6 comments
Open

Optionally ignore deprecated structural elements #37

GaryJones opened this issue Feb 10, 2014 · 6 comments

Comments

@GaryJones
Copy link
Member

Since functions, methods and classes can have the @deprecated tag, some may want to only include the non-deprecated stuff in the final import. An --ignore-deprecated=true (default = false) flag when generating the JSON file would be handy, and would be handled in a similar way to how the @internal tag is supported.

Vaguely related: #11.

@Rarst
Copy link
Contributor

Rarst commented Feb 24, 2014

Had you seen specific use cases or just hypothetical? I would think deprecated code is still important to be in reference, it's omission could be very confusing.

@GaryJones
Copy link
Member Author

The Genesis Framework has a deprecated.php file where each and every function inside of it is tagged with @deprecated. The same would apply to the contents of wp-includes/deprecated.php.

Some codebases being parsed by WP-Parser would most definitely not want deprecated functions included, since they've been deprecated for a reason, to avoid increasing their visibility. Others, like you, think that they should still be included (you're wrong btw ;-) ), hence the usefulness of an option that can include or exclude them.

For instance, although wp_get_linksbyname(), user_can_delete_post_comments(), get_the_author_msn() and permalink_link() (among others) all exist in WP, I wouldn't expect DevHub to be making anyone aware of their existence, because they are deprecated.

@Rarst
Copy link
Contributor

Rarst commented Feb 25, 2014

I find limiting information about source counter-productive. You cannot hide deprecated from people, they will encounter it anyway and need to be educated about it.

How do you expect someone to move on from using deprecated function without documenting that it is deprecated and providing recommended replacement?

DevHub will absolutely be including them, so does QueryPosts.

On that note I don't see this as part of parsing process. I don't remember if deprecated stuff is properly detected and meta-data-ed now (probably not), but it will be. From there you can do what you want with data parser gives you, such as not showing deprecated items or blocking their creation altogether.

In a nutshell we can make convenient to get rid of them, just not via complicating parsing stage.

@GaryJones
Copy link
Member Author

I'd be expecting the parser to work the same as how the optional @internal flag already works.

@Rarst
Copy link
Contributor

Rarst commented Feb 25, 2014

I am afraid to look how that is, but I'll probably have to later. :)

@GaryJones
Copy link
Member Author

#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants