diff --git a/.github/workflows/PHPStan.yaml b/.github/workflows/PHPStan.yaml index c27c413..5a970d7 100644 --- a/.github/workflows/PHPStan.yaml +++ b/.github/workflows/PHPStan.yaml @@ -8,7 +8,7 @@ jobs: - uses: actions/checkout@master - uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' tools: pecl extensions: gd coverage: xdebug diff --git a/.github/workflows/PHPUnit.yaml b/.github/workflows/PHPUnit.yaml index b0c5e6c..4b8bc98 100644 --- a/.github/workflows/PHPUnit.yaml +++ b/.github/workflows/PHPUnit.yaml @@ -7,13 +7,13 @@ jobs: - uses: actions/checkout@v1 - uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' tools: pecl extensions: amqp coverage: xdebug - uses: php-actions/composer@v5 with: - php_version: '8.2' + php_version: '8.3' - name: PHPUnit run: | php vendor/bin/phpunit -v --coverage-clover clover-coverage.xml --coverage-html coverage_html --log-junit coverage_html/junit.xml diff --git a/.php-version b/.php-version index 2983cad..cf02201 100644 --- a/.php-version +++ b/.php-version @@ -1 +1 @@ -8.2 +8.3 diff --git a/composer.json b/composer.json index 9773193..56b431b 100644 --- a/composer.json +++ b/composer.json @@ -9,13 +9,13 @@ } ], "require": { - "php": "^8.0", + "php": "^8.3", "ext-json": "*", - "symfony/config": "^6.2.0", - "symfony/dependency-injection": "^6.2.0", - "symfony/http-kernel": "^6.2.0", - "symfony/cache": "^6.2.0", - "symfony/http-client": "^6.2.0" + "symfony/config": "^7.1.0", + "symfony/dependency-injection": "^7.1.0", + "symfony/http-kernel": "^7.1.0", + "symfony/cache": "^7.1.0", + "symfony/http-client": "^7.1.0" }, "autoload": { "psr-4": { diff --git a/src/AkeneoApiAuthenticator.php b/src/AkeneoApiAuthenticator.php index d9012f8..59aa10b 100644 --- a/src/AkeneoApiAuthenticator.php +++ b/src/AkeneoApiAuthenticator.php @@ -21,7 +21,7 @@ public function __construct( string $apiUser, string $apiPassword, string $authToken, - HttpClientInterface $client + HttpClientInterface $client, ) { $this->baseUrl = $baseUrl; $this->apiUser = $apiUser; @@ -51,7 +51,7 @@ public function getToken(): string $this->buildUrl('/api/oauth/v1/token'), [ 'headers' => [ 'Content-Type' => 'application/json', - 'Authorization' => sprintf('Basic %s', $this->authToken), + 'Authorization' => \sprintf('Basic %s', $this->authToken), ], 'body' => $body, ] @@ -72,6 +72,6 @@ public function getToken(): string protected function buildUrl(string $endpoint): string { - return sprintf('%s%s', $this->baseUrl, $endpoint); + return \sprintf('%s%s', $this->baseUrl, $endpoint); } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 60acd3d..9973b28 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -9,7 +9,7 @@ class Configuration implements ConfigurationInterface { - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treebuilder = new TreeBuilder('asgoodasnew_akeneo_api'); diff --git a/src/SymfonyHttpClientAkeneoApi.php b/src/SymfonyHttpClientAkeneoApi.php index 22701d3..ff2cbfc 100644 --- a/src/SymfonyHttpClientAkeneoApi.php +++ b/src/SymfonyHttpClientAkeneoApi.php @@ -23,7 +23,7 @@ public function __construct( string $baseUrl, HttpClientInterface $client, AkeneoApiAuthenticator $akeneoApiAuthenticator, - CategoryTreeBuilder $categoryTreeBuilder + CategoryTreeBuilder $categoryTreeBuilder, ) { $this->baseUrl = $baseUrl; $this->client = $client; @@ -39,7 +39,7 @@ public function __construct( */ public function getProduct(string $identifier): array { - $url = $this->buildUrl(sprintf('/api/rest/v1/products/%s', $identifier)); + $url = $this->buildUrl(\sprintf('/api/rest/v1/products/%s', $identifier)); try { $response = $this->client->request(Request::METHOD_GET, $url, $this->getDefaultHeaders()); @@ -90,7 +90,7 @@ public function triggerUpdate(string $identifier, ?string $message = null): void try { $response = $this->client->request( Request::METHOD_PATCH, - $this->buildUrl(sprintf('/api/rest/v1/products/%s', $identifier)), + $this->buildUrl(\sprintf('/api/rest/v1/products/%s', $identifier)), $options ); @@ -112,14 +112,14 @@ private function getDefaultHeaders(): array return [ 'headers' => [ 'Content-Type' => 'application/json', - 'Authorization' => sprintf('Bearer %s', $this->token), + 'Authorization' => \sprintf('Bearer %s', $this->token), ], ]; } private function buildUrl(string $endpoint): string { - return sprintf('%s%s', $this->baseUrl, $endpoint); + return \sprintf('%s%s', $this->baseUrl, $endpoint); } /** @@ -137,7 +137,7 @@ private function assertProductExists(string $identifier): void private function getTriggerUpdateBody(string $identifier, ?string $message): string { - $value = sprintf( + $value = \sprintf( '%s - %s', (new \DateTime())->format('Y-m-d H:i:s'), $message ?? 'update from AkeneoApiBundle'