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

Allow using composer config to guess settings #73

Open
nochso opened this issue Jan 17, 2016 · 2 comments
Open

Allow using composer config to guess settings #73

nochso opened this issue Jan 17, 2016 · 2 comments

Comments

@nochso
Copy link
Contributor

nochso commented Jan 17, 2016

I'd like to suggest a new option to parse a projects composer.json:

--composer [optional path to file]

  • All paths from the autoload section will be automatically included in a search.
  • autoload-dev could be used to exclude, as this usually points to tests and not a public API.
  • If the path is not specified, look for a composer.json in source-before/after folders.

This should help with #69 Adding/Removing a class supertype:
Instead of starting to scan all files, take the fully qualified name of the supertype and map it using the autoload mapping. I've already written such a mapper and I'd be happy to share it: given a composer.json and a FQN it will return the filepath (supports PSR-0 and PSR-4).
That way you can keep parsing only relevant files.

Also makes setup easier for a lot of users, as composer is everywhere :)

@tomzx
Copy link
Owner

tomzx commented Jan 18, 2016

It is true that by assuming a PSR-0/4 compliant code it may be easier to determine the parent classes in a hierarchy.

I do agree that using composer.json to tell us about the known namespaces might allow us to "ease" the duplication of information that might be in php-semver-checker configuration file.

@tomzx tomzx added this to the Candidate for next Minor milestone Jan 23, 2016
@nochso
Copy link
Contributor Author

nochso commented Jan 23, 2016

I'll give this a try next so we can begin solving #69.

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