Skip to content

Commit

Permalink
Union type issue fixed for older PHP versions 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulhaque committed Nov 13, 2023
1 parent 1fdcdd5 commit 141225d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 36 deletions.
75 changes: 42 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,51 @@
name: run-tests

on:
push:
branches: [master]
# pull_request:
# branches: [master]
push:
branches: [master]
# pull_request:
# branches: [master]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1]
laravel: [10.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 7.4]
laravel: [10.*, 9.*, 8.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
exclude:
- laravel: 10.*
php: 7.4
- laravel: 9.*
php: 7.4

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

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

- name: Setup PHP
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
coverage: none
- name: Setup PHP
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
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": "^7.4|^8.0",
"php": "^7.3|^8.0|^8.1",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0"
},
"require-dev": {
Expand Down
3 changes: 2 additions & 1 deletion src/AbstractFilepond.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ protected function getFieldValue()
/**
* Set the FilePond field value data
*
* @param string|array|null $fieldValue
* @return $this
*/
protected function setFieldValue(string|array|null $fieldValue)
protected function setFieldValue($fieldValue)
{
if (! $fieldValue) {
$this->fieldValue = null;
Expand Down
3 changes: 2 additions & 1 deletion src/Filepond.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ class Filepond extends AbstractFilepond
/**
* Set the FilePond field name
*
* @param string|array|null $field
* @return $this
*/
public function field(string|array|null $field, bool $checkOwnership = true)
public function field($field, bool $checkOwnership = true)
{
$this->setFieldValue($field)
->setTempDisk(config('filepond.temp_disk', 'local'))
Expand Down

0 comments on commit 141225d

Please sign in to comment.