Using the VS Code extension PHP Sniffer & Beautifier as a guideline, the Traits Importer and its test files need to be brought up to PHP/Drupal coding standards before we proceed with further development.
What does this PR do?
Applies PHP/Drupal standards to the following files:
adding Drupal's EntityTypeManager service for use with loading files instead of file::load() directly
using Drupal's StringTranslationTrait to translate UI messages using $this->t()
docblock added to $headers property and clarification in various comments/docblocks. I held back from improving processValidationMessages() though as I know that method will be undergoing major changes soon.
No automated tests have been added, though it's good to confirm that every test is still passing.
Manual Testing
You can check that all errors/warnings were addressed by doing the following:
Create a new docker from this branch and open the repo in vs code.
Choose any one of the files changed in this PR, and confirm that no problems are reported in your terminal window.
Additionally, please visually inspect the changes that occurred in each file as part of this PR. You may have to click on Load diff in the Files Changed tab to see changes to the Traits Importer- these changes are considered the most important to focus on review-wise. Fortunately, this PR should be far more manageable than #119 😅 🙏
Issue #121
Dependant on PR #119
Motivation
Using the VS Code extension PHP Sniffer & Beautifier as a guideline, the Traits Importer and its test files need to be brought up to PHP/Drupal coding standards before we proceed with further development.
What does this PR do?
Applies PHP/Drupal standards to the following files:
trpcultivate_phenotypes/src/Plugin/TripalImporter/TripalCultivatePhenotypesTraitsImporter.php
Notably:EntityTypeManager
service for use with loading files instead offile::load()
directlyStringTranslationTrait
to translate UI messages using$this->t()
$headers
property and clarification in various comments/docblocks. I held back from improvingprocessValidationMessages()
though as I know that method will be undergoing major changes soon.trpcultivate_phenotypes/tests/src/Kernel/TripalImporter/TraitImporterFormTest.php
trpcultivate_phenotypes/tests/src/Kernel/TripalImporter/TraitImporterFormValidateTest.php
trpcultivate_phenotypes/tests/src/Kernel/TripalImporter/TraitImporterRunTest.php
Testing
Automated Testing
No automated tests have been added, though it's good to confirm that every test is still passing.
Manual Testing
You can check that all errors/warnings were addressed by doing the following:
Additionally, please visually inspect the changes that occurred in each file as part of this PR. You may have to click on
Load diff
in theFiles Changed
tab to see changes to the Traits Importer- these changes are considered the most important to focus on review-wise. Fortunately, this PR should be far more manageable than #119 😅 🙏