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

2024 Update #20

Merged
merged 39 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
799ee7e
updates dependencies.
stopfstedt Feb 9, 2024
335aa1d
tranform phpunit config file to v11 compliant format.
stopfstedt Feb 10, 2024
04b6ccf
adjust name of phpunit cache file in git ignore list.
stopfstedt Feb 10, 2024
e5a48af
update minimum PHP version requirement to 8.1
stopfstedt Feb 10, 2024
845d813
bump PHP version to 8.1 on GH actions.
stopfstedt Feb 10, 2024
88cf6db
adds phpcs config file and configures its cache file to be git-ignored.
stopfstedt Feb 10, 2024
05e8110
ditch command line flags from phpcs invocations in the CI.
stopfstedt Feb 10, 2024
d611111
updates test coverage.
stopfstedt Feb 10, 2024
87eb375
updates model classes.
stopfstedt Feb 12, 2024
b1d7776
make $name attr "nullable".
stopfstedt Feb 12, 2024
e9d89d5
dissolve Nameable trait.
stopfstedt Feb 12, 2024
6da2d64
expand scope of setter/getter test helper to allow for NULL input che…
stopfstedt Feb 12, 2024
eebef5a
unearth PHPUnit attribute from docblock.
stopfstedt Feb 12, 2024
871576c
appease the code linter.
stopfstedt Feb 12, 2024
8c1d34c
updates links and docs.
stopfstedt Feb 12, 2024
583c3f4
expand test matrix to PHP 8.2 and 8.3
stopfstedt Feb 12, 2024
d15f0ab
ditch PHP 8.1. update dependencies.
stopfstedt Feb 12, 2024
c590765
https it is.
stopfstedt Feb 12, 2024
573650f
add PHPStan to the mix.
stopfstedt Feb 13, 2024
8aeddfc
declare the XMLWriter PHP extension as requirement.
stopfstedt Feb 13, 2024
9407b30
declare the DOM PHP extension as requirement.
stopfstedt Feb 13, 2024
4d019ca
cleanup the Parser class.
stopfstedt Feb 13, 2024
7449a01
rm unused class constants.
stopfstedt Feb 13, 2024
510c548
consolidate case statements with same body.
stopfstedt Feb 13, 2024
c08bd30
rm dead code branch.
stopfstedt Feb 13, 2024
d7c4b57
update file name in code example.
stopfstedt Feb 13, 2024
0a32f40
dial in PHPCS config and streamline linting step in the CI.
stopfstedt Feb 13, 2024
8774940
run PHPStan in the CI pipeline.
stopfstedt Feb 13, 2024
638ae89
update actions/checkout to v4
stopfstedt Feb 13, 2024
66418e5
initalize nullable class member to null.
stopfstedt Feb 13, 2024
d07af88
updates model tests to invoke getter/setters tests for nullable attri…
stopfstedt Feb 13, 2024
f4f66aa
configure PHPUnit for code coverage.
stopfstedt Feb 13, 2024
97885ce
update setter/getter test helper for object attrs that can be nulled.
stopfstedt Feb 13, 2024
d2f01a5
adds dependabot configuration.
stopfstedt Feb 13, 2024
6ce9da8
git ignore phpunit.xml file.
stopfstedt Feb 13, 2024
351eec9
put all remaining model attrs under test coverage.
stopfstedt Feb 13, 2024
b33920c
change dependabot interval from daily to weekly.
stopfstedt Feb 13, 2024
dbd97cd
adds dependency update workflow.
stopfstedt Feb 13, 2024
05b99a6
rm pointless docblocks.
stopfstedt Feb 14, 2024
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
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given our infrequent release here I think weekly may be a better choice with less PRs to manage. I wonder if it's worth pulling in the update-dependencies and maybe adding auto merge as well to keep the number even lower?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to weekly and deps update workflow added ✔️

time: "02:30"
timezone: America/Los_Angeles
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "02:30"
timezone: America/Los_Angeles
open-pull-requests-limit: 10
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:

strategy:
matrix:
php-version: [8.0]
php-version: [8.2, 8.3]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- name: install dependencies
run: composer install --no-interaction --prefer-dist
- name: lint src
run: bin/phpcs --standard=PSR2 src
- name: lint tests
run: bin/phpcs --standard=PSR2 tests
- name: lint PHP
run: bin/phpcs
- name: static code analysis
run: bin/phpstan

tests:
name: PHPUnit Tests
Expand All @@ -38,10 +38,10 @@ jobs:

strategy:
matrix:
php-version: [8.0]
php-version: [8.2, 8.3]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*~
*.patch
/bin/*
/html-coverage/
/vendor/
.phpunit.result.cache
.phpunit.cache
.phpcs-cache
phpunit.xml

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# MeSH Parser

This PHP code library provides tools for extracting [Medical Subject Headings](https://www.nlm.nih.gov/mesh/)
This PHP code library provides tools for extracting [Medical Subject Headings](https://www.nlm.nih.gov/mesh/meshhome.html)
(MeSH) descriptors and associated data from a given XML file into an object representation.

It expects its input to be compliant with the 2019 or 2020 [MeSH DTDs](https://www.nlm.nih.gov/databases/dtd/).
It expects its input to be compliant with the 2023 or 2024 [MeSH DTDs](https://www.nlm.nih.gov/databases/download/mesh.html).

## Installation

Expand All @@ -15,11 +15,11 @@ composer require ilios/mesh-parser

## Usage

Instantiate `\Ilios\MeSH\Parser` and invoke its `parse()` method with an URI that points at valid MeSH descriptors
Instantiate `\Ilios\MeSH\Parser` and invoke its `parse()` method with a URI that points at valid MeSH descriptors
XML file.
This method call will return an instance of `\Ilios\MeSH\Model\DescriptorSet`; this is the entry point into
the object representation of the descriptors data model.
Use getter methods on this object and its sub-components to traverse and process this model.
Use getter methods on this object and its subcomponents to traverse and process this model.

### Example

Expand All @@ -28,9 +28,9 @@ Use getter methods on this object and its sub-components to traverse and process

require __DIR__ . '/vendor/autoload.php';

// provide an URL or a local file path.
//$uri = 'ftp://nlmpubs.nlm.nih.gov/online/mesh/MESH_FILES/xmlmesh/desc2020.xml';
$uri = __DIR__ . '/desc2019.xml';
// provide a URL or a local file path.
//$uri = 'https://nlmpubs.nlm.nih.gov/projects/mesh/MESH_FILES/xmlmesh/desc2024.xml';
$uri = __DIR__ . '/desc2024.xml';

// instantiate the parser and parse the input.
$parser = new \Ilios\MeSH\Parser();
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Ilios",
"MeSH"
],
"homepage": "http://iliosproject.org/",
"homepage": "https://iliosproject.org/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So secure!

"license": "MIT",
"authors": [
{
Expand All @@ -16,13 +16,16 @@
}
],
"require": {
"php": ">=8.0"
"php": ">=8.2",
"ext-dom": "*",
"ext-xmlreader": "*"
},
"require-dev": {
"mockery/mockery": "@stable",
"phpunit/phpunit": "@stable",
"squizlabs/php_codesniffer": "@stable",
"fakerphp/faker": "@stable"
"fakerphp/faker": "@stable",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand Down
Loading