From 545b84e1f27307782d5941f4c6d113a2498ffab5 Mon Sep 17 00:00:00 2001 From: Robert M <48888686+robertmarney@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:10:42 -0700 Subject: [PATCH] L11 Support (#14) * Update to support Laravel 11 --------- Co-authored-by: robertmarney --- .github/workflows/dependabot-auto-merge.yml | 8 ++++---- .github/workflows/fix-php-code-style-issues.yml | 4 ++-- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 13 +++++-------- .github/workflows/update-changelog.yml | 2 +- README.md | 4 ++-- composer.json | 16 ++++++++-------- src/LaraHierarchy.php | 6 +++--- 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 8fc6538..f98ff2a 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -10,20 +10,20 @@ jobs: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: - + - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.4.0 + uses: dependabot/fetch-metadata@v1.6.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - + - name: Auto-merge Dependabot PRs for semver-minor updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - + - name: Auto-merge Dependabot PRs for semver-patch updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} run: gh pr merge --auto --merge "$PR_URL" diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index cc0c956..b28ae50 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -8,12 +8,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.2.0 + uses: aglipanci/laravel-pint-action@2.3.0 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 9d41c0c..ccfa9d9 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -11,7 +11,7 @@ jobs: name: phpstan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 11d0619..404a9e4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,23 +9,20 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.2, 8.1, 8.0] - laravel: [10.*, 9.*] + php: [8.3, 8.2] + laravel: [11.*, 10.*] dependency-version: [prefer-lowest, prefer-stable] include: + - laravel: 11.* + testbench: 9.*-dev - laravel: 10.* testbench: 8.* - - laravel: 9.* - testbench: 7.* - exclude: - - laravel: 10.* - php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index b20f3b6..94df2c3 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main diff --git a/README.md b/README.md index 79983dd..6192334 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ The package supports unlimited starting nodes, and has been tested to 10 levels ## Requirements: -* Illuminate Collections 8+/9+/10+ (Packaged in Laravel 8+/9+/10+) -* PHP 8.0 / 8.1 / 8.2 +* Illuminate Collections 8+/9+/10+/11+ (Packaged in Laravel 8+/9+/10+/11+) +* PHP 8.0 / 8.1 / 8.2 / 8.3 ## Installation diff --git a/composer.json b/composer.json index 5b48fe6..64ce09c 100644 --- a/composer.json +++ b/composer.json @@ -16,21 +16,21 @@ } ], "require": { - "php": "^8.0|^8.1|^8.2", - "illuminate/collections": "^8.0|^9.0|^10.0", - "illuminate/contracts": "^8.0|^9.0|^10.0" + "php": "^8.0|^8.1|^8.2|^8.3", + "illuminate/collections": "^8.0|^9.0|^10.0|^11.0", + "illuminate/contracts": "^8.0|^9.0|^10.0|^11.0" }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^6.0", + "nunomaduro/collision": "^7.0|^8.0|^9.0", "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^7.0|^8.0", - "pestphp/pest": "^1.21", - "pestphp/pest-plugin-laravel": "^1.1", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.5" }, "autoload": { "psr-4": { diff --git a/src/LaraHierarchy.php b/src/LaraHierarchy.php index fb966c1..e4bf4ae 100644 --- a/src/LaraHierarchy.php +++ b/src/LaraHierarchy.php @@ -9,9 +9,9 @@ class LaraHierarchy /** * Take a flat collection of objects and transform into a hierarchical collection * - * @param Collection $collection - Data to be translated to a hierarchy of nodes. - * @param string $parentIdentifier - default: 'parent_id' - * @param string $relationName - default: 'children + * @param Collection $collection - Data to be translated to a hierarchy of nodes. + * @param string $parentIdentifier - default: 'parent_id' + * @param string $relationName - default: 'children * @param string $localIdentifier - default 'id' */ public function collectionToHierarchy(Collection $collection, string $parentIdentifier = 'parent_id', string $relationName = 'children', string $localIdentifier = 'id'): Collection