From 0c440721b35272599cac859c145ce19c19310d6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 07:15:43 +0000 Subject: [PATCH 01/10] chore(deps): bump dependabot/fetch-metadata from 1.6.0 to 2.2.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.6.0 to 2.2.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.6.0...v2.2.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index ca2197d..eb537d8 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 2937fd1a6e7ac95fc592e1e736e8868fe8fc3fc7 Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:12:34 +0100 Subject: [PATCH 02/10] build(workflows): streamline workflows and update PHP version --- .../workflows/fix-php-code-style-issues.yml | 5 +--- .github/workflows/phpstan.yml | 8 ++---- .github/workflows/run-tests.yml | 27 ++++++++++++------- composer.json | 15 +++++------ 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 255506b..a0a1920 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -1,9 +1,6 @@ name: Fix PHP code style issues -on: - push: - paths: - - '**.php' +on: [push] permissions: contents: write diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index ccfa9d9..1aa0eaa 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,10 +1,6 @@ name: PHPStan -on: - push: - paths: - - '**.php' - - 'phpstan.neon.dist' +on: [push] jobs: phpstan: @@ -16,7 +12,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.4' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 180659f..21effb5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,25 +1,35 @@ name: run-tests on: - push: - branches: [main] - pull_request: - branches: [main] + - push + - pull_request jobs: test: runs-on: ${{ matrix.os }} + strategy: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.2, 8.1] - laravel: [10.*] + php: [8.1, 8.2, 8.3, 8.4] + laravel: [10.*, 11.*, 12.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 10.* testbench: 8.* carbon: ^2.63 + - laravel: 11.* + testbench: 9.* + carbon: ^3.0 + - laravel: 12.* + testbench: 10.* + carbon: ^3.0 + exclude: + - laravel: 11.* + php: 8.1 + - laravel: 12.* + php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -31,7 +41,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite coverage: none - name: Setup problem matchers @@ -44,8 +54,5 @@ jobs: composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - - name: List Installed Dependencies - run: composer show -D - - name: Execute tests run: vendor/bin/pest diff --git a/composer.json b/composer.json index 5897761..3b4f45e 100644 --- a/composer.json +++ b/composer.json @@ -19,18 +19,17 @@ ], "require": { "php": "^8.1", - "guzzlehttp/guzzle": "^7.5", - "illuminate/contracts": "^9.0|^10.0", + "guzzlehttp/guzzle": "^7.5|^8.0", + "illuminate/contracts": "^9.0|^10.0|^11.0|^12.0", "spatie/laravel-package-tools": "^1.14.0" }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^6.0|^7.0", - "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^8.0", - "pestphp/pest": "^2.0", - "pestphp/pest-plugin-arch": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0", + "nunomaduro/collision": "^6.0|^7.0|^8.0", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.0|^3.0", + "pestphp/pest-plugin-arch": "^2.0|^3.0", + "pestphp/pest-plugin-laravel": "^2.0|^3.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0" From a379ae2c02827be27bf1ed66d198ab00e106c072 Mon Sep 17 00:00:00 2001 From: leMaur <2118799+leMaur@users.noreply.github.com> Date: Sun, 23 Feb 2025 11:13:21 +0000 Subject: [PATCH 03/10] Fix styling --- src/Data/BoardData.php | 3 +-- src/Data/ConfigData.php | 3 +-- src/Data/Contracts/MediaSourceContract.php | 4 +--- src/Data/MediaSource/MediaSourceData.php | 3 +-- src/Data/MediaSource/MediaUrlItemData.php | 3 +-- src/Data/OAuthData.php | 7 +++---- src/Data/PinData.php | 3 +-- src/Events/CredentialsRetrieved.php | 3 +-- src/Exceptions/OAuthException.php | 4 +--- src/Services/Pinterest.php | 3 +-- src/Services/Resources/BoardResource.php | 3 +-- src/Services/Resources/OAuthResource.php | 3 +-- src/Services/Resources/PinResource.php | 3 +-- 13 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/Data/BoardData.php b/src/Data/BoardData.php index 7a64dc5..d819509 100644 --- a/src/Data/BoardData.php +++ b/src/Data/BoardData.php @@ -16,8 +16,7 @@ public function __construct( public readonly string $description, public readonly PrivacyEnum $privacy, public readonly ?string $cover_image = null, - ) { - } + ) {} public static function fromApi(array $data): self { diff --git a/src/Data/ConfigData.php b/src/Data/ConfigData.php index 9308f58..9f8e7b8 100644 --- a/src/Data/ConfigData.php +++ b/src/Data/ConfigData.php @@ -20,8 +20,7 @@ public function __construct( public readonly int $retry_times, public readonly int $retry_sleep, public readonly array $scopes - ) { - } + ) {} public static function fromConfig(array $data): self { diff --git a/src/Data/Contracts/MediaSourceContract.php b/src/Data/Contracts/MediaSourceContract.php index 84312c9..4ed2631 100644 --- a/src/Data/Contracts/MediaSourceContract.php +++ b/src/Data/Contracts/MediaSourceContract.php @@ -4,6 +4,4 @@ namespace Lemaur\Pinterest\Data\Contracts; -interface MediaSourceContract extends DataContract -{ -} +interface MediaSourceContract extends DataContract {} diff --git a/src/Data/MediaSource/MediaSourceData.php b/src/Data/MediaSource/MediaSourceData.php index eb76e7a..00efae7 100644 --- a/src/Data/MediaSource/MediaSourceData.php +++ b/src/Data/MediaSource/MediaSourceData.php @@ -15,6 +15,5 @@ abstract class MediaSourceData implements MediaSourceContract public function __construct( public string $source_type, - ) { - } + ) {} } diff --git a/src/Data/MediaSource/MediaUrlItemData.php b/src/Data/MediaSource/MediaUrlItemData.php index d104d49..3bfe329 100644 --- a/src/Data/MediaSource/MediaUrlItemData.php +++ b/src/Data/MediaSource/MediaUrlItemData.php @@ -13,6 +13,5 @@ public function __construct( public readonly ?string $title = null, public readonly ?string $description = null, public readonly ?string $link = null, - ) { - } + ) {} } diff --git a/src/Data/OAuthData.php b/src/Data/OAuthData.php index 2218038..56ccbf3 100644 --- a/src/Data/OAuthData.php +++ b/src/Data/OAuthData.php @@ -17,20 +17,19 @@ public function __construct( public readonly ?string $refresh_token = null, public readonly ?Carbon $access_token_expired_at = null, public readonly ?Carbon $refresh_token_expired_at = null, - ) { - } + ) {} public function missingAccessToken(): bool { return blank($this->access_token); } - public function isAccessTokenExpired(): bool|null + public function isAccessTokenExpired(): ?bool { return $this->access_token_expired_at?->isPast(); } - public function isRefreshTokenExpired(): bool|null + public function isRefreshTokenExpired(): ?bool { return $this->refresh_token_expired_at?->isPast(); } diff --git a/src/Data/PinData.php b/src/Data/PinData.php index e14de4e..dac10d9 100644 --- a/src/Data/PinData.php +++ b/src/Data/PinData.php @@ -15,8 +15,7 @@ public function __construct( public readonly string $title, public readonly string $description, public readonly string $link, - ) { - } + ) {} public static function fromApi(array $data): self { diff --git a/src/Events/CredentialsRetrieved.php b/src/Events/CredentialsRetrieved.php index 85f6235..a10da6e 100644 --- a/src/Events/CredentialsRetrieved.php +++ b/src/Events/CredentialsRetrieved.php @@ -13,6 +13,5 @@ class CredentialsRetrieved public function __construct( public readonly OAuthData $oauth, - ) { - } + ) {} } diff --git a/src/Exceptions/OAuthException.php b/src/Exceptions/OAuthException.php index f938557..327869b 100644 --- a/src/Exceptions/OAuthException.php +++ b/src/Exceptions/OAuthException.php @@ -6,6 +6,4 @@ use Exception; -class OAuthException extends Exception -{ -} +class OAuthException extends Exception {} diff --git a/src/Services/Pinterest.php b/src/Services/Pinterest.php index 15427b6..923b75c 100755 --- a/src/Services/Pinterest.php +++ b/src/Services/Pinterest.php @@ -20,8 +20,7 @@ class Pinterest implements PinterestContract public function __construct( public readonly ConfigData $config, public readonly OAuthData $oauth, - ) { - } + ) {} /** * @throws OAuthException diff --git a/src/Services/Resources/BoardResource.php b/src/Services/Resources/BoardResource.php index 5eb13c5..acf5365 100644 --- a/src/Services/Resources/BoardResource.php +++ b/src/Services/Resources/BoardResource.php @@ -16,8 +16,7 @@ class BoardResource public function __construct( private readonly Pinterest $service, - ) { - } + ) {} /** * Get a list of the boards owned by the "operation user_account" diff --git a/src/Services/Resources/OAuthResource.php b/src/Services/Resources/OAuthResource.php index 022339b..b7e3363 100644 --- a/src/Services/Resources/OAuthResource.php +++ b/src/Services/Resources/OAuthResource.php @@ -31,8 +31,7 @@ public function __construct( private readonly Pinterest $service, private readonly ConfigData $config, private readonly OAuthData $oauth, - ) { - } + ) {} public function credentials(): OAuthData { diff --git a/src/Services/Resources/PinResource.php b/src/Services/Resources/PinResource.php index 543ee48..ffa8cb2 100644 --- a/src/Services/Resources/PinResource.php +++ b/src/Services/Resources/PinResource.php @@ -20,8 +20,7 @@ class PinResource public function __construct( private readonly Pinterest $service, - ) { - } + ) {} public function list() { From 76840a51a197da2f64ea4b03ef7a0a782d739105 Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:15:02 +0100 Subject: [PATCH 04/10] ci: update test matrix to exclude specific versions --- .github/workflows/run-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 21effb5..2101fb8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -28,8 +28,10 @@ jobs: exclude: - laravel: 11.* php: 8.1 + carbon: ^2.63 - laravel: 12.* php: 8.1 + carbon: ^2.63 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 49cb343fccba05533e14f9961908ed04367c511e Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:16:25 +0100 Subject: [PATCH 05/10] chore: remove unused PHPStan checks for clarity --- phpstan.neon.dist | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 21dc694..bfe3b1b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,8 +7,7 @@ parameters: - src - config - routes + tmpDir: build/phpstan - checkOctaneCompatibility: true - checkModelProperties: true checkMissingIterableValueType: false From fc096ab48127607304fc8e348ba8d10153b86636 Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:17:24 +0100 Subject: [PATCH 06/10] ci: update test matrix for Laravel and Carbon versions --- .github/workflows/run-tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2101fb8..7f553b2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,20 +18,15 @@ jobs: include: - laravel: 10.* testbench: 8.* - carbon: ^2.63 - laravel: 11.* testbench: 9.* - carbon: ^3.0 - laravel: 12.* testbench: 10.* - carbon: ^3.0 exclude: - laravel: 11.* php: 8.1 - carbon: ^2.63 - laravel: 12.* php: 8.1 - carbon: ^2.63 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 094c01e15db35b648781075f05bdddc46f36bb56 Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:18:14 +0100 Subject: [PATCH 07/10] chore: remove unused PHPStan configuration options --- phpstan.neon.dist | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index bfe3b1b..84ef38e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,5 +9,3 @@ parameters: - routes tmpDir: build/phpstan - checkMissingIterableValueType: false - From 42f03de64021dd43245504b4fb6c2d6115a15613 Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:20:23 +0100 Subject: [PATCH 08/10] chore: remove obsolete PHPStan workflow file --- .github/workflows/phpstan.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/phpstan.yml diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml deleted file mode 100644 index 1aa0eaa..0000000 --- a/.github/workflows/phpstan.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: PHPStan - -on: [push] - -jobs: - phpstan: - name: phpstan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - coverage: none - - - name: Install composer dependencies - uses: ramsey/composer-install@v2 - - - name: Run PHPStan - run: ./vendor/bin/phpstan --error-format=github From 4cd37e969b22f9e1d1aca42c7358c253d39c9621 Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:21:31 +0100 Subject: [PATCH 09/10] chore(ci): update carbon versions in test workflow --- .github/workflows/run-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7f553b2..21effb5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,10 +18,13 @@ jobs: include: - laravel: 10.* testbench: 8.* + carbon: ^2.63 - laravel: 11.* testbench: 9.* + carbon: ^3.0 - laravel: 12.* testbench: 10.* + carbon: ^3.0 exclude: - laravel: 11.* php: 8.1 From f9a201a4b60707d6bf5c32f05e1ff584c147de80 Mon Sep 17 00:00:00 2001 From: Maurizio Date: Sun, 23 Feb 2025 12:22:58 +0100 Subject: [PATCH 10/10] ci: update stability setting for test workflow --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 21effb5..7ba8954 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: os: [ubuntu-latest, windows-latest] php: [8.1, 8.2, 8.3, 8.4] laravel: [10.*, 11.*, 12.*] - stability: [prefer-lowest, prefer-stable] + stability: [prefer-stable] include: - laravel: 10.* testbench: 8.*