Skip to content

Commit

Permalink
fixup! Set minimum CiviCRM version to 5.45, Use PHP 8.3 for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Tubach committed Feb 9, 2024
1 parent fad8496 commit 99ed789
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3
coverage: none
tools: cs2pr
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['7.4', '8.0', '8.3']
prefer: ['prefer-stable', 'prefer-lowest']
name: PHPStan with PHP ${{ matrix.php-versions }} ${{ matrix.prefer }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
civicrm-image-tags: [ '5-drupal', '5-drupal-php7.4', '5.44-drupal-php7.4' ]
civicrm-image-tags: [ '5-drupal', '5-drupal-php7.4', '5.45-drupal-php7.4' ]
name: PHPUnit with Docker image michaelmcandrew/civicrm:${{ matrix.civicrm-image-tags }}
env:
CIVICRM_IMAGE_TAG: ${{ matrix.civicrm-image-tags }}
Expand Down
7 changes: 1 addition & 6 deletions Civi/Civioffice/Api4/Action/LiveSnippet/GetAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,9 @@ public function _run(Result $result): void {
->setLimit($this->getLimit())
->setWhere($this->getWhere())
->setOrderBy($this->getOrderBy())
->setLanguage($this->language)

Check failure on line 43 in Civi/Civioffice/Api4/Action/LiveSnippet/GetAction.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 7.4 prefer-lowest

Access to an undefined property Civi\Civioffice\Api4\Action\LiveSnippet\GetAction::$language.

Check failure on line 43 in Civi/Civioffice/Api4/Action/LiveSnippet/GetAction.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 8.0 prefer-lowest

Access to an undefined property Civi\Civioffice\Api4\Action\LiveSnippet\GetAction::$language.

Check failure on line 43 in Civi/Civioffice/Api4/Action/LiveSnippet/GetAction.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 8.3 prefer-lowest

Access to an undefined property Civi\Civioffice\Api4\Action\LiveSnippet\GetAction::$language.
->addWhere('option_group_id:name', '=', 'civioffice_live_snippets');

// Property "language" is not available in CiviCRM <5.45
// @phpstan-ignore-next-line
if (property_exists($this, 'language')) {
$action->setLanguage($this->language);
}

$result->exchangeArray($action->execute()->getArrayCopy());

$lastValueSelected = $this->isLastValueSelected();
Expand Down
7 changes: 1 addition & 6 deletions Civi/Civioffice/Api4/Action/LiveSnippet/GetFieldsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,10 @@ protected function getRecords(): array {
->setAction($this->getAction())
->setLoadOptions($this->getLoadOptions())
->setOrderBy($this->getOrderBy())
->setLanguage($this->language)

Check failure on line 40 in Civi/Civioffice/Api4/Action/LiveSnippet/GetFieldsAction.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 7.4 prefer-lowest

Access to an undefined property Civi\Civioffice\Api4\Action\LiveSnippet\GetFieldsAction::$language.

Check failure on line 40 in Civi/Civioffice/Api4/Action/LiveSnippet/GetFieldsAction.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 8.0 prefer-lowest

Access to an undefined property Civi\Civioffice\Api4\Action\LiveSnippet\GetFieldsAction::$language.

Check failure on line 40 in Civi/Civioffice/Api4/Action/LiveSnippet/GetFieldsAction.php

View workflow job for this annotation

GitHub Actions / PHPStan with PHP 8.3 prefer-lowest

Access to an undefined property Civi\Civioffice\Api4\Action\LiveSnippet\GetFieldsAction::$language.
->addWhere('name', 'IN', ['label', 'name', 'description'])
->addValue('option_group_id:name', 'civioffice_live_snippets');

// Property "language" is not available in CiviCRM <5.45
// @phpstan-ignore-next-line
if (property_exists($this, 'language')) {
$action->setLanguage($this->language);
}

$fields = $action->execute()->getArrayCopy();

$fields[] = [
Expand Down
2 changes: 1 addition & 1 deletion ci/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
}
},
"require": {
"civicrm/civicrm-core": "^5.44"
"civicrm/civicrm-core": "^5.45"
}
}
2 changes: 1 addition & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<version>1.0-dev</version>
<develStage>dev</develStage>
<compatibility>
<ver>5.44</ver>
<ver>5.45</ver>
</compatibility>
<comments/>
<classloader>
Expand Down
2 changes: 0 additions & 2 deletions phpstan.ci.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ parameters:
-
message: '#Dead catch - CRM_Core_Exception is never thrown in the try block.#'
path: */Civi/Civioffice/EventSubscriber/ParticipantCiviOfficeTokenSubscriber.php
# CiviCRM <5.45
- '#^Call to an undefined method Civi\\Api4\\Generic\\DAOGetFieldsAction::setLanguage\(\).$#'

0 comments on commit 99ed789

Please sign in to comment.