- Notifications
You must be signed in to change notification settings - Fork2.5k
feat: improves PHP generation.#7513
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
zap/src/main/java/org/zaproxy/zap/extension/api/PhpAPIGenerator.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
| } | ||
| // Always add the API key - we've no way of knowing if it will be required or not | ||
| out.write("$" +API.API_KEY_PARAM +"='') {\n"); | ||
| out.write("string$" +API.API_KEY_PARAM +" ='') {\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
apikey is always a string.
zap/src/main/java/org/zaproxy/zap/extension/api/PhpAPIGenerator.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
While we can't improve arguments because lack of typing, this is a best effort to improve the code.Signed-off-by: José Carlos Chávez <jcchavezs@gmail.com>
e2bbe59 to9a3a395Comparepsiinon commentedOct 10, 2022
The build failed: |
Signed-off-by: José Carlos Chávez <jcchavezs@gmail.com>
afcf10b tod856850CompareSigned-off-by: José Carlos Chávez <jcchavezs@gmail.com>
psiinon left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM but I'm no PHP developer 😉
Signed-off-by: José Carlos Chávez <jcchavezs@gmail.com>
psiinon commentedOct 11, 2022
|
Signed-off-by: José Carlos Chávez <jcchavezs@gmail.com>
jcchavezs commentedOct 18, 2022
Fixed@psiinon |
jcchavezs commentedOct 21, 2022
Ping@thc202 |
| for (ApiParameterparameter :optionalParameters) { | ||
| Stringname =parameter.getName(); | ||
| StringvarName =name.toLowerCase(Locale.ROOT); | ||
| out.write("\t\tif ($" +varName +" !== NULL) {\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Switched tabs into spaces as that is what is being used by standards. In any case, all the code is reformatted by proper PHP linters in the PHP API client.
| importjava.util.ResourceBundle; | ||
| importjava.util.stream.Collectors; | ||
| /* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
**
| /** | ||
| * Generates the API client files of the given API implementors. | ||
| * | ||
| * @param implementors the implementors | ||
| * @throws IOException if an error occurred while generating the APIs. | ||
| * @deprecated (2.6.0) Use {@link #generateAPIFiles(List)} instead. | ||
| */ | ||
| @Deprecated | ||
| publicvoidgeneratePhpFiles(List<ApiImplementor>implementors)throwsIOException { | ||
| this.generateAPIFiles(implementors); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This should not be needed.
thc202 commentedOct 21, 2022
Commits should be squashed. |
While we can't improve arguments because lack of typing, this is a best effort to improve the code.
Ping@psiinon