Skip to content

Commit

Permalink
add trouble shooting
Browse files Browse the repository at this point in the history
  • Loading branch information
nazonohito51 committed Apr 6, 2019
1 parent cfa6135 commit 0291726
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions README.md
Expand Up @@ -173,6 +173,77 @@ Every command have verbose option. So use it, check error detail.
PHPStan need autoloader (likely `vendor/autoload.php` ) of repository.
So, current working directory is must repository root.

### Rule violation was not detected
#### Define rule by phpdoc(`@canOnlyUsedBy`)
There are two possible causes.

The first possibility is that the dependency is not analyzed correctly.
Output a graph, and check that the analysis result is what you expected.
If it is different, the target code is that can not be statically analyzed, or a bug of this library.

```bash
php vendor/bin/analyze-deps graph --output ./graph.puml ./some/analyze/dir1 ./some/analyze/dir2
```

The second possibility is that this library can not collect phpdoc(`@canOnlyUsedBy`).
Use verify command with `-v` option.
You can check the final rule definition.

```bash
php vendor/bin/analyze-deps verify -v ./some/analyze/dir1 ./some/analyze/dir2
```


If you do not find a rule definition like below, this library have failed to collect phpdoc.
Please adjust the position of phpdoc, or check typo.

```bash
Defined rules:
array (
'phpdoc in Your\\Class\\Name\\Have\\Phpdoc' =>
array (
'phpdoc' =>
array (
'define' =>
array (
'include' =>
array (
0 => 'Your\\Class\\Name\\Have\\Phpdoc',
),
'exclude' =>
array (
),
),
'depender' =>
array (
'include' =>
array (
0 => 'Your\\Definition1\\In\\Phpdoc',
1 => 'Your\\Definition2\\In\\Phpdoc',
),
'exclude' =>
array (
),
),
),
'other' =>
array (
'define' =>
array (
'include' =>
array (
),
'exclude' =>
array (
0 => 'Your\\Definition1\\In\\Phpdoc',
1 => 'Your\\Definition2\\In\\Phpdoc',
),
),
),
),
)
```

## Advanced Usages
### Create dependency graph
TBD...
Expand Down

0 comments on commit 0291726

Please sign in to comment.