Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: flexjoly on June 13, 2020, 05:52:07 am

Title: Php namespaces not recognized?
Post by: flexjoly on June 13, 2020, 05:52:07 am
Hi,

Lately I started to work more actively with namespaces in php. I expected that EA would love that and would recognize the connection between classes even beter. But the opposite seems to be true :-(

Because of namespaces it is possible to have the same classnames. But EA does not recognize (nor generate) the correct namespace-path. And EA seems to have never heard of namespaces aliases  :-[

I set some packages as root namespace:
Some of the classes I have are:
Base Data class
Code: [Select]
<?php
namespace rh\data\data;

class 
Data implements DataInterface{}
?>


Config Data class
Code: [Select]
<?php
namespace rh\config\db;
use 
rh\data\listdata\ListAbstract;

class 
Data extends ListAbstract{}
?>



A Class which extends the base Data class
Code: [Select]
<?php
namespace ls\api;
use 
rh\data\data\Data;

class 
Params extends Data{}
?>



The class are imported as by directories and the packages are created on namespaces.

But a class like Params is connected to the Config-Data class and not to rh\data\data\Data  :o :-\
And when looking into the relations or find-window only classnames without their namespaces are shown.

I tried to change the extend to:
I searched and read many pages in the tutorials. Downloaded the latest version 15.2 beta.

I also tried:
What am I doing wrong??? What can I do to get EA to recognize the namespace paths and make the right connections.

And what about namespace aliases? I use "use my\namespaced\Class as Base;" a lot.... but EA just connects to the first "class Base{}" it finds  :-[


I hope someone can help me.
Thanks in advance.
Flexjoly