inpsyde / modularity

A PSR-11 implementation for WordPress Plugins, Themes or Libraries.
https://inpsyde.github.io/modularity/
GNU General Public License v2.0
44 stars 4 forks source link

Add PluginProperties::pluginMainFile method #28

Closed shvlv closed 1 year ago

shvlv commented 1 year ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Feature.

What is the current behavior? (You can also link to an open issue here) There is no ability to retrieve the plugin's main file from PluginProperties. Such functionality could be useful for registration activation/deactivation hooks, etc.

What is the new behavior (if this is a feature change)? Add the PluginProperties::mainPluginFile getter.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) No.

Other information: Missed tests targeted to the BaseProperties::sanitizeBaseName method were added. PluginProperties tests were updated to be more self-explanatory.

codecov[bot] commented 1 year ago

Codecov Report

Base: 96.86% // Head: 96.88% // Increases project coverage by +0.01% :tada:

Coverage data is based on head (602a940) compared to base (eb14a9b). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #28 +/- ## ============================================ + Coverage 96.86% 96.88% +0.01% - Complexity 177 178 +1 ============================================ Files 9 9 Lines 510 513 +3 ============================================ + Hits 494 497 +3 Misses 16 16 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `96.88% <100.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/inpsyde/modularity/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde) | Coverage Δ | | |---|---|---| | [src/Properties/PluginProperties.php](https://codecov.io/gh/inpsyde/modularity/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde#diff-c3JjL1Byb3BlcnRpZXMvUGx1Z2luUHJvcGVydGllcy5waHA=) | `93.47% <100.00%> (+0.45%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inpsyde)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.