Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

WSDL Generation rewrite (with new tests also) as a base for future changes. #3919

Closed
wants to merge 21 commits into from

Conversation

GrzegorzDrozd
Copy link

Hello.

Serious Rewrite of WSDL generation from strings and simple DOM to full object oriented from the begining. This is a base for more changes like: multiple faults, missing xsd types etc.
It uses dom and proper namespaces. All tests are also rewritten to new structure and now are using xpath versus old string comparison.
Code formating in accordance with Coding Style.
More tests.
Integration of recent code changes introduced among others by ayastreb and weierophinney.
Even more tests and test data.

I checked current test output wsdl files against new xpath rules and everything was in green. I also checked new wsdl files against old tests.

I have more patches almost ready and all of them are based on this rewrite.

This is my first pull request so if I did something wrong please let me know so I can fix it.

Best regards.

Grzegorz Drozd and others added 11 commits October 11, 2012 12:02
Conflicts:
	library/Zend/Soap/Wsdl.php
	tests/Zend/Soap/Server/DocumentLiteralWrapperTest.php
	tests/Zend/Soap/WsdlTest.php
Complete rewrite of wsdl generation from strings and simple dom to full object oriented from the begining.
It uses dom and proper namespaces. All tests are also rewritten to new structure and now are using xpath
versus old string comparison.
Conflicts:
	library/Zend/Soap/Wsdl.php
	tests/Zend/Soap/WsdlTest.php
When runing clean from command line one test was failing. Fixed.
Code formating in accordance with Coding Style.
More tests.
Integration of recent code changes from ayastreb and weierophinney.
Even more tests and test data.
@Maks3w
Copy link
Member

Maks3w commented Feb 28, 2013

Your commits cannot be merged because are in conflict with the actual master branch. For fix this merge the most recent version of master in your PR branch.

Also it's a good thing make your commits in a specific branch rather than master or develop. See this article for to see how to do this http://blog.evan.pro/keeping-a-clean-github-fork-part-1

Finally some files has now different chmod rigts (00644 > 00755) please restore the original chmod rights

* @param array $input An array of attributes for the input element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
* @param array $output An array of attributes for the output element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
* @param array $fault An array of attributes for the fault element, allowed keys are: 'name', 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
* @param string $name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this kind of indentations along all the PR

public function __construct(ComplexTypeStrategy $strategy = null, $endpointUri=null, $wsdlClass=null, array $classMap = array())
{
public function __construct(ComplexTypeStrategy $strategy = null,
$endpointUri=null, $wsdlClass=null, array $classMap = array()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According PSR-2 guidelines when the arguments line is splitted must be only one argument by line

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md#44-method-arguments

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So PSR-2 is now standard for Zend Framework ? Because in coding standard there is no info about one argument per line: http://framework.zend.com/wiki/display/ZFDEV2/Coding+Standards#CodingStandards-FunctionandMethodDeclaration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, PSR-2 is the statndard for ZF2

case 'featues':
trigger_error(__METHOD__ . ': the option "featues" is deprecated as of 1.10.x and will be removed with 2.0.0; use "features" instead', E_USER_NOTICE);
trigger_error(__METHOD__ . ': the option "featues" is deprecated'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove case

@GrzegorzDrozd
Copy link
Author

I just committed merge with master and file permission fix.

@@ -329,6 +357,7 @@ public function setActor($actor)
{
$this->validateUrn($actor);
$this->actor = $actor;

return $this;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restore the return type

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean change from @return bool to @return true ? But TRUE is not valid data type. Maybe I should change is to : "@return bool always true or throws exception when error."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true is a valid phpDoc type. A different thing is that some IDE's doesn't support it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure?
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.return.pkg.html
States: "The datatype should be a valid PHP type (int, string, bool, etc), a class name for the type of object returned, or simply "mixed". "

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for a link :) I did not know that phpdoc and phpdocumentator differ about that.

@GrzegorzDrozd
Copy link
Author

Code is reformatted according to Your suggestions: multi-line arguments and more loose line length (only when line length excess 120 chars new line is introduced.

Maybe it is time to change guide for contributors? It still points to outdated code style rules?

I don't know how to move commits to other branch. Is this necessary? My next PR are in separate branches, only this one is on master because I started to work on it so long ago.

return;
}

// Echo the response, if we're not returning it
if (!$this->returnResponse) {
echo $this->response;

return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the blank preceding line.

@ghost ghost assigned weierophinney Apr 15, 2013
@weierophinney
Copy link
Member

@GrzegorzDrozd This looks like an EXCELLENT addition. I made a ton of comments, but there are some general ones I want to point out:

  • The accepted order for params/return/throws annotations is exactly that: params, return, throws. Additionally, there should be no empty lines between them.
  • You introduce a lot of empty lines that are largely unnecessary -- particularly when introduced between lines in a method or block with 5 lines or fewer to begin with. These can be removed.
  • We prefer protected visibility over private unless there are very compelling reasons for the stricter visibility. If you have such reasons, please document them.
  • $foo instanceof SomeClass is the same as is_object($foo) && is_subclass_of($foo, 'SomeClass') -- but is faster and more readable. :)
  • For classes referenced by docblock, the preferred practice is to use imports and/or names relative to the current namespace; add imports if none already exist. An import statement is a no-op if the code never references the class (and even a no-op in instanceof checks!), so they're cheap, and aid in readability. (Plus, phpdoc and most IDEs will expand based on imports and current namespace already!)

Finally, make sure you rebase, as master has diverged from when you created the original work.

Thanks in advance -- again, looks EXCELLENT!

@GrzegorzDrozd
Copy link
Author

Thank you for your appreciation :)

I'll fix the code and apply your comments. But due to lack of time, I might not finish before the weekend. Or even next weekend. :( I will try to do my best.

weierophinney added a commit that referenced this pull request Apr 30, 2013
WSDL Generation rewrite (with new tests also) as a base for future changes.

Conflicts:
	library/Zend/Soap/AutoDiscover.php
	library/Zend/Soap/Client/DotNet.php
	library/Zend/Soap/Server.php
	library/Zend/Soap/Server/DocumentLiteralWrapper.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeComplex.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/Composite.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/DefaultComplexType.php
	tests/ZendTest/Soap/Wsdl/CompositeStrategyTest.php
weierophinney added a commit that referenced this pull request Apr 30, 2013
- Ensure params/return/throws annotations are in correct order, with no
  whitespace between.
- Remove unnecessary empty lines.
- Ensure properties are in alphabetical order.
- Ensure classes referenced in docblocks are imported and/or resolved
  from current namespace.
weierophinney added a commit that referenced this pull request Apr 30, 2013
- instead of is_object() && is_subclass_of()
weierophinney added a commit that referenced this pull request Apr 30, 2013
- per php-cs-fixer
weierophinney added a commit that referenced this pull request Apr 30, 2013
@weierophinney
Copy link
Member

Merged to develop for release with 2.2.0 -- thanks, @GrzegorzDrozd ! (I made the changes requested on merge)

@GrzegorzDrozd
Copy link
Author

Thank you! :) I have deadline on my project so I planned to take care of Your feedback during this, 5 day (at least in Poland ;) ) weekend. Sorry for extra work which You had to do.

ps. batch of next improvements coming soon :) This time smaller ;)

weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
…d/master

WSDL Generation rewrite (with new tests also) as a base for future changes.

Conflicts:
	library/Zend/Soap/AutoDiscover.php
	library/Zend/Soap/Client/DotNet.php
	library/Zend/Soap/Server.php
	library/Zend/Soap/Server/DocumentLiteralWrapper.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeComplex.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/Composite.php
	library/Zend/Soap/Wsdl/ComplexTypeStrategy/DefaultComplexType.php
	tests/ZendTest/Soap/Wsdl/CompositeStrategyTest.php
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
- Ensure params/return/throws annotations are in correct order, with no
  whitespace between.
- Remove unnecessary empty lines.
- Ensure properties are in alphabetical order.
- Ensure classes referenced in docblocks are imported and/or resolved
  from current namespace.
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
- instead of is_object() && is_subclass_of()
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants