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

subdirectory not converted in namespaces #256

Closed
lmartin59 opened this issue Jul 1, 2021 · 7 comments
Closed

subdirectory not converted in namespaces #256

lmartin59 opened this issue Jul 1, 2021 · 7 comments
Assignees
Labels

Comments

@lmartin59
Copy link

lmartin59 commented Jul 1, 2021

when a Folder option contains a sub directory with "/" the namespace is not converted to "\"
exemple :

$options = GeneratorOptions::instance();
            $options 
...
 ->setNamespace("App\TestWS")
                ->setStructsFolder("Domain/Entities")
                ->setServicesFolder("Infrastructure/".$service);

The generator create the file in the right place in App/TestWS/Domain/Entities but the namespace of structs class is :

namespace App\TestWS\Domain/Entities;

and

?\App\TestWS\Domain/Entities\CommuneDTO

I took the liberty of testing a modification in the class AbstractModel line 258

$namespaces[] = str_replace('/','\\',$this->getSubDirectory());

and it work

@mikaelcom
Copy link
Member

Thanks for your feedback. Which version are you using?

@lmartin59
Copy link
Author

it's wsdltophp/packagegenerator version 4.0.2
with PHP 7.4 on debian docker image

@voipminic
Copy link

I have the same problem using CLI in Debian with php7.4

@voipminic
Copy link

solved putting the namespace beteween '' ( --namespace='vendor\app\subdir' )

@mikaelcom
Copy link
Member

I'll fix it very soon, thx for your feedback!

@mikaelcom
Copy link
Member

This bug is also present in the 3.* versions, to be fixed :)

mikaelcom added a commit that referenced this issue Sep 10, 2021
which never passed locally but on Travis CI (from which I'm leaving...)
mikaelcom added a commit that referenced this issue Sep 10, 2021
which never passed locally but on Travis CI (from which I'm leaving...)
@mikaelcom
Copy link
Member

Can you try with either:

Thx

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

No branches or pull requests

3 participants