Skip to content
Merged
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
10 changes: 5 additions & 5 deletions .github/workflows/run-phpstan-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-24.04]
php: [8.3]
laravel: [11]
os: [ubuntu-latest]
php: [8.4]
laravel: [12]
stability: [prefer-dist]

name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
Expand Down Expand Up @@ -77,10 +77,10 @@ jobs:

- name: Update dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --${{ matrix.stability }} --no-interaction
run: composer update --${{ matrix.stability }} --no-interaction -W

- name: Install PHPStan
run: composer require larastan/larastan:^2.0 --no-interaction
run: composer require larastan/larastan:^3.0 --no-interaction -W

- uses: actions/cache@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-24.04]
php: [8.3]
laravel: [11]
os: [ubuntu-latest]
php: [8.4]
laravel: [12]
stability: [prefer-dist]

name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
Expand Down Expand Up @@ -80,10 +80,10 @@ jobs:

- name: Update dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --${{ matrix.stability }} --no-interaction
run: composer update --${{ matrix.stability }} --no-interaction -W

- name: Install PHPStan
run: composer require larastan/larastan:^2.0 --dev --no-interaction
run: composer require larastan/larastan:^3.0 --dev --no-interaction -W

- uses: actions/cache@v4
with:
Expand Down
85 changes: 84 additions & 1 deletion .github/workflows/run-tests-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
max-parallel: 2
matrix:
os: [ubuntu-latest]
php: [8.2, 8.3, 8.4]
php: [8.2, 8.3]
laravel: [10.*]
stability: [prefer-dist]

Expand Down Expand Up @@ -172,3 +172,86 @@ jobs:

- name: Run Visuals Tests
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage

test-laravel12:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [ubuntu-latest]
php: [8.2, 8.3, 8.4]
laravel: [12.*]
stability: [prefer-dist]

name: PULL PHP-${{ matrix.php }} - Laravel-12
env:
extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.extensionKey }}

- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
tools: phpunit:latest
ini-values: memory_limit=512M
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Get composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }}-composer-

- name: Add token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer config github-oauth.github.com $GITHUB_TOKEN

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update

- name: Update dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --${{ matrix.stability }} --no-interaction

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run Unit Tests
run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage

- name: Run Visuals Tests
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage
85 changes: 84 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
max-parallel: 2
matrix:
os: [ubuntu-24.04]
php: [8.2, 8.3, 8.4]
php: [8.2, 8.3]
laravel: [10.*]
stability: [prefer-dist]

Expand Down Expand Up @@ -174,3 +174,86 @@ jobs:

- name: Run Visuals Tests
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage

test-laravel12:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [ubuntu-24.04]
php: [8.2, 8.3, 8.4]
laravel: [12.*]
stability: [prefer-dist]

name: PHP-${{ matrix.php }} - Laravel-12
env:
extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.extensionKey }}

- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
tools: phpunit:latest
ini-values: memory_limit=512M
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Get composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-

- name: Add token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer config github-oauth.github.com $GITHUB_TOKEN

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update

- name: Update dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --${{ matrix.stability }} --no-interaction

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run Unit Tests
run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage

- name: Run Visuals Tests
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
}
],
"require": {
"php": "^8.1|^8.2|^8.3",
"php": "^8.1|^8.2|^8.3|^8.4",
"blade-ui-kit/blade-heroicons": "^2.1",
"illuminate/contracts": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"illuminate/contracts": "^10.0|^11.0|^12.0",
"illuminate/support": "^10.0|^11.0|^12.0",
"livewire/livewire": "^3.0|dev-main"
},
"require-dev": {
"ext-sqlite3": "*",
"brianium/paratest": "^5.0|^6.0|^7.0|^8.0",
"brianium/paratest": "^5.0|^6.0|^7.0|^8.0|^9.0",
"larastan/larastan": "^2.6|^3.0",
"laravel/pint": "^1.10",
"monolog/monolog": "*",
"nunomaduro/collision": "^6.0|^7.0|^8.0",
"larastan/larastan": "^2.6",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.0|^10.0|^11.0"
"nunomaduro/collision": "^6.0|^7.0|^8.0|^9.0",
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0",
"phpunit/phpunit": "^9.0|^10.0|^11.0|^12.0"
},
"autoload": {
"psr-4": {
Expand Down
51 changes: 36 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,76 +1,97 @@
parameters:
ignoreErrors:
-
message: "#^Offset '1' on array\\<string, non\\-empty\\-array\\<int\\<0, max\\>, mixed\\>\\> in empty\\(\\) does not exist\\.$#"
message: '#^Offset ''1'' on array\<string, non\-empty\-list\> in empty\(\) does not exist\.$#'
identifier: empty.offset
count: 1
path: src/DataTableComponent.php

-
message: "#^Offset '99' on array\\<string, non\\-empty\\-array\\<int\\<0, max\\>, mixed\\>\\> in isset\\(\\) does not exist\\.$#"
message: '#^Offset ''99'' on array\<string, non\-empty\-list\> in isset\(\) does not exist\.$#'
identifier: isset.offset
count: 1
path: src/DataTableComponent.php

-
message: "#^Offset '99' on non\\-empty\\-array\\<1\\|string, array\\<int\\<0, max\\>, mixed\\>\\> in isset\\(\\) does not exist\\.$#"
message: '#^Offset ''99'' on non\-empty\-array\<1\|string, list\> in isset\(\) does not exist\.$#'
identifier: isset.offset
count: 1
path: src/DataTableComponent.php

-
message: "#^Property Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:\\$joins \\(array\\) on left side of \\?\\? is not nullable\\.$#"
message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#'
identifier: argument.type
count: 1
path: src/DataTableComponent.php

-
message: "#^Property Rappasoft\\\\LaravelLivewireTables\\\\DataTableComponent\\:\\:\\$model has no type specified\\.$#"
message: '#^Property Rappasoft\\LaravelLivewireTables\\DataTableComponent\:\:\$model has no type specified\.$#'
identifier: missingType.property
count: 1
path: src/DataTableComponent.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
message: '#^Parameter \#1 \$view of function view expects view\-string\|null, string given\.$#'
identifier: argument.type
count: 1
path: src/View/Components/FilterPill.php

-
message: '#^Unsafe usage of new static\(\)\.$#'
identifier: new.static
count: 1
path: src/Views/Action.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
message: '#^Unsafe usage of new static\(\)\.$#'
identifier: new.static
count: 1
path: src/Views/Column.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
message: '#^Unsafe usage of new static\(\)\.$#'
identifier: new.static
count: 1
path: src/Views/Filter.php

-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#"
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
identifier: argument.type
count: 1
path: src/Views/Filters/MultiSelectDropdownFilter.php

-
message: "#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
identifier: argument.templateType
count: 1
path: src/Views/Filters/MultiSelectDropdownFilter.php

-
message: "#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
identifier: argument.templateType
count: 1
path: src/Views/Filters/MultiSelectDropdownFilter.php

-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#"
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
identifier: argument.type
count: 1
path: src/Views/Filters/MultiSelectFilter.php

-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#"
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<int,string\>\:\:filter\(\) expects \(callable\(string, int\)\: bool\)\|null, Closure\(mixed\)\: int\<0, max\> given\.$#'
identifier: argument.type
count: 1
path: src/Views/Filters/NumberRangeFilter.php

-
message: "#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
message: '#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
identifier: argument.templateType
count: 1
path: src/Views/Filters/SelectFilter.php

-
message: "#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#"
message: '#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:mapWithKeys\(\)$#'
identifier: argument.templateType
count: 1
path: src/Views/Filters/SelectFilter.php
Loading