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

Syntax error thrown due to invalid subgraph groupid #51

Open
buddh4 opened this issue Jun 5, 2020 · 0 comments
Open

Syntax error thrown due to invalid subgraph groupid #51

buddh4 opened this issue Jun 5, 2020 · 0 comments

Comments

@buddh4
Copy link

buddh4 commented Jun 5, 2020

My Environment

My phpda.yml:

mode: 'usage'
source: 'src'
filePattern: '*.php'
ignore: 'tests'
formatter: 'PhpDA\Writer\Strategy\Svg'
target: './phpda.svg'
groupLength: 1
visitor:
  - PhpDA\Parser\Visitor\TagCollector
  - PhpDA\Parser\Visitor\SuperglobalCollector
visitorOptions:
  PhpDA\Parser\Visitor\Required\DeclaredNamespaceCollector: {minDepth: 2, sliceLength: 2}
  PhpDA\Parser\Visitor\Required\MetaNamespaceCollector: {minDepth: 2, sliceLength: 2}
  PhpDA\Parser\Visitor\Required\UsedNamespaceCollector: {minDepth: 2, sliceLength: 2}
  PhpDA\Parser\Visitor\TagCollector: {minDepth: 2, sliceLength: 2}

When I run this command:

.\vendor\bin\phpda.bat analyze phpda.yml

Actual behavior:

Error:

Write dependency graph to C:\xxx\./phpda.svg
Error: C:\xxx\AppData\Local\Temp\graE965.tmp: syntax error in line 3 near '-1'

Temp file:

digraph {
  graph [rankdir="LR" ranksep=1 nodesep=0.1 fontsize=8 label="PhpDependencyAnalysis by Marco Muths (dev-master)"]
  subgraph cluster_-1 {
...

It seems that graphviz does not accept group ids like subgraph cluster_-1:

When I remove the *-1 in https://github.com/mamuz/PhpDependencyAnalysis/blob/v2.0.2/src/Layout/Helper/GroupGenerator.php#L97 everything works fine.

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

No branches or pull requests

1 participant