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

Feature: Add FileAssembler #250

Closed
wants to merge 200 commits into from
Closed

Feature: Add FileAssembler #250

wants to merge 200 commits into from

Conversation

icanhazstring
Copy link
Contributor

@icanhazstring icanhazstring commented Jun 17, 2019

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 with declare() 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.

hshhhhh and others added 2 commits June 10, 2019 21:45
…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.
Copy link
Contributor

@veewee veewee left a 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.
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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 :)

}
```

## FileAssembler
Copy link
Contributor

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?

Copy link
Contributor Author

@icanhazstring icanhazstring Jun 18, 2019

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 ;)

Copy link
Contributor

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

Copy link
Contributor Author

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

@icanhazstring
Copy link
Contributor Author

icanhazstring commented Oct 6, 2019

@veewee zend-code was just updated to 3.4.0. So the feature is now available.

@veewee
Copy link
Contributor

veewee commented Oct 10, 2019

Great to hear @icanhazstring.
I've re-ran the tests and they return as broken. Besides that, there were some unresolved code comments.
Feel free to pick it up if you have the space to do so.

@icanhazstring
Copy link
Contributor Author

Yep, will update the feature PR as soon as I find the time :)
Also the renaming, which was noted, wasn't done yet. So still some work to do :)

veewee and others added 27 commits September 24, 2021 07:28
Use stable php-soap and veewee/xml
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)
Allow all currently available versions of psr/log
…to file-assembler

# Conflicts:
#	composer.json
#	src/Phpro/SoapClient/CodeGenerator/ConfigGenerator.php
#	src/Phpro/SoapClient/CodeGenerator/TypeGenerator.php

Updated FileAssembler
@janvernieuwe janvernieuwe mentioned this pull request Sep 30, 2022
@janvernieuwe
Copy link
Collaborator

Closed in favor of #450

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

Successfully merging this pull request may close these issues.