Skip to content

Commit

Permalink
PHP doc updates (googleapis#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjonesgoogle committed Jun 15, 2016
1 parent 43cacb6 commit af76d3a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ public String addImport(String typeName) {
* Returns the PHP representation of a reference to a type.
*/
public String typeName(TypeRef type) {
if (type.isMap() || type.isRepeated()) {
if (type.isMap()) {
return "array";
} else if (type.isRepeated()) {
return basicTypeName(type) + "[]";
} else {
return basicTypeName(type);
}
Expand Down
10 changes: 4 additions & 6 deletions src/main/resources/com/google/api/codegen/php/main.snip
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
* <pre>
* <code>
* ```
{@createMethodSampleDoc(service, context.getFirstMethod(service))}
* </code>
* </pre>
* ```
*
* Many parameters require resource names to be formatted in a particular way. To assist
* with these names, this class includes a format method for each type of name, and additionally
Expand Down Expand Up @@ -449,9 +447,9 @@
{@docLinesFromStr(context.getDescription(method))}
*
* Sample code:
* <pre><code>
* ```
{@createMethodSampleDoc(service, method)}
* </code></pre>
* ```
{@requiredArgsDoc(service, method)}
{@optionalArgsDoc(service, method)}
* @@param array $callSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ use google\protobuf\FieldMask;
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
* <pre>
* <code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $shelf = new Shelf();
Expand All @@ -85,8 +84,7 @@ use google\protobuf\FieldMask;
* $libraryServiceApi->close();
* }
* }
* </code>
* </pre>
* ```
*
* Many parameters require resource names to be formatted in a particular way. To assist
* with these names, this class includes a format method for each type of name, and additionally
Expand Down Expand Up @@ -370,7 +368,7 @@ class LibraryServiceApi
* Creates a shelf, and returns the new Shelf.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $shelf = new Shelf();
Expand All @@ -380,7 +378,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param Shelf $shelf The shelf to create.
* @param array $optionalArgs {
Expand Down Expand Up @@ -421,7 +419,7 @@ class LibraryServiceApi
* Gets a shelf.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatShelfName("[SHELF]");
Expand All @@ -431,7 +429,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the shelf to retrieve.
* @param array $optionalArgs {
Expand Down Expand Up @@ -479,7 +477,7 @@ class LibraryServiceApi
* Lists shelves.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
*
Expand All @@ -491,7 +489,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param array $optionalArgs {
* Optional. There are no optional parameters for this method yet;
Expand Down Expand Up @@ -530,7 +528,7 @@ class LibraryServiceApi
* Deletes a shelf.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatShelfName("[SHELF]");
Expand All @@ -540,7 +538,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the shelf to delete.
* @param array $optionalArgs {
Expand Down Expand Up @@ -581,7 +579,7 @@ class LibraryServiceApi
* `other_shelf_name`. Returns the updated shelf.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatShelfName("[SHELF]");
Expand All @@ -592,7 +590,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the shelf we're adding books to.
* @param string $otherShelfName The name of the shelf we're removing books from and deleting.
Expand Down Expand Up @@ -635,7 +633,7 @@ class LibraryServiceApi
* Creates a book.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatShelfName("[SHELF]");
Expand All @@ -646,7 +644,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the shelf in which the book is created.
* @param Book $book The book to create.
Expand Down Expand Up @@ -689,7 +687,7 @@ class LibraryServiceApi
* Creates a series of books.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $shelf = new Shelf();
Expand All @@ -700,10 +698,10 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param Shelf $shelf The shelf in which the series is created.
* @param array $books The books to publish in the series.
* @param Book[] $books The books to publish in the series.
* @param array $optionalArgs {
* Optional.
* @var int $edition The edition of the series
Expand Down Expand Up @@ -748,7 +746,7 @@ class LibraryServiceApi
* Gets a book.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatBookName("[SHELF]", "[BOOK]");
Expand All @@ -758,7 +756,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the book to retrieve.
* @param array $optionalArgs {
Expand Down Expand Up @@ -799,7 +797,7 @@ class LibraryServiceApi
* Lists books in a shelf.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatShelfName("[SHELF]");
Expand All @@ -811,7 +809,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the shelf whose books we'd like to list.
* @param array $optionalArgs {
Expand Down Expand Up @@ -864,7 +862,7 @@ class LibraryServiceApi
* Deletes a book.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatBookName("[SHELF]", "[BOOK]");
Expand All @@ -874,7 +872,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the book to delete.
* @param array $optionalArgs {
Expand Down Expand Up @@ -913,7 +911,7 @@ class LibraryServiceApi
* Updates a book.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatBookName("[SHELF]", "[BOOK]");
Expand All @@ -924,7 +922,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the book to update.
* @param Book $book The book to update with.
Expand Down Expand Up @@ -974,7 +972,7 @@ class LibraryServiceApi
* Moves a book to another shelf, and returns the new book.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatBookName("[SHELF]", "[BOOK]");
Expand All @@ -985,7 +983,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the book to move.
* @param string $otherShelfName The name of the destination shelf.
Expand Down Expand Up @@ -1028,7 +1026,7 @@ class LibraryServiceApi
* Lists a primitive resource. To test go page streaming.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
*
Expand All @@ -1040,7 +1038,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param array $optionalArgs {
* Optional.
Expand Down Expand Up @@ -1091,7 +1089,7 @@ class LibraryServiceApi
* Adds comments to a book
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatBookName("[SHELF]", "[BOOK]");
Expand All @@ -1105,10 +1103,10 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name
* @param array $comments
* @param Comment[] $comments
* @param array $optionalArgs {
* Optional. There are no optional parameters for this method yet;
* this $optionalArgs parameter reserves a spot for future ones.
Expand Down Expand Up @@ -1148,7 +1146,7 @@ class LibraryServiceApi
* Gets a book from an archive.
*
* Sample code:
* <pre><code>
* ```
* try {
* $libraryServiceApi = new LibraryServiceApi();
* $formattedName = LibraryServiceApi::formatArchivedBookName("[ARCHIVE_PATH]", "[BOOK]");
Expand All @@ -1158,7 +1156,7 @@ class LibraryServiceApi
* $libraryServiceApi->close();
* }
* }
* </code></pre>
* ```
*
* @param string $name The name of the book to retrieve.
* @param array $optionalArgs {
Expand Down

0 comments on commit af76d3a

Please sign in to comment.