From 2285baf07495488e4db463d0bb250e231932f02d Mon Sep 17 00:00:00 2001 From: sinkcup Date: Sun, 24 Oct 2021 14:01:32 +0800 Subject: [PATCH 1/9] refactor: #81 use coding sdk --- app/Coding/Iteration.php | 21 - app/Commands/IterationCreateCommand.php | 12 +- composer.json | 1 + composer.lock | 751 +++++++++++++++++-- tests/Feature/IterationCreateCommandTest.php | 2 +- tests/Unit/CodingIterationTest.php | 36 - 6 files changed, 694 insertions(+), 129 deletions(-) diff --git a/app/Coding/Iteration.php b/app/Coding/Iteration.php index d105293..8ec9031 100644 --- a/app/Coding/Iteration.php +++ b/app/Coding/Iteration.php @@ -3,30 +3,9 @@ namespace App\Coding; use Carbon\Carbon; -use Exception; class Iteration extends Base { - public function create($token, $projectName, $data) - { - $response = $this->client->request('POST', 'https://e.coding.net/open-api', [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${token}", - 'Content-Type' => 'application/json' - ], - 'json' => array_merge([ - 'Action' => 'CreateIteration', - 'ProjectName' => $projectName, - ], $data), - ]); - $result = json_decode($response->getBody(), true); - if (isset($result['Response']['Error']['Message'])) { - throw new Exception($result['Response']['Error']['Message']); - } - return $result['Response']['Iteration']; - } - public static function generateName(Carbon $startAt, Carbon $endAt): string { $endFormat = $startAt->year == $endAt->year ? 'm/d' : 'Y/m/d'; diff --git a/app/Commands/IterationCreateCommand.php b/app/Commands/IterationCreateCommand.php index 80d79ed..bc1745a 100644 --- a/app/Commands/IterationCreateCommand.php +++ b/app/Commands/IterationCreateCommand.php @@ -2,8 +2,9 @@ namespace App\Commands; -use App\Coding\Iteration; +use App\Coding\Iteration as LocalIteration; use Carbon\Carbon; +use Coding\Iteration; use LaravelZero\Framework\Commands\Command; class IterationCreateCommand extends Command @@ -40,8 +41,11 @@ class IterationCreateCommand extends Command public function handle(Iteration $iteration): int { $this->setCodingApi(); + $iteration->setToken($this->codingToken); - $data = []; + $data = [ + 'ProjectName' => $this->codingProjectUri, + ]; $startAt = Carbon::parse($this->option('start_at') ?? $this->ask('开始时间:', Carbon::today()->toDateString())); $data['StartAt'] = $startAt->toDateString(); $endAt = Carbon::parse($this->option('end_at') ?? $this->ask( @@ -49,11 +53,11 @@ public function handle(Iteration $iteration): int Carbon::today()->addDays(14)->toDateString() )); $data['EndAt'] = $endAt->toDateString(); - $data['Name'] = $this->option('name') ?? $this->ask('标题:', Iteration::generateName($startAt, $endAt)); + $data['Name'] = $this->option('name') ?? $this->ask('标题:', LocalIteration::generateName($startAt, $endAt)); $data['Goal'] = $this->option('goal'); $data['Assignee'] = $this->option('assignee'); - $result = $iteration->create($this->codingToken, $this->codingProjectUri, $data); + $result = $iteration->create($data); $this->info('创建成功'); $this->info("https://{$this->codingTeamDomain}.coding.net/p/{$this->codingProjectUri}" . diff --git a/composer.json b/composer.json index a306282..e800b44 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "ext-json": "*", "ext-libxml": "*", "ext-zip": "*", + "coding/sdk": "^0.1.2", "illuminate/log": "^8.0", "laravel-fans/confluence": "^0.1.1", "laravel-zero/framework": "^8.8", diff --git a/composer.lock b/composer.lock index 0a7476d..3528ba6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0134f2de9ac0b0a115a392c6dfb421dc", + "content-hash": "7bd97de09ac0e5981d59996e4f1ddb21", "packages": [ { "name": "box/spout", @@ -140,36 +140,76 @@ ], "time": "2021-08-15T20:50:18+00:00" }, + { + "name": "coding/sdk", + "version": "0.1.2", + "source": { + "type": "git", + "url": "https://github.com/Coding/coding-sdk-php.git", + "reference": "b3885378414a1906b179fe656ae4f0831bb23068" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Coding/coding-sdk-php/zipball/b3885378414a1906b179fe656ae4f0831bb23068", + "reference": "b3885378414a1906b179fe656ae4f0831bb23068", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "^7.4", + "illuminate/validation": "^8.67", + "php": ">=7.4" + }, + "require-dev": { + "fakerphp/faker": "^1.16", + "mockery/mockery": "^1.4", + "phpmd/phpmd": "^2.10", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Coding\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "CODING.net SDK for PHP", + "support": { + "issues": "https://github.com/Coding/coding-sdk-php/issues", + "source": "https://github.com/Coding/coding-sdk-php/tree/0.1.2" + }, + "time": "2021-10-24T05:56:17+00:00" + }, { "name": "doctrine/inflector", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" @@ -217,7 +257,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.x" + "source": "https://github.com/doctrine/inflector/tree/2.0.4" }, "funding": [ { @@ -233,7 +273,87 @@ "type": "tidelift" } ], - "time": "2020-05-29T15:13:26+00:00" + "time": "2021-10-22T20:16:43+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2020-05-25T17:44:05+00:00" }, { "name": "dragonmantank/cron-expression", @@ -296,6 +416,74 @@ ], "time": "2020-11-24T19:55:57+00:00" }, + { + "name": "egulias/email-validator", + "version": "2.1.25", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^1.0.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.10" + }, + "require-dev": { + "dominicsayers/isemail": "^3.0.7", + "phpunit/phpunit": "^4.8.36|^7.5.15", + "satooshi/php-coveralls": "^1.0.1" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/2.1.25" + }, + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2020-12-29T14:50:06+00:00" + }, { "name": "facade/ignition-contracts", "version": "1.0.2", @@ -773,16 +961,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "136a635e2b4a49b9d79e9c8fee267ffb257fdba0" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/136a635e2b4a49b9d79e9c8fee267ffb257fdba0", - "reference": "136a635e2b4a49b9d79e9c8fee267ffb257fdba0", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { @@ -837,7 +1025,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.0" + "source": "https://github.com/guzzle/promises/tree/1.5.1" }, "funding": [ { @@ -853,7 +1041,7 @@ "type": "tidelift" } ], - "time": "2021-10-07T13:05:22+00:00" + "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", @@ -1056,16 +1244,16 @@ }, { "name": "illuminate/bus", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "a222094903c473b6b0ade0b0b0e20b83ae1472b6" + "reference": "be400399687b97d5558a224e970060fd5d5f2735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/a222094903c473b6b0ade0b0b0e20b83ae1472b6", - "reference": "a222094903c473b6b0ade0b0b0e20b83ae1472b6", + "url": "https://api.github.com/repos/illuminate/bus/zipball/be400399687b97d5558a224e970060fd5d5f2735", + "reference": "be400399687b97d5558a224e970060fd5d5f2735", "shasum": "" }, "require": { @@ -1105,11 +1293,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-15T14:32:50+00:00" + "time": "2021-10-21T19:19:36+00:00" }, { "name": "illuminate/cache", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", @@ -1169,16 +1357,16 @@ }, { "name": "illuminate/collections", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "dca614ef58d05d01c5610ae9c91536f4afe6f695" + "reference": "2142c8cf75f1cf4416a5f414a6ed377de4b73ad9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/dca614ef58d05d01c5610ae9c91536f4afe6f695", - "reference": "dca614ef58d05d01c5610ae9c91536f4afe6f695", + "url": "https://api.github.com/repos/illuminate/collections/zipball/2142c8cf75f1cf4416a5f414a6ed377de4b73ad9", + "reference": "2142c8cf75f1cf4416a5f414a6ed377de4b73ad9", "shasum": "" }, "require": { @@ -1219,11 +1407,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-10-14T15:27:26+00:00" + "time": "2021-10-20T22:21:30+00:00" }, { "name": "illuminate/config", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -1271,16 +1459,16 @@ }, { "name": "illuminate/console", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "9d450507e8106002ec948c7108075cc0a72e5216" + "reference": "9c66af18f7a491d45dc7527837f22a175776870a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/9d450507e8106002ec948c7108075cc0a72e5216", - "reference": "9d450507e8106002ec948c7108075cc0a72e5216", + "url": "https://api.github.com/repos/illuminate/console/zipball/9c66af18f7a491d45dc7527837f22a175776870a", + "reference": "9c66af18f7a491d45dc7527837f22a175776870a", "shasum": "" }, "require": { @@ -1327,11 +1515,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-10-14T18:05:05+00:00" + "time": "2021-10-21T19:19:36+00:00" }, { "name": "illuminate/container", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -1382,7 +1570,7 @@ }, { "name": "illuminate/contracts", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -1430,7 +1618,7 @@ }, { "name": "illuminate/events", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -1485,16 +1673,16 @@ }, { "name": "illuminate/filesystem", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "f33219e5550f8f280169e933b91a95250920de06" + "reference": "a7bc30dac4e27dbeb37b026f3dbaee13bd578861" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/f33219e5550f8f280169e933b91a95250920de06", - "reference": "f33219e5550f8f280169e933b91a95250920de06", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/a7bc30dac4e27dbeb37b026f3dbaee13bd578861", + "reference": "a7bc30dac4e27dbeb37b026f3dbaee13bd578861", "shasum": "" }, "require": { @@ -1543,20 +1731,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-07-20T13:46:01+00:00" + "time": "2021-10-22T13:20:42+00:00" }, { "name": "illuminate/log", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", - "reference": "56d0383bcd8f7c3ba2ff9868e47459998953f4d7" + "reference": "48f459af3ffc2b5dc030986742812cfb0b9babcc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/log/zipball/56d0383bcd8f7c3ba2ff9868e47459998953f4d7", - "reference": "56d0383bcd8f7c3ba2ff9868e47459998953f4d7", + "url": "https://api.github.com/repos/illuminate/log/zipball/48f459af3ffc2b5dc030986742812cfb0b9babcc", + "reference": "48f459af3ffc2b5dc030986742812cfb0b9babcc", "shasum": "" }, "require": { @@ -1592,11 +1780,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-10-05T16:21:49+00:00" + "time": "2021-10-20T14:18:17+00:00" }, { "name": "illuminate/macroable", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1642,7 +1830,7 @@ }, { "name": "illuminate/pipeline", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -1690,16 +1878,16 @@ }, { "name": "illuminate/support", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "066058e2f017d818cf6fe37ae7b103ed1312f76a" + "reference": "85b6513696d407280b54014865dca4e3fcdccce3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/066058e2f017d818cf6fe37ae7b103ed1312f76a", - "reference": "066058e2f017d818cf6fe37ae7b103ed1312f76a", + "url": "https://api.github.com/repos/illuminate/support/zipball/85b6513696d407280b54014865dca4e3fcdccce3", + "reference": "85b6513696d407280b54014865dca4e3fcdccce3", "shasum": "" }, "require": { @@ -1709,7 +1897,7 @@ "illuminate/collections": "^8.0", "illuminate/contracts": "^8.0", "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.31", + "nesbot/carbon": "^2.53.1", "php": "^7.3|^8.0", "voku/portable-ascii": "^1.4.8" }, @@ -1754,20 +1942,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-10-18T13:43:07+00:00" + "time": "2021-10-22T13:20:42+00:00" }, { "name": "illuminate/testing", - "version": "v8.65.0", + "version": "v8.67.0", "source": { "type": "git", "url": "https://github.com/illuminate/testing.git", - "reference": "be26a610573fafa9ca893e465aaea3c6e4a35779" + "reference": "e55e0e2d0655fc606d01744140528848c9b80887" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/testing/zipball/be26a610573fafa9ca893e465aaea3c6e4a35779", - "reference": "be26a610573fafa9ca893e465aaea3c6e4a35779", + "url": "https://api.github.com/repos/illuminate/testing/zipball/e55e0e2d0655fc606d01744140528848c9b80887", + "reference": "e55e0e2d0655fc606d01744140528848c9b80887", "shasum": "" }, "require": { @@ -1812,7 +2000,118 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-10-18T13:37:32+00:00" + "time": "2021-10-20T13:28:43+00:00" + }, + { + "name": "illuminate/translation", + "version": "v8.67.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/translation.git", + "reference": "019c83d17b6311be5e52ab99487804d210110d9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/translation/zipball/019c83d17b6311be5e52ab99487804d210110d9d", + "reference": "019c83d17b6311be5e52ab99487804d210110d9d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Translation package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-10-21T16:07:23+00:00" + }, + { + "name": "illuminate/validation", + "version": "v8.67.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/validation.git", + "reference": "221e63001f0c698b5df2300224aae6409267d2b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/validation/zipball/221e63001f0c698b5df2300224aae6409267d2b9", + "reference": "221e63001f0c698b5df2300224aae6409267d2b9", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.10", + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "illuminate/translation": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.1.4", + "symfony/mime": "^5.1.4" + }, + "suggest": { + "illuminate/database": "Required to use the database presence verifier (^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Validation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Validation package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-10-13T13:37:38+00:00" }, { "name": "jolicode/jolinotif", @@ -3892,6 +4191,162 @@ ], "time": "2021-08-04T21:20:46+00:00" }, + { + "name": "symfony/http-foundation", + "version": "v5.3.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "e36c8e5502b4f3f0190c675f1c1f1248a64f04e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e36c8e5502b4f3f0190c675f1c1f1248a64f04e5", + "reference": "e36c8e5502b4f3f0190c675f1c1f1248a64f04e5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.3.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-27T11:20:35+00:00" + }, + { + "name": "symfony/mime", + "version": "v5.3.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "a756033d0a7e53db389618653ae991eba5a19a11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/a756033d0a7e53db389618653ae991eba5a19a11", + "reference": "a756033d0a7e53db389618653ae991eba5a19a11", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/mailer": "<4.4" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/property-access": "^4.4|^5.1", + "symfony/property-info": "^4.4|^5.1", + "symfony/serializer": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v5.3.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-10T12:30:38+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.23.0", @@ -4052,6 +4507,93 @@ ], "time": "2021-05-27T12:26:48+00:00" }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:27:20+00:00" + }, { "name": "symfony/polyfill-intl-normalizer", "version": "v1.23.0", @@ -4216,6 +4758,82 @@ ], "time": "2021-05-27T12:26:48+00:00" }, + { + "name": "symfony/polyfill-php72", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, { "name": "symfony/polyfill-php73", "version": "v1.23.0", @@ -7341,7 +7959,6 @@ "type": "github" } ], - "abandoned": true, "time": "2020-09-28T06:45:17+00:00" }, { diff --git a/tests/Feature/IterationCreateCommandTest.php b/tests/Feature/IterationCreateCommandTest.php index b7746e6..8a8a2b8 100755 --- a/tests/Feature/IterationCreateCommandTest.php +++ b/tests/Feature/IterationCreateCommandTest.php @@ -2,8 +2,8 @@ namespace Tests\Feature; -use App\Coding\Iteration; use Carbon\Carbon; +use Coding\Iteration; use Tests\TestCase; class IterationCreateCommandTest extends TestCase diff --git a/tests/Unit/CodingIterationTest.php b/tests/Unit/CodingIterationTest.php index b0cdb5b..f83f664 100644 --- a/tests/Unit/CodingIterationTest.php +++ b/tests/Unit/CodingIterationTest.php @@ -2,48 +2,12 @@ namespace Tests\Unit; -use App\Coding\Issue; use App\Coding\Iteration; use Carbon\Carbon; -use GuzzleHttp\Client; -use GuzzleHttp\Psr7\Response; use Tests\TestCase; class CodingIterationTest extends TestCase { - public function testCreateSuccess() - { - $responseBody = file_get_contents($this->dataDir . 'coding/CreateIterationResponse.json'); - $codingToken = $this->faker->md5; - $codingProjectUri = $this->faker->slug; - $data = [ - 'Name' => $this->faker->title, - ]; - - $clientMock = $this->getMockBuilder(Client::class)->getMock(); - $clientMock->expects($this->once()) - ->method('request') - ->with( - 'POST', - 'https://e.coding.net/open-api', - [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${codingToken}", - 'Content-Type' => 'application/json' - ], - 'json' => array_merge([ - 'Action' => 'CreateIteration', - 'ProjectName' => $codingProjectUri, - ], $data) - ] - ) - ->willReturn(new Response(200, [], $responseBody)); - $coding = new Iteration($clientMock); - $result = $coding->create($codingToken, $codingProjectUri, $data); - $this->assertEquals(json_decode($responseBody, true)['Response']['Iteration'], $result); - } - public function testGenerateName() { $startAt = Carbon::parse('2021-10-20'); From 0e20b8c573c2d62d3437aeac285eddb304400a25 Mon Sep 17 00:00:00 2001 From: sinkcup Date: Mon, 25 Oct 2021 16:26:06 +0800 Subject: [PATCH 2/9] refactor: #81 use sdk to create issue --- app/Coding/Issue.php | 28 -------- app/Commands/IssueCreateCommand.php | 9 ++- app/Commands/IssueImportCommand.php | 15 +++-- composer.json | 2 +- composer.lock | 14 ++-- tests/Feature/IssueCreateCommandTest.php | 2 +- tests/Feature/IssueImportCommandTest.php | 16 ++--- tests/Unit/CodingIssueTest.php | 81 ------------------------ 8 files changed, 31 insertions(+), 136 deletions(-) delete mode 100644 app/Coding/Issue.php delete mode 100644 tests/Unit/CodingIssueTest.php diff --git a/app/Coding/Issue.php b/app/Coding/Issue.php deleted file mode 100644 index b37ef64..0000000 --- a/app/Coding/Issue.php +++ /dev/null @@ -1,28 +0,0 @@ -client->request('POST', 'https://e.coding.net/open-api', [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${token}", - 'Content-Type' => 'application/json' - ], - 'json' => array_merge([ - 'Action' => 'CreateIssue', - 'ProjectName' => $projectName, - ], $data), - ]); - $result = json_decode($response->getBody(), true); - if (isset($result['Response']['Error']['Message'])) { - throw new Exception($result['Response']['Error']['Message']); - } - return $result['Response']['Issue']; - } -} diff --git a/app/Commands/IssueCreateCommand.php b/app/Commands/IssueCreateCommand.php index 7a0ba7c..c883013 100644 --- a/app/Commands/IssueCreateCommand.php +++ b/app/Commands/IssueCreateCommand.php @@ -2,7 +2,7 @@ namespace App\Commands; -use App\Coding\Issue; +use Coding\Issue; use LaravelZero\Framework\Commands\Command; class IssueCreateCommand extends Command @@ -37,8 +37,11 @@ class IssueCreateCommand extends Command public function handle(Issue $codingIssue): int { $this->setCodingApi(); + $codingIssue->setToken($this->codingToken); - $data = []; + $data = [ + 'ProjectName' => $this->codingProjectUri, + ]; $data['Type'] = $this->option('type') ?? $this->choice( '类型:', ['DEFECT', 'REQUIREMENT', 'MISSION', 'EPIC', 'SUB_TASK'], @@ -52,7 +55,7 @@ public function handle(Issue $codingIssue): int ); try { - $result = $codingIssue->create($this->codingToken, $this->codingProjectUri, $data); + $result = $codingIssue->create($data); } catch (\Exception $e) { $this->error('Error: ' . $e->getMessage()); return 1; diff --git a/app/Commands/IssueImportCommand.php b/app/Commands/IssueImportCommand.php index f237f61..8f89d0d 100644 --- a/app/Commands/IssueImportCommand.php +++ b/app/Commands/IssueImportCommand.php @@ -2,11 +2,10 @@ namespace App\Commands; -use App\Coding\Issue; -use App\Coding\Iteration; +use Coding\Issue; +use Coding\Iteration; use App\Coding\ProjectSetting; use Exception; -use Illuminate\Support\Arr; use LaravelZero\Framework\Commands\Command; use Rap2hpoutre\FastExcel\Facades\FastExcel; @@ -45,6 +44,8 @@ class IssueImportCommand extends Command public function handle(Issue $codingIssue, ProjectSetting $projectSetting, Iteration $iteration): int { $this->setCodingApi(); + $codingIssue->setToken($this->codingToken); + $iteration->setToken($this->codingToken); $filePath = $this->argument('file'); if (!file_exists($filePath)) { @@ -105,6 +106,7 @@ private function createIssueByRow(ProjectSetting $projectSetting, Issue $issue, { $this->getIssueTypes($projectSetting, $row); $data = [ + 'ProjectName' => $this->codingProjectUri, 'Type' => $this->issueTypes[$row['事项类型']]['IssueType'], 'IssueTypeId' => $this->issueTypes[$row['事项类型']]['Id'], 'Name' => $row['标题'], @@ -133,7 +135,7 @@ private function createIssueByRow(ProjectSetting $projectSetting, Issue $issue, if (!empty($row['状态'])) { $data['StatusId'] = $this->getStatusId($projectSetting, $row['事项类型'], $row['状态']); } - $result = $issue->create($this->codingToken, $this->codingProjectUri, $data); + $result = $issue->create($data); if (isset($row['ID'])) { $this->issueCodeMap[$row['ID']] = intval($result['Code']); } @@ -143,7 +145,10 @@ private function createIssueByRow(ProjectSetting $projectSetting, Issue $issue, private function getIterationCode(Iteration $iteration, string $name) { if (!isset($this->iterationMap[$name])) { - $result = $iteration->create($this->codingToken, $this->codingProjectUri, ['name' => $name]); + $result = $iteration->create([ + 'ProjectName' => $this->codingProjectUri, + 'Name' => $name, + ]); $this->iterationMap[$name] = $result['Code']; } return $this->iterationMap[$name]; diff --git a/composer.json b/composer.json index e800b44..ac4e7b3 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "ext-json": "*", "ext-libxml": "*", "ext-zip": "*", - "coding/sdk": "^0.1.2", + "coding/sdk": "^0.2.0", "illuminate/log": "^8.0", "laravel-fans/confluence": "^0.1.1", "laravel-zero/framework": "^8.8", diff --git a/composer.lock b/composer.lock index 3528ba6..34222cb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7bd97de09ac0e5981d59996e4f1ddb21", + "content-hash": "1fbbc80274b42f3e2ef3f4dd2840f643", "packages": [ { "name": "box/spout", @@ -142,16 +142,16 @@ }, { "name": "coding/sdk", - "version": "0.1.2", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/Coding/coding-sdk-php.git", - "reference": "b3885378414a1906b179fe656ae4f0831bb23068" + "reference": "17575f7ca9a6475f32bd9ce0ef13f58f0045079b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Coding/coding-sdk-php/zipball/b3885378414a1906b179fe656ae4f0831bb23068", - "reference": "b3885378414a1906b179fe656ae4f0831bb23068", + "url": "https://api.github.com/repos/Coding/coding-sdk-php/zipball/17575f7ca9a6475f32bd9ce0ef13f58f0045079b", + "reference": "17575f7ca9a6475f32bd9ce0ef13f58f0045079b", "shasum": "" }, "require": { @@ -180,9 +180,9 @@ "description": "CODING.net SDK for PHP", "support": { "issues": "https://github.com/Coding/coding-sdk-php/issues", - "source": "https://github.com/Coding/coding-sdk-php/tree/0.1.2" + "source": "https://github.com/Coding/coding-sdk-php/tree/0.2.0" }, - "time": "2021-10-24T05:56:17+00:00" + "time": "2021-10-25T07:58:15+00:00" }, { "name": "doctrine/inflector", diff --git a/tests/Feature/IssueCreateCommandTest.php b/tests/Feature/IssueCreateCommandTest.php index fb43c9f..6edaec6 100755 --- a/tests/Feature/IssueCreateCommandTest.php +++ b/tests/Feature/IssueCreateCommandTest.php @@ -2,7 +2,7 @@ namespace Tests\Feature; -use App\Coding\Issue; +use Coding\Issue; use Tests\TestCase; class IssueCreateCommandTest extends TestCase diff --git a/tests/Feature/IssueImportCommandTest.php b/tests/Feature/IssueImportCommandTest.php index 518767b..6f1f502 100755 --- a/tests/Feature/IssueImportCommandTest.php +++ b/tests/Feature/IssueImportCommandTest.php @@ -2,8 +2,8 @@ namespace Tests\Feature; -use App\Coding\Issue; -use App\Coding\Iteration; +use Coding\Issue; +use Coding\Iteration; use App\Coding\ProjectSetting; use Tests\TestCase; @@ -109,9 +109,8 @@ public function testImportUserStorySuccess() )['Response']['Iteration']); $issueMock->shouldReceive('create')->times(1)->withArgs([ - $this->token, - $this->projectUri, [ + 'ProjectName' => $this->projectUri, 'Type' => 'REQUIREMENT', 'IssueTypeId' => 213218, 'Name' => '用户可通过手机号注册账户', @@ -154,9 +153,8 @@ public function testImportSubTask() $parentIssue = $response; $issueMock->shouldReceive('create')->times(1)->withArgs([ - $this->token, - $this->projectUri, [ + 'ProjectName' => $this->projectUri, 'Type' => 'REQUIREMENT', 'IssueTypeId' => 213218, 'Name' => '用户可通过手机号注册账户', @@ -169,9 +167,8 @@ public function testImportSubTask() $subTask1 = $response; $subTask1['Code'] = $this->faker->randomNumber(); $issueMock->shouldReceive('create')->times(1)->withArgs([ - $this->token, - $this->projectUri, [ + 'ProjectName' => $this->projectUri, 'Type' => 'SUB_TASK', 'IssueTypeId' => 213222, 'Name' => '完成手机号注册的短信验证码发送接口', @@ -184,9 +181,8 @@ public function testImportSubTask() $subTask2 = $response; $subTask2['Code'] = $this->faker->randomNumber(); $issueMock->shouldReceive('create')->times(1)->withArgs([ - $this->token, - $this->projectUri, [ + 'ProjectName' => $this->projectUri, 'Type' => 'SUB_TASK', 'IssueTypeId' => 213222, 'Name' => '完成通过手机号注册用户的接口', diff --git a/tests/Unit/CodingIssueTest.php b/tests/Unit/CodingIssueTest.php deleted file mode 100644 index 861fe1b..0000000 --- a/tests/Unit/CodingIssueTest.php +++ /dev/null @@ -1,81 +0,0 @@ -dataDir . 'coding/CreateIssueResponse.json'); - $codingToken = $this->faker->md5; - $codingProjectUri = $this->faker->slug; - $data = [ - 'Type' => 'REQUIREMENT', - 'Name' => $this->faker->title, - 'Priority' => $this->faker->randomElement([0, 1, 2, 3]), - ]; - - $clientMock = $this->getMockBuilder(Client::class)->getMock(); - $clientMock->expects($this->once()) - ->method('request') - ->with( - 'POST', - 'https://e.coding.net/open-api', - [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${codingToken}", - 'Content-Type' => 'application/json' - ], - 'json' => array_merge([ - 'Action' => 'CreateIssue', - 'ProjectName' => $codingProjectUri, - ], $data) - ] - ) - ->willReturn(new Response(200, [], $responseBody)); - $coding = new Issue($clientMock); - $result = $coding->create($codingToken, $codingProjectUri, $data); - $this->assertEquals(json_decode($responseBody, true)['Response']['Issue'], $result); - } - - public function testCreateFailed() - { - $responseBody = file_get_contents($this->dataDir . 'coding/CreateIssueFailedResponse.json'); - $codingToken = $this->faker->md5; - $codingProjectUri = $this->faker->slug; - $data = [ - 'Type' => 'REQUIREMENT', - 'Name' => $this->faker->title, - 'Priority' => $this->faker->randomElement([0, 1, 2, 3]), - ]; - - $clientMock = $this->getMockBuilder(Client::class)->getMock(); - $clientMock->expects($this->once()) - ->method('request') - ->with( - 'POST', - 'https://e.coding.net/open-api', - [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${codingToken}", - 'Content-Type' => 'application/json' - ], - 'json' => array_merge([ - 'Action' => 'CreateIssue', - 'ProjectName' => $codingProjectUri, - ], $data) - ] - ) - ->willReturn(new Response(200, [], $responseBody)); - $coding = new Issue($clientMock); - $this->expectException(\Exception::class); - $coding->create($codingToken, $codingProjectUri, $data); - } -} From beb492d43eebd7ec60cb3ab57c79821753c6caf4 Mon Sep 17 00:00:00 2001 From: sink Date: Mon, 25 Oct 2021 17:51:07 +0800 Subject: [PATCH 3/9] refactor: #81 use coding sdk project setting --- app/Coding/ProjectSetting.php | 42 ----------- app/Commands/IssueImportCommand.php | 11 ++- app/Commands/ProjectGetIssueTypesCommand.php | 5 +- composer.json | 2 +- composer.lock | 14 ++-- tests/Feature/IssueImportCommandTest.php | 8 +- .../ProjectGetIssueTypesCommandTest.php | 2 +- tests/Unit/CodingProjectSettingTest.php | 75 ------------------- 8 files changed, 24 insertions(+), 135 deletions(-) delete mode 100644 app/Coding/ProjectSetting.php delete mode 100644 tests/Unit/CodingProjectSettingTest.php diff --git a/app/Coding/ProjectSetting.php b/app/Coding/ProjectSetting.php deleted file mode 100644 index ee644f7..0000000 --- a/app/Coding/ProjectSetting.php +++ /dev/null @@ -1,42 +0,0 @@ -client->request('POST', 'https://e.coding.net/open-api', [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${token}", - 'Content-Type' => 'application/json' - ], - 'json' => [ - 'Action' => 'DescribeProjectIssueTypeList', - 'ProjectName' => $projectName, - ], - ]); - $result = json_decode($response->getBody(), true); - return $result['Response']['IssueTypes']; - } - - public function getIssueTypeStatus(string $token, string $projectName, string $issueType, int $issueTypeId) - { - $response = $this->client->request('POST', 'https://e.coding.net/open-api', [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${token}", - 'Content-Type' => 'application/json' - ], - 'json' => [ - 'Action' => 'DescribeProjectIssueStatusList', - 'ProjectName' => $projectName, - 'IssueType' => $issueType, - 'IssueTypeId' => $issueTypeId, - ], - ]); - $result = json_decode($response->getBody(), true); - return $result['Response']['ProjectIssueStatusList']; - } -} diff --git a/app/Commands/IssueImportCommand.php b/app/Commands/IssueImportCommand.php index 8f89d0d..6b433ab 100644 --- a/app/Commands/IssueImportCommand.php +++ b/app/Commands/IssueImportCommand.php @@ -4,7 +4,7 @@ use Coding\Issue; use Coding\Iteration; -use App\Coding\ProjectSetting; +use Coding\ProjectSetting; use Exception; use LaravelZero\Framework\Commands\Command; use Rap2hpoutre\FastExcel\Facades\FastExcel; @@ -46,6 +46,7 @@ public function handle(Issue $codingIssue, ProjectSetting $projectSetting, Itera $this->setCodingApi(); $codingIssue->setToken($this->codingToken); $iteration->setToken($this->codingToken); + $projectSetting->setToken($this->codingToken); $filePath = $this->argument('file'); if (!file_exists($filePath)) { @@ -75,7 +76,7 @@ public function handle(Issue $codingIssue, ProjectSetting $projectSetting, Itera private function getIssueTypes(ProjectSetting $projectSetting, array $row): void { if (empty($this->issueTypes)) { - $result = $projectSetting->getIssueTypes($this->codingToken, $this->codingProjectUri); + $result = $projectSetting->getIssueTypes(['ProjectName' => $this->codingProjectUri]); foreach ($result as $item) { $this->issueTypes[$item['Name']] = $item; } @@ -90,7 +91,11 @@ private function getStatusId(ProjectSetting $projectSetting, string $issueTypeNa if (!isset($this->issueTypeStatus[$issueTypeName])) { $type = $this->issueTypes[$issueTypeName]['IssueType']; $typeId = $this->issueTypes[$issueTypeName]['Id']; - $result = $projectSetting->getIssueTypeStatus($this->codingToken, $this->codingProjectUri, $type, $typeId); + $result = $projectSetting->getIssueStatus([ + 'ProjectName' => $this->codingProjectUri, + 'IssueType' => $type, + 'IssueTypeId' => $typeId + ]); foreach ($result as $item) { $tmp = $item['IssueStatus']; $this->issueTypeStatus[$issueTypeName][$tmp['Name']] = $tmp['Id']; diff --git a/app/Commands/ProjectGetIssueTypesCommand.php b/app/Commands/ProjectGetIssueTypesCommand.php index 6c81755..ff7b081 100644 --- a/app/Commands/ProjectGetIssueTypesCommand.php +++ b/app/Commands/ProjectGetIssueTypesCommand.php @@ -2,7 +2,7 @@ namespace App\Commands; -use App\Coding\ProjectSetting; +use Coding\ProjectSetting; use LaravelZero\Framework\Commands\Command; class ProjectGetIssueTypesCommand extends Command @@ -34,8 +34,9 @@ class ProjectGetIssueTypesCommand extends Command public function handle(ProjectSetting $projectSetting): int { $this->setCodingApi(); + $projectSetting->setToken($this->codingToken); - $result = $projectSetting->getIssueTypes($this->codingToken, $this->codingProjectUri); + $result = $projectSetting->getIssueTypes(['ProjectName' => $this->codingProjectUri]); foreach ($result as $item) { $this->info($item['Id'] . ' ' . $item['Name']); diff --git a/composer.json b/composer.json index ac4e7b3..2d5c4f1 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "ext-json": "*", "ext-libxml": "*", "ext-zip": "*", - "coding/sdk": "^0.2.0", + "coding/sdk": "^0.3.0", "illuminate/log": "^8.0", "laravel-fans/confluence": "^0.1.1", "laravel-zero/framework": "^8.8", diff --git a/composer.lock b/composer.lock index 34222cb..1b078aa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1fbbc80274b42f3e2ef3f4dd2840f643", + "content-hash": "b408b6a3c536eca0f449625d5f3fca29", "packages": [ { "name": "box/spout", @@ -142,16 +142,16 @@ }, { "name": "coding/sdk", - "version": "0.2.0", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/Coding/coding-sdk-php.git", - "reference": "17575f7ca9a6475f32bd9ce0ef13f58f0045079b" + "reference": "4bdc7746826f7f1025198e6dc9543d9a3127eb59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Coding/coding-sdk-php/zipball/17575f7ca9a6475f32bd9ce0ef13f58f0045079b", - "reference": "17575f7ca9a6475f32bd9ce0ef13f58f0045079b", + "url": "https://api.github.com/repos/Coding/coding-sdk-php/zipball/4bdc7746826f7f1025198e6dc9543d9a3127eb59", + "reference": "4bdc7746826f7f1025198e6dc9543d9a3127eb59", "shasum": "" }, "require": { @@ -180,9 +180,9 @@ "description": "CODING.net SDK for PHP", "support": { "issues": "https://github.com/Coding/coding-sdk-php/issues", - "source": "https://github.com/Coding/coding-sdk-php/tree/0.2.0" + "source": "https://github.com/Coding/coding-sdk-php/tree/0.3.0" }, - "time": "2021-10-25T07:58:15+00:00" + "time": "2021-10-25T09:09:13+00:00" }, { "name": "doctrine/inflector", diff --git a/tests/Feature/IssueImportCommandTest.php b/tests/Feature/IssueImportCommandTest.php index 6f1f502..797e509 100755 --- a/tests/Feature/IssueImportCommandTest.php +++ b/tests/Feature/IssueImportCommandTest.php @@ -4,7 +4,7 @@ use Coding\Issue; use Coding\Iteration; -use App\Coding\ProjectSetting; +use Coding\ProjectSetting; use Tests\TestCase; class IssueImportCommandTest extends TestCase @@ -37,7 +37,7 @@ public function testImportSuccess() file_get_contents($this->dataDir . 'coding/' . 'DescribeProjectIssueStatusListResponse.json'), true )['Response']['ProjectIssueStatusList']; - $projectSettingMock->shouldReceive('getIssueTypeStatus')->times(5)->andReturn( + $projectSettingMock->shouldReceive('getIssueStatus')->times(5)->andReturn( $requirementStatus, $requirementStatus, $requirementStatus, @@ -87,7 +87,7 @@ public function testImportUserStorySuccess() file_get_contents($this->dataDir . 'coding/' . 'DescribeProjectIssueTypeListResponse.json'), true )['Response']['IssueTypes']); - $projectSettingMock->shouldReceive('getIssueTypeStatus')->times(1)->andReturn(json_decode( + $projectSettingMock->shouldReceive('getIssueStatus')->times(1)->andReturn(json_decode( file_get_contents($this->dataDir . 'coding/' . 'DescribeProjectIssueStatusListResponse.json'), true )['Response']['ProjectIssueStatusList']); @@ -138,7 +138,7 @@ public function testImportSubTask() file_get_contents($this->dataDir . 'coding/' . 'DescribeProjectIssueTypeListResponse.json'), true )['Response']['IssueTypes']); - $projectSettingMock->shouldReceive('getIssueTypeStatus')->times(2)->andReturn(json_decode( + $projectSettingMock->shouldReceive('getIssueStatus')->times(2)->andReturn(json_decode( file_get_contents($this->dataDir . 'coding/' . 'DescribeProjectIssueStatusListResponse.json'), true )['Response']['ProjectIssueStatusList']); diff --git a/tests/Feature/ProjectGetIssueTypesCommandTest.php b/tests/Feature/ProjectGetIssueTypesCommandTest.php index e900124..85de5ee 100755 --- a/tests/Feature/ProjectGetIssueTypesCommandTest.php +++ b/tests/Feature/ProjectGetIssueTypesCommandTest.php @@ -2,7 +2,7 @@ namespace Tests\Feature; -use App\Coding\ProjectSetting; +use Coding\ProjectSetting; use Tests\TestCase; class ProjectGetIssueTypesCommandTest extends TestCase diff --git a/tests/Unit/CodingProjectSettingTest.php b/tests/Unit/CodingProjectSettingTest.php deleted file mode 100644 index 3766757..0000000 --- a/tests/Unit/CodingProjectSettingTest.php +++ /dev/null @@ -1,75 +0,0 @@ -dataDir . 'coding/DescribeProjectIssueTypeListResponse.json'); - $codingToken = $this->faker->md5; - $codingProjectUri = $this->faker->slug; - - $clientMock = $this->getMockBuilder(Client::class)->getMock(); - $clientMock->expects($this->once()) - ->method('request') - ->with( - 'POST', - 'https://e.coding.net/open-api', - [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${codingToken}", - 'Content-Type' => 'application/json' - ], - 'json' => array_merge([ - 'Action' => 'DescribeProjectIssueTypeList', - 'ProjectName' => $codingProjectUri, - ]) - ] - ) - ->willReturn(new Response(200, [], $responseBody)); - $coding = new ProjectSetting($clientMock); - $result = $coding->getIssueTypes($codingToken, $codingProjectUri); - $this->assertEquals(json_decode($responseBody, true)['Response']['IssueTypes'], $result); - } - - public function testGetIssueTypeStatusSuccess() - { - $responseBody = file_get_contents($this->dataDir . 'coding/DescribeProjectIssueStatusListResponse.json'); - $codingToken = $this->faker->md5; - $codingProjectUri = $this->faker->slug; - - $issueType = $this->faker->randomElement(['DEFECT', 'REQUIREMENT', 'MISSION', 'EPIC', 'SUB_TASK']); - $issueTypeId = $this->faker->randomNumber(); - $clientMock = $this->getMockBuilder(Client::class)->getMock(); - $clientMock->expects($this->once()) - ->method('request') - ->with( - 'POST', - 'https://e.coding.net/open-api', - [ - 'headers' => [ - 'Accept' => 'application/json', - 'Authorization' => "token ${codingToken}", - 'Content-Type' => 'application/json' - ], - 'json' => array_merge([ - 'Action' => 'DescribeProjectIssueStatusList', - 'ProjectName' => $codingProjectUri, - 'IssueType' => $issueType, - 'IssueTypeId' => $issueTypeId, - ]) - ] - ) - ->willReturn(new Response(200, [], $responseBody)); - $coding = new ProjectSetting($clientMock); - $result = $coding->getIssueTypeStatus($codingToken, $codingProjectUri, $issueType, $issueTypeId); - $this->assertEquals(json_decode($responseBody, true)['Response']['ProjectIssueStatusList'], $result); - } -} From 0206121ff24c9b2d2224822f61c7271ba32f59ea Mon Sep 17 00:00:00 2001 From: sinkcup Date: Mon, 25 Oct 2021 19:06:18 +0800 Subject: [PATCH 4/9] build: failed when no php changed --- .git-pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-pre-commit b/.git-pre-commit index bbfec67..12ba4ef 100755 --- a/.git-pre-commit +++ b/.git-pre-commit @@ -1,7 +1,7 @@ #!/bin/sh set -e -FILES=$(git diff --diff-filter=d --name-only HEAD | grep '.php$') +FILES=$(git diff --diff-filter=d --name-only HEAD | { grep '.php$' || true; }) for file in $FILES; do ./vendor/bin/phpcs --extensions=php --standard=PSR12 "$file" ./vendor/bin/phpmd "$file" text phpmd.xml --exclude vendor From 21353d58b7019a9b28f50f6efec9cda41a5eb722 Mon Sep 17 00:00:00 2001 From: sinkcup Date: Mon, 25 Oct 2021 19:06:57 +0800 Subject: [PATCH 5/9] build: show coverage --- .git-pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.git-pre-commit b/.git-pre-commit index 12ba4ef..c456026 100755 --- a/.git-pre-commit +++ b/.git-pre-commit @@ -6,4 +6,4 @@ for file in $FILES; do ./vendor/bin/phpcs --extensions=php --standard=PSR12 "$file" ./vendor/bin/phpmd "$file" text phpmd.xml --exclude vendor done -./vendor/bin/phpunit tests/ +XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text --coverage-filter=app/ tests/ From b98681cda1e9d74497aeea1e035c5ef3e08ad4cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 01:19:46 +0000 Subject: [PATCH 6/9] build(deps): bump guzzlehttp/psr7 from 2.1.0 to 2.2.1 Bumps [guzzlehttp/psr7](https://github.com/guzzle/psr7) from 2.1.0 to 2.2.1. - [Release notes](https://github.com/guzzle/psr7/releases) - [Changelog](https://github.com/guzzle/psr7/blob/master/CHANGELOG.md) - [Commits](https://github.com/guzzle/psr7/compare/2.1.0...2.2.1) --- updated-dependencies: - dependency-name: guzzlehttp/psr7 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index 1b078aa..23f8a6d 100644 --- a/composer.lock +++ b/composer.lock @@ -1045,16 +1045,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.1.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", "shasum": "" }, "require": { @@ -1078,7 +1078,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -1140,7 +1140,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.1.0" + "source": "https://github.com/guzzle/psr7/tree/2.2.1" }, "funding": [ { @@ -1156,7 +1156,7 @@ "type": "tidelift" } ], - "time": "2021-10-06T17:43:30+00:00" + "time": "2022-03-20T21:55:58+00:00" }, { "name": "guzzlehttp/uri-template", @@ -8421,5 +8421,5 @@ "ext-zip": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.2.0" } From 279164f54b3c7be5b49de7d3292e5b8315ccf58d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 21:01:55 +0000 Subject: [PATCH 7/9] build(deps): bump guzzlehttp/guzzle from 7.4.0 to 7.4.3 Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.4.0 to 7.4.3. - [Release notes](https://github.com/guzzle/guzzle/releases) - [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md) - [Commits](https://github.com/guzzle/guzzle/compare/7.4.0...7.4.3) --- updated-dependencies: - dependency-name: guzzlehttp/guzzle dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/composer.lock b/composer.lock index 23f8a6d..d9edadf 100644 --- a/composer.lock +++ b/composer.lock @@ -752,16 +752,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.0", + "version": "7.4.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94" + "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94", - "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", + "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", "shasum": "" }, "require": { @@ -770,7 +770,7 @@ "guzzlehttp/psr7": "^1.8.3 || ^2.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2" + "symfony/deprecation-contracts": "^2.2 || ^3.0" }, "provide": { "psr/http-client-implementation": "1.0" @@ -794,12 +794,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -856,7 +856,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.0" + "source": "https://github.com/guzzle/guzzle/tree/7.4.3" }, "funding": [ { @@ -872,7 +872,7 @@ "type": "tidelift" } ], - "time": "2021-10-18T09:52:00+00:00" + "time": "2022-05-25T13:24:33+00:00" }, { "name": "guzzlehttp/guzzle-services", @@ -986,12 +986,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3996,16 +3996,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.4.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { @@ -4014,7 +4014,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4043,7 +4043,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" }, "funding": [ { @@ -4059,7 +4059,7 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/error-handler", @@ -8421,5 +8421,5 @@ "ext-zip": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From 48f1c4850e097dccfdd6c3111710f02ea60f2664 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 06:50:47 +0000 Subject: [PATCH 8/9] build(deps): bump guzzlehttp/guzzle from 7.4.3 to 7.4.4 Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.4.3 to 7.4.4. - [Release notes](https://github.com/guzzle/guzzle/releases) - [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md) - [Commits](https://github.com/guzzle/guzzle/compare/7.4.3...7.4.4) --- updated-dependencies: - dependency-name: guzzlehttp/guzzle dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index d9edadf..796dd98 100644 --- a/composer.lock +++ b/composer.lock @@ -752,16 +752,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.3", + "version": "7.4.4", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8", + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8", "shasum": "" }, "require": { @@ -856,7 +856,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.3" + "source": "https://github.com/guzzle/guzzle/tree/7.4.4" }, "funding": [ { @@ -872,7 +872,7 @@ "type": "tidelift" } ], - "time": "2022-05-25T13:24:33+00:00" + "time": "2022-06-09T21:39:15+00:00" }, { "name": "guzzlehttp/guzzle-services", @@ -1045,16 +1045,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.2.1", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/83260bb50b8fc753c72d14dc1621a2dac31877ee", + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee", "shasum": "" }, "require": { @@ -1078,7 +1078,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -1140,7 +1140,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.2.1" + "source": "https://github.com/guzzle/psr7/tree/2.3.0" }, "funding": [ { @@ -1156,7 +1156,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:55:58+00:00" + "time": "2022-06-09T08:26:02+00:00" }, { "name": "guzzlehttp/uri-template", From 23aa919fef6ce3aaf6dc2fbce2b15c0e2d8d7bef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 21:02:15 +0000 Subject: [PATCH 9/9] build(deps): bump guzzlehttp/guzzle from 7.4.4 to 7.4.5 Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.4.4 to 7.4.5. - [Release notes](https://github.com/guzzle/guzzle/releases) - [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md) - [Commits](https://github.com/guzzle/guzzle/compare/7.4.4...7.4.5) --- updated-dependencies: - dependency-name: guzzlehttp/guzzle dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 796dd98..1e3073b 100644 --- a/composer.lock +++ b/composer.lock @@ -752,22 +752,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.4", + "version": "7.4.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8" + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8", - "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/psr7": "^1.9 || ^2.4", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -856,7 +856,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.4" + "source": "https://github.com/guzzle/guzzle/tree/7.4.5" }, "funding": [ { @@ -872,7 +872,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T21:39:15+00:00" + "time": "2022-06-20T22:16:13+00:00" }, { "name": "guzzlehttp/guzzle-services", @@ -1045,16 +1045,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.3.0", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee" + "reference": "13388f00956b1503577598873fffb5ae994b5737" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/83260bb50b8fc753c72d14dc1621a2dac31877ee", - "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", + "reference": "13388f00956b1503577598873fffb5ae994b5737", "shasum": "" }, "require": { @@ -1078,7 +1078,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } }, "autoload": { @@ -1140,7 +1140,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.3.0" + "source": "https://github.com/guzzle/psr7/tree/2.4.0" }, "funding": [ { @@ -1156,7 +1156,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T08:26:02+00:00" + "time": "2022-06-20T21:43:11+00:00" }, { "name": "guzzlehttp/uri-template",