diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fea4c6f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - master + - 'claude/**' + pull_request: + branches: + - master + +jobs: + lint: + name: PHP ${{ matrix.php }} lint + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + php: ['5.6', '7.4', '8.0', '8.1', '8.2', '8.3'] + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + coverage: none + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress + + - name: Parallel lint + run: vendor/bin/parallel-lint --exclude vendor . diff --git a/HTML/QuickForm/depselect.php b/HTML/QuickForm/depselect.php index 9196817..86418cf 100644 --- a/HTML/QuickForm/depselect.php +++ b/HTML/QuickForm/depselect.php @@ -2,15 +2,23 @@ require_once 'HTML/QuickForm/text.php'; class HTML_QuickForm_depselect extends HTML_QuickForm_text { - - function HTML_QuickForm_depselect( - $elementName=null, - $elementLabel=null, - $attributes=null, + + function __construct( + $elementName=null, + $elementLabel=null, + $attributes=null, $properties=null){ - parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes); + // PHP 4-style parent constructors are fatal in PHP 8. Prefer + // parent::__construct(), but fall back to the PHP 4 ctor name + // for installations running against pre-modernized PEAR + // HTML_QuickForm bundles shipped with older xataface versions. + if (is_callable(array('HTML_QuickForm_input', '__construct'))) { + parent::__construct($elementName, $elementLabel, $attributes); + } else { + parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes); + } } - + function toHtml(){ $oldFrozen = $this->_flagFrozen; $this->_flagFrozen = 0; @@ -23,4 +31,3 @@ function toHtml(){ return $out; } } - diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..32c2757 --- /dev/null +++ b/composer.json @@ -0,0 +1,12 @@ +{ + "name": "shannah/xataface-module-depselect", + "description": "Xataface dependent-select widget module.", + "type": "xataface-module", + "license": "LGPL-2.1-or-later", + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.3" + } +}