-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
This package will be used to pull in documentation from the API.
Use case:
This package should be included in composer via: https://packagist.org/packages/phrest/doc
You should supply the documenter with an API object in the constructor, this will provide the class with everything it needs to get all of the required data for documentation.
The package should contain a set of hydration objects that will be returned via the main object.
i.e.
$doc = new PhrestDoc(new MyAPI(new MyDI));
// Get an array of PhrestDoc\Collection objects
$collections = $doc->getCollections();
foreach($collections as $collection)
{
// Get an array of PhrestDoc\Collection\Call objects
$calls = $collection->getCalls();
foreach($calls as $call)
{
// POST, GET, etc. Constants in PhrestAPI\Request\PhrestRequest object
echo $call->getHTTPMethod();
// Get array of PhrestDoc\Collection\Call\PostParam objects
foreach($call->getPostParams() as $param)
{
// etc...
echo $param->getName();
}
// Get array of PhrestDoc\Collection\Call\MethodParam objects
foreach($call->getMethodParams() as $param)
{
// as above
}
}
}
This will allow us to create out own style of documentation pages.
A lot of the functionality that we will need is already in the SDK Generator class. We could either use these functions directly, or promote them up a level into the API itself, and use the functions from both the SDK and the Doc package.
Metadata
Metadata
Assignees
Labels
No labels