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

ParserAbstract error whn trying to generate a diagram (on docker) #27

Open
SereneRuby12 opened this issue Sep 16, 2022 · 5 comments
Open

Comments

@SereneRuby12
Copy link

I can't get phuml on docker to work, I haven't tried with Composer or Phive.
It was working last time I tried some months ago.
I tried the examples on the docs page and also tried editing it without any success

docker run --rm -v $PWD:/code montealegreluis/phuml phuml:diagram -p dot -r -a src UML.png
[|] Running... (This may take some time)
[|] Parsing codebase structure

In ParserAbstract.php line 318:
                                                                     
  Syntax error, unexpected T_STRING, expecting T_VARIABLE on line 7  
                                                                     

phuml:diagram [-p|--processor PROCESSOR] [-r|--recursive] [-a|--associations] [-i|--hide-private] [-o|--hide-protected] [-m|--hide-methods] [-t|--hide-attributes] [-b|--hide-empty-blocks] [-e|--theme [THEME]] [--] <directory> <output>
@wazum
Copy link

wazum commented Oct 28, 2022

I get the same error

@realFranco
Copy link

Hello, I have been utilizing phuml on Docker as well and it is working sucessfully.

I would ask for the image version that you was using at that time but at least the image tagged latest works for my experiments, I used it on a dummy project with 4 classes only.

As info. the image tagged 6.1.0is non-working correctly, as a non-expert on PHP I think that is an error with the source code used on that tag.

I'll expose a demonstration about how I use the tool on a pretty straighforward project and the results that I got.

Project structure and files

./
  .docker/  --> Bridge for containerization logic.
  └── compose.yaml

  src/      --> App logic.
  └── Leaf
      ├── LeafHandler.php  --> Use Repository logic.
      ├── LeafHandlerInterface.php
      └── Repository
          ├── LeafRepository.php
          └── LeafRepositoryInterface.php
  uml/      --> Directory where to store artifacts.

For my purposes I have to use a docker compose scheme in order to orchestrate this service with some others required.

# .docker/compose.yaml

services:
    # Some other services before this line.
    uml:
        image: montealegreluis/phuml:latest
        volumes:
            - ./../:/code
            - ./../uml:/uml

Hands on

After observing the documentation and the "layers" that x image have on it the next
docker commands helps my to achieve my needs.

docker compose -f .docker/compose.yaml build

To execute the phuml services I do it in this way, feel free to observe the documentation in order to understand the command and set of arguments.

docker compose -f .docker/compose.yaml run --rm uml phuml:diagram -r -a -i -o -p dot src/ uml/example.png

Results

After observe the uml/ directory I have the next image:

example

Expected for me ofc! ⚽️

References

I didn't review the final reference, but seems ok for me share the blog related with this tool and how the autor use it.

@realFranco
Copy link

Hello @MontealegreLuis

Maybe you could review this issue and close it, assuming that there is an incomplete evidence from the author and the project have at least a Docker image working (I did not try all of them).

@landure
Copy link

landure commented Aug 21, 2023

I can confirm this error. It may be due to using phUML docker image on a PHP 8.2 code base.

@johnfallen
Copy link

I can confirm this error. I am also using PHP 8.2.

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

5 participants