nahakiole / staruml-php

PHP extension for StarUML
https://staruml.io/extensions
MIT License
17 stars 8 forks source link

Type hints not working correctly? #5

Open jrswgtr opened 2 years ago

jrswgtr commented 2 years ago

Type hints don't get the class names but instead [object Object]. Is this a bug, or am I doing something wrong?

Here's an example.

Class diagram:

+-----------------------+
| SynchronizerInterface |
+-----------------------+
| +synchronize()        |
+-----------------------+
+---------------------------------------------------------------+
|                         Synchronizer                          |
+---------------------------------------------------------------+
| -synchronizers: SynchronizerInterface[0..*]                   |
+---------------------------------------------------------------+
| +__construct(synchronizers: SynchronizerInterface[0..*] = []) |
| +add(synchronizer: SynchronizerInterface)                     |
+---------------------------------------------------------------+

Generated PHP code of the SynchronizerInterface interface and Synchronizer implementation:

interface SynchronizerInterface
{

    /**
     * 
     */
    public function synchronize();

}

class Synchronizer implements SynchronizerInterface
{

    /** @var [object Object][] */
    private array $synchronizers;

    /**
     * @param [object Object][] $synchronizers
     */
    public function __construct([object Object] $synchronizers = [])
    {
        // TODO implement here
    }

    /**
     * @param [object Object] $synchronizer
     */
    public function add([object Object] $synchronizer)
    {
        // TODO implement here
    }

    /**
     * 
     */
    public function synchronize()
    {
        // TODO implement here
    }

}
nahakiole commented 2 years ago

Hey, thank you for reporting this. I think it is a bug :) Did the bug template not show up for you? Could you reformat it like in the template and send me an example file as described?

Describe the bug A clear and concise description of what the bug is.

Attach the .mdj file To reproduce the problem it's best to attach the .mdj file where the problem appears. Else I might not be able to reproduce it and won't be able to solve the problem.

You can also try and create a blank one and reproduce it there, so you won't need to send me your evil world takeover UML plans.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.