Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump PHP requirement to 8.1 and update dependencies. #162

Merged
merged 4 commits into from
Jun 28, 2024
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
18 changes: 9 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local
strategy:
matrix:
php-version: ['8.0', '8.1', '8.2', '8.2-no-mongo']
php-version: ['8.1', '8.2', '8.3', '8.3-no-mongo']
include:
- php-version: 8.0
phing_tasks: "qa-tasks"
php-extensions: intl, xsl, mongodb
- php-version: 8.1
phing_tasks: "qa-tasks"
php-extensions: intl, xsl, mongodb
- php-version: 8.2
phing_tasks: "qa-tasks"
php-extensions: intl, xsl, mongodb
- php-version: 8.2-no-mongo
- php-version: 8.3
phing_tasks: "qa-tasks"
php-extensions: intl, xsl, mongodb
- php-version: 8.3-no-mongo
phing_tasks: "qa-tasks"
php-extensions: intl, xsl

Expand All @@ -34,28 +34,28 @@ jobs:
extensions: ${{ matrix.php-extensions }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Cache php-cs-fixer data
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .php_cs_cache
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"

- name: Cache php-stan data
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .phpstan_cache
key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ reports
transformations/*.properties
transformations/*.xsl
vendor
tests/.phpunit.cache
tests/.phpunit.result.cache

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## 3.0.0 - TBD

**N.B. This version bumps the minimum PHP version to 8.1**

Anything marked with [**BC**] is known to affect backward compatibility with previous versions.

### Changed
Expand All @@ -16,6 +18,7 @@ Anything marked with [**BC**] is known to affect backward compatibility with pre
### Removed

- [**BC**] Support for splitting titles of LIDO records has been dropped.
- [**BC**] Updated all dependencies including PHPUnit 10. Some tests may require changes.


## 2.3.0 - 2024-06-24
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For a stable version, see the stable branch.

## General Installation

- Minimum supported PHP version is 8.0.
- Minimum supported PHP version is 8.1.
- Composer is required for dependencies. Run `composer install` (or `php /path/to/composer.phar install`) in the directory where RecordManager is installed.
- The following PHP extensions are required: xml, xslt, mbstring, intl

Expand Down
41 changes: 31 additions & 10 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,44 +35,65 @@
<mkdir dir="${builddir}/reports/coverage"/>
</then>
</if>
<exec command="XDEBUG_MODE=coverage ${basedir}/vendor/bin/phpunit -c ${basedir}/tests/phpunit.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/ ${basedir}/tests ${phpunit_extra_params}" passthru="true" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/phpunit" passthru="true" checkreturn="true">
<arg line="-c ${basedir}/tests/phpunit.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/ ${basedir}/tests ${phpunit_extra_params}" />
<env name="XDEBUG_MODE" value="coverage" />
</exec>
</target>
<target name="phpunitfast" description="Run tests">
<exec command="${basedir}/vendor/bin/phpunit -c ${basedir}/tests/phpunit.xml ${basedir}/tests ${phpunit_extra_params}" passthru="true" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/phpunit" passthru="true" checkreturn="true" >
<arg line="-c ${basedir}/tests/phpunit.xml ${basedir}/tests ${phpunit_extra_params}" />
</exec>
</target>

<!-- PHP CodeSniffer -->
<target name="phpcbf">
<exec command="${basedir}/vendor/bin/phpcbf --standard=${basedir}/tests/phpcs.xml" escape="false" passthru="true" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/phpcbf" escape="false" passthru="true" checkreturn="true">
<arg line="--standard=${basedir}/tests/phpcs.xml" />
</exec>
</target>
<target name="phpcs">
<exec command="${basedir}/vendor/bin/phpcs -s --standard=${basedir}/tests/phpcs.xml" escape="false" passthru="true" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/phpcs" escape="false" passthru="true" checkreturn="true">
<arg line="-s --standard=${basedir}/tests/phpcs.xml" />
</exec>
</target>

<!-- php-cs-fixer (first task applies fixes, second task simply checks if they are needed) -->
<target name="php-cs-fixer">
<exec command="${basedir}/vendor/bin/php-cs-fixer fix --config=${basedir}/tests/recordmanager.php-cs-fixer.php -vvv" passthru="true" escape="false" />
<exec executable="${basedir}/vendor/bin/php-cs-fixer" passthru="true" escape="false">
<arg line="fix --config=${basedir}/tests/recordmanager.php-cs-fixer.php -vvv" />
</exec>
</target>
<target name="php-cs-fixer-dryrun">
<exec command="${basedir}/vendor/bin/php-cs-fixer fix --config=${basedir}/tests/recordmanager.php-cs-fixer.php --dry-run -vvv --diff" passthru="true" escape="false" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/php-cs-fixer" passthru="true" escape="false" checkreturn="true">
<arg line="fix --config=${basedir}/tests/recordmanager.php-cs-fixer.php --dry-run -vvv --diff" />
</exec>
</target>

<!-- Report rule violations with PHPMD (mess detector) -->
<target name="phpmd">
<echo>Make sure you have phpmd installed in path. It's not installed by default due to its dependencies.</echo>
<exec command="phpmd ${srcdir} html ${basedir}/tests/phpmd.xml --reportfile ${basedir}/reports/phpmd.html" />
<exec executable="phpmd">
<arg line="${srcdir} html ${basedir}/tests/phpmd.xml --reportfile ${basedir}/reports/phpmd.html" />
</exec>
</target>

<!-- Psalm -->
<target name="psalm">
<exec command="${basedir}/vendor/bin/psalm --diff" escape="false" passthru="true" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/psalm" escape="false" passthru="true" checkreturn="true">
<arg line="--diff" />
</exec>
</target>
<target name="psalm-info">
<exec command="${basedir}/vendor/bin/psalm --diff --show-info=true" escape="false" passthru="true" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/psalm" escape="false" passthru="true" checkreturn="true">
<arg line="--diff --show-info=true" />
</exec>
</target>

<!-- Phpstan -->
<target name="phpstan-console">
<exec command="${basedir}/vendor/bin/phpstan.phar --configuration=${basedir}/tests/phpstan.neon --memory-limit=2G analyse" escape="false" passthru="true" checkreturn="true" />
<exec executable="${basedir}/vendor/bin/phpstan.phar" escape="false" passthru="true" checkreturn="true">
<arg line="--configuration=${basedir}/tests/phpstan.neon --memory-limit=2G analyse" />
</exec>
</target>
</project>
37 changes: 18 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "GPL-2.0",
"config": {
"platform": {
"php": "8.0"
"php": "8.1"
},
"allow-plugins": {
"composer/package-versions-deprecated": true,
Expand All @@ -33,29 +33,28 @@
"require": {
"cash/lrucache": "1.0.0",
"guzzlehttp/guzzle": "^7.8",
"laminas/laminas-mvc": "3.6.1",
"laminas/laminas-router": "3.11.1",
"laminas/laminas-servicemanager": "3.20.0",
"laminas/laminas-xml": "1.5.0",
"league/mime-type-detection": "1.11.0",
"laminas/laminas-mvc": "3.7.0",
"laminas/laminas-router": "3.13.0",
"laminas/laminas-servicemanager": "3.22.1",
"laminas/laminas-xml": "1.6.0",
"league/mime-type-detection": "1.15.0",
"ml/json-ld": "1.2.1",
"mongodb/mongodb": "1.15.0",
"ocramius/proxy-manager": "2.14.1",
"pcrov/jsonreader": "1.0.2",
"mongodb/mongodb": "1.16.1",
"pcrov/jsonreader": "1.0.3",
"phayes/geophp": "1.2",
"pietercolpaert/hardf": "0.3.1",
"symfony/console": "5.4.23",
"symfony/lock": "5.4.22",
"vufind-org/vufind-marc": "1.0.2",
"pietercolpaert/hardf": "0.4.0",
"symfony/console": "6.4.8",
"symfony/lock": "6.4.8",
"vufind-org/vufind-marc": "1.1.0",
"wikimedia/composer-merge-plugin": "2.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "3.22.0",
"phing/phing": "2.17.4",
"phpstan/phpstan": "1.10.10",
"phpunit/phpunit": "9.6.8",
"squizlabs/php_codesniffer": "3.7.2",
"vimeo/psalm": "5.11.0"
"friendsofphp/php-cs-fixer": "3.59.3",
"phing/phing": "3.0.0",
"phpstan/phpstan": "1.11.5",
"phpunit/phpunit": "10.5.24",
"squizlabs/php_codesniffer": "3.10.1",
"vimeo/psalm": "5.25.0"
},
"scripts": {
"qa": "phing qa-tasks"
Expand Down
Loading