-
Notifications
You must be signed in to change notification settings - Fork 5
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
2024 Update #20
Conversation
stopfstedt
commented
Feb 10, 2024
•
edited
Loading
edited
- new baseline is PHP 8.2
- upgrades to PHPUnit 11
- adds configuration for PHPCS
- PHP strict mode across the board
- introduces PHPStan
- fleshes out code coverage on models
- integrates with Dependabot
- increases code coverage on parser
0474e52
to
5fd8fdb
Compare
PHPUnit 11 requires PHP 8.1 or higher.
staying in lock-step with required min version specified in package file.
we're specifying everything we need in the new phpcs config file now.
- declare PHP strict mode - resolves all PHPUnit-related deprecations - resolves all Faker-related deprecations
- strict mode - type hints - ditch pointless comments
according to the DTD, ConceptRelation::RelationName is an "implied" attribute, which makes it optional.
meld it into Reference class, its only consumer.
…cks. this will come in handy when testing Models with nullable attrs.
5fd8fdb
to
7f45b20
Compare
7f45b20
to
8c1d34c
Compare
- add type hints where missing - simplify paths via imports - An vs a - drop unnecessary function args where defaults suffice - fix up code comments
courtesy of PHPStan lvl 5. explanation: that local variable was never instantiated as a Reference object, thus remaining NULL throughout parsing, thus the if conditional was always evaluating to FALSE. turns out that we don't need to local Referencevariable after all - we want to set concept id (UI) and name directly on the Concept object. which we've been doing. in sum - not a bugfix, just cleanup.
exclude the vendor dir. in the CI, lint all configured dirs in one step.
ee86838
to
97885ce
Compare
copied and stripped down from ilios/ilios.
|
.github/dependabot.yml
Outdated
- package-ecosystem: composer | ||
directory: "/" | ||
schedule: | ||
interval: daily |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ✔️
@@ -6,7 +6,7 @@ | |||
"Ilios", | |||
"MeSH" | |||
], | |||
"homepage": "http://iliosproject.org/", | |||
"homepage": "https://iliosproject.org/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So secure!
const TREE_NUMBER = 'TreeNumber'; | ||
const TREE_NUMBER_LIST = 'TreeNumberList'; | ||
const YEAR = 'Year'; | ||
public const ABBREVIATION = 'Abbreviation'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that it matters, but are these public
? I searched for a few of them and they seem to only be used in this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS won't have it any other way. without an accessor, it will emit this warning:
Visibility must be declared on all constants if your project supports PHP 7.1 or later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was assuming we'd go protected
instead, but let's make that a next time problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a lateral shift, as these are public by default/without the accessor. don't see why not, the values can't be tampered with.
} | ||
|
||
/** | ||
* @param string $property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docblocks in this file are duplicates of declarations in the code. Just remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. ✔️
@@ -135,6 +135,8 @@ It contains all possible elements defined by the schema. | |||
<CASN1Name>a casn1 name</CASN1Name> | |||
<RegistryNumber>00000AAAAA</RegistryNumber> | |||
<ScopeNote>a scope note</ScopeNote> | |||
<TranslatorsEnglishScopeNote>something in English.</TranslatorsEnglishScopeNote> | |||
<TranslatorsScopeNote>i got nothing</TranslatorsScopeNote> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zero points for creativity!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.