Skip to content

Commit

Permalink
Adding promise example to api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling committed May 21, 2015
1 parent 0d1e105 commit cd6f849
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build/docs/classes/DocsBuilder.php
Expand Up @@ -155,7 +155,7 @@ private function createHtmlForToc(Service $service, array $operations)
$html->open('ul', 'methods-summary');
foreach ($operations as $opName => $operation) {
$item = '<a class="method-summary-link" href="#' . $html->slug($opName)
. '"><strong>' . "{$opName}</strong></a>";
. '"><strong>' . "{$opName}</strong> ( array \$params = [] )</a>";

if ($description = $service->docs->getOperationDocs($opName)) {
$shortened = strip_tags($description);
Expand Down Expand Up @@ -312,7 +312,12 @@ private function createHtmlForOperation(Service $service, $name, Operation $oper
$html->section(3, $html->glyph('cog') . ' ' . $name, null, 'method-title');

// Code
$html->elem('pre', 'opcode', '$result = $client-&gt;<code>' . lcfirst($name) . '</code>([/* ... */]);');
$html->elem(
'pre',
'opcode',
'$result = $client-&gt;<code>' . lcfirst($name) . '</code>([/* ... */]);' . "\n"
. '$promise = $client-&gt;<code>' . lcfirst($name) . 'Async</code>([/* ... */]);' . "\n"
);

// Description
if ($description = $service->docs->getOperationDocs($name)) {
Expand Down

0 comments on commit cd6f849

Please sign in to comment.