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

Specify classes as fully-qualified names in stubs #156

Merged
merged 2 commits into from
Sep 30, 2022

Conversation

joehoyle
Copy link
Collaborator

When stubs are generated, the type annotations don't use a loading \, which means they are interpreted as relative to the current namespace. That's wrong, as all types are relative to the root namespace.

@striezel
Copy link
Contributor

The rustfmt check is complaining about those changes:

/home/runner/.cargo/bin/cargo fmt --all -- --check
Diff in /home/runner/work/ext-php-rs/ext-php-rs/src/describe/stub.rs at line 166:
                 DataType::Object(Some(ty)) => {
                     fqdn.push_str(ty);
                     fqdn.as_str()
-                },
+                }
                 DataType::Object(None) => "object",
                 DataType::Resource => "resource",
                 DataType::Reference => "reference",
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 1

When stubs are generated, the type annotations don't use a loading `\`, which means they are interpreted as relative to the current namespace. That's wrong, as all types are relative to the root namespace.
@davidcole1340 davidcole1340 merged commit 90cbbc0 into davidcole1340:master Sep 30, 2022
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

Successfully merging this pull request may close these issues.

3 participants