From 41e8f7835ea27492f5f55d41e4ca2f5c0f830fdd Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:04:38 +0900 Subject: [PATCH 01/15] Update CI workflow to use specific action versions and improve PHP setup --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b5d349..c1ef7c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,19 +16,23 @@ jobs: php-versions: ['7.3', '7.4', '8.0'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false - name: Setup PHP - uses: shivammathur/setup-php@master + uses: step-security/setup-php@0b4c3f57a1fb50d5cc8172a9700f35b97b3b5d97 # v2.37.0 with: php-version: ${{ matrix.php-versions }} + env: + fail-fast: true - name: Validate composer.json and composer.lock run: composer validate --strict - name: Cache Composer packages id: composer-cache - uses: actions/cache@v2 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: vendor key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} From 819daf1620584d144df49ed198cff2d05b2809a9 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:11:33 +0900 Subject: [PATCH 02/15] Refactor CI workflow to set PHP version via environment variable and add linting job --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1ef7c8..a9a359c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,13 @@ on: pull_request: branches: [ main ] -jobs: - tests: +env: + MAIN_PHP_VERSION: '8.5' +jobs: + lint: runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.3', '7.4', '8.0'] - steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -23,7 +21,7 @@ jobs: - name: Setup PHP uses: step-security/setup-php@0b4c3f57a1fb50d5cc8172a9700f35b97b3b5d97 # v2.37.0 with: - php-version: ${{ matrix.php-versions }} + php-version: ${{ env.MAIN_PHP_VERSION }} env: fail-fast: true @@ -35,9 +33,9 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-php-${{ env.MAIN_PHP_VERSION }}-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-php- + ${{ runner.os }}-php-${{ env.MAIN_PHP_VERSION }}- - name: Install dependencies run: composer install --prefer-dist --no-progress @@ -55,5 +53,37 @@ jobs: - name: Run linter run: vendor/bin/phpstan analyse --level 5 src/ tests/ + tests: + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + php-versions: ['7.4', ${{ env.MAIN_PHP_VERSION }}] + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Setup PHP + uses: step-security/setup-php@0b4c3f57a1fb50d5cc8172a9700f35b97b3b5d97 # v2.37.0 + with: + php-version: ${{ matrix.php-versions }} + env: + fail-fast: true + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php-versions }}- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + - name: Run test suite run: vendor/bin/phpunit tests/ From 7dba0b98a0b7930676a53fe1a1825a4593c35bb3 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:20:31 +0900 Subject: [PATCH 03/15] Enhance CI workflow by consolidating formatter steps, updating PHPStan level, and removing caching for Composer packages --- .github/workflows/ci.yml | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9a359c..6f75c4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,36 +22,21 @@ jobs: uses: step-security/setup-php@0b4c3f57a1fb50d5cc8172a9700f35b97b3b5d97 # v2.37.0 with: php-version: ${{ env.MAIN_PHP_VERSION }} + tools: composer, php-cs-fixer, phpstan env: fail-fast: true - name: Validate composer.json and composer.lock run: composer validate --strict - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: vendor - key: ${{ runner.os }}-php-${{ env.MAIN_PHP_VERSION }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php-${{ env.MAIN_PHP_VERSION }}- - - name: Install dependencies run: composer install --prefer-dist --no-progress - - name: Run formatter (src/) - uses: docker://oskarstark/php-cs-fixer-ga - with: - args: --diff --dry-run src/ - - - name: Run formatter (tests/) - uses: docker://oskarstark/php-cs-fixer-ga - with: - args: --diff --dry-run tests/ + - name: Run formatter (src directory and tests directory) + run: php-cs-fixer fix --diff --dry-run src/ tests/ - name: Run linter - run: vendor/bin/phpstan analyse --level 5 src/ tests/ + run: phpstan analyse --level 8 src/ tests/ tests: runs-on: ubuntu-latest @@ -70,20 +55,12 @@ jobs: uses: step-security/setup-php@0b4c3f57a1fb50d5cc8172a9700f35b97b3b5d97 # v2.37.0 with: php-version: ${{ matrix.php-versions }} + tools: composer, phpunit env: fail-fast: true - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: vendor - key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php-${{ matrix.php-versions }}- - - name: Install dependencies run: composer install --prefer-dist --no-progress - name: Run test suite - run: vendor/bin/phpunit tests/ + run: phpunit tests/ From de673c4c6e1b88181def395521fbdded147018da Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:23:02 +0900 Subject: [PATCH 04/15] Update CI workflow to include PHP 8.5 in the testing matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f75c4b..461fe8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: strategy: fail-fast: true matrix: - php-versions: ['7.4', ${{ env.MAIN_PHP_VERSION }}] + php-versions: ['7.4', '8.5'] steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 From ed4aefca7da062a0a4a941f1eafd7dec9a41d97a Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:25:53 +0900 Subject: [PATCH 05/15] Refactor CI workflow to run PHP CS Fixer on src and tests directories separately --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 461fe8b..68f84ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,10 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress - - name: Run formatter (src directory and tests directory) - run: php-cs-fixer fix --diff --dry-run src/ tests/ + - name: Run formatter + run: | + php-cs-fixer fix --diff --dry-run src/ + php-cs-fixer fix --diff --dry-run tests/ - name: Run linter run: phpstan analyse --level 8 src/ tests/ From 7cca9bf743c20845d4da664cc41f6d8f7b8ba2bc Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:26:39 +0900 Subject: [PATCH 06/15] Update CI workflow to set timeout for linting and testing jobs --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68f84ca..24637a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ env: jobs: lint: runs-on: ubuntu-latest - + timeout-minutes: 10 steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -42,7 +42,7 @@ jobs: tests: runs-on: ubuntu-latest - + timeout-minutes: 10 strategy: fail-fast: true matrix: From d5bc4b86bd7701606140fbb27ac81040ba0e2a21 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:31:12 +0900 Subject: [PATCH 07/15] Refactor CI workflow to remove PHPStan and PHPUnit from tools list, and update commands to use vendor binaries --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24637a7..71e495a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: uses: step-security/setup-php@0b4c3f57a1fb50d5cc8172a9700f35b97b3b5d97 # v2.37.0 with: php-version: ${{ env.MAIN_PHP_VERSION }} - tools: composer, php-cs-fixer, phpstan + tools: composer, php-cs-fixer env: fail-fast: true @@ -38,7 +38,7 @@ jobs: php-cs-fixer fix --diff --dry-run tests/ - name: Run linter - run: phpstan analyse --level 8 src/ tests/ + run: vendor/bin/phpstan analyse --level 8 src/ tests/ tests: runs-on: ubuntu-latest @@ -57,7 +57,7 @@ jobs: uses: step-security/setup-php@0b4c3f57a1fb50d5cc8172a9700f35b97b3b5d97 # v2.37.0 with: php-version: ${{ matrix.php-versions }} - tools: composer, phpunit + tools: composer env: fail-fast: true @@ -65,4 +65,4 @@ jobs: run: composer install --prefer-dist --no-progress - name: Run test suite - run: phpunit tests/ + run: vendor/bin/phpunit tests/ From 8a25f42c5e6cef7c039363d4bbb00e055b9d3c8f Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:33:02 +0900 Subject: [PATCH 08/15] Reduce timeout for linting and testing jobs in CI workflow from 10 to 5 minutes --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71e495a..1d1a6b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ env: jobs: lint: runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 5 steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -42,7 +42,7 @@ jobs: tests: runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 5 strategy: fail-fast: true matrix: From bdff50f2dcf18c9b3a542a915bd3aa8b7d158da8 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:41:25 +0900 Subject: [PATCH 09/15] Add PHP CS Fixer configuration file and simplify CI formatter step --- .github/workflows/ci.yml | 4 +--- .php-cs-fixer.dist.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .php-cs-fixer.dist.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d1a6b8..73bc1d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,9 +33,7 @@ jobs: run: composer install --prefer-dist --no-progress - name: Run formatter - run: | - php-cs-fixer fix --diff --dry-run src/ - php-cs-fixer fix --diff --dry-run tests/ + run: php-cs-fixer fix --diff --dry-run - name: Run linter run: vendor/bin/phpstan analyse --level 8 src/ tests/ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..c7e7147 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,14 @@ +in([__DIR__ . '/src', __DIR__ . '/tests']); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PER-CS' => true, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => false, + 'elements' => ['arguments', 'array_destructuring', 'arrays', 'match', 'parameters'], + ], + ]) + ->setFinder($finder); From 620e9b6cb453f44e0d9ef15634d63a23334a9993 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:45:54 +0900 Subject: [PATCH 10/15] Update PHP CS Fixer configuration to simplify trailing comma rule --- .php-cs-fixer.dist.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index c7e7147..d516260 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -6,9 +6,6 @@ return (new PhpCsFixer\Config()) ->setRules([ '@PER-CS' => true, - 'trailing_comma_in_multiline' => [ - 'after_heredoc' => false, - 'elements' => ['arguments', 'array_destructuring', 'arrays', 'match', 'parameters'], - ], + 'trailing_comma_in_multiline' => false, ]) ->setFinder($finder); From c846e1ed1d8093ded1c31e95143274d85a0c5964 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 11:50:17 +0900 Subject: [PATCH 11/15] Add operator linebreak rule to PHP CS Fixer configuration --- .php-cs-fixer.dist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index d516260..08469fd 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -7,5 +7,6 @@ ->setRules([ '@PER-CS' => true, 'trailing_comma_in_multiline' => false, + 'operator_linebreak' => ['position' => 'end'], ]) ->setFinder($finder); From 4e2655492dc52ba1b22583083fc9e08cdb39cc25 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 02:58:03 +0000 Subject: [PATCH 12/15] Add devcontainer configuration for PHP development environment --- .devcontainer/devcontainer.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3c59058 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "name": "microcms-php-sdk", + "image": "mcr.microsoft.com/devcontainers/php:8.5", + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "xdebug.php-debug", + "bmewburn.vscode-intelephense-client", + "junstyle.php-cs-fixer" + ] + } + }, + "postCreateCommand": "composer install" +} From 2a86af10b615b064e7de278a84bcd91ff99aff46 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 03:05:31 +0000 Subject: [PATCH 13/15] Update PHPStan version to 2.0, add PHPStan configuration file, and adjust CI workflow to run analysis without specifying level --- .github/workflows/ci.yml | 2 +- composer.json | 2 +- phpstan.neon | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 phpstan.neon diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73bc1d8..f21ac85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: php-cs-fixer fix --diff --dry-run - name: Run linter - run: vendor/bin/phpstan analyse --level 8 src/ tests/ + run: vendor/bin/phpstan analyse tests: runs-on: ubuntu-latest diff --git a/composer.json b/composer.json index 99740a4..e958a62 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ ], "require-dev": { "psy/psysh": "@stable", - "phpstan/phpstan": "^0.12.99", + "phpstan/phpstan": "^2.0", "phpunit/phpunit": "^9.5" } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..1cd333b --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 8 + paths: + - src + - tests From 7a2e42b3649dcc296ebf32fa3dc048e36f7bdfa2 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 03:05:50 +0000 Subject: [PATCH 14/15] Refactor Client class to use typed properties and return types, and update test class to use typed variables --- src/Client.php | 45 +++++++++++++++++++++++++++++++++----------- tests/ClientTest.php | 9 ++++++--- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/Client.php b/src/Client.php index 3e8929b..eb0ae63 100644 --- a/src/Client.php +++ b/src/Client.php @@ -4,12 +4,12 @@ class Client { - private $serviceDomain; - private $apiKey; + private string $serviceDomain; + private string $apiKey; - private $client; + private \GuzzleHttp\Client $client; - public function __construct(string $serviceDomain, string $apiKey, \GuzzleHttp\ClientInterface $client = null) + public function __construct(string $serviceDomain, string $apiKey, ?\GuzzleHttp\Client $client = null) { $this->serviceDomain = $serviceDomain; $this->apiKey = $apiKey; @@ -21,7 +21,10 @@ public function __construct(string $serviceDomain, string $apiKey, \GuzzleHttp\C } } - public function list(string $endpoint, array $options = []) + /** + * @param array $options + */ + public function list(string $endpoint, array $options = []): mixed { $path = $endpoint; $response = $this->client->get( @@ -33,7 +36,10 @@ public function list(string $endpoint, array $options = []) return json_decode($response->getBody()); } - public function get(string $endpoint, string $contentId = "", array $options = []) + /** + * @param array $options + */ + public function get(string $endpoint, string $contentId = "", array $options = []): mixed { $path = $contentId ? implode("/", [$endpoint, $contentId]) : $endpoint; $response = $this->client->get( @@ -45,7 +51,11 @@ public function get(string $endpoint, string $contentId = "", array $options = [ return json_decode($response->getBody()); } - public function create(string $endpoint, array $body = [], array $options = []) + /** + * @param array $body + * @param array $options + */ + public function create(string $endpoint, array $body = [], array $options = []): mixed { if (array_key_exists("id", $body)) { $method = "PUT"; @@ -66,7 +76,10 @@ public function create(string $endpoint, array $body = [], array $options = []) return json_decode($response->getBody()); } - public function update(string $endpoint, array $body = []) + /** + * @param array $body + */ + public function update(string $endpoint, array $body = []): mixed { $response = $this->client->patch( array_key_exists("id", $body) ? implode("/", [$endpoint, $body["id"]]) : $endpoint, @@ -83,13 +96,18 @@ function ($v, $k) { return json_decode($response->getBody()); } - public function delete(string $endpoint, string $id) + public function delete(string $endpoint, string $id): void { $path = implode("/", [$endpoint, $id]); $this->client->delete($path, $this->buildOption()); } - private function buildOption(array $option = []) + /** + * @param array $option + * + * @return array + */ + private function buildOption(array $option = []): array { return array_merge( [ @@ -102,7 +120,12 @@ private function buildOption(array $option = []) ); } - private function buildQuery(array $options) + /** + * @param array $options + * + * @return array + */ + private function buildQuery(array $options): array { return array_filter( [ diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 644b4ae..9273330 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -11,19 +11,22 @@ final class ClientTest extends TestCase { - private $handlerStack; - private $mock; + private HandlerStack $handlerStack; + private MockHandler $mock; + + /** @var array> */ private $container; protected function setUp(): void { $this->handlerStack = HandlerStack::create(); $this->container = []; + $container = &$this->container; $this->mock = new MockHandler([]); $this->handlerStack->setHandler($this->mock); - $history = Middleware::history($this->container); + $history = Middleware::history($container); $this->handlerStack->push($history); } From 9e3dc0b3653b9a646ae0ddbc610aef062c865324 Mon Sep 17 00:00:00 2001 From: "K.Utsunomiya" Date: Fri, 3 Jul 2026 03:15:08 +0000 Subject: [PATCH 15/15] Enhance Client class method signatures by adding return type annotations for list, get, create, and update methods. --- src/Client.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Client.php b/src/Client.php index eb0ae63..5161781 100644 --- a/src/Client.php +++ b/src/Client.php @@ -23,8 +23,10 @@ public function __construct(string $serviceDomain, string $apiKey, ?\GuzzleHttp\ /** * @param array $options + * + * @return mixed */ - public function list(string $endpoint, array $options = []): mixed + public function list(string $endpoint, array $options = []) { $path = $endpoint; $response = $this->client->get( @@ -38,8 +40,10 @@ public function list(string $endpoint, array $options = []): mixed /** * @param array $options + * + * @return mixed */ - public function get(string $endpoint, string $contentId = "", array $options = []): mixed + public function get(string $endpoint, string $contentId = "", array $options = []) { $path = $contentId ? implode("/", [$endpoint, $contentId]) : $endpoint; $response = $this->client->get( @@ -54,8 +58,10 @@ public function get(string $endpoint, string $contentId = "", array $options = [ /** * @param array $body * @param array $options + * + * @return mixed */ - public function create(string $endpoint, array $body = [], array $options = []): mixed + public function create(string $endpoint, array $body = [], array $options = []) { if (array_key_exists("id", $body)) { $method = "PUT"; @@ -78,8 +84,10 @@ public function create(string $endpoint, array $body = [], array $options = []): /** * @param array $body + * + * @return mixed */ - public function update(string $endpoint, array $body = []): mixed + public function update(string $endpoint, array $body = []) { $response = $this->client->patch( array_key_exists("id", $body) ? implode("/", [$endpoint, $body["id"]]) : $endpoint,