-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Feature: Add FileAssembler #250
Conversation
…onse.body` (#1) `Phpro\SoapClient\Soap\Driver\ExtSoap\AbusedClient::doActualRequest()` doesn't set `$this->__last_response` so `Phpro\SoapClient\Client::debugLastSoapRequest()` returns empty `response.body`
This will add the ability to add script_types declare statement into the generated file.
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.
Thanks for the PR!
Looks like a nice addition. I added a couple of small remarks.
Of course we won't merge it in before the feature is available in zend-code. :)
|
||
## FileAssembler | ||
|
||
The `FileAssembler` is able to add `declare()` statements into generated files. |
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.
Since it adds a declare statement, wouldn't it be better to name it DeclareAssembler ?
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.
I choose FileAssembler
because there is also the ability to require
files if you need to.
Or do other stuff inside the file, which is not strictly limited to class, namespace
or use
.
DeclareAssembler
would only be a single usage limited to declare
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.
I discussed this with @janvernieuwe : the purpose of the assemblers in this package is to do one tiny change to a file.
It seems like a better idea to go for a DeclareAssembler
and add other assemblers when needed.
That way the assembler doesn't get bloated if we add additional features on file level + you can easily add the assemblers you want to use in your config instead of adding tons of options to one assembler.
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.
Alright. Got it. Will rename it then :)
src/Phpro/SoapClient/CodeGenerator/Assembler/FileAssemblerOptions.php
Outdated
Show resolved
Hide resolved
test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/FileAssemblerTest.php
Outdated
Show resolved
Hide resolved
} | ||
``` | ||
|
||
## FileAssembler |
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.
Maybe a good idea to add the version of zend-code in which this feature will be released?
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.
I updated the composer.json
with the next possible version where this will be included (which should be ^3.4
), This will obviously break the build even more ;)
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.
We'll also have to update some additional files (since we are not shipping the code generation in a separate package atm). In here we hardcoded the version of zend-code.
- README.md
- docs/code-generation/assemblers.md
- docs/cli/generate-client.md
- docs/cli/generate-types.md
- docs/cli/generate-classmap.md
- src/Phpro/SoapClient/Console/Event/Subscriber/ZendCodeValidationSubscriber.php
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.
Alright, thanks. Will update them as well
This requires the minimum required version of zend-code with the needed implementations for FileAssembler to work
PHPStan level 4
call cleanUpTemporaryState() if SoapFault is thrown in __soapCall fixes #252
Also cleanup temporary encoder state on failure
@veewee zend-code was just updated to 3.4.0. So the feature is now available. |
Great to hear @icanhazstring. |
Yep, will update the feature PR as soon as I find the time :) |
WSSE Make sure BinarySecurityToken is singed as well
Fix getClass issue due to bad return types
Rename engine factory
Use stable php-soap and veewee/xml
PHP 8.1 Compatibility
Don't import known types
Fixes rules.md documentation
Use real type of iterator return value type hint
This fixes the new deprecation warnings in PHP 8.1.
Use return types from JsonSerializable/IteratorAggregate (fixes PHP 8.1 deprecations)
Fix phpspec on PHP81
Allow all currently available versions of psr/log
Fix typo in readme.md
…to file-assembler # Conflicts: # composer.json # src/Phpro/SoapClient/CodeGenerator/ConfigGenerator.php # src/Phpro/SoapClient/CodeGenerator/TypeGenerator.php Updated FileAssembler
Closed in favor of #450 |
This will add the ability to give your generated files
declare(strict_types=1);
.This depends on a feature in
zend-code
being merged and tagged. Currently its not possible to generate a file withdeclare()
statements. So the build will probably fail with the tests since the needed method is not there.zendframework/zend-code#169
I hope I found everything that has to be updated (docs, tests etc). If something is missing
or should be changed. Let me know.