Skip to content

Conversation

@sy-records
Copy link
Contributor

@sy-records sy-records commented Dec 29, 2020

image

use Qcloud\Cos\Service;
use GuzzleHttp\Command\Guzzle\Description;

$des = new Description(Service::getService());
$operations = array_keys($des->getOperations());

$method = "/**\n";
foreach ($operations as $key => $operation) {
    $type = $arg = '';
    $model = $des->getOperation($operation)->getResponseModel();
    if ($des->hasModel($model)) {
        $type = $des->getModel($model)->getType();
        if (!empty($des->getOperation($operation)->getParams())) {
            $arg = " (array \$arg)";
        }
    }
    $method .= " * @method {$type} {$operation}{$arg}\n";
}
$method .= " */\n";
echo $method;

@lewzylu
Copy link
Contributor

lewzylu commented Jan 6, 2021

LGTM

@lewzylu lewzylu merged commit 3b71ec4 into tencentyun:master Jan 6, 2021
@sy-records sy-records deleted the method branch January 6, 2021 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants