Skip to content

Upgrade Laravel 12 / 11 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Fix PHP code style issues

on:
push:
paths:
- '**.php'
on: [push]

permissions:
contents: write
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/phpstan.yml

This file was deleted.

29 changes: 18 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}

Expand All @@ -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
Expand All @@ -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
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 1 addition & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ parameters:
- src
- config
- routes
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false

tmpDir: build/phpstan
3 changes: 1 addition & 2 deletions src/Data/BoardData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions src/Data/ConfigData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 1 addition & 3 deletions src/Data/Contracts/MediaSourceContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

namespace Lemaur\Pinterest\Data\Contracts;

interface MediaSourceContract extends DataContract
{
}
interface MediaSourceContract extends DataContract {}
3 changes: 1 addition & 2 deletions src/Data/MediaSource/MediaSourceData.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ abstract class MediaSourceData implements MediaSourceContract

public function __construct(
public string $source_type,
) {
}
) {}
}
3 changes: 1 addition & 2 deletions src/Data/MediaSource/MediaUrlItemData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ public function __construct(
public readonly ?string $title = null,
public readonly ?string $description = null,
public readonly ?string $link = null,
) {
}
) {}
}
7 changes: 3 additions & 4 deletions src/Data/OAuthData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions src/Data/PinData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions src/Events/CredentialsRetrieved.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ class CredentialsRetrieved

public function __construct(
public readonly OAuthData $oauth,
) {
}
) {}
}
4 changes: 1 addition & 3 deletions src/Exceptions/OAuthException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Exception;

class OAuthException extends Exception
{
}
class OAuthException extends Exception {}
3 changes: 1 addition & 2 deletions src/Services/Pinterest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class Pinterest implements PinterestContract
public function __construct(
public readonly ConfigData $config,
public readonly OAuthData $oauth,
) {
}
) {}

/**
* @throws OAuthException
Expand Down
3 changes: 1 addition & 2 deletions src/Services/Resources/BoardResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions src/Services/Resources/OAuthResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public function __construct(
private readonly Pinterest $service,
private readonly ConfigData $config,
private readonly OAuthData $oauth,
) {
}
) {}

public function credentials(): OAuthData
{
Expand Down
3 changes: 1 addition & 2 deletions src/Services/Resources/PinResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class PinResource

public function __construct(
private readonly Pinterest $service,
) {
}
) {}

public function list()
{
Expand Down
Loading