-
Notifications
You must be signed in to change notification settings - Fork 51
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
Static analysis fixes for block theme #269
Conversation
@@ -21,3 +21,11 @@ | |||
define( 'TENUP_THEME_DIST_URL', TENUP_THEME_TEMPLATE_URL . '/dist/' ); | |||
define( 'TENUP_THEME_INC', TENUP_THEME_PATH . 'includes/' ); | |||
define( 'TENUP_THEME_BLOCK_DIR', TENUP_THEME_INC . 'blocks/' ); | |||
|
|||
define( 'TENUP_BLOCK_THEME_VERSION', '1.0.0' ); |
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 intentionally left this one out as it doesn't do anything and we have the version in the style.css
file that actually controls caching
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.
You have this defined in the theme, see: https://github.com/10up/wp-scaffold/blob/trunk/themes/10up-block-theme/functions.php#L9
All custom consts should also be defined here since this is how PHPStan knows about them. If you remove from the theme, feel free to also remove from here.
define( 'TENUP_BLOCK_THEME_TEMPLATE_URL', '' ); | ||
define( 'TENUP_BLOCK_THEME_PATH', '/' ); | ||
define( 'TENUP_BLOCK_THEME_DIST_PATH', TENUP_BLOCK_THEME_PATH . 'dist/' ); | ||
define( 'TENUP_BLOCK_THEME_DIST_URL', TENUP_BLOCK_THEME_TEMPLATE_URL . '/dist/' ); | ||
define( 'TENUP_BLOCK_THEME_INC', TENUP_BLOCK_THEME_PATH . 'includes/' ); | ||
define( 'TENUP_BLOCK_THEME_BLOCK_DIST_DIR', TENUP_BLOCK_THEME_DIST_PATH . '/blocks/' ); |
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.
These are all already defined above 🤔
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.
The ones above are TENUP_THEME_*
and these are TENUP_BLOCK_THEME_*
. This file is use by PHPStan to know what custom constants exist, so needs to be 1:1 with what we have in the code.
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 didn't reallize we were in a separate file here... 🤦
Description of the Change
This PR fixes any static analysis violations in the block theme.
How to test the Change
Test the theme out
Changelog Entry
Fixed - Static analysis violations in the block theme.
Credits
Props @darylldoyle
Checklist:
I have updated the documentation accordingly.I have added Critical Flows, Test Cases, and/or End-to-End Tests to cover my change.