Skip to content

Incorrect usage of phpdoc #90

Closed
Closed
@hakimio

Description

@hakimio

In most places of this library phpdoc is used incorrectly. For example, right now mutate method definition in AdGroupAdService looks like this:

     /* 
     * @param operations The operations to apply.
     * @return A list of AdGroupAds where <...>
     */
    public function mutate($operations)

Where the correct way to define this would be the following way:

     /* 
     * @param AdGroupAdOperation[] $operations The operations to apply.
     * @return AdGroupAdReturnValue A list of AdGroupAds where <..>
     */
    public function mutate($operations)

Same for the get method. Current usage:

     /* 
     * @param serviceSelector The selector specifying the {@link AdGroupAd}s to return.
     * @return The page containing the AdGroupAds that meet the criteria specified  <..>
     * @throws ApiException when there is at least one error with the request.
     */
    public function get($serviceSelector) 

Correct way to define it:

     /* 
     * @param Selector $serviceSelector The selector specifying the <...>
     * @return AdGroupAdPage The page containing the AdGroupAds that meet the <..>
     * @throws ApiException when there is at least one error with the request.
     */
    public function get($serviceSelector) 

The biggest problem with incorrect phpdoc usage is that it confuses static code analysis present in most advanced IDEs and it shows loads of warnings just from your library.
More information about correct phpdoc usage can be found here.
Most of the problems could be fixed with a simple regex search & replace, while some of them would require manual editing. I could fix the latest version of Adwords API if you don't have the time or don't think it's worth your time and then either send a patch or push request if you are willing to accept it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions