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

Add ability to auto-document complex types #53

Merged
merged 8 commits into from
Apr 12, 2018
Merged

Add ability to auto-document complex types #53

merged 8 commits into from
Apr 12, 2018

Conversation

kynx
Copy link

@kynx kynx commented Apr 6, 2018

This PR adds the ability to generate <xsd:documentation> elements for complex types from class and property docblocks. This is useful when auto-generating API documentation from the WSDL file.

@kynx
Copy link
Author

kynx commented Apr 6, 2018

Hrm... travis is failing on PHP5.6 - I'm using return types. Will the next version be targetting PHP7+?

@samsonasik
Copy link
Contributor

I think php 7+ support only can be applied in separate pull request

@kynx
Copy link
Author

kynx commented Apr 9, 2018

Thanks @samsonasik - so should I ditch the return types or ignore the errors?

@samsonasik
Copy link
Contributor

@kynx I think return type can be removed for this PR

* Property documentation
*/
public $foo;
};
Copy link
Member

Choose a reason for hiding this comment

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

Once you remove the scalar type hints and return type hints, you'll also need to update this test to remove anonymous class usage. Create classes under a TestAsset directory, and instantiate them here.


public function testGetPropertyDocumentationSkipsAnnotations()
{

Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to run via phpcs when done; extra lines like this one should be picked up and flagged.

@@ -573,6 +573,20 @@ public function testAddDocumentationToSetInsertsBefore()
$this->assertEquals('documentation', $nodes->item(0)->nodeName);
}

public function testComplexTypeDocumentationAddedAsAnnotation()
{
$this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\WsdlTestClass');
Copy link
Member

Choose a reason for hiding this comment

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

Import the class and use ::class notation instead of a string.

@weierophinney weierophinney merged commit 011e032 into zendframework:develop Apr 12, 2018
weierophinney added a commit that referenced this pull request Apr 12, 2018
Add ability to auto-document complex types
weierophinney added a commit that referenced this pull request Apr 12, 2018
weierophinney added a commit that referenced this pull request Apr 12, 2018
@weierophinney
Copy link
Member

Thanks, @kynx!

@Xerkus Xerkus added this to the 2.8.0 milestone Apr 30, 2019
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