diff --git a/.github/workflows/composerAudit.yaml b/.github/workflows/composerAudit.yaml new file mode 100644 index 0000000..dc196b6 --- /dev/null +++ b/.github/workflows/composerAudit.yaml @@ -0,0 +1,30 @@ +on: [push] +name: Composer Audit Check +jobs: + composer-audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Read the current used PHP Version + id: get-php-version + run: echo "::set-output name=version $(head -n1 .php-version)" + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ steps.get-php-version.outputs.version }} + tools: pecl, composer:2 + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --prefer-dist --no-scripts --no-dev + + - run: composer audit \ No newline at end of file diff --git a/src/AkeneoApi.php b/src/AkeneoApi.php index 0efe8d3..5ee9dba 100644 --- a/src/AkeneoApi.php +++ b/src/AkeneoApi.php @@ -22,5 +22,5 @@ public function getCategories(string $rootCode): CategoryItem; /** * @throws AkeneoApiException */ - public function triggerUpdate(string $identifier, string $message = null): void; + public function triggerUpdate(string $identifier, ?string $message = null): void; } diff --git a/src/AkeneoApiException.php b/src/AkeneoApiException.php index 02f51ee..2e8be4f 100644 --- a/src/AkeneoApiException.php +++ b/src/AkeneoApiException.php @@ -11,7 +11,7 @@ class AkeneoApiException extends \Exception { - protected function __construct(string $message = '', \Throwable $previous = null) + protected function __construct(string $message = '', ?\Throwable $previous = null) { parent::__construct($message, 0, $previous); } diff --git a/src/CachedSymfonyHttpClientAkeneoApi.php b/src/CachedSymfonyHttpClientAkeneoApi.php index 6625b4c..9f6183a 100644 --- a/src/CachedSymfonyHttpClientAkeneoApi.php +++ b/src/CachedSymfonyHttpClientAkeneoApi.php @@ -64,7 +64,7 @@ public function getCategories(string $rootCode): CategoryItem return $item; } - public function triggerUpdate(string $identifier, string $message = null): void + public function triggerUpdate(string $identifier, ?string $message = null): void { $this->decorated->triggerUpdate($identifier); } diff --git a/src/SymfonyHttpClientAkeneoApi.php b/src/SymfonyHttpClientAkeneoApi.php index d275ddf..22701d3 100644 --- a/src/SymfonyHttpClientAkeneoApi.php +++ b/src/SymfonyHttpClientAkeneoApi.php @@ -80,7 +80,7 @@ public function getCategories(string $rootCode): CategoryItem /** * @throws AkeneoApiException */ - public function triggerUpdate(string $identifier, string $message = null): void + public function triggerUpdate(string $identifier, ?string $message = null): void { $this->assertProductExists($identifier);