mamuz / PhpDependencyAnalysis

Static code analysis to find violations in a dependency graph
http://mamuz.github.io/PhpDependencyAnalysis/
MIT License
561 stars 45 forks source link

Use a single file as the source #15

Closed fonsecas72 closed 8 years ago

fonsecas72 commented 8 years ago

Hi, I see that this library can only accept directories as the source. I can see that this makes sense. What do you think of also accept single files? Sometimes I have files with such an amount of dependencies that I'm only to understand its dependencies individually.

Another way of solving it: Could we possible generate multiple svgs in such situations? I mean, could we optionally generate a svg(target) for each file?

I know this may sound odd, but what do you think of it?

ghost commented 8 years ago

You can check only one file with this settings:

source: './src/AppBundle/Command'
filePattern: 'ImportAllCommand.php'

will check only one file.

I would make phpda to work with parameters passed. Like I want to check only one file, I pass it as a parameter. Configuration file should be something generic accepted, a convention like .phpda.yml in the root directory

bin/phpda analyze src/AppBundle/AppBundle.php

mamuz commented 8 years ago

@marius-rizac :+1: