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 }}" 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 deleted file mode 100644 index ccfa9d9..0000000 --- a/.github/workflows/phpstan.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: PHPStan - -on: - push: - paths: - - '**.php' - - 'phpstan.neon.dist' - -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.1' - coverage: none - - - name: Install composer dependencies - uses: ramsey/composer-install@v2 - - - name: Run PHPStan - run: ./vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 180659f..7ba8954 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.*] - stability: [prefer-lowest, prefer-stable] + php: [8.1, 8.2, 8.3, 8.4] + laravel: [10.*, 11.*, 12.*] + stability: [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" diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 21dc694..84ef38e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,8 +7,5 @@ parameters: - src - config - routes - tmpDir: build/phpstan - checkOctaneCompatibility: true - checkModelProperties: true - checkMissingIterableValueType: false + tmpDir: build/phpstan 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() {